2011-02-03 23:51:35 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class Application_Form_Preferences extends Zend_Form
|
|
|
|
{
|
|
|
|
|
|
|
|
public function init()
|
|
|
|
{
|
|
|
|
$this->setAction('/Preference/update')->setMethod('post');
|
|
|
|
|
2011-03-18 22:15:12 +01:00
|
|
|
//Station name
|
2011-02-03 23:51:35 +01:00
|
|
|
$this->addElement('text', 'stationName', array(
|
2011-02-07 18:36:35 +01:00
|
|
|
'class' => 'input_text',
|
2011-02-03 23:51:35 +01:00
|
|
|
'label' => 'Station Name:',
|
|
|
|
'required' => true,
|
|
|
|
'filters' => array('StringTrim'),
|
2011-02-04 01:17:52 +01:00
|
|
|
'validators' => array('NotEmpty'),
|
|
|
|
'value' => Application_Model_Preference::GetValue("station_name")
|
2011-02-03 23:51:35 +01:00
|
|
|
));
|
2011-02-11 23:46:55 +01:00
|
|
|
|
2011-03-21 20:48:44 +01:00
|
|
|
$defaultFade = Application_Model_Preference::GetDefaultFade();
|
2011-02-12 20:04:09 +01:00
|
|
|
if($defaultFade == ""){
|
|
|
|
$defaultFade = '00:00:00.000000';
|
|
|
|
}
|
|
|
|
|
2011-03-18 22:15:12 +01:00
|
|
|
//Default station fade
|
2011-02-11 23:46:55 +01:00
|
|
|
$this->addElement('text', 'stationDefaultFade', array(
|
|
|
|
'class' => 'input_text',
|
|
|
|
'label' => 'Default Fade:',
|
|
|
|
'required' => false,
|
|
|
|
'filters' => array('StringTrim'),
|
2011-02-12 20:04:09 +01:00
|
|
|
'validators' => array(array('regex', false,
|
|
|
|
array('/^[0-2][0-3]:[0-5][0-9]:[0-5][0-9](\.\d{1,6})?$/',
|
|
|
|
'messages' => 'enter a time 00:00:00{.000000}'))),
|
|
|
|
'value' => $defaultFade
|
2011-02-11 23:46:55 +01:00
|
|
|
));
|
2011-02-07 18:36:35 +01:00
|
|
|
|
2011-03-04 18:07:22 +01:00
|
|
|
$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());
|
|
|
|
$this->addElement($stream_format);
|
|
|
|
|
2011-03-30 21:34:35 +02:00
|
|
|
$third_party_api = new Zend_Form_Element_Radio('thirdPartyApi');
|
|
|
|
$third_party_api->setLabel('Allow Remote Websites To Access Show Schedule Info');
|
|
|
|
$third_party_api->setMultiOptions(array("Disabled",
|
|
|
|
"Enabled"));
|
|
|
|
$third_party_api->setValue(Application_Model_Preference::GetAllow3rdPartyApi());
|
|
|
|
$this->addElement($third_party_api);
|
|
|
|
|
2011-03-18 22:15:12 +01:00
|
|
|
|
|
|
|
$this->addElement('checkbox', 'UseSoundCloud', array(
|
|
|
|
'label' => 'Automatically Upload Recorded Shows To SoundCloud',
|
|
|
|
'required' => false,
|
2011-03-21 20:48:44 +01:00
|
|
|
'value' => Application_Model_Preference::GetDoSoundCloudUpload()
|
2011-03-18 22:15:12 +01:00
|
|
|
));
|
|
|
|
|
|
|
|
//SoundCloud Username
|
|
|
|
$this->addElement('text', 'SoundCloudUser', array(
|
|
|
|
'class' => 'input_text',
|
2011-03-25 20:08:57 +01:00
|
|
|
'label' => 'SoundCloud Email:',
|
2011-03-18 22:15:12 +01:00
|
|
|
'required' => false,
|
|
|
|
'filters' => array('StringTrim'),
|
2011-03-21 20:48:44 +01:00
|
|
|
'value' => Application_Model_Preference::GetSoundCloudUser()
|
2011-03-18 22:15:12 +01:00
|
|
|
));
|
|
|
|
|
|
|
|
//SoundCloud Password
|
2011-03-30 19:14:37 +02:00
|
|
|
$this->addElement('password', 'SoundCloudPassword', array(
|
2011-03-18 22:15:12 +01:00
|
|
|
'class' => 'input_text',
|
|
|
|
'label' => 'SoundCloud Password:',
|
|
|
|
'required' => false,
|
|
|
|
'filters' => array('StringTrim'),
|
2011-03-21 20:48:44 +01:00
|
|
|
'value' => Application_Model_Preference::GetSoundCloudPassword()
|
2011-03-18 22:15:12 +01:00
|
|
|
));
|
|
|
|
|
2011-03-28 21:39:01 +02:00
|
|
|
// Add the description element
|
|
|
|
$this->addElement('textarea', 'SoundCloudTags', array(
|
|
|
|
'label' => 'space separated SoundCloud Tags',
|
|
|
|
'required' => false,
|
|
|
|
'class' => 'input_text_area',
|
|
|
|
'value' => Application_Model_Preference::GetSoundCloudTags()
|
|
|
|
));
|
|
|
|
|
2011-04-02 22:33:45 +02:00
|
|
|
//SoundCloud default genre
|
|
|
|
$this->addElement('text', 'SoundCloudGenre', array(
|
|
|
|
'class' => 'input_text',
|
|
|
|
'label' => 'Default Genre:',
|
|
|
|
'required' => false,
|
|
|
|
'filters' => array('StringTrim'),
|
|
|
|
'value' => Application_Model_Preference::GetSoundCloudGenre()
|
|
|
|
));
|
|
|
|
|
|
|
|
$select = new Zend_Form_Element_Select('SoundCloudTrackType');
|
|
|
|
$select->setLabel('Default Track Type:');
|
|
|
|
$select->setAttrib('class', 'input_select');
|
|
|
|
$select->setMultiOptions(array(
|
|
|
|
"" => "",
|
|
|
|
"original" => "Original",
|
|
|
|
"remix" => "Remix",
|
|
|
|
"live" => "Live",
|
|
|
|
"recording" => "Recording",
|
|
|
|
"spoken" => "Spoken",
|
|
|
|
"podcast" => "Podcast",
|
|
|
|
"demo" => "Demo",
|
|
|
|
"in progress" => "Work in progress",
|
|
|
|
"stem" => "Stem",
|
|
|
|
"loop" => "Loop",
|
|
|
|
"sound effect" => "Sound Effect",
|
|
|
|
"sample" => "One Shot Sample",
|
|
|
|
"other" => "Other"
|
|
|
|
));
|
|
|
|
$select->setRequired(false);
|
|
|
|
$select->setValue(Application_Model_Preference::GetSoundCloudTrackType());
|
|
|
|
$this->addElement($select);
|
|
|
|
|
|
|
|
$select = new Zend_Form_Element_Select('SoundCloudLicense');
|
|
|
|
$select->setLabel('Default License:');
|
|
|
|
$select->setAttrib('class', 'input_select');
|
|
|
|
$select->setMultiOptions(array(
|
|
|
|
"" => "",
|
|
|
|
"no-rights-reserved" => "The work is in the public domain",
|
|
|
|
"all-rights-reserved" => "All rights are reserved",
|
|
|
|
"cc-by" => "Creative Commons Attribution",
|
|
|
|
"cc-by-nc" => "Creative Commons Attribution Noncommercial",
|
|
|
|
"cc-by-nd" => "Creative Commons Attribution No Derivative Works",
|
|
|
|
"cc-by-sa" => "Creative Commons Attribution Share Alike",
|
|
|
|
"cc-by-nc-nd" => "Creative Commons Attribution Noncommercial Non Derivate Works",
|
|
|
|
"cc-by-nc-sa" => "Creative Commons Attribution Noncommercial Share Alike"
|
|
|
|
));
|
|
|
|
$select->setRequired(false);
|
|
|
|
$select->setValue(Application_Model_Preference::GetSoundCloudLicense());
|
|
|
|
$this->addElement($select);
|
|
|
|
|
2011-02-03 23:51:35 +01:00
|
|
|
$this->addElement('submit', 'submit', array(
|
2011-02-07 18:36:35 +01:00
|
|
|
'class' => 'ui-button ui-state-default',
|
2011-02-03 23:51:35 +01:00
|
|
|
'ignore' => true,
|
|
|
|
'label' => 'Submit',
|
|
|
|
));
|
2011-03-18 22:15:12 +01:00
|
|
|
|
|
|
|
|
2011-03-04 18:07:22 +01:00
|
|
|
|
2011-02-03 23:51:35 +01:00
|
|
|
}
|
|
|
|
}
|