]> dev.renevier.net Git - syj.git/blob - application/controllers/ListController.php
remove uniquepath constraint
[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
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"));
16     }
17
18     public function indexAction() {
19         $user = $this->_helper->SyjUserManager->current();
20         $pathMapper = new Syj_Model_PathMapper();
21         $list = $pathMapper->fetchByCreator($user);
22         $paginator = Zend_Paginator::factory($list);
23
24         $paginator->setDefaultItemCountPerPage(20);
25         $paginator->setCurrentPageNumber($this->_getParam('page', 1));
26         $this->view->paginator = $paginator;
27         $this->_jsLocaleStrings();
28     }
29
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"),
39             );
40     }
41
42 }