2011-02-03 23:51:35 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class PreferenceController extends Zend_Controller_Action
|
|
|
|
{
|
|
|
|
|
|
|
|
public function init()
|
|
|
|
{
|
|
|
|
/* Initialize action controller here */
|
|
|
|
}
|
|
|
|
|
|
|
|
public function indexAction()
|
|
|
|
{
|
2011-02-07 18:36:35 +01:00
|
|
|
$this->view->statusMsg = "";
|
|
|
|
|
2011-02-03 23:51:35 +01:00
|
|
|
$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())) {
|
2011-02-07 18:36:35 +01:00
|
|
|
|
|
|
|
} else {
|
|
|
|
$values = $form->getValues();
|
|
|
|
Application_Model_Preference::SetHeadTitle($values["stationName"], $this->view);
|
|
|
|
|
|
|
|
$this->view->statusMsg = "Preferences Updated.";
|
2011-02-03 23:51:35 +01:00
|
|
|
}
|
2011-02-04 01:17:52 +01:00
|
|
|
|
2011-02-07 18:36:35 +01:00
|
|
|
|
2011-02-04 01:17:52 +01:00
|
|
|
|
2011-02-03 23:51:35 +01:00
|
|
|
$this->view->form = $form;
|
2011-02-07 18:36:35 +01:00
|
|
|
return $this->render('index'); //render the phtml file
|
2011-02-03 23:51:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|