public function indexAction() { $menu_title = trim($this->_getParam('menu_title')); $this->view->linkArray = array(); $menu = new Base_Security_Menu(); $pages = $menu->getChildPages(0, 0); $this->view->sortOptions = array(); $this->view->menu_title = ""; if ($menu_title != "") { $this->view->linkArray['menu_title'] = $menu_title; $this->view->menu_title = $menu_title; $arrObj = new Base_Array(); $pages = $arrObj->search($pages, 'menu_title', $menu_title); $this->view->sortOptions['menu_title'] = $menu_title; } /*---sorting ----*/ $order = trim($this->_getParam('order', "")); $col = trim($this->_getParam('col', "")); if ($order != "" && $col != "") { $arrObj = new Base_Array(); $arrObj->orderBy($pages, $col, $order); } /*----------------*/ $page_size = Zend_Registry::get('page_size'); $this->view->page = $page = $this->_getParam('page', 1); $paginator = Base_Paginator::factory($pages); $paginator->setItemCountPerPage($page_size); $paginator->setCurrentPageNumber($page); $this->view->paginator = $paginator; }
public function setBlock($blocks, $region = "blocks") { if (is_array($blocks)) { $base = new Base_Array(); $base->orderBy($blocks, 'order', 'desc'); Zend_Registry::set($region, $blocks); } else { "Invalid Array"; } }