2 /* This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
3 and is published under the AGPL license. */
5 class ListController extends Zend_Controller_Action
8 public function init() {
9 $this->_helper->SyjSession->needsLogin();
11 $this->_helper->SyjMedias->addScripts('list');
13 $this->view->headLink()->appendStylesheet('css/generic.css', 'all');
14 $this->view->headLink()->appendStylesheet('css/list.css', 'all');
15 $this->view->headTitle($this->view->translate("my routes"));
18 public function indexAction() {
19 $user = $this->_helper->SyjSession->user();
20 $pathMapper = new Syj_Model_PathMapper();
21 $list = $pathMapper->fetchByCreator($user);
22 $paginator = Zend_Paginator::factory($list);
24 $paginator->setDefaultItemCountPerPage(20);
25 $paginator->setCurrentPageNumber($this->_getParam('page', 1));
26 $this->view->paginator = $paginator;
27 $this->_jsLocaleStrings();
30 protected function _jsLocaleStrings() {
31 $this->view->jslocales = array(
32 'confirmDelete' => __("There is no undo. Delete this route definitively ?"),
33 'notReachedError' => __("server could not be reached"),
34 'requestError' => __("server did not understood request. That's probably caused by a bug in SYJ"),
35 'gonePathError' => __("route not referenced on the server. It has probably been deleted."),
36 'serverError' => __("there was a server error"),
37 'unknownError' => __("there was an unknown error"),
38 'deleteSuccess' => __("route was successfully deleted"),