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.  * Groups view class for Finder.
  16.  *
  17.  * @package     Joomla.Administrator
  18.  * @subpackage  com_finder
  19.  * @since       2.5
  20.  */
  21. class FinderViewMaps 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.         // Load the view data.
  37.         $this->items        $this->get('Items');
  38.         $this->total        $this->get('Total');
  39.         $this->pagination    $this->get('Pagination');
  40.         $this->state        $this->get('State');
  41.  
  42.         FinderHelper::addSubmenu('maps');
  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.         // Prepare the view.
  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.         // For whatever reason, the helper isn't being found
  69.         include_once JPATH_COMPONENT '/helpers/finder.php';
  70.         $canDo    FinderHelper::getActions();
  71.  
  72.         JToolbarHelper::title(JText::_('COM_FINDER_MAPS_TOOLBAR_TITLE')'zoom-in finder');
  73.         $toolbar JToolbar::getInstance('toolbar');
  74.  
  75.         if ($canDo->get('core.edit.state'))
  76.         {
  77.             JToolbarHelper::publishList('maps.publish');
  78.             JToolbarHelper::unpublishList('maps.unpublish');
  79.             JToolbarHelper::divider();
  80.         }
  81.         if ($canDo->get('core.delete'))
  82.         {
  83.             JToolbarHelper::deleteList('''maps.delete');
  84.             JToolbarHelper::divider();
  85.         }
  86.         if ($canDo->get('core.admin'))
  87.         {
  88.             JToolbarHelper::preferences('com_finder');
  89.         }
  90.         JToolbarHelper::divider();
  91.         $toolbar->appendButton('Popup''stats''COM_FINDER_STATISTICS''index.php?option=com_finder&view=statistics&tmpl=component'550350);
  92.         JToolbarHelper::divider();
  93.         JToolbarHelper::help('JHELP_COMPONENTS_FINDER_MANAGE_CONTENT_MAPS');
  94.  
  95.         JHtmlSidebar::setAction('index.php?option=com_finder&view=maps');
  96.  
  97.         JHtmlSidebar::addFilter(
  98.             '',
  99.             'filter_branch',
  100.             JHtml::_('select.options'JHtml::_('finder.mapslist')'value''text'$this->state->get('filter.branch')),
  101.             true
  102.         );
  103.  
  104.         JHtmlSidebar::addFilter(
  105.             JText::_('COM_FINDER_INDEX_FILTER_BY_STATE'),
  106.             'filter_state',
  107.             JHtml::_('select.options'JHtml::_('finder.statelist')'value''text'$this->state->get('filter.state'))
  108.         );
  109.     }
  110. }

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