]> dev.renevier.net Git - syj.git/blobdiff - application/controllers/NewpwdController.php
some style for forms
[syj.git] / application / controllers / NewpwdController.php
index 5facb89771110c78a40a6712c28fe8108ee089fc..85edbd9483ec04c5fa5143a52e4b9536b6f1a78b 100644 (file)
@@ -6,11 +6,10 @@ class NewpwdController extends Zend_Controller_Action
 {
 
     public function init() {
-        $this->view->headScript()->appendFile('js/prototype.js');
-        $this->view->headScript()->appendFile('js/newpwd.js');
-        $this->view->headScript()->appendFile('js/highlight.js');
-        $this->view->headLink()->appendStylesheet('css/generic.css');
-        $this->view->headLink()->appendStylesheet('css/newpwd.css');
+        $this->_helper->SyjMedias->addScripts('newpwd');
+        $this->view->headLink()->appendStylesheet('css/generic.css', 'all');
+        $this->view->headLink()->appendStylesheet('css/form.css', 'all');
+        $this->view->headLink()->appendStylesheet('css/newpwd.css', 'all');
     }
 
     public function indexAction() {
@@ -25,7 +24,7 @@ class NewpwdController extends Zend_Controller_Action
         }
 
         if (empty($formData)) {
-            $loggeduser = $this->view->loggedUser();
+            $loggeduser = $this->_helper->SyjSession->user();
             if ($loggeduser) {
                 $form->newpwd_email->setValue($loggeduser->email)
                                     ->setAttrib('readonly', 'true');
@@ -45,7 +44,7 @@ class NewpwdController extends Zend_Controller_Action
         $user = new Syj_Model_User();
         if ($userMapper->findByEmail($formData['newpwd_email'], $user)) {
             // if no user exist with posted email, pretend everything went correct
-            $loggeduser = isset($loggeduser) ? $loggeduser: $this->view->loggedUser();
+            $loggeduser = isset($loggeduser) ? $loggeduser: $this->_helper->SyjSession->user();
             if ($loggeduser and ($loggeduser != $user)) {
                 throw new Syj_Exception_Request();
             }
@@ -66,7 +65,7 @@ class NewpwdController extends Zend_Controller_Action
 
     protected function _jsLocaleStrings() {
         $this->view->jslocales = array(
-            'notEmptyField' => __("Value is required and can't be empty"),
+            'notEmptyField' => __("Value is required"),
             );
     }
 }