CC-2704: Support settings UI tweaks
- Move station name to "Support Settins" page
This commit is contained in:
parent
138ad06a0e
commit
db225dd610
5 changed files with 31 additions and 34 deletions
|
@ -29,7 +29,6 @@ class PreferenceController extends Zend_Controller_Action
|
|||
if ($form->isValid($request->getPost())) {
|
||||
$values = $form->getValues();
|
||||
|
||||
Application_Model_Preference::SetHeadTitle($values["preferences_general"]["stationName"], $this->view);
|
||||
Application_Model_Preference::SetDefaultFade($values["preferences_general"]["stationDefaultFade"]);
|
||||
Application_Model_Preference::SetStreamLabelFormat($values["preferences_general"]["streamFormat"]);
|
||||
Application_Model_Preference::SetAllow3rdPartyApi($values["preferences_general"]["thirdPartyApi"]);
|
||||
|
@ -63,6 +62,7 @@ class PreferenceController extends Zend_Controller_Action
|
|||
if ($form->isValid($request->getPost())) {
|
||||
$values = $form->getValues();
|
||||
|
||||
Application_Model_Preference::SetHeadTitle($values["stationName"], $this->view);
|
||||
Application_Model_Preference::SetPhone($values["Phone"]);
|
||||
Application_Model_Preference::SetEmail($values["Email"]);
|
||||
Application_Model_Preference::SetStationWebSite($values["StationWebSite"]);
|
||||
|
|
|
@ -9,19 +9,6 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
|||
array('ViewScript', array('viewScript' => 'form/preferences_general.phtml'))
|
||||
));
|
||||
|
||||
//Station name
|
||||
$this->addElement('text', 'stationName', array(
|
||||
'class' => 'input_text',
|
||||
'label' => 'Station Name',
|
||||
'required' => true,
|
||||
'filters' => array('StringTrim'),
|
||||
'validators' => array('NotEmpty'),
|
||||
'value' => Application_Model_Preference::GetValue("station_name"),
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
));
|
||||
|
||||
$defaultFade = Application_Model_Preference::GetDefaultFade();
|
||||
if($defaultFade == ""){
|
||||
$defaultFade = '00:00:00.000000';
|
||||
|
|
|
@ -12,6 +12,18 @@ class Application_Form_SupportSettings extends Zend_Form
|
|||
array('File', array('viewScript' => 'form/support-setting.phtml', 'placement' => false)))
|
||||
);
|
||||
|
||||
//Station name
|
||||
$this->addElement('text', 'stationName', array(
|
||||
'class' => 'input_text',
|
||||
'label' => 'Station Name',
|
||||
'required' => false,
|
||||
'filters' => array('StringTrim'),
|
||||
'value' => Application_Model_Preference::GetValue("station_name"),
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
));
|
||||
|
||||
// Phone number
|
||||
$this->addElement('text', 'Phone', array(
|
||||
'class' => 'input_text',
|
||||
|
@ -147,13 +159,13 @@ class Application_Form_SupportSettings extends Zend_Form
|
|||
// overwriting isValid function
|
||||
public function isValid ($data)
|
||||
{
|
||||
parent::isValid($data);
|
||||
$isValid = parent::isValid($data);
|
||||
$checkPrivacy = $this->getElement('Privacy');
|
||||
if($data["SupportFeedback"] == "1" && $data["Privacy"] != "1"){
|
||||
$checkPrivacy->addError("You have to agree to privacy policy.");
|
||||
return false;
|
||||
$isValid = false;
|
||||
}
|
||||
return true;
|
||||
return $isValid;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,21 +1,5 @@
|
|||
<fieldset class="padded">
|
||||
<dl class="zend_form">
|
||||
|
||||
<dt id="stationName-label" class="block-display">
|
||||
<label class="required" for="stationName"><?php echo $this->element->getElement('stationName')->getLabel() ?>
|
||||
<span class="info-text-small">(Required)</span> :
|
||||
</label>
|
||||
</dt>
|
||||
<dd id="stationName-element" class="block-display">
|
||||
<?php echo $this->element->getElement('stationName') ?>
|
||||
<?php if($this->element->getElement('stationName')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('stationName')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<dt id="stationDefaultFade-label" class="block-display">
|
||||
<label class="optional" for="stationDefaultFade"><?php echo $this->element->getElement('stationDefaultFade')->getLabel() ?></label>
|
||||
</dt>
|
||||
|
|
|
@ -1,5 +1,19 @@
|
|||
<fieldset class="padded">
|
||||
<dl class="zend_form">
|
||||
<dt id="stationName-label" class="block-display">
|
||||
<label class="required" for="stationName"><?php echo $this->element->getElement('stationName')->getLabel() ?> :
|
||||
</label>
|
||||
</dt>
|
||||
<dd id="stationName-element" class="block-display">
|
||||
<?php echo $this->element->getElement('stationName') ?>
|
||||
<?php if($this->element->getElement('stationName')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('stationName')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<dd id="SupportFeedback-element" style="width:90%;">
|
||||
<div class="info-text">Help Airtime improve by letting us know you are using it. This info
|
||||
will be collected regularly in order to improve your user experience.</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue