SAAS-41: Changed name of boolean value from disable-stream-conf to

enable-stream-conf for easier logic.
This commit is contained in:
Paul Baranowski 2011-09-29 18:11:22 -04:00
parent 8ef8dbc668
commit 44481d2776
5 changed files with 72 additions and 72 deletions

View file

@ -193,7 +193,7 @@ class PreferenceController extends Zend_Controller_Action
} }
} }
$this->view->num_stream = $num_of_stream; $this->view->num_stream = $num_of_stream;
$this->view->disable_stream_conf = Application_Model_Preference::GetDisableStreamConf(); $this->view->enable_stream_conf = Application_Model_Preference::GetEnableStreamConf();
$this->view->form = $form; $this->view->form = $form;
} }

View file

@ -13,14 +13,14 @@ class Application_Form_StreamSetting extends Zend_Form
$this->setting = $setting; $this->setting = $setting;
} }
public function startFrom(){ public function startFrom() {
$setting = $this->setting; $setting = $this->setting;
$output_sound_device = new Zend_Form_Element_Checkbox('output_sound_device'); $output_sound_device = new Zend_Form_Element_Checkbox('output_sound_device');
$output_sound_device->setLabel('Enabled') $output_sound_device->setLabel('Enabled')
->setRequired(false) ->setRequired(false)
->setValue(($setting['output_sound_device'] == "true")?1:0) ->setValue(($setting['output_sound_device'] == "true")?1:0)
->setDecorators(array('ViewHelper')); ->setDecorators(array('ViewHelper'));
if(Application_Model_Preference::GetDisableStreamConf() == "true"){ if (Application_Model_Preference::GetEnableStreamConf() == "false"){
$output_sound_device->setAttrib("readonly", true); $output_sound_device->setAttrib("readonly", true);
} }
$this->addElement($output_sound_device); $this->addElement($output_sound_device);

View file

@ -37,7 +37,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm{
$this->setElementsBelongTo($prefix."_data"); $this->setElementsBelongTo($prefix."_data");
$disable_all = false; $disable_all = false;
if(Application_Model_Preference::GetDisableStreamConf() == "true"){ if(Application_Model_Preference::GetEnableStreamConf() == "false"){
$disable_all = true; $disable_all = true;
} }

View file

@ -427,12 +427,12 @@ class Application_Model_Preference
return self::GetValue("trial_end_date"); return self::GetValue("trial_end_date");
} }
public static function SetDisableStreamConf($bool){ public static function SetEnableStreamConf($bool){
self::SetValue("disable_stream_conf", $bool); self::SetValue("enable_stream_conf", $bool);
} }
public static function GetDisableStreamConf(){ public static function GetEnableStreamConf(){
return self::GetValue("disable_stream_conf"); return self::GetValue("enable_stream_conf");
} }
public static function GetAirtimeVersion(){ public static function GetAirtimeVersion(){

View file

@ -1,6 +1,6 @@
<div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong stream-config"> <div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong stream-config">
<h2 style="float:left">Stream Settings</h2> <h2 style="float:left">Stream Settings</h2>
<?php if($this->disable_stream_conf != "true"){?> <?php if($this->enable_stream_conf == "true"){?>
<form method="post" action="/Preference/stream-setting" enctype="application/x-www-form-urlencoded"> <form method="post" action="/Preference/stream-setting" enctype="application/x-www-form-urlencoded">
<div class="button-bar bottom" id="submit-element" style="float:right"> <div class="button-bar bottom" id="submit-element" style="float:right">
<input type="submit" class="ui-button ui-state-default right-floated" value="Save" id="Save" name="Save" /> <input type="submit" class="ui-button ui-state-default right-floated" value="Save" id="Save" name="Save" />
@ -26,7 +26,7 @@
echo $this->form->getSubform("s".$i."_subform"); echo $this->form->getSubform("s".$i."_subform");
} }
?> ?>
<?php if($this->disable_stream_conf != "true"){?> <?php if($this->enable_stream_conf == "true"){?>
<div class="button-bar bottom" id="submit-element"> <div class="button-bar bottom" id="submit-element">
<input type="submit" class="ui-button ui-state-default right-floated" value="Save" id="Save" name="Save" /> <input type="submit" class="ui-button ui-state-default right-floated" value="Save" id="Save" name="Save" />
</div> </div>