/** * Execute and display a template : Printers * * @access protected * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. * * @since 11.1 */ protected function displayDefault($tpl = null) { $document = JFactory::getDocument(); $this->title = JText::_("RTIPRINT_LAYOUT_PRINTERS"); $document->title = $document->titlePrefix . $this->title . $document->titleSuffix; $this->model = $model = $this->getModel(); $this->state = $state = $this->get('State'); $state->set('context', 'printers.default'); $this->items = $items = $this->get('Items'); $this->canDo = $canDo = RtiprintHelper::getActions(); $this->pagination = $this->get('Pagination'); $this->filters = $filters = $model->getForm('default.filters'); $this->menu = RtiprintHelper::addSubmenu('printers', 'default'); $lists = array(); $this->lists =& $lists; //Filters // Printer Model > Name $modelPrinter_model = CkJModel::getInstance('printermdls', 'RtiprintModel'); $filters['filter_printer_model']->jdomOptions = array('list' => $modelPrinter_model->getItems()); // Building > Building $filters['filter_building']->jdomOptions = array('ajaxVars' => array('values' => array($model->getState("filter.building"), $model->getState("filter.building_town")))); // Server > Name $modelServer = CkJModel::getInstance('servers', 'RtiprintModel'); $filters['filter_server']->jdomOptions = array('list' => $modelServer->getItems()); // Sort by $filters['sortTable']->jdomOptions = array('list' => $this->getSortFields('default')); // Limit $filters['limit']->jdomOptions = array('pagination' => $this->pagination); //Toolbar initialization JToolBarHelper::title(JText::_('RTIPRINT_LAYOUT_PRINTERS'), 'rtiprint_printers'); // New if ($model->canCreate()) { CkJToolBarHelper::addNew('printer.add', "RTIPRINT_JTOOLBAR_NEW"); } // Edit if ($model->canEdit()) { CkJToolBarHelper::editList('printer.edit', "RTIPRINT_JTOOLBAR_EDIT"); } // Publish if ($model->canEditState()) { CkJToolBarHelper::publishList('printers.publish', "RTIPRINT_JTOOLBAR_PUBLISH"); } // Unpublish if ($model->canEditState()) { CkJToolBarHelper::unpublishList('printers.unpublish', "RTIPRINT_JTOOLBAR_UNPUBLISH"); } // Archive if ($model->canEditState()) { CkJToolBarHelper::archiveList('printers.archive', "RTIPRINT_JTOOLBAR_ARCHIVE"); } // Trash if ($model->canEditState()) { CkJToolBarHelper::trash('printers.trash', "RTIPRINT_JTOOLBAR_TRASH"); } // Delete if ($model->canDelete()) { CkJToolBarHelper::deleteList(JText::_('RTIPRINT_JTOOLBAR_ARE_YOU_SURE_TO_DELETE'), 'printer.delete', "RTIPRINT_JTOOLBAR_DELETE"); } }
/** * Execute and display a template : Manufacturers * * @access protected * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. * * @since 11.1 */ protected function displayDefault($tpl = null) { $document = JFactory::getDocument(); $this->title = JText::_("RTIPRINT_LAYOUT_MANUFACTURERS"); $document->title = $document->titlePrefix . $this->title . $document->titleSuffix; $this->model = $model = $this->getModel(); $this->state = $state = $this->get('State'); $state->set('context', 'manufacturers.default'); $this->items = $items = $this->get('Items'); $this->canDo = $canDo = RtiprintHelper::getActions(); $this->pagination = $this->get('Pagination'); $this->filters = $filters = $model->getForm('default.filters'); $this->menu = RtiprintHelper::addSubmenu('manufacturers', 'default'); $lists = array(); $this->lists =& $lists; //Filters // Sort by $filters['sortTable']->jdomOptions = array('list' => $this->getSortFields('default')); // Limit $filters['limit']->jdomOptions = array('pagination' => $this->pagination); //Toolbar initialization JToolBarHelper::title(JText::_('RTIPRINT_LAYOUT_MANUFACTURERS'), 'rtiprint_manufacturers'); // New if ($model->canCreate()) { CkJToolBarHelper::addNew('manufacturer.add', "RTIPRINT_JTOOLBAR_NEW"); } // Edit if ($model->canEdit()) { CkJToolBarHelper::editList('manufacturer.edit', "RTIPRINT_JTOOLBAR_EDIT"); } // Publish if ($model->canEditState()) { CkJToolBarHelper::publishList('manufacturers.publish', "RTIPRINT_JTOOLBAR_PUBLISH"); } // Unpublish if ($model->canEditState()) { CkJToolBarHelper::unpublishList('manufacturers.unpublish', "RTIPRINT_JTOOLBAR_UNPUBLISH"); } // Archive if ($model->canEditState()) { CkJToolBarHelper::archiveList('manufacturers.archive', "RTIPRINT_JTOOLBAR_ARCHIVE"); } // Trash if ($model->canEditState()) { CkJToolBarHelper::trash('manufacturers.trash', "RTIPRINT_JTOOLBAR_TRASH"); } // Delete if ($model->canDelete()) { CkJToolBarHelper::deleteList(JText::_('RTIPRINT_JTOOLBAR_ARE_YOU_SURE_TO_DELETE'), 'manufacturer.delete', "RTIPRINT_JTOOLBAR_DELETE"); } }