sintonia/application/controllers/PreferenceController.php
Naomi 3a0f9ddcd1 CC-1987 : Automatic upload of recorded shows to Soundcloud
Added fields to preference form for the station's soundcloud user/pass
need to generalize file upload as commented out in the new Soundcloud.php file.
2011-03-18 17:15:12 -04:00

46 lines
1.5 KiB
PHP

<?php
class PreferenceController extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
$this->view->statusMsg = "";
$form = new Application_Form_Preferences();
$this->view->form = $form;
}
public function updateAction()
{
$request = $this->getRequest();
if (!$this->getRequest()->isPost()) {
return $this->_forward('Preference/index');
}
$form = new Application_Form_Preferences();
if ($form->isValid($request->getPost())) {
$values = $form->getValues();
Application_Model_Preference::SetHeadTitle($values["stationName"], $this->view);
Application_Model_Preference::SetDefaultFade($values["stationDefaultFade"]);
Application_Model_Preference::SetStreamLabelFormat($values["streamFormat"]);
Application_Model_Preference::SetDoSoundCloudUpload($values["UseSoundCloud"]);
Application_Model_Preference::SetSoundCloudUser($values["SoundCloudUser"]);
Application_Model_Preference::SetSoundCloudPassword($values["SoundCloudPassword"]);
$this->view->statusMsg = "Preferences Updated.";
}
$this->view->form = $form;
return $this->render('index'); //render the phtml file
}
}