Esempio n. 1
0
 public function configAction()
 {
     $menuId = $this->getParam('menu_id');
     $this->view->menuId = $menuId;
     $menus = Modules_Menu_Services_Menu::getAllMenus();
     $this->view->menus = $menus;
     $this->view->moduleName = Gio_Core_Widget::getIntance()->getModuleName();
     $this->view->widgetName = Gio_Core_Widget::getIntance()->getWidgetName();
     $this->view->widgetIndex = $this->getParam('widget_index');
 }
Esempio n. 2
0
 public function listAction()
 {
     $request = $this->getRequest();
     $lang = $request->getParam('lang');
     $this->view->lang = $lang;
     $paramLang = $lang ? '/' . $lang : null;
     $perPage = 20;
     $pageIndex = (int) $request->getParam('page_index');
     if (null == $pageIndex || '' == $pageIndex || $pageIndex < 0) {
         $pageIndex = 1;
     }
     $start = ($pageIndex - 1) * $perPage;
     $this->view->pageIndex = $pageIndex;
     $this->view->menuDao = new Modules_Menu_Models_Mysql_Menu();
     $condition = array('language' => $lang);
     $menus = Modules_Menu_Services_Menu::find($start, $perPage, $condition);
     $numMenus = Modules_Menu_Services_Menu::count($condition);
     $this->view->menus = $menus;
     // Pager
     require_once LIB_DIR . DS . 'PEAR' . DS . 'Pager' . DS . 'Sliding.php';
     $pagerPath = $this->view->url('menu_menu_list');
     $pagerOptions = array('mode' => 'Sliding', 'append' => false, 'perPage' => $perPage, 'delta' => 5, 'urlVar' => 'page', 'path' => $pagerPath, 'fileName' => 'page-%d' . $paramLang, 'separator' => '', 'nextImg' => '<small class="icon arrow_right"></small>', 'prevImg' => '<small class="icon arrow_left"></small>', 'altNext' => '', 'altPrev' => '', 'altPage' => '', 'totalItems' => $numMenus, 'currentPage' => $pageIndex, 'urlSeparator' => '/', 'spacesBeforeSeparator' => 0, 'spacesAfterSeparator' => 0, 'curPageSpanPre' => '<a href="javascript: void();" class="current">', 'curPageSpanPost' => '</a>');
     $pager = new Pager_Sliding($pagerOptions);
     $this->view->pager = $pager;
 }