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::SetHeadTitle($values["preferences_general"]["stationName"], $this->view);
|
||||||
Application_Model_Preference::SetDefaultFade($values["preferences_general"]["stationDefaultFade"]);
|
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::SetAllow3rdPartyApi($values["preferences_general"]["thirdPartyApi"]);
|
||||||
Application_Model_Preference::SetTimezone($values["preferences_general"]["timezone"]);
|
Application_Model_Preference::SetTimezone($values["preferences_general"]["timezone"]);
|
||||||
Application_Model_Preference::SetWeekStartDay($values["preferences_general"]["weekStartDay"]);
|
Application_Model_Preference::SetWeekStartDay($values["preferences_general"]["weekStartDay"]);
|
||||||
|
@ -64,9 +63,9 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
$this->view->statusMsg = "";
|
$this->view->statusMsg = "";
|
||||||
|
|
||||||
$isSass = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
|
$isSass = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
|
||||||
|
|
||||||
$form = new Application_Form_SupportSettings();
|
$form = new Application_Form_SupportSettings();
|
||||||
|
|
||||||
if ($request->isPost()) {
|
if ($request->isPost()) {
|
||||||
$values = $request->getPost();
|
$values = $request->getPost();
|
||||||
if ($form->isValid($values)) {
|
if ($form->isValid($values)) {
|
||||||
|
@ -165,10 +164,10 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
|
|
||||||
$num_of_stream = intval(Application_Model_Preference::GetNumOfStreams());
|
$num_of_stream = intval(Application_Model_Preference::GetNumOfStreams());
|
||||||
$form = new Application_Form_StreamSetting();
|
$form = new Application_Form_StreamSetting();
|
||||||
|
|
||||||
$form->setSetting($setting);
|
$form->setSetting($setting);
|
||||||
$form->startFrom();
|
$form->startFrom();
|
||||||
|
|
||||||
for($i=1; $i<=$num_of_stream; $i++){
|
for($i=1; $i<=$num_of_stream; $i++){
|
||||||
$subform = new Application_Form_StreamSettingSubForm();
|
$subform = new Application_Form_StreamSettingSubForm();
|
||||||
$subform->setPrefix($i);
|
$subform->setPrefix($i);
|
||||||
|
@ -180,6 +179,7 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
if ($request->isPost()) {
|
if ($request->isPost()) {
|
||||||
$post_data = $request->getPost();
|
$post_data = $request->getPost();
|
||||||
|
|
||||||
$error = false;
|
$error = false;
|
||||||
$values = array();
|
$values = array();
|
||||||
for($i=1; $i<=$num_of_stream; $i++){
|
for($i=1; $i<=$num_of_stream; $i++){
|
||||||
|
@ -196,9 +196,11 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
if(Application_Model_Preference::GetPlanLevel() == 'disabled'){// && $form->isValid($post_data['output_sound_device'])){
|
if(Application_Model_Preference::GetPlanLevel() == 'disabled'){// && $form->isValid($post_data['output_sound_device'])){
|
||||||
$values['output_sound_device'] = $form->getValue('output_sound_device');
|
$values['output_sound_device'] = $form->getValue('output_sound_device');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$values['icecast_vorbis_metadata'] = $form->getValue('icecast_vorbis_metadata');
|
$values['icecast_vorbis_metadata'] = $form->getValue('icecast_vorbis_metadata');
|
||||||
$values['output_sound_device_type'] = $form->getValue('output_sound_device_type');
|
$values['output_sound_device_type'] = $form->getValue('output_sound_device_type');
|
||||||
|
|
||||||
}
|
}
|
||||||
if(!$error){
|
if(!$error){
|
||||||
Application_Model_StreamSetting::setStreamSetting($values);
|
Application_Model_StreamSetting::setStreamSetting($values);
|
||||||
|
@ -303,7 +305,7 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
die(json_encode($res));
|
die(json_encode($res));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLiquidsoapStatusAction(){
|
public function getLiquidsoapStatusAction(){
|
||||||
$out = array();
|
$out = array();
|
||||||
$num_of_stream = intval(Application_Model_Preference::GetNumOfStreams());
|
$num_of_stream = intval(Application_Model_Preference::GetNumOfStreams());
|
||||||
|
|
|
@ -13,7 +13,7 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
||||||
if($defaultFade == ""){
|
if($defaultFade == ""){
|
||||||
$defaultFade = '00:00:00.000000';
|
$defaultFade = '00:00:00.000000';
|
||||||
}
|
}
|
||||||
|
|
||||||
//Station name
|
//Station name
|
||||||
$this->addElement('text', 'stationName', array(
|
$this->addElement('text', 'stationName', array(
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
|
@ -25,7 +25,7 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
||||||
'ViewHelper'
|
'ViewHelper'
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
//Default station fade
|
//Default station fade
|
||||||
$this->addElement('text', 'stationDefaultFade', array(
|
$this->addElement('text', 'stationDefaultFade', array(
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
|
@ -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 = 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->setLabel('Allow Remote Websites To Access "Schedule" Info?<br> (Enable this to make front-end widgets work.)');
|
||||||
$third_party_api->setMultiOptions(array("Disabled",
|
$third_party_api->setMultiOptions(array("Disabled",
|
||||||
|
@ -57,7 +48,7 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
||||||
$third_party_api->setValue(Application_Model_Preference::GetAllow3rdPartyApi());
|
$third_party_api->setValue(Application_Model_Preference::GetAllow3rdPartyApi());
|
||||||
$third_party_api->setDecorators(array('ViewHelper'));
|
$third_party_api->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($third_party_api);
|
$this->addElement($third_party_api);
|
||||||
|
|
||||||
/* Form Element for setting the Timezone */
|
/* Form Element for setting the Timezone */
|
||||||
$timezone = new Zend_Form_Element_Select("timezone");
|
$timezone = new Zend_Form_Element_Select("timezone");
|
||||||
$timezone->setLabel("Timezone");
|
$timezone->setLabel("Timezone");
|
||||||
|
@ -65,7 +56,7 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
||||||
$timezone->setValue(Application_Model_Preference::GetTimezone());
|
$timezone->setValue(Application_Model_Preference::GetTimezone());
|
||||||
$timezone->setDecorators(array('ViewHelper'));
|
$timezone->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($timezone);
|
$this->addElement($timezone);
|
||||||
|
|
||||||
/* Form Element for setting which day is the start of the week */
|
/* Form Element for setting which day is the start of the week */
|
||||||
$week_start_day = new Zend_Form_Element_Select("weekStartDay");
|
$week_start_day = new Zend_Form_Element_Select("weekStartDay");
|
||||||
$week_start_day->setLabel("Week Starts On");
|
$week_start_day->setLabel("Week Starts On");
|
||||||
|
@ -74,7 +65,7 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
||||||
$week_start_day->setDecorators(array('ViewHelper'));
|
$week_start_day->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($week_start_day);
|
$this->addElement($week_start_day);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getTimezones(){
|
private function getTimezones(){
|
||||||
$regions = array(
|
$regions = array(
|
||||||
'Africa' => DateTimeZone::AFRICA,
|
'Africa' => DateTimeZone::AFRICA,
|
||||||
|
@ -86,9 +77,9 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
||||||
'Indian' => DateTimeZone::INDIAN,
|
'Indian' => DateTimeZone::INDIAN,
|
||||||
'Pacific' => DateTimeZone::PACIFIC
|
'Pacific' => DateTimeZone::PACIFIC
|
||||||
);
|
);
|
||||||
|
|
||||||
$tzlist = array();
|
$tzlist = array();
|
||||||
|
|
||||||
foreach ($regions as $name => $mask){
|
foreach ($regions as $name => $mask){
|
||||||
$ids = DateTimeZone::listIdentifiers($mask);
|
$ids = DateTimeZone::listIdentifiers($mask);
|
||||||
foreach ($ids as $id){
|
foreach ($ids as $id){
|
||||||
|
@ -98,7 +89,7 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
||||||
|
|
||||||
return $tzlist;
|
return $tzlist;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private function getWeekStartDays() {
|
private function getWeekStartDays() {
|
||||||
$days = array(
|
$days = array(
|
||||||
|
@ -110,7 +101,7 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
||||||
'Friday',
|
'Friday',
|
||||||
'Saturday'
|
'Saturday'
|
||||||
);
|
);
|
||||||
return $days;
|
return $days;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ class Application_Form_StreamSetting extends Zend_Form
|
||||||
$output_sound_device->setAttrib("readonly", true);
|
$output_sound_device->setAttrib("readonly", true);
|
||||||
}
|
}
|
||||||
$this->addElement($output_sound_device);
|
$this->addElement($output_sound_device);
|
||||||
|
|
||||||
$output_types = array("ALSA"=>"ALSA", "AO"=>"AO", "OSS"=>"OSS", "Portaudio"=>"Portaudio", "Pulseaudio"=>"Pulseaudio");
|
$output_types = array("ALSA"=>"ALSA", "AO"=>"AO", "OSS"=>"OSS", "Portaudio"=>"Portaudio", "Pulseaudio"=>"Pulseaudio");
|
||||||
$output_type = new Zend_Form_Element_Select('output_sound_device_type');
|
$output_type = new Zend_Form_Element_Select('output_sound_device_type');
|
||||||
$output_type->setLabel("Output Type")
|
$output_type->setLabel("Output Type")
|
||||||
|
@ -37,15 +37,15 @@ class Application_Form_StreamSetting extends Zend_Form
|
||||||
}
|
}
|
||||||
$this->addElement($output_type);
|
$this->addElement($output_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
# tooltip
|
# tooltip
|
||||||
$description = 'VLC and mplayer have a serious bug when playing an OGG/VORBIS
|
$description = 'VLC and mplayer have a serious bug when playing an OGG/VORBIS
|
||||||
stream that has metadata information enabled (stream metadata is the
|
stream that has metadata information enabled (stream metadata is the
|
||||||
track title, show name, etc displayed in the audio player): they will
|
track title, show name, etc displayed in the audio player): they will
|
||||||
disconnect from the stream after every song if this option is enabled.
|
disconnect from the stream after every song if this option is enabled.
|
||||||
If your listeners do not require support for these audio players,
|
If your listeners do not require support for these audio players,
|
||||||
then you should enable this option.';
|
then you should enable this option.';
|
||||||
|
|
||||||
$icecast_vorbis_metadata = new Zend_Form_Element_Checkbox('icecast_vorbis_metadata');
|
$icecast_vorbis_metadata = new Zend_Form_Element_Checkbox('icecast_vorbis_metadata');
|
||||||
$icecast_vorbis_metadata->setLabel('Icecast Vorbis Metadata')
|
$icecast_vorbis_metadata->setLabel('Icecast Vorbis Metadata')
|
||||||
->setDescription($description)
|
->setDescription($description)
|
||||||
|
@ -56,11 +56,20 @@ class Application_Form_StreamSetting extends Zend_Form
|
||||||
$icecast_vorbis_metadata->setAttrib("readonly", true);
|
$icecast_vorbis_metadata->setAttrib("readonly", true);
|
||||||
}
|
}
|
||||||
$this->addElement($icecast_vorbis_metadata);
|
$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){
|
public function isValid($data){
|
||||||
$this->populate(array("output_sound_device"=>$data['output_sound_device'], "icecast_vorbis_metadata"=>$data['icecast_vorbis_metadata'],
|
$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;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,29 +27,6 @@
|
||||||
</ul>
|
</ul>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</dd>
|
</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">
|
<dt id="thirdPartyApi-label" class="block-display">
|
||||||
<label class="optional"><?php echo $this->element->getElement('thirdPartyApi')->getLabel() ?></label>
|
<label class="optional"><?php echo $this->element->getElement('thirdPartyApi')->getLabel() ?></label>
|
||||||
</dt>
|
</dt>
|
||||||
|
@ -88,7 +65,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
<!-- Week Start Day option -->
|
<!-- Week Start Day option -->
|
||||||
<dt id="weekStartDay-label" class="block-display">
|
<dt id="weekStartDay-label" class="block-display">
|
||||||
<label class="required" for="timezone"><?php echo $this->element->getElement('weekStartDay')->getLabel() ?>:
|
<label class="required" for="timezone"><?php echo $this->element->getElement('weekStartDay')->getLabel() ?>:
|
||||||
|
@ -106,7 +83,7 @@
|
||||||
<?php $i = $i + 1; ?>
|
<?php $i = $i + 1; ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<?php if($this->element->getElement('weekStartDay')->hasErrors()) : ?>
|
<?php if($this->element->getElement('weekStartDay')->hasErrors()) : ?>
|
||||||
<ul class='errors'>
|
<ul class='errors'>
|
||||||
<?php foreach($this->element->getElement('weekStartDay')->getMessages() as $error): ?>
|
<?php foreach($this->element->getElement('weekStartDay')->getMessages() as $error): ?>
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<dt id="vorbisMetadata-label">
|
<dt id="vorbisMetadata-label">
|
||||||
<label class="required">
|
<label class="required">
|
||||||
<?php echo $this->form->getElement('icecast_vorbis_metadata')->getLabel() ?> :
|
<?php echo $this->form->getElement('icecast_vorbis_metadata')->getLabel() ?> :
|
||||||
<span class='info-tooltip'>
|
<span class='info-tooltip'>
|
||||||
<span>
|
<span>
|
||||||
<?php echo $this->form->getElement('icecast_vorbis_metadata')->getDescription() ?>
|
<?php echo $this->form->getElement('icecast_vorbis_metadata')->getDescription() ?>
|
||||||
|
@ -42,6 +42,29 @@
|
||||||
<dd id="vorbisMetadata-element">
|
<dd id="vorbisMetadata-element">
|
||||||
<?php echo $this->form->getElement('icecast_vorbis_metadata') ?>
|
<?php echo $this->form->getElement('icecast_vorbis_metadata') ?>
|
||||||
</dd>
|
</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>
|
</dl>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<?php
|
<?php
|
||||||
|
|
Loading…
Reference in New Issue