-added simple configuration page
-implemented CC-1830 -issue CC-1850 closed
This commit is contained in:
parent
1e23907df1
commit
df675bd8c6
15 changed files with 179 additions and 9 deletions
43
application/controllers/PreferenceController.php
Normal file
43
application/controllers/PreferenceController.php
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
class PreferenceController extends Zend_Controller_Action
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
/* Initialize action controller here */
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$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())) {
|
||||
// Failed validation; redisplay form
|
||||
$this->view->form = $form;
|
||||
return $this->render('index'); //render the phtml file
|
||||
}
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$id = $auth->getIdentity()->id;
|
||||
|
||||
$values = $form->getValues();
|
||||
Application_Model_Preference::UpdateStationName($values["stationName"], $id);
|
||||
$this->view->form = $form;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue