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:
Naomi Aro 2011-06-21 11:20:35 +02:00
commit 253eb811c7
42 changed files with 3966 additions and 499 deletions

View file

@ -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'
)
));
}

View file

@ -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'
)
));
));
}
}

View 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;
}
}
}