feat(mvc): add preview mode setting
This commit is contained in:
parent
104e9053e1
commit
c2bfee60f1
6 changed files with 42 additions and 0 deletions
|
@ -56,6 +56,7 @@ class PreferenceController extends Zend_Controller_Action
|
|||
Application_Model_Preference::SetDefaultTimezone($values["timezone"]);
|
||||
Application_Model_Preference::SetWeekStartDay($values["weekStartDay"]);
|
||||
Application_Model_Preference::setRadioPageDisplayLoginButton($values["radioPageLoginButton"]);
|
||||
Application_Model_Preference::SetFeaturePreviewMode($values["featurePreviewMode"]);
|
||||
|
||||
$logoUploadElement = $form->getSubForm('preferences_general')->getElement('stationLogo');
|
||||
$logoUploadElement->receive();
|
||||
|
|
|
@ -210,6 +210,21 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
|||
$radioPageLoginButton->setLabel(_("Display login button on your Radio Page?"));
|
||||
$radioPageLoginButton->setValue($displayRadioPageLoginButtonValue);
|
||||
$this->addElement($radioPageLoginButton);
|
||||
|
||||
$feature_preview_mode = new Zend_Form_Element_Radio('featurePreviewMode');
|
||||
$feature_preview_mode->setLabel(_('Feature Previews'));
|
||||
$feature_preview_mode->setMultiOptions(array(
|
||||
_("Disabled"),
|
||||
_("Enabled"),
|
||||
));
|
||||
$feature_preview_mode->setValue(Application_Model_Preference::GetFeaturePreviewMode());
|
||||
$feature_preview_mode->setDescription(_('Enable this to opt-in to test new features.'));
|
||||
$feature_preview_mode->setSeparator(' '); //No <br> between radio buttons
|
||||
$feature_preview_mode->addDecorator('HtmlTag', array('tag' => 'dd',
|
||||
'id'=>"featurePreviewMode-element",
|
||||
'class' => 'radio-inline-list',
|
||||
));
|
||||
$this->addElement($feature_preview_mode);
|
||||
}
|
||||
|
||||
private function getWeekStartDays()
|
||||
|
|
|
@ -1653,4 +1653,23 @@ class Application_Model_Preference
|
|||
public static function SetAllowedCorsUrls($value) {
|
||||
self::setValue('allowed_cors_urls', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for feature preview mode.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function GetFeaturePreviewMode() {
|
||||
return self::getValue('feature_preview_mode') === '1';
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for feature preview mode.
|
||||
*
|
||||
* @param bool $value
|
||||
* @return void
|
||||
*/
|
||||
public static function SetFeaturePreviewMode($value) {
|
||||
return self::setValue('feature_preview_mode', $value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,6 +41,8 @@
|
|||
|
||||
<?php echo $this->element->getElement('podcastAutoSmartblock')->render() ?>
|
||||
|
||||
<?php echo $this->element->getElement('featurePreviewMode')->render() ?>
|
||||
|
||||
<?php echo $this->element->getElement('thirdPartyApi')->render() ?>
|
||||
<?php echo $this->element->getElement('allowedCorsUrls')->render() ?>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue