X-Git-Url: https://dev.renevier.net/?p=syj.git;a=blobdiff_plain;f=application%2Fcontrollers%2FAccountController.php;h=3bd20c6b63018317ef14511b94095cc2ff7262e5;hp=30daa5bc3eead3ad461c261e215358705c130a8c;hb=70d6bb9dfa4c198607fbe75592f108bc8d69048b;hpb=1de0f433144272946051bb0df886b8c43459beb8 diff --git a/application/controllers/AccountController.php b/application/controllers/AccountController.php index 30daa5b..3bd20c6 100644 --- a/application/controllers/AccountController.php +++ b/application/controllers/AccountController.php @@ -6,32 +6,19 @@ class AccountController extends Zend_Controller_Action { public function init() { - $this->view->headScript()->appendFile('js/prototype.js'); - $this->view->headScript()->appendFile('js/utils.js'); - $this->view->headScript()->appendFile('js/account.js'); - $this->view->headLink()->appendStylesheet('css/generic.css'); - $this->view->headLink()->appendStylesheet('css/account.css'); + $this->_helper->SyjSession->needsLogin(); + $this->_helper->SyjMedias->addScripts('account'); + + $this->view->headLink()->appendStylesheet('css/generic.css', 'all'); + $this->view->headLink()->appendStylesheet('css/form.css', 'all'); + $this->view->headLink()->appendStylesheet('css/account.css', 'all'); $this->view->headTitle($this->view->translate("my account")); } public function indexAction() { - $user = $this->view->loggedUser(); + $user = $this->_helper->SyjSession->user(); $request = $this->getRequest(); - if ($user === null) { - $encodeduri = implode('/', array_map('urlencode', explode('/', $request->getRequestUri()))); - $loginurl = $this->view->addParamToUrl($this->view->baseUrl() . '/' . 'login', 'redirect', $encodeduri); - $translator = Zend_Registry::get('Zend_Translate'); - $lang = Zend_Controller_Front::getInstance()->getRequest()->getQuery('lang'); - if ($lang) { - $adapter = $translator->getAdapter(); - if ($adapter->isAvailable($lang)) { - $loginurl = $this->view->addParamToUrl($loginurl, 'lang', $lang); - } - } - $this->_helper->Redirector->gotoURL($loginurl, array('prependBase' => false)); - } - $form = new Syj_Form_Account(array('name' => 'accountform')); $formData = $request->getPost(); @@ -80,7 +67,7 @@ class AccountController extends Zend_Controller_Action protected function _jsLocaleStrings() { $this->view->jslocales = array( - 'notEmptyField' => __("Value is required and can't be empty"), + 'notEmptyField' => __("Value is required"), 'passwordNoMatchWarn' => __("Password do not match"), 'passwordLenghtWarn' => array(__("At least %d characters"), 6), 'nochangeWarn' => __("You have made no change"),