X-Git-Url: https://dev.renevier.net/gitweb.cgi?a=blobdiff_plain;f=application%2Fcontrollers%2FListController.php;fp=application%2Fcontrollers%2FListController.php;h=317505e7d67b54dcc5b66e92e6d34184cb6b11f4;hb=ec061a75fe57a25eb7ef0894f5e723397ba35472;hp=0000000000000000000000000000000000000000;hpb=3ff82e2d9fa289beba4e965b82772cf83f905b2f;p=syj.git diff --git a/application/controllers/ListController.php b/application/controllers/ListController.php new file mode 100644 index 0000000..317505e --- /dev/null +++ b/application/controllers/ListController.php @@ -0,0 +1,45 @@ +_helper->SyjSession->needsLogin(); + + $this->view->headScript()->appendFile('js/OpenLayers.js'); + $this->view->headScript()->appendFile('js/prototype.js'); + $this->view->headScript()->appendFile('js/utils.js'); + $this->view->headScript()->appendFile('js/list.js'); + + $this->view->headLink()->appendStylesheet('css/generic.css'); + $this->view->headLink()->appendStylesheet('css/list.css'); + $this->view->headTitle($this->view->translate("my routes")); + } + + public function indexAction() { + $user = $this->_helper->SyjSession->user(); + $pathMapper = new Syj_Model_PathMapper(); + $list = $pathMapper->fetchByCreator($user); + $paginator = Zend_Paginator::factory($list); + + $paginator->setDefaultItemCountPerPage(20); + $paginator->setCurrentPageNumber($this->_getParam('page', 1)); + $this->view->paginator = $paginator; + $this->_jsLocaleStrings(); + } + + protected function _jsLocaleStrings() { + $this->view->jslocales = array( + 'confirmDelete' => __("There is no undo. Delete this route definitively ?"), + 'notReachedError' => __("server could not be reached"), + 'requestError' => __("server did not understood request. That's probably caused by a bug in SYJ"), + 'gonePathError' => __("route has been deleted from the server."), + 'serverError' => __("there was a server error"), + 'unknownError' => __("there was an unknown error"), + 'deleteSuccess' => __("route was successfully deleted"), + ); + } + +}