Source for file view.html.php

Documentation is available at view.html.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Administrator
  4.  * @subpackage  com_finder
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE
  8.  */
  9.  
  10. defined('_JEXEC'or die;
  11.  
  12. JLoader::register('FinderHelperLanguage'JPATH_ADMINISTRATOR '/components/com_finder/helpers/language.php');
  13.  
  14. /**
  15.  * Index view class for Finder.
  16.  *
  17.  * @package     Joomla.Administrator
  18.  * @subpackage  com_finder
  19.  * @since       2.5
  20.  */
  21. class FinderViewIndex extends JViewLegacy
  22. {
  23.     /**
  24.      * Method to display the view.
  25.      *
  26.      * @param   string  $tpl  A template file to load. [optional]
  27.      *
  28.      * @return  mixed  A string if successful, otherwise a JError object.
  29.      *
  30.      * @since   2.5
  31.      */
  32.     public function display($tpl null)
  33.     {
  34.         // Load plug-in language files.
  35.  
  36.         $this->items        $this->get('Items');
  37.         $this->total        $this->get('Total');
  38.         $this->pagination    $this->get('Pagination');
  39.         $this->state        $this->get('State');
  40.         $this->pluginState  $this->get('pluginState');
  41.  
  42.         FinderHelper::addSubmenu('index');
  43.  
  44.         // Check for errors.
  45.         if (count($errors $this->get('Errors')))
  46.         {
  47.             JError::raiseError(500implode("\n"$errors));
  48.             return false;
  49.         }
  50.  
  51.         JHtml::addIncludePath(JPATH_COMPONENT '/helpers/html');
  52.  
  53.         // Configure the toolbar.
  54.         $this->addToolbar();
  55.         $this->sidebar JHtmlSidebar::render();
  56.         parent::display($tpl);
  57.     }
  58.  
  59.     /**
  60.      * Method to configure the toolbar for this view.
  61.      *
  62.      * @return  void 
  63.      *
  64.      * @since   2.5
  65.      */
  66.     protected function addToolbar()
  67.     {
  68.         $canDo    FinderHelper::getActions();
  69.  
  70.         JToolbarHelper::title(JText::_('COM_FINDER_INDEX_TOOLBAR_TITLE')'zoom-in finder');
  71.  
  72.         $toolbar JToolbar::getInstance('toolbar');
  73.         $toolbar->appendButton(
  74.             'Popup''archive''COM_FINDER_INDEX''index.php?option=com_finder&view=indexer&tmpl=component'50021000,
  75.             'window.parent.location.reload()''COM_FINDER_HEADING_INDEXER'
  76.         );
  77.  
  78.         if ($canDo->get('core.edit.state'))
  79.         {
  80.             JToolbarHelper::publishList('index.publish');
  81.             JToolbarHelper::unpublishList('index.unpublish');
  82.         }
  83.         if ($canDo->get('core.delete'))
  84.         {
  85.             JToolbarHelper::deleteList('''index.delete');
  86.         }
  87.         if ($canDo->get('core.edit.state'))
  88.         {
  89.             JToolbarHelper::trash('index.purge''COM_FINDER_INDEX_TOOLBAR_PURGE'false);
  90.         }
  91.  
  92.         if ($canDo->get('core.admin'))
  93.         {
  94.             JToolbarHelper::preferences('com_finder');
  95.         }
  96.  
  97.         $toolbar->appendButton('Popup''stats''COM_FINDER_STATISTICS''index.php?option=com_finder&view=statistics&tmpl=component'550350);
  98.  
  99.         JToolbarHelper::help('JHELP_COMPONENTS_FINDER_MANAGE_INDEXED_CONTENT');
  100.  
  101.         JHtmlSidebar::setAction('index.php?option=com_finder&view=index');
  102.  
  103.         JHtmlSidebar::addFilter(
  104.             JText::_('COM_FINDER_INDEX_FILTER_BY_STATE'),
  105.             'filter_state',
  106.             JHtml::_('select.options'JHtml::_('finder.statelist')'value''text'$this->state->get('filter.state'))
  107.         );
  108.  
  109.         JHtmlSidebar::addFilter(
  110.             JText::_('COM_FINDER_INDEX_TYPE_FILTER'),
  111.             'filter_type',
  112.             JHtml::_('select.options'JHtml::_('finder.typeslist')'value''text'$this->state->get('filter.type'))
  113.         );
  114.     }
  115. }

Documentation generated on Tue, 19 Nov 2013 15:17:06 +0100 by phpDocumentor 1.4.3