/** * Display the view * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return void */ public function display($tpl = null) { ContentHelper::addSubmenu('featured'); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); $this->authors = $this->get('Authors'); $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } // Levels filter. $options = array(); $options[] = JHtml::_('select.option', '1', JText::_('J1')); $options[] = JHtml::_('select.option', '2', JText::_('J2')); $options[] = JHtml::_('select.option', '3', JText::_('J3')); $options[] = JHtml::_('select.option', '4', JText::_('J4')); $options[] = JHtml::_('select.option', '5', JText::_('J5')); $options[] = JHtml::_('select.option', '6', JText::_('J6')); $options[] = JHtml::_('select.option', '7', JText::_('J7')); $options[] = JHtml::_('select.option', '8', JText::_('J8')); $options[] = JHtml::_('select.option', '9', JText::_('J9')); $options[] = JHtml::_('select.option', '10', JText::_('J10')); $this->f_levels = $options; $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); parent::display($tpl); }
/** * Display the view * * @return void */ public function display($tpl = null) { if ($this->getLayout() !== 'modal') { ContentHelper::addSubmenu('articles'); } $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); $this->authors = $this->get('Authors'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } // Levels filter. $options = array(); $options[] = JHtml::_('select.option', '1', JText::_('J1')); $options[] = JHtml::_('select.option', '2', JText::_('J2')); $options[] = JHtml::_('select.option', '3', JText::_('J3')); $options[] = JHtml::_('select.option', '4', JText::_('J4')); $options[] = JHtml::_('select.option', '5', JText::_('J5')); $options[] = JHtml::_('select.option', '6', JText::_('J6')); $options[] = JHtml::_('select.option', '7', JText::_('J7')); $options[] = JHtml::_('select.option', '8', JText::_('J8')); $options[] = JHtml::_('select.option', '9', JText::_('J9')); $options[] = JHtml::_('select.option', '10', JText::_('J10')); $this->f_levels = $options; // We don't need toolbar in the modal window. if ($this->getLayout() !== 'modal') { $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); } parent::display($tpl); }
/** * Display the view * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return void */ public function display($tpl = null) { if ($this->getLayout() !== 'modal') { ContentHelper::addSubmenu('articles'); } $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); $this->authors = $this->get('Authors'); $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } // Levels filter. $options = array(); $options[] = JHtml::_('select.option', '1', JText::_('J1')); $options[] = JHtml::_('select.option', '2', JText::_('J2')); $options[] = JHtml::_('select.option', '3', JText::_('J3')); $options[] = JHtml::_('select.option', '4', JText::_('J4')); $options[] = JHtml::_('select.option', '5', JText::_('J5')); $options[] = JHtml::_('select.option', '6', JText::_('J6')); $options[] = JHtml::_('select.option', '7', JText::_('J7')); $options[] = JHtml::_('select.option', '8', JText::_('J8')); $options[] = JHtml::_('select.option', '9', JText::_('J9')); $options[] = JHtml::_('select.option', '10', JText::_('J10')); $this->f_levels = $options; // We don't need toolbar in the modal window. if ($this->getLayout() !== 'modal') { $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); } else { // In article associations modal we need to remove language filter if forcing a language. // We also need to change the category filter to show show categories with All or the forced language. if ($forcedLanguage = JFactory::getApplication()->input->get('forcedLanguage', '', 'CMD')) { // If the language is forced we can't allow to select the language, so transform the language selector filter into an hidden field. $languageXml = new SimpleXMLElement('<field name="language" type="hidden" default="' . $forcedLanguage . '" />'); $this->filterForm->setField($languageXml, 'filter', true); // Also, unset the active language filter so the search tools is not open by default with this filter. unset($this->activeFilters['language']); // One last changes needed is to change the category filter to just show categories with All language or with the forced language. $this->filterForm->setFieldAttribute('category_id', 'language', '*,' . $forcedLanguage, 'filter'); } } parent::display($tpl); }
/** * Method to display a view. * * @param boolean If true, the view output will be cached * @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}. * * @return JController This object to support chaining. * @since 1.5 */ public function display($cachable = false, $urlparams = false) { // Load the submenu. ContentHelper::addSubmenu(JRequest::getCmd('view', 'articles')); $view = JRequest::getCmd('view', 'articles'); $layout = JRequest::getCmd('layout', 'articles'); $id = JRequest::getInt('id'); // Check for edit form. if ($view == 'article' && $layout == 'edit' && !$this->checkEditId('com_content.edit.article', $id)) { // Somehow the person just went to the form - we don't allow that. $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); $this->setMessage($this->getError(), 'error'); $this->setRedirect(JRoute::_('index.php?option=com_content&view=articles', false)); return false; } parent::display(); return $this; }
/** * Display the view */ function display() { require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'content.php'; // Get the document object. $document = JFactory::getDocument(); // Set the default view name and format from the Request. $vName = JRequest::getWord('view', 'articles'); $vFormat = $document->getType(); $lName = JRequest::getWord('layout', 'default'); // Get and render the view. if ($view =& $this->getView($vName, $vFormat)) { // Get the model for the view. $model =& $this->getModel($vName); // Push the model into the view (as default). $view->setModel($model, true); $view->setLayout($lName); // Push document object into the view. $view->assignRef('document', $document); $view->display(); // Load the submenu. ContentHelper::addSubmenu($vName); } }