diff --git a/airtime_mvc/application/Bootstrap.php b/airtime_mvc/application/Bootstrap.php
index 1e0b31cf4..a7910dadf 100644
--- a/airtime_mvc/application/Bootstrap.php
+++ b/airtime_mvc/application/Bootstrap.php
@@ -17,6 +17,7 @@ require_once "Database.php";
require_once "Timezone.php";
require_once "Auth.php";
require_once __DIR__.'/forms/helpers/ValidationTypes.php';
+require_once __DIR__.'/forms/helpers/CustomDecorators.php';
require_once __DIR__.'/controllers/plugins/RabbitMqPlugin.php';
require_once (APPLICATION_PATH."/logging/Logging.php");
diff --git a/airtime_mvc/application/forms/GeneralPreferences.php b/airtime_mvc/application/forms/GeneralPreferences.php
index 8828c925c..d956b8d1e 100644
--- a/airtime_mvc/application/forms/GeneralPreferences.php
+++ b/airtime_mvc/application/forms/GeneralPreferences.php
@@ -5,6 +5,7 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
public function init()
{
+ $maxLens = Application_Model_Show::getMaxLengths();
$notEmptyValidator = Application_Form_Helper_ValidationTypes::overrideNotEmptyValidator();
$rangeValidator = Application_Form_Helper_ValidationTypes::overrideBetweenValidator(0, 59.9);
@@ -14,84 +15,90 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
$defaultFadeIn = Application_Model_Preference::GetDefaultFadeIn();
$defaultFadeOut = Application_Model_Preference::GetDefaultFadeOut();
-
+
//Station name
$this->addElement('text', 'stationName', array(
- 'class' => 'input_text',
- 'label' => _('Station Name'),
- 'required' => false,
- 'filters' => array('StringTrim'),
+ 'class' => 'input_text',
+ 'label' => _('Station Name'),
+ 'required' => false,
+ 'filters' => array('StringTrim'),
'value' => Application_Model_Preference::GetStationName(),
- 'decorators' => array(
- 'ViewHelper'
- )
));
-
- //Default station fade in
+
+ // Station description
+ $stationDescription = new Zend_Form_Element_Textarea("stationDescription");
+ $stationDescription->setLabel(_('Station Description'));
+ $stationDescription->setValue(Application_Model_Preference::GetStationDescription());
+ $stationDescription->setRequired(false);
+ $stationDescription->setValidators(array(array('StringLength', false, array(0, $maxLens['description']))));
+ $stationDescription->setAttrib('rows', 4);
+ $this->addElement($stationDescription);
+
+ //Default station crossfade duration
$this->addElement('text', 'stationDefaultCrossfadeDuration', array(
- 'class' => 'input_text',
- 'label' => _('Default Crossfade Duration (s):'),
- 'required' => true,
- 'filters' => array('StringTrim'),
- 'validators' => array(
+ 'class' => 'input_text',
+ 'label' => _('Default Crossfade Duration (s):'),
+ 'required' => true,
+ 'filters' => array('StringTrim'),
+ 'validators' => array(
$rangeValidator,
$notEmptyValidator,
array('regex', false, array('/^[0-9]+(\.\d+)?$/', 'messages' => _('Please enter a time in seconds (eg. 0.5)')))
- ),
- 'value' => Application_Model_Preference::GetDefaultCrossfadeDuration(),
- 'decorators' => array(
- 'ViewHelper'
- )
+ ),
+ 'value' => Application_Model_Preference::GetDefaultCrossfadeDuration(),
));
//Default station fade in
$this->addElement('text', 'stationDefaultFadeIn', array(
- 'class' => 'input_text',
- 'label' => _('Default Fade In (s):'),
- 'required' => true,
- 'filters' => array('StringTrim'),
+ 'class' => 'input_text',
+ 'label' => _('Default Fade In (s):'),
+ 'required' => true,
+ 'filters' => array('StringTrim'),
'validators' => array(
$rangeValidator,
$notEmptyValidator,
array('regex', false, array('/^[0-9]+(\.\d+)?$/', 'messages' => _('Please enter a time in seconds (eg. 0.5)')))
),
'value' => $defaultFadeIn,
- 'decorators' => array(
- 'ViewHelper'
- )
));
-
+
//Default station fade out
$this->addElement('text', 'stationDefaultFadeOut', array(
- 'class' => 'input_text',
- 'label' => _('Default Fade Out (s):'),
- 'required' => true,
- 'filters' => array('StringTrim'),
- 'validators' => array(
- $rangeValidator,
- $notEmptyValidator,
- array('regex', false, array('/^[0-9]+(\.\d+)?$/', 'messages' => _('Please enter a time in seconds (eg. 0.5)')))
- ),
- 'value' => $defaultFadeOut,
- 'decorators' => array(
- 'ViewHelper'
- )
+ 'class' => 'input_text',
+ 'label' => _('Default Fade Out (s):'),
+ 'required' => true,
+ 'filters' => array('StringTrim'),
+ 'validators' => array(
+ $rangeValidator,
+ $notEmptyValidator,
+ array('regex', false, array('/^[0-9]+(\.\d+)?$/', 'messages' => _('Please enter a time in seconds (eg. 0.5)')))
+ ),
+ 'value' => $defaultFadeOut,
));
$third_party_api = new Zend_Form_Element_Radio('thirdPartyApi');
- $third_party_api->setLabel(
- sprintf(_('Allow Remote Websites To Access "Schedule" Info?%s (Enable this to make front-end widgets work.)'), '
'));
- $third_party_api->setMultiOptions(array(_("Disabled"),
- _("Enabled")));
+ $third_party_api->setLabel(_('Public Airtime API'));
+ $third_party_api->setDescription(_('Required for embeddable schedule widget.'));
+ $third_party_api->setMultiOptions(array(
+ _("Disabled"),
+ _("Enabled"),
+ ));
$third_party_api->setValue(Application_Model_Preference::GetAllow3rdPartyApi());
- $third_party_api->setDecorators(array('ViewHelper'));
+ $third_party_api->setDescription(_('Enabling this feature will allow Airtime to provide schedule data
+ to external widgets that can be embedded in your website. Enable this
+ feature to reveal the embeddable code.'));
+ $third_party_api->setSeparator(' '); //No
between radio buttons
+ //$third_party_api->addDecorator(new Zend_Form_Decorator_Label(array('tag' => 'dd', 'class' => 'radio-inline-list')));
+ $third_party_api->addDecorator('HtmlTag', array('tag' => 'dd',
+ 'id'=>"thirdPartyApi-element",
+ 'class' => 'radio-inline-list',
+ ));
$this->addElement($third_party_api);
$locale = new Zend_Form_Element_Select("locale");
- $locale->setLabel(_("Default Interface Language"));
+ $locale->setLabel(_("Default Language"));
$locale->setMultiOptions(Application_Model_Locale::getLocales());
$locale->setValue(Application_Model_Preference::GetDefaultLocale());
- $locale->setDecorators(array('ViewHelper'));
$this->addElement($locale);
/* Form Element for setting the Timezone */
@@ -99,7 +106,6 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
$timezone->setLabel(_("Station Timezone"));
$timezone->setMultiOptions(Application_Common_Timezone::getTimezones());
$timezone->setValue(Application_Model_Preference::GetDefaultTimezone());
- $timezone->setDecorators(array('ViewHelper'));
$this->addElement($timezone);
/* Form Element for setting which day is the start of the week */
@@ -107,7 +113,6 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
$week_start_day->setLabel(_("Week Starts On"));
$week_start_day->setMultiOptions($this->getWeekStartDays());
$week_start_day->setValue(Application_Model_Preference::GetWeekStartDay());
- $week_start_day->setDecorators(array('ViewHelper'));
$this->addElement($week_start_day);
}
diff --git a/airtime_mvc/application/forms/helpers/CustomDecorators.php b/airtime_mvc/application/forms/helpers/CustomDecorators.php
new file mode 100644
index 000000000..a4abe2daf
--- /dev/null
+++ b/airtime_mvc/application/forms/helpers/CustomDecorators.php
@@ -0,0 +1,2 @@
+ $rows[$i]['id'],
"instance_id" => $rows[$i]['instance_id'],
- "name" => $rows[$i]['name'],
+ "name" => $rows[$i]['name'],
"description" => $rows[$i]['description'],
- "url" => $rows[$i]['url'],
+ "url" => $rows[$i]['url'],
"start_timestamp" => $rows[$i]['start_timestamp'],
"end_timestamp" => $rows[$i]['end_timestamp'],
"starts" => $rows[$i]['starts'],
"ends" => $rows[$i]['ends'],
"record" => $rows[$i]['record'],
"image_path" => $rows[$i]['image_path'],
- "type" => "show");
+ "type" => "show");
break;
}
}
diff --git a/airtime_mvc/application/views/scripts/form/preferences_general.phtml b/airtime_mvc/application/views/scripts/form/preferences_general.phtml
index a438fb446..de3f6b13d 100644
--- a/airtime_mvc/application/views/scripts/form/preferences_general.phtml
+++ b/airtime_mvc/application/views/scripts/form/preferences_general.phtml
@@ -1,138 +1,23 @@