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->view->headScript()->appendFile('js/OpenLayers.js');
12 $this->view->headScript()->appendFile('js/prototype.js');
13 $this->view->headScript()->appendFile('js/utils.js');
14 $this->view->headScript()->appendFile('js/list.js');
16 $this->view->headLink()->appendStylesheet('css/generic.css');
17 $this->view->headLink()->appendStylesheet('css/list.css');
18 $this->view->headTitle($this->view->translate("my routes"));
21 public function indexAction() {
22 $user = $this->_helper->SyjSession->user();
23 $pathMapper = new Syj_Model_PathMapper();
24 $list = $pathMapper->fetchByCreator($user);
25 $paginator = Zend_Paginator::factory($list);
27 $paginator->setDefaultItemCountPerPage(20);
28 $paginator->setCurrentPageNumber($this->_getParam('page', 1));
29 $this->view->paginator = $paginator;
30 $this->_jsLocaleStrings();
33 protected function _jsLocaleStrings() {
34 $this->view->jslocales = array(
35 'confirmDelete' => __("There is no undo. Delete this route definitively ?"),
36 'notReachedError' => __("server could not be reached"),
37 'requestError' => __("server did not understood request. That's probably caused by a bug in SYJ"),
38 'gonePathError' => __("route not referenced on the server. It has probably been deleted."),
39 'serverError' => __("there was a server error"),
40 'unknownError' => __("there was an unknown error"),
41 'deleteSuccess' => __("route was successfully deleted"),