addToolBar(); $rows = ""; $navbut = ""; $dbo = JFactory::getDbo(); $mainframe = JFactory::getApplication(); $lim = $mainframe->getUserStateFromRequest("com_vikbooking.limit", 'limit', $mainframe->get('list_limit'), 'int'); $lim0 = VikRequest::getVar('limitstart', 0, '', 'int'); $q = "SELECT SQL_CALC_FOUND_ROWS * FROM `#__vikbooking_custfields` ORDER BY `#__vikbooking_custfields`.`ordering` ASC"; $dbo->setQuery($q, $lim0, $lim); $dbo->execute(); if ($dbo->getNumRows() > 0) { $rows = $dbo->loadAssocList(); $dbo->setQuery('SELECT FOUND_ROWS();'); jimport('joomla.html.pagination'); $pageNav = new JPagination( $dbo->loadResult(), $lim0, $lim ); $navbut = "
".$pageNav->getListFooter()."
"; } $this->rows = $rows; $this->lim0 = $lim0; $this->navbut = $navbut; // Display the template parent::display($tpl); } /** * Sets the toolbar */ protected function addToolBar() { JToolBarHelper::title(JText::translate('VBMAINCUSTOMFTITLE'), 'vikbooking'); if (JFactory::getUser()->authorise('core.create', 'com_vikbooking')) { JToolBarHelper::addNew('newcustomf', JText::translate('VBMAINCUSTOMFNEW')); JToolBarHelper::spacer(); } if (JFactory::getUser()->authorise('core.edit', 'com_vikbooking')) { JToolBarHelper::editList('editcustomf', JText::translate('VBMAINCUSTOMFEDIT')); JToolBarHelper::spacer(); } if (JFactory::getUser()->authorise('core.delete', 'com_vikbooking')) { JToolBarHelper::deleteList(JText::translate('VBDELCONFIRM'), 'removecustomf', JText::translate('VBMAINCUSTOMFDEL')); JToolBarHelper::spacer(); } } }