-implemented new ui design for preferences page.

This commit is contained in:
mkonecny 2011-02-07 12:36:35 -05:00
parent 89ae221f4c
commit 7c17758721
4 changed files with 17 additions and 20 deletions

View File

@ -10,6 +10,8 @@ class PreferenceController extends Zend_Controller_Action
public function indexAction() public function indexAction()
{ {
$this->view->statusMsg = "";
$form = new Application_Form_Preferences(); $form = new Application_Form_Preferences();
$this->view->form = $form; $this->view->form = $form;
} }
@ -23,15 +25,18 @@ class PreferenceController extends Zend_Controller_Action
$form = new Application_Form_Preferences(); $form = new Application_Form_Preferences();
if (!$form->isValid($request->getPost())) { if (!$form->isValid($request->getPost())) {
// Failed validation; redisplay form
$this->view->form = $form; } else {
return $this->render('index'); //render the phtml file $values = $form->getValues();
Application_Model_Preference::SetHeadTitle($values["stationName"], $this->view);
$this->view->statusMsg = "Preferences Updated.";
} }
$values = $form->getValues();
Application_Model_Preference::SetHeadTitle($values["stationName"], $this->view);
$this->view->form = $form; $this->view->form = $form;
return $this->render('index'); //render the phtml file
} }

View File

@ -9,24 +9,16 @@ class Application_Form_Preferences extends Zend_Form
// Add login element // Add login element
$this->addElement('text', 'stationName', array( $this->addElement('text', 'stationName', array(
'class' => 'input_text',
'label' => 'Station Name:', 'label' => 'Station Name:',
'required' => true, 'required' => true,
'filters' => array('StringTrim'), 'filters' => array('StringTrim'),
'validators' => array('NotEmpty'), 'validators' => array('NotEmpty'),
'value' => Application_Model_Preference::GetValue("station_name") 'value' => Application_Model_Preference::GetValue("station_name")
)); ));
/*
$this->addElement('select', 'test', array(
'label' => 'Live Stream Button: ',
'multiOptions' => array(
"e" => "enabled",
"d" => "disabled"
))
);
*/
$this->addElement('submit', 'submit', array( $this->addElement('submit', 'submit', array(
'class' => 'ui-button ui-state-default',
'ignore' => true, 'ignore' => true,
'label' => 'Submit', 'label' => 'Submit',
)); ));

View File

@ -1,3 +1,6 @@
<div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong">
<?php <?php
echo $this->statusMsg;
echo $this->form; echo $this->form;
?> ?>
</div>

View File

@ -1,4 +1 @@
Preferences Updated. Left empty on purpose
<?php
echo $this->form;
?>