CC-3184 : Preferences: "Stream Label" needs to be moved to "Stream Settings"->"Global"
This commit is contained in:
parent
9275b21f48
commit
3cd11c696f
|
@ -33,7 +33,6 @@ class PreferenceController extends Zend_Controller_Action
|
|||
|
||||
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"]);
|
||||
Application_Model_Preference::SetTimezone($values["preferences_general"]["timezone"]);
|
||||
Application_Model_Preference::SetWeekStartDay($values["preferences_general"]["weekStartDay"]);
|
||||
|
@ -180,6 +179,7 @@ class PreferenceController extends Zend_Controller_Action
|
|||
}
|
||||
if ($request->isPost()) {
|
||||
$post_data = $request->getPost();
|
||||
|
||||
$error = false;
|
||||
$values = array();
|
||||
for($i=1; $i<=$num_of_stream; $i++){
|
||||
|
@ -197,8 +197,10 @@ class PreferenceController extends Zend_Controller_Action
|
|||
$values['output_sound_device'] = $form->getValue('output_sound_device');
|
||||
}
|
||||
|
||||
|
||||
$values['icecast_vorbis_metadata'] = $form->getValue('icecast_vorbis_metadata');
|
||||
$values['output_sound_device_type'] = $form->getValue('output_sound_device_type');
|
||||
|
||||
}
|
||||
if(!$error){
|
||||
Application_Model_StreamSetting::setStreamSetting($values);
|
||||
|
|
|
@ -41,15 +41,6 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
|||
)
|
||||
));
|
||||
|
||||
$stream_format = new Zend_Form_Element_Radio('streamFormat');
|
||||
$stream_format->setLabel('Stream Label:');
|
||||
$stream_format->setMultiOptions(array("Artist - Title",
|
||||
"Show - Artist - Title",
|
||||
"Station name - Show name"));
|
||||
$stream_format->setValue(Application_Model_Preference::GetStreamLabelFormat());
|
||||
$stream_format->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($stream_format);
|
||||
|
||||
$third_party_api = new Zend_Form_Element_Radio('thirdPartyApi');
|
||||
$third_party_api->setLabel('Allow Remote Websites To Access "Schedule" Info?<br> (Enable this to make front-end widgets work.)');
|
||||
$third_party_api->setMultiOptions(array("Disabled",
|
||||
|
|
|
@ -56,11 +56,20 @@ class Application_Form_StreamSetting extends Zend_Form
|
|||
$icecast_vorbis_metadata->setAttrib("readonly", true);
|
||||
}
|
||||
$this->addElement($icecast_vorbis_metadata);
|
||||
|
||||
$stream_format = new Zend_Form_Element_Radio('streamFormat');
|
||||
$stream_format->setLabel('Stream Label:');
|
||||
$stream_format->setMultiOptions(array("Artist - Title",
|
||||
"Show - Artist - Title",
|
||||
"Station name - Show name"));
|
||||
$stream_format->setValue(Application_Model_Preference::GetStreamLabelFormat());
|
||||
$stream_format->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($stream_format);
|
||||
}
|
||||
|
||||
public function isValid($data){
|
||||
$this->populate(array("output_sound_device"=>$data['output_sound_device'], "icecast_vorbis_metadata"=>$data['icecast_vorbis_metadata'],
|
||||
"output_sound_device_type"=>$data['output_sound_device_type']));
|
||||
"output_sound_device_type"=>$data['output_sound_device_type'], "streamFormat"=>$data['streamFormat']));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,29 +27,6 @@
|
|||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<dt id="streamFormat-label" class="block-display">
|
||||
<label class="optional"><?php echo $this->element->getElement('streamFormat')->getLabel() ?></label>
|
||||
</dt>
|
||||
<dd id="streamFormat-element" class="block-display radio-inline-list">
|
||||
<?php $i=0;
|
||||
$value = $this->element->getElement('streamFormat')->getValue();
|
||||
?>
|
||||
<?php foreach ($this->element->getElement('streamFormat')->getMultiOptions() as $radio) : ?>
|
||||
<label for="streamFormat-<?php echo $i ?>">
|
||||
<input type="radio" value="<?php echo $i ?>" id="streamFormat-<?php echo $i ?>" name="streamFormat" <?php if($i == $value){echo 'checked="checked"';}?> >
|
||||
<?php echo $radio ?>
|
||||
</input>
|
||||
</label>
|
||||
<?php $i = $i + 1; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php if($this->element->getElement('streamFormat')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('streamFormat')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<dt id="thirdPartyApi-label" class="block-display">
|
||||
<label class="optional"><?php echo $this->element->getElement('thirdPartyApi')->getLabel() ?></label>
|
||||
</dt>
|
||||
|
|
|
@ -42,6 +42,29 @@
|
|||
<dd id="vorbisMetadata-element">
|
||||
<?php echo $this->form->getElement('icecast_vorbis_metadata') ?>
|
||||
</dd>
|
||||
<dt id="streamFormat-label" class="block-display">
|
||||
<label class="optional"><?php echo $this->form->getElement('streamFormat')->getLabel() ?></label>
|
||||
</dt>
|
||||
<dd id="streamFormat-element" class="block-display radio-inline-list">
|
||||
<?php $i=0;
|
||||
$value = $this->form->getElement('streamFormat')->getValue();
|
||||
?>
|
||||
<?php foreach ($this->form->getElement('streamFormat')->getMultiOptions() as $radio) : ?>
|
||||
<label for="streamFormat-<?php echo $i ?>">
|
||||
<input type="radio" value="<?php echo $i ?>" id="streamFormat-<?php echo $i ?>" name="streamFormat" <?php if($i == $value){echo 'checked="checked"';}?> >
|
||||
<?php echo $radio ?>
|
||||
</input>
|
||||
</label>
|
||||
<?php $i = $i + 1; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php if($this->form->getElement('streamFormat')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->form->getElement('streamFormat')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
</dl>
|
||||
</fieldset>
|
||||
<?php
|
||||
|
|
Loading…
Reference in New Issue