public function testPaginationControlUsesDefaultPartial() { Zend_View_Helper_PaginationControl::setDefaultViewPartial('testPagination.phtml'); $output = $this->_viewHelper->paginationControl($this->_paginator); $this->assertEquals('pagination control', $output); Zend_View_Helper_PaginationControl::setDefaultViewPartial(null); }
public function indexAction() { // TODO Auto-generated {0}::indexAction() default action $this->view->form = $form = new Admin_Form_FilterHT(); $params = Default_Model_Functions::filterParams($this->_getAllParams()); $_SESSION['filterHT'] = $_SERVER['QUERY_STRING']; if (empty($params)) { $params['nam'] = date('Y'); } if (empty($params['order'])) { $params['order'] = 'ngay_to_chuc'; } if (empty($params['direction'])) { $params['direction'] = 'DESC'; } $form->populate($params); $hoiThaos = Khcn_Api::_()->getDbTable('hoi_thao', 'default')->loc($params); if ($hoiThaos == null) { $_SESSION['msg'] = 'Không tìm thấy dữ liệu, vui lòng thử lại .'; $_SESSION['type_msg'] = 'attention'; } //Set the properties for the pagination $paginator = Zend_Paginator::factory($hoiThaos); $paginator->setItemCountPerPage(20); $paginator->setPageRange(10); $paginator->setCurrentPageNumber($this->_getParam('page', 1)); Zend_Paginator::setDefaultScrollingStyle('Sliding'); Zend_View_Helper_PaginationControl::setDefaultViewPartial('includes/pagination.phtml'); $this->view->paginator = $paginator; $this->view->filterValues = $params; $this->view->order = $params['order']; $this->view->direction = $params['direction']; $this->view->capQLs = $capQLs = Default_Model_Constraints::hoithao_capquanly(); }
protected function _initPaginator() { $options = $this->getOptions(); if (array_key_exists('cache', $options) && $options['cache']) { // ensure the cache is initialized... $this->getBootstrap()->bootstrap('cachemanager'); // get the cache manager object $manager = $this->getBootstrap()->getResource('cachemanager'); // get the paginator cache object $cache = $manager->getCache(self::PAGINATOR_CACHE); if (!is_null($cache)) { Zend_Paginator::setCache($cache); } } if (!empty($options['scrollingType'])) { Zend_Paginator::setDefaultScrollingStyle($options['scrollingType']); } else { Zend_Paginator::setDefaultScrollingStyle(self::DEFAULT_SCROLLING_TYPE); } if (!empty($options['recordsPerPage'])) { Zend_Paginator::setDefaultItemCountPerPage($options['recordsPerPage']); } else { Zend_Paginator::setDefaultItemCountPerPage(self::DEFAULT_RECORDS_PER_PAGE); } if (!empty($options['viewScript'])) { Zend_View_Helper_PaginationControl::setDefaultViewPartial($options['viewScript']); } }
/** * The default action - show the guestbook entries */ public function indexAction() { $method = __METHOD__; $cacheid = str_replace("::", "_", $method) . intval($this->getRequest()->getParam('page', 1)); $can_edit = false; if (Zoo::getService('acl')->checkAccess('edit')) { $cacheid .= "_edit"; $can_edit = true; } $content = $this->checkCache($cacheid); if (!$content) { $limit = 20; // Offset = items per page multiplied by the page number minus 1 $offset = ($this->getRequest()->getParam('page', 1) - 1) * $limit; $options = array('active' => true, 'nodetype' => 'guestbook_entry', 'order' => 'created DESC', 'render' => true); $select = Zoo::getService('content')->getContentSelect($options, $offset, $limit); $this->view->items = Zoo::getService('content')->getContent($options, $offset, $limit); // Pagination Zend_Paginator::setDefaultScrollingStyle('Elastic'); Zend_View_Helper_PaginationControl::setDefaultViewPartial(array('pagination_control.phtml', 'zoo')); $adapter = new Zend_Paginator_Adapter_DbSelect($select); $paginator = new Zend_Paginator($adapter); $paginator->setItemCountPerPage($limit); $paginator->setCurrentPageNumber($this->getRequest()->getParam('page', 1)); $paginator->setView($this->view); $this->view->assign('paginator', $paginator); $this->view->can_edit = $can_edit; $content = $this->getContent(); $this->cache($content, $cacheid, array('nodelist', 'guestbook_list')); } $this->view->pagetitle = Zoo::_('Guestbook'); $this->renderContent($content); }
public function indexAction() { $auth = Zend_Auth::getInstance(); $identity = $auth->getIdentity(); $this->identity = $identity; switch ($this->identity->usr_permissao) { case 'administrador': $list = $this->_notificacao->fetchAll(null, "not_id DESC"); break; case 'revendedor': $codigo = (int) $this->identity->usr_id; $list = $this->_notificacao->fetchAll("usr_id_fk='{$codigo}'", "not_id DESC"); break; case 'vendedor': $codigo = (int) $this->identity->usr_id; $list = $this->_notificacao->fetchAll("usr_id_fk='{$codigo}'", "not_id DESC"); break; } $paginator = Zend_Paginator::factory($list); $paginator->setCurrentPageNumber($this->_getParam('page')); $paginator->setItemCountPerPage(100); Zend_Paginator::setDefaultScrollingStyle('Sliding'); Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml'); $this->view->lista = $paginator; $this->view->paginator = $paginator; }
/** * The default action - show the home page */ public function indexAction() { $loai = $this->_getParam('loai', 'dhsg'); $table = Khcn_Api::_()->getDbTable('he_cao_hoc', 'default'); $this->view->he_cao_hoc = $he_cao_hoc = $table->fetchRow($table->select()->where('name = ?', $loai)); if (!$he_cao_hoc) { $this->_redirect('index'); } // TODO Auto-generated {0}::indexAction() default action $params = array('trang_thai' => true, 'limit' => 20, 'he_cao_hoc' => $he_cao_hoc->getIdentity()); $danhSach = Khcn_Api::_()->getDbTable('lich_hoc', 'default')->getPaginator($params); $paginator = Zend_Paginator::factory($danhSach); $currentPage = 1; //Check if the user is not on page 1 $page = $this->_getParam('page'); if (!empty($page)) { //Where page is the current page $currentPage = $this->_getParam('page'); } //Set the properties for the pagination $paginator->setItemCountPerPage(15); $paginator->setPageRange(10); $paginator->setCurrentPageNumber($currentPage); Zend_Paginator::setDefaultScrollingStyle('Sliding'); Zend_View_Helper_PaginationControl::setDefaultViewPartial('includes/pagination.phtml'); $paginator->setView($this->view); $this->view->paginator = $paginator; }
/** * 初始化Zend_Paginator */ protected function _initPaginator() { Zend_Paginator::setDefaultItemCountPerPage(15); Zend_View_Helper_PaginationControl::setDefaultViewPartial('paginator.phtml'); $view = $this->bootstrap('view')->getResource('view'); $view->addScriptPath(realpath(__DIR__) . '/layouts'); }
public function indexAction() { //include_once('PS/Filtrador.php'); //display_errors("1"); $auth = Zend_Auth::getInstance(); if (!$auth->hasIdentity()) { return $this->_redirect('/auth/login'); } $model = new Application_Model_Analysis(); //echo print_r($this->_getAllParams()); $filtrador = new PS_Filtrador($model, $this->_getAllParams()); $wheres = $filtrador->getFiltros(); if ($auth->getIdentity()->role === 'Medico') { $wheres['medic_id = ?'] = $auth->getIdentity()->contact_id; } else { if ($auth->getIdentity()->role === 'Paciente') { $wheres['applicant_id = ?'] = $auth->getIdentity()->contact_id; } } Zend_View_Helper_PaginationControl::setDefaultViewPartial('paginator/items.phtml'); $paginator = Zend_Paginator::factory($model->getBy($wheres)); if ($this->_hasParam('page')) { $paginator->setCurrentPageNumber($this->_getParam('page')); $paginator->setItemCountPerPage(5); } $this->view->paginator = $paginator; $this->view->params = $this->_getAllParams(); }
public function indexAction() { // TODO Auto-generated {0}::indexAction() default action\ $this->view->form = $form = new Admin_Form_FilterGV(); $params = Default_Model_Functions::filterParams($this->_getAllParams()); $_SESSION['filterGV'] = $_SERVER['QUERY_STRING']; if (empty($params['order'])) { $params['order'] = 'ho_ten'; } if (empty($params['direction'])) { $params['direction'] = 'ASC'; } $form->populate($params); $giangViens = $this->giang_vien->loc($params); if ($giangViens == null) { $_SESSION['msg'] = 'Không tìm thấy dữ liệu, vui lòng thử lại .'; $_SESSION['type_msg'] = 'attention'; } //Set the properties for the pagination $paginator = Zend_Paginator::factory($giangViens); $paginator->setItemCountPerPage(20); $paginator->setPageRange(10); $paginator->setCurrentPageNumber($this->_getParam('page', 1)); Zend_Paginator::setDefaultScrollingStyle('Sliding'); Zend_View_Helper_PaginationControl::setDefaultViewPartial('includes/pagination.phtml'); $paginator->setView($this->view); $this->view->paginator = $paginator; $this->view->filterValues = $params; $this->view->order = $params['order']; $this->view->direction = $params['direction']; }
/** * Reescreve o metodo init() * @access public * @param void * @return void */ public function init() { $auth = Zend_Auth::getInstance(); // instancia da autenticação $this->permissoesGrupo = array(); $this->permissoesOrgao = array(); //Da permissao de acesso a todos os grupos do usuario logado afim de atender o UC75 if (isset($auth->getIdentity()->usu_codigo)) { //Recupera todos os grupos do Usuario $Usuario = new Usuario(); // objeto usuário $grupos = $Usuario->buscarUnidades($auth->getIdentity()->usu_codigo, 21); foreach ($grupos as $grupo) { if (!in_array($grupo->gru_codigo, $this->permissoesGrupo)) { $this->permissoesGrupo[] = $grupo->gru_codigo; } if (!in_array($grupo->uog_orgao, $this->permissoesOrgao)) { $this->permissoesOrgao[] = $grupo->uog_orgao; } } } isset($auth->getIdentity()->usu_codigo) ? parent::perfil(1, $this->permissoesGrupo) : parent::perfil(4, $this->permissoesGrupo); $this->usuarioLogado = isset($auth->getIdentity()->usu_codigo) ? $auth->getIdentity()->usu_codigo : $auth->getIdentity()->IdUsuario; parent::init(); /* =============================================================================== */ /* ==== VERIFICA PERMISSAO DE ACESSO DO PROPONENTE A PROPOSTA OU AO PROJETO ====== */ /* =============================================================================== */ $this->verificarPermissaoAcesso(true, false, false); # Paginator Zend_Paginator::setDefaultScrollingStyle('Sliding'); Zend_View_Helper_PaginationControl::setDefaultViewPartial('paginacao/paginacaoMinc.phtml'); }
/** * * Kilka dodatkowych statycznych inicjaliacji * */ public function _initStatics() { $config = $this->getApplication()->getOptions(); /** * Ustawienie konfigu na rejestrze dla kompatybilnosci z poprzednmi rozwiazaniami (resouce plugin dla ACL) */ Zend_Registry::set('config', $config); if (isset($config['general']['pluginloader']) and $config['general']['pluginloader']) { $classFileIncCache = APPLICATION_PATH . '/../tmp/pluginLoaderCache.php'; if (file_exists($classFileIncCache)) { include_once $classFileIncCache; } Zend_Loader_PluginLoader::setIncludeFileCache($classFileIncCache); } /** * Ustawienie fallback tak by klasy bez namespacu tez dzialaly */ Zend_Loader_Autoloader::getInstance()->setFallbackAutoloader(true)->pushAutoloader(NULL, 'Smarty_'); /** * Domyslny rozmiar strony paginatora */ Zend_Paginator::setDefaultItemCountPerPage($config['paginator']['DefaultItemCountPerPage']); Zend_View_Helper_PaginationControl::setDefaultViewPartial('/common/paginator_footer.phtml'); Zend_Controller_Action_HelperBroker::addPrefix('Base_Controller_Action_Helper'); Zend_Markup::addRendererPath('Logic', 'Logic/'); Base_Logic_Abstract::setUsePreexecuteHooks($config['general']['usepreexecutehooks']); }
public function hinhAnhAction() { $params = $this->_getAllParams(); $table = Khcn_Api::_()->getDbTable('hinh_anh', 'default'); $select = $table->select(); if (empty($params['order'])) { $params['order'] = 'id'; } if (empty($params['direction'])) { $params['direction'] = 'DESC'; } $select->order($params['order'] . ' ' . $params['direction']); $hinhAnhs = $table->fetchAll($select); $this->view->filterValues = $params; // TODO Auto-generated {0}::indexAction() default action $paginator = Zend_Paginator::factory($hinhAnhs); $currentPage = 1; //Check if the user is not on page 1 $page = $this->_getParam('page'); if (!empty($page)) { //Where page is the current page $currentPage = $this->_getParam('page'); } //Set the properties for the pagination $paginator->setItemCountPerPage(10); $paginator->setPageRange(5); $paginator->setCurrentPageNumber($currentPage); Zend_Paginator::setDefaultScrollingStyle('Sliding'); Zend_View_Helper_PaginationControl::setDefaultViewPartial('includes/pagination.phtml'); $paginator->setView($this->view); $this->view->paginator = $paginator; }
function adminimagereportAction() { $this->view->title = 'Reports'; $this->view->activeTab = 'Reports'; $this->_helper->layout->setLayout("layout_admin"); $this->view->campaign_id = $this->_request->getParam('id'); $curPage = 1; $rowsPerPage = 50; if ($this->_request->getParam('page')) { $curPage = $this->_request->getParam('page'); } $db = Zend_Registry::get('db'); $select = $db->select(); $select->from('image_report', array('id', 'image', 'state', 'create_date', 'consumer_id', 'thumb_width', 'thumb_height'))->join('consumer', 'consumer.id = image_report.consumer_id', array('email', 'name', 'recipients_name', 'language_pref'))->joinLeft('image_report_reply', 'image_report_reply.image_report_id = image_report.id', 'content')->joinLeft('reward_point_transaction_record', 'reward_point_transaction_record.id = image_report.reward_point_transaction_record_id', 'point_amount')->where('campaign_id = ?', $this->view->campaign_id)->where('consumer.pest is null')->order('create_date desc'); $this->view->imageReports = $db->fetchAll($select); //paging $this->view->controller = $this->_request->getControllerName(); $this->view->action = $this->_request->getActionName(); $paginator = new Zend_Paginator(new Zend_Paginator_Adapter_Array($this->view->imageReports)); $paginator->setCurrentPageNumber($curPage)->setItemCountPerPage($rowsPerPage); $this->view->paginator = $paginator; // Zend_Debug::dump($this->view->duplicatedUrlArray); Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination/pagelist.phtml'); $this->view->NoInitValue = ($curPage - 1) * $rowsPerPage + 1; }
public function indexAction() { // TODO Auto-generated {0}::indexAction() default action $this->view->form = $form = new Admin_Form_FilterTB(); $table = Khcn_Api::_()->getDbTable('thong_bao', 'default'); $select = $table->select(); $params = Default_Model_Functions::filterParams($this->_getAllParams()); if (empty($params['order'])) { $params['order'] = 'ngay_tao'; } if (empty($params['direction'])) { $params['direction'] = 'DESC'; } $form->populate($params); if (isset($params['loai']) && !empty($params['loai'])) { $select->where('loai = ?', $params['loai']); } $select->order($params['order'] . ' ' . $params['direction']); $thongBaos = $table->fetchAll($select); //Set the properties for the pagination $paginator = Zend_Paginator::factory($thongBaos); $paginator->setItemCountPerPage(20); $paginator->setPageRange(10); $paginator->setCurrentPageNumber($this->_getParam('page', 1)); Zend_Paginator::setDefaultScrollingStyle('Sliding'); Zend_View_Helper_PaginationControl::setDefaultViewPartial('includes/pagination.phtml'); $paginator->setView($this->view); $this->view->paginator = $paginator; $this->view->filterValues = $params; $this->view->order = $params['order']; $this->view->direction = $params['direction']; }
public function _initPagination() { Zend_Paginator::setDefaultScrollingStyle('Sliding'); Zend_View_Helper_PaginationControl::setDefaultViewPartial( array('partials/pagination.phtml', 'default') ); }
public function run() { // Lade Konfig $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', APPLICATION_ENV); Zend_Registry::set('config', $config); // Erstelle DB Adapter $db = Zend_Db::factory($config->db); Zend_Registry::set('db', $db); Zend_Db_Table_Abstract::setDefaultAdapter(Zend_Registry::get('db')); if (APPLICATION_ENV !== 'production') { $profiler = new Zend_Db_Profiler_Firebug('All Database Queries:'); $profiler->setEnabled(true); $db->setProfiler($profiler); } $resourceLoader = new Zend_Loader_Autoloader_Resource(array('basePath' => APPLICATION_PATH, 'namespace' => '')); $resourceLoader->addResourceType('plugins', 'plugins', 'Plugins'); if (PHP_SAPI != 'cli') { $front = Zend_Controller_Front::getInstance(); $front->registerPlugin(new Plugins_Stats()); if (APPLICATION_ENV == 'production') { $front->registerPlugin(new Plugins_Cache()); } } Zend_View_Helper_PaginationControl::setDefaultViewPartial('_partials/controls.phtml'); parent::run(); }
public function indexAction() { $this->defaultNamespace = new Zend_Session_Namespace('default'); $this->myNamespace = new Zend_Session_Namespace('editParticipants'); $ceId = $this->defaultNamespace->callingActionId; $this->view->callingActionId = $ceId; if ($this->getRequest()->isPost()) { //save form params to namespace $this->myNamespace->params = $this->getRequest()->getParams(); //check which submit button has been clicked if ($this->getRequest()->getParam('Check_all') != NULL) { $this->myNamespace->checkAll = TRUE; $this->redirectTo('index'); } if ($this->getRequest()->getParam('Uncheck_all') != NULL) { $this->myNamespace->checkAll = FALSE; $this->redirectTo('index'); } if ($this->getRequest()->getParam('Remove_from_participants') != NULL) { $success = $this->deleteParticipants(); if (!$success) { //XXX show error } $this->redirectTo('index'); } if ($this->getRequest()->getParam('Apply_to_selected') != NULL) { $success = $this->applySettingsToParticipants(); if (!$success) { ///XXX show error } $this->redirectTo('index'); } } else { //not post //TODO getCaliExName and display in header $userTable = new User(); $participantsTable = new Participant(); $dbAdapter = Zend_Registry::get('DB_CONNECTION1'); $select = $dbAdapter->select(); $select->from(array('user' => $userTable->getTableName()), array(User::COL_LASTNAME, User::COL_FIRSTNAME, User::COL_USERNAME)); $select->join(array('part' => $participantsTable->getTableName()), $dbAdapter->quoteIdentifier('user.' . User::COL_ID) . '=' . $dbAdapter->quoteIdentifier('part.' . Participant::COL_USER_ID), array(Participant::COL_ID, Participant::COL_NUMBER, Participant::COL_EXPERTISE_LEVEL, Participant::COL_STOCK_ASSESSMENT, Participant::COL_ROLE)); $select->where($dbAdapter->quoteInto('part.' . Participant::COL_CE_ID . ' = ?', $ceId)); //echo $select; $paginator = new Ble422_Paginator_Extended($select, $this->getRequest()); $paginator->setHeader(array(array('raw' => User::COL_LASTNAME, 'name' => 'Last name'), array('raw' => User::COL_FIRSTNAME, 'name' => 'First name'), array('raw' => User::COL_USERNAME, 'name' => 'User name'), array('raw' => Participant::COL_NUMBER, 'name' => 'Reader no.'), array('raw' => Participant::COL_EXPERTISE_LEVEL, 'name' => 'Expertise level'), array('raw' => Participant::COL_STOCK_ASSESSMENT, 'name' => 'Stock assess.'), array('raw' => Participant::COL_ROLE, 'name' => 'Role'))); $paginator->setCurrentPageNumber($this->getRequest()->getParam('page'))->setItemCountPerPage(50)->setPageRange(10)->orderBy($this->getRequest()->getParam('orderBy')); //$this->_getParam('pageRange')); Zend_View_Helper_PaginationControl::setDefaultViewPartial('partials/list_pagination_control.phtml'); $this->view->paginator = $paginator; $this->defaultNamespace->callingAction = "ce/editparticipants/index"; //callingActionId stays the same $this->view->callingAction = $this->defaultNamespace->callingAction; $this->view->callingActionId = $ceId; $this->view->ceName = Default_SimpleQuery::getCeName($ceId); $this->view->checkAll = $this->myNamespace->checkAll; unset($this->myNamespace->checkAll); //TODO partTable.phtml wird schon auf this->checkAll geprüft, vom Controller übergeben, ebenso reload bei uncheck all } }
/** * Constructor. * * @param Doctrine_Query $select The select query */ public function __construct(Doctrine_Query $select) { $this->_select = $select; // Set default paginator options Zend_Paginator::setDefaultScrollingStyle('Sliding'); Zend_Paginator::setDefaultItemCountPerPage(8); Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml'); }
/** * @group ZF-4328 */ public function testUsesPaginatorFromViewOnlyIfNoneSupplied() { $this->_viewHelper->view->paginator = $this->_paginator; $paginator = Zend_Paginator::factory(range(1, 30)); Zend_View_Helper_PaginationControl::setDefaultViewPartial('testPagination.phtml'); $output = $this->_viewHelper->paginationControl($paginator); $this->assertContains('page count (3)', $output, $output); }
/** */ public function init() { camp_load_translation_strings('users'); $this->userService = $this->_helper->service('user'); $this->userTypeService = $this->_helper->service('user_type'); Zend_View_Helper_PaginationControl::setDefaultViewPartial('paginator.phtml'); $this->_helper->contextSwitch->addActionContext('index', 'json')->initContext(); }
/** * Sets up XSLT-specific view settings * * @return Drake_View_Xslt */ public function init() { parent::init(); $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer'); $viewRenderer->setViewSuffix('xsl'); Zend_View_Helper_PaginationControl::setDefaultViewPartial('_pagination-control.xsl'); return $this->getView(); }
/** * Returns the Zend_View object * * @return Zend_View */ public function init() { parent::init(); $view = $this->getView(); $view->doctype('XHTML1_STRICT'); $view->setEncoding('UTF-8'); Zend_View_Helper_PaginationControl::setDefaultViewPartial('_pagination-control.phtml'); return $this->getView(); }
/** * @return Zend_Paginator */ public function getResult() { $paginator = Zend_Paginator::factory($this->_select); $paginator->setCurrentPageNumber($this->_page); $paginator->setItemCountPerPage($this->_quantity); $paginator->setDefaultScrollingStyle('Sliding'); Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml'); return $paginator; }
public function indexAction() { $params = array(); $modul = $this->getRequest()->getParam('modul'); $action = $this->getRequest()->getParam('actionType'); $data_inceput = $this->getRequest()->getParam('data_inceput'); $data_sfarsit = $this->getRequest()->getParam('data_sfarsit'); //form cautare dupa modul/tip de actiune/data $form = new Default_Form_SearchLogs(); $form->modul->setValue($modul); $form->actionType->setValue($action); $form->data_inceput->setValue($data_inceput); $form->data_sfarsit->setValue($data_sfarsit); $form->setDecorators(array('ViewScript', array('ViewScript', array('viewScript' => 'forms/logs/search.phtml')))); $this->view->form = $form; if ($this->getRequest()->isPost()) { if ($form->isValid($this->getRequest()->getPost())) { $post = $this->getRequest()->getPost(); $model = new Default_Model_Logs(); $model->setOptions($form->getValues()); } } //end form //fetch loguri $logs = new Default_Model_Logs(); $select = $logs->getMapper()->getDbTable()->select(); if (!empty($action)) { $params['actionType'] = $action; $select->where('actionType = ?', $action); } if (!empty($modul)) { $params['modul'] = $modul; $select->where('modul = ?', $modul); } if (!empty($data_inceput)) { $params['data_inceput'] = $data_inceput; $select->where("DATE(created) >= ?", $data_inceput); } if (!empty($data_sfarsit)) { $params['data_sfarsit'] = $data_sfarsit; $select->where("DATE(created) <= ?", $data_sfarsit); } $select->order('created DESC'); $result = $logs->fetchAll($select); if (NULL != $result) { $paginator = Zend_Paginator::factory($result); $paginator->setItemCountPerPage(10); $paginator->setCurrentPageNumber($this->_getParam('page')); $paginator->setPageRange(5); $this->view->result = $paginator; $this->view->itemCountPerPage = $paginator->getItemCountPerPage(); $this->view->totalItemCount = $paginator->getTotalItemCount(); Zend_Paginator::setDefaultScrollingStyle('Sliding'); Zend_View_Helper_PaginationControl::setDefaultViewPartial(array('_pagination.phtml', $params)); } }
/** * @group ZF-4878 */ public function testCanUseObjectForScrollingStyle() { $all = new Zend_Paginator_ScrollingStyle_All(); try { $output = $this->_viewHelper->paginationControl($this->_paginator, $all, 'testPagination.phtml'); } catch (Exception $e) { $this->fail('Could not use object for sliding style'); } $this->assertContains('page count (11) equals pages in range (11)', $output, $output); }
public function indexAction() { // TODO Auto-generated {0}::indexAction() default action //Set the properties for the pagination $this->view->paginator = $paginator = Khcn_Api::_()->getDbTable('bai_bao', 'default')->getBaiBaosPaginator(); $paginator->setItemCountPerPage(20); $paginator->setPageRange(10); $paginator->setCurrentPageNumber($this->_getParam('page', 1)); Zend_Paginator::setDefaultScrollingStyle('Sliding'); Zend_View_Helper_PaginationControl::setDefaultViewPartial('includes/pagination.phtml'); }
public function indexAction() { $list = $this->_produto->fetchAll(null, "pro_nome ASC"); $paginator = Zend_Paginator::factory($list); $paginator->setCurrentPageNumber($this->_getParam('page')); $paginator->setItemCountPerPage(50); Zend_Paginator::setDefaultScrollingStyle('Sliding'); Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml'); $this->view->lista = $paginator; $this->view->paginator = $paginator; }
public function indexAction() { //Set the properties for the pagination $data = Khcn_Api::_()->getDbTable('download', 'default')->fetchAll(null, "ngay_tao DESC"); $this->view->paginator = $paginator = Zend_Paginator::factory($data); $paginator->setItemCountPerPage(20); $paginator->setPageRange(10); $paginator->setCurrentPageNumber($this->_getParam('page', 1)); Zend_Paginator::setDefaultScrollingStyle('Sliding'); Zend_View_Helper_PaginationControl::setDefaultViewPartial('includes/pagination.phtml'); }
public function articleAttachAction() { $this->_helper->layout->setLayout('iframe'); Zend_View_Helper_PaginationControl::setDefaultViewPartial('paginator-hash.phtml'); $page = (int) $this->_getParam('page', 1); if (1 > $page) { $page = 1; } $search_paging = array('length' => self::LIMIT, 'offset' => ($page - 1) * self::LIMIT); $term = $this->_getParam('term'); $em = \Zend_Registry::get('container')->getService('em'); if (!empty($term)) { $qb = $em->getRepository('Newscoop\\Image\\LocalImage')->createQueryBuilder('i'); $users = $qb->select('i.id', 'u.id', 'u.username')->leftJoin('i.user', 'u')->where($qb->expr()->like('u.username', $qb->expr()->literal('%' . $term . '%')))->groupBy('u.id')->setMaxResults(25)->getQuery()->getArrayResult(); echo json_encode(array('items' => $users)); die; } $source_criteria = array('source' => array('local', 'feedback')); $uploaderId = $this->_getParam('uploader', ''); $newsfeed = $this->_getParam('newsfeed', 0); if ($newsfeed) { $source_criteria = array(); } $count = $this->_helper->service('image')->getCountBy(array()); $this->view->q = $this->_getParam('search', ''); if (is_array($this->view->q)) { $this->view->q = $this->view->q[0]; } $paginator = Zend_Paginator::factory($count); $paginator->setItemCountPerPage(self::LIMIT); $paginator->setCurrentPageNumber($page); $paginator->setView($this->view); $paginator->setDefaultScrollingStyle('Sliding'); $this->view->paginator = $paginator; if (!empty($this->view->q)) { $search_count = 0; $this->view->images = $this->_helper->service('image.search')->find($this->view->q, $source_criteria, array('id' => 'desc'), $search_paging, $search_count); $count = $search_count; } else { if (!empty($uploaderId)) { $this->view->images = $this->_helper->service('image.search')->find($uploaderId, $source_criteria, array('id' => 'desc'), $search_paging); } else { $count = $this->_helper->service('image')->getCountBy($source_criteria); $this->view->images = $this->_helper->service('image')->findBy($source_criteria, array('id' => 'desc'), self::LIMIT, ($paginator->getCurrentPageNumber() - 1) * self::LIMIT); } } $this->view->newsfeed = false; if ($newsfeed) { $this->view->newsfeed = true; } $this->view->article = (int) $this->_getParam('article_number', 0); $this->view->languageId = (int) $this->_getParam('language_id', 0); $this->view->articleImages = $this->_helper->service('image')->findByArticle((int) $this->_getParam('article_number', 0)); }
public function indexAction() { $table = $this->getTable(); $page = $this->_getParam('page', 1); $paginator = Zend_Paginator::factory($table->getRowsMapper()); $paginator->setCurrentPageNumber($page)->setItemCountPerPage(30); Zend_Paginator::setDefaultScrollingStyle('Sliding'); Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml'); $this->view->assign('paginator', $paginator); $this->view->title = ucfirst($this->controller); $this->view->controller = $this->controller; }