]> dev.renevier.net Git - syj.git/blob - application/controllers/ListController.php
fixes wrong exception in release.py if no git tag is set
[syj.git] / application / controllers / ListController.php
1 <?php
2 /*  This file is part of Syj, Copyright (c) 2010-2011 Arnaud Renevier,
3     and is published under the AGPL license. */
4
5 class ListController extends Zend_Controller_Action
6 {
7
8     public function init() {
9         $this->_helper->SyjUserManager->needsLogin();
10
11         $this->_helper->SyjMedias->addScripts('list');
12         $this->_helper->SyjMedias->addStyleSheets('list');
13
14         $this->view->headTitle($this->view->translate("my routes"));
15     }
16
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);
22
23         $paginator->setDefaultItemCountPerPage(20);
24         $paginator->setCurrentPageNumber($this->_getParam('page', 1));
25         $this->view->paginator = $paginator;
26         $this->_jsLocaleStrings();
27     }
28
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"),
38             );
39     }
40
41 }