From 7c17758721393331fd90b13ca84d1ce1497ca559 Mon Sep 17 00:00:00 2001 From: mkonecny Date: Mon, 7 Feb 2011 12:36:35 -0500 Subject: [PATCH] -implemented new ui design for preferences page. --- application/controllers/PreferenceController.php | 15 ++++++++++----- application/forms/Preferences.php | 14 +++----------- application/views/scripts/preference/index.phtml | 3 +++ application/views/scripts/preference/update.phtml | 5 +---- 4 files changed, 17 insertions(+), 20 deletions(-) diff --git a/application/controllers/PreferenceController.php b/application/controllers/PreferenceController.php index ccd52d962..cbfa1d26b 100644 --- a/application/controllers/PreferenceController.php +++ b/application/controllers/PreferenceController.php @@ -10,6 +10,8 @@ class PreferenceController extends Zend_Controller_Action public function indexAction() { + $this->view->statusMsg = ""; + $form = new Application_Form_Preferences(); $this->view->form = $form; } @@ -23,15 +25,18 @@ class PreferenceController extends Zend_Controller_Action $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 + + } else { + $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; + return $this->render('index'); //render the phtml file } diff --git a/application/forms/Preferences.php b/application/forms/Preferences.php index 152468842..3ae783572 100644 --- a/application/forms/Preferences.php +++ b/application/forms/Preferences.php @@ -9,24 +9,16 @@ class Application_Form_Preferences extends Zend_Form // Add login element $this->addElement('text', 'stationName', array( + 'class' => 'input_text', 'label' => 'Station Name:', 'required' => true, 'filters' => array('StringTrim'), 'validators' => array('NotEmpty'), '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( + 'class' => 'ui-button ui-state-default', 'ignore' => true, 'label' => 'Submit', )); diff --git a/application/views/scripts/preference/index.phtml b/application/views/scripts/preference/index.phtml index c7fd9eb7e..68cb33a1b 100644 --- a/application/views/scripts/preference/index.phtml +++ b/application/views/scripts/preference/index.phtml @@ -1,3 +1,6 @@ +
statusMsg; echo $this->form; ?> +
diff --git a/application/views/scripts/preference/update.phtml b/application/views/scripts/preference/update.phtml index 63d962812..3c48814f4 100644 --- a/application/views/scripts/preference/update.phtml +++ b/application/views/scripts/preference/update.phtml @@ -1,4 +1 @@ -Preferences Updated. -form; -?> +Left empty on purpose