Source for file view.html.php

Documentation is available at view.html.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Administrator
  4.  * @subpackage  com_banners
  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.txt
  8.  */
  9.  
  10. defined('_JEXEC'or die;
  11.  
  12. /**
  13.  * View class for a list of tracks.
  14.  *
  15.  * @package     Joomla.Administrator
  16.  * @subpackage  com_banners
  17.  * @since       1.6
  18.  */
  19. {
  20.     protected $items;
  21.  
  22.     protected $pagination;
  23.  
  24.     protected $state;
  25.  
  26.     /**
  27.      * Display the view
  28.      */
  29.     public function display($tpl null)
  30.     {
  31.         $this->items        = $this->get('Items');
  32.         $this->pagination    = $this->get('Pagination');
  33.         $this->state        = $this->get('State');
  34.  
  35.         // Check for errors.
  36.         if (count($errors $this->get('Errors')))
  37.         {
  38.             JError::raiseError(500implode("\n"$errors));
  39.             return false;
  40.         }
  41.  
  42.         BannersHelper::addSubmenu('tracks');
  43.  
  44.         $this->addToolbar();
  45.         require_once JPATH_COMPONENT .'/models/fields/bannerclient.php';
  46.         $this->sidebar JHtmlSidebar::render();
  47.         parent::display($tpl);
  48.     }
  49.  
  50.     /**
  51.      * Add the page title and toolbar.
  52.      *
  53.      * @since   1.6
  54.      */
  55.     protected function addToolbar()
  56.     {
  57.         require_once JPATH_COMPONENT.'/helpers/banners.php';
  58.  
  59.         $canDo    JHelperContent::getActions($this->state->get('filter.category_id')0'com_banners');
  60.  
  61.         JToolbarHelper::title(JText::_('COM_BANNERS_MANAGER_TRACKS')'bookmark banners-tracks');
  62.  
  63.         $bar JToolBar::getInstance('toolbar');
  64.         $bar->appendButton('Slider''export''JTOOLBAR_EXPORT''index.php?option=com_banners&amp;view=download&amp;tmpl=component'600300);
  65.         if ($canDo->get('core.delete'))
  66.         {
  67.             $bar->appendButton('Confirm''COM_BANNERS_DELETE_MSG''delete''COM_BANNERS_TRACKS_DELETE''tracks.delete'false);
  68.             JToolbarHelper::divider();
  69.         }
  70.         if ($canDo->get('core.admin'))
  71.         {
  72.             JToolbarHelper::preferences('com_banners');
  73.             JToolbarHelper::divider();
  74.         }
  75.         JToolbarHelper::help('JHELP_COMPONENTS_BANNERS_TRACKS');
  76.  
  77.         JHtmlSidebar::setAction('index.php?option=com_banners&view=tracks');
  78.  
  79.         JHtmlSidebar::addFilter(
  80.             JText::_('COM_BANNERS_SELECT_CLIENT'),
  81.             'filter_client_id',
  82.             JHtml::_('select.options'BannersHelper::getClientOptions()'value''text'$this->state->get('filter.client_id'))
  83.         );
  84.  
  85.         JHtmlSidebar::addFilter(
  86.             JText::_('JOPTION_SELECT_CATEGORY'),
  87.             'filter_category_id',
  88.             JHtml::_('select.options'JHtml::_('category.options''com_banners')'value''text'$this->state->get('filter.category_id'))
  89.         );
  90.  
  91.         JHtmlSidebar::addFilter(
  92.             JText::_('COM_BANNERS_SELECT_TYPE'),
  93.             'filter_type',
  94.             JHtml::_('select.options'array(JHtml::_('select.option'1JText::_('COM_BANNERS_IMPRESSION'))JHtml::_('select.option'2JText::_('COM_BANNERS_CLICK')))'value''text'$this->state->get('filter.type'))
  95.         );
  96.     }
  97.  
  98.     /**
  99.      * Returns an array of fields the table can be sorted by
  100.      *
  101.      * @return  array  Array containing the field name to sort by as the key and display text as value
  102.      *
  103.      * @since   3.0
  104.      */
  105.     protected function getSortFields()
  106.     {
  107.         return array(
  108.             'b.name' => JText::_('COM_BANNERS_HEADING_NAME'),
  109.             'cl.name' => JText::_('COM_BANNERS_HEADING_CLIENT'),
  110.             'track_type' => JText::_('COM_BANNERS_HEADING_TYPE'),
  111.             'count' => JText::_('COM_BANNERS_HEADING_COUNT'),
  112.             'track_date' => JText::_('JDATE')
  113.         );
  114.     }
  115. }

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