diff --git a/airtime_mvc/application/controllers/PreferenceController.php b/airtime_mvc/application/controllers/PreferenceController.php index 79d97c658..f320a9f73 100644 --- a/airtime_mvc/application/controllers/PreferenceController.php +++ b/airtime_mvc/application/controllers/PreferenceController.php @@ -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(); diff --git a/airtime_mvc/application/forms/GeneralPreferences.php b/airtime_mvc/application/forms/GeneralPreferences.php index c32107ccc..a4740ab1e 100644 --- a/airtime_mvc/application/forms/GeneralPreferences.php +++ b/airtime_mvc/application/forms/GeneralPreferences.php @@ -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
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() diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index 17448b7fb..df70454c0 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -1591,4 +1591,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); + } } diff --git a/airtime_mvc/application/views/scripts/form/preferences_general.phtml b/airtime_mvc/application/views/scripts/form/preferences_general.phtml index 7aeafb1cc..11e907f95 100644 --- a/airtime_mvc/application/views/scripts/form/preferences_general.phtml +++ b/airtime_mvc/application/views/scripts/form/preferences_general.phtml @@ -41,6 +41,8 @@ element->getElement('podcastAutoSmartblock')->render() ?> + element->getElement('featurePreviewMode')->render() ?> + element->getElement('thirdPartyApi')->render() ?> element->getElement('allowedCorsUrls')->render() ?> diff --git a/docs/_docs/settings.md b/docs/_docs/settings.md index 2d0598fae..0cdc2af94 100644 --- a/docs/_docs/settings.md +++ b/docs/_docs/settings.md @@ -52,6 +52,11 @@ default. ![](/img/api-settings.png) +You can opt-in to test new features with the **Feature Previews** option. +Features that we soft rollout this way may need more feedback or still have +tolerable bugs. This contains but is not limited to features like large ui +refactors. You can switch back at any time. + You can enable live, read-only access to the LibreTime schedule calendar for your station's public website with the **Public LibreTime API** option, if you wish. (There is more about this feature in the diff --git a/docs/img/api-settings.png b/docs/img/api-settings.png index 5abdce0b1..1b7cf7bea 100644 Binary files a/docs/img/api-settings.png and b/docs/img/api-settings.png differ