Merge branch 'cc-1799-put-airtime-storage-into-a-human-readable-file-naming-convention' into devel
Conflicts: airtime_mvc/application/controllers/PreferenceController.php airtime_mvc/application/models/Preference.php airtime_mvc/application/views/scripts/form/preferences.phtml airtime_mvc/public/js/airtime/preferences/preferences.js
This commit is contained in:
commit
253eb811c7
42 changed files with 3966 additions and 499 deletions
|
@ -59,17 +59,6 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
|||
$third_party_api->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($third_party_api);
|
||||
|
||||
//Default station fade
|
||||
$this->addElement('text', 'watchedFolder', array(
|
||||
'class' => 'input_text',
|
||||
'label' => 'WatchedFolder:',
|
||||
'required' => false,
|
||||
'filters' => array('StringTrim'),
|
||||
'value' => Application_Model_Preference::GetWatchedDirectory(),
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ class Application_Form_Preferences extends Zend_Form
|
|||
$this->setDecorators(array(
|
||||
array('ViewScript', array('viewScript' => 'form/preferences.phtml'))
|
||||
));
|
||||
|
||||
|
||||
$general_pref = new Application_Form_GeneralPreferences();
|
||||
$this->addSubForm($general_pref, 'preferences_general');
|
||||
|
||||
|
@ -28,6 +28,6 @@ class Application_Form_Preferences extends Zend_Form
|
|||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
));
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
58
airtime_mvc/application/forms/WatchedDirPreferences.php
Normal file
58
airtime_mvc/application/forms/WatchedDirPreferences.php
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
class Application_Form_WatchedDirPreferences extends Zend_Form_SubForm
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
$this->setDecorators(array(
|
||||
array('ViewScript', array('viewScript' => 'form/preferences_watched_dirs.phtml'))
|
||||
));
|
||||
|
||||
$this->addElement('text', 'watchedFolder', array(
|
||||
'class' => 'input_text',
|
||||
'label' => 'Choose a Folder to Watch:',
|
||||
'required' => false,
|
||||
'filters' => array('StringTrim'),
|
||||
'value' => '',
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
));
|
||||
}
|
||||
|
||||
public function verifyChosenFolder() {
|
||||
|
||||
$element = $this->getElement('watchedFolder');
|
||||
|
||||
if (!is_dir($element->getValue())) {
|
||||
$element->setErrors(array('Not a valid Directory'));
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
$element->setValue("");
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function setWatchedDirs() {
|
||||
|
||||
$watched_dirs = MusicDir::getWatchedDirs();
|
||||
$i = 1;
|
||||
foreach($watched_dirs as $dir) {
|
||||
|
||||
$text = new Zend_Form_Element_Text("watched_dir_$i");
|
||||
$text->setAttrib('class', 'input_text');
|
||||
$text->addFilter('StringTrim');
|
||||
$text->setValue($dir->getDirectory());
|
||||
$text->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($text);
|
||||
|
||||
$i = $i + 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue