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