Пример #1
0
 /**
  * Method to display the view.
  *
  * @param   string  $tpl  A template file to load. [optional]
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  *
  * @since   2.5
  */
 public function display($tpl = null)
 {
     // Load plug-in language files.
     FinderHelperLanguage::loadPluginLanguage();
     $this->items = $this->get('Items');
     $this->total = $this->get('Total');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->pluginState = $this->get('pluginState');
     $this->filterForm = $this->get('FilterForm');
     $this->activeFilters = $this->get('ActiveFilters');
     FinderHelper::addSubmenu('index');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     if (!$this->pluginState['plg_content_finder']->enabled) {
         JFactory::getApplication()->enqueueMessage(JText::_('COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED'), 'warning');
     } elseif ($this->get('TotalIndexed') === 0) {
         JFactory::getApplication()->enqueueMessage(JText::_('COM_FINDER_INDEX_NO_DATA') . '  ' . JText::_('COM_FINDER_INDEX_TIP'), 'notice');
     }
     JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
     // Configure the toolbar.
     $this->addToolbar();
     $this->sidebar = JHtmlSidebar::render();
     parent::display($tpl);
 }
Пример #2
0
 /**
  * Method to display the view.
  *
  * @param   string  $tpl  A template file to load. [optional]
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  *
  * @since   2.5
  */
 public function display($tpl = null)
 {
     // Load the view data.
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->total = $this->get('Total');
     $this->state = $this->get('State');
     FinderHelper::addSubmenu('filters');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
     // Configure the toolbar.
     $this->addToolbar();
     $this->sidebar = JHtmlSidebar::render();
     parent::display($tpl);
 }
Пример #3
0
 /**
  * Method to display a view.
  *
  * @param   boolean  $cachable   If true, the view output will be cached
  * @param   array    $urlparams  An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  *
  * @return	JController  A JController object to support chaining.
  *
  * @since	2.5
  */
 public function display($cachable = false, $urlparams = array())
 {
     include_once JPATH_COMPONENT . '/helpers/finder.php';
     // Set the variables.
     $input = JFactory::getApplication()->input;
     // Load the submenu.
     FinderHelper::addSubmenu($input->get('view', 'index', 'word'));
     $view = $input->get('view', 'index', 'word');
     $layout = $input->get('layout', 'index', 'word');
     $id = $input->get('id', null, 'int');
     $f_id = $input->get('filter_id', null, 'int');
     // Check for edit form.
     if ($view == 'filter' && $layout == 'edit' && !$this->checkEditId('com_finder.edit.filter', $f_id)) {
         // Somehow the person just went to the form - we don't allow that.
         $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $f_id));
         $this->setMessage($this->getError(), 'error');
         $this->setRedirect(JRoute::_('index.php?option=com_finder&view=filters', false));
         return false;
     }
     parent::display();
     return $this;
 }
Пример #4
0
 /**
  * Method to display the view.
  *
  * @param   string  $tpl  A template file to load. [optional]
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  *
  * @since   2.5
  */
 public function display($tpl = null)
 {
     // Load plug-in language files.
     FinderHelperLanguage::loadPluginLanguage();
     $this->items = $this->get('Items');
     $this->total = $this->get('Total');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->pluginState = $this->get('pluginState');
     $this->filterForm = $this->get('FilterForm');
     $this->activeFilters = $this->get('ActiveFilters');
     FinderHelper::addSubmenu('index');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
     // Configure the toolbar.
     $this->addToolbar();
     $this->sidebar = JHtmlSidebar::render();
     parent::display($tpl);
 }