Пример #1
0
 /**
  * Add the page title and toolbar.
  *
  * @return  void
  *
  * @since   1.6
  */
 protected function addToolbar()
 {
     $canDo = JHelperContent::getActions('com_banners', 'category', $this->state->get('filter.category_id'));
     JToolbarHelper::title(JText::_('COM_BANNERS_MANAGER_TRACKS'), 'bookmark banners-tracks');
     $bar = JToolbar::getInstance('toolbar');
     $bar->appendButton('Popup', 'download', 'JTOOLBAR_EXPORT', 'index.php?option=com_banners&view=download&tmpl=component', 600, 300);
     if ($canDo->get('core.delete')) {
         $bar->appendButton('Confirm', 'COM_BANNERS_DELETE_MSG', 'delete', 'COM_BANNERS_TRACKS_DELETE', 'tracks.delete', false);
         JToolbarHelper::divider();
     }
     if ($canDo->get('core.admin') || $canDo->get('core.options')) {
         JToolbarHelper::preferences('com_banners');
         JToolbarHelper::divider();
     }
     JToolbarHelper::help('JHELP_COMPONENTS_BANNERS_TRACKS');
     JHtmlSidebar::setAction('index.php?option=com_banners&view=tracks');
     JHtmlSidebar::addFilter(JText::_('COM_BANNERS_SELECT_CLIENT'), 'filter_client_id', JHtml::_('select.options', BannersHelper::getClientOptions(), 'value', 'text', $this->state->get('filter.client_id')));
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_CATEGORY'), 'filter_category_id', JHtml::_('select.options', JHtml::_('category.options', 'com_banners'), 'value', 'text', $this->state->get('filter.category_id')));
     JHtmlSidebar::addFilter(JText::_('COM_BANNERS_SELECT_TYPE'), 'filter_type', JHtml::_('select.options', array(JHtml::_('select.option', 1, JText::_('COM_BANNERS_IMPRESSION')), JHtml::_('select.option', 2, JText::_('COM_BANNERS_CLICK'))), 'value', 'text', $this->state->get('filter.type')));
 }
Пример #2
0
echo JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.state'), true);
?>
			</select>

			<label class="selectlabel" for="filter_client_id">
				<?php 
echo JText::_('COM_BANNERS_SELECT_CLIENT');
?>
			</label>
			<select name="filter_client_id" class="inputbox" id="filter_client_id">
				<option value=""><?php 
echo JText::_('COM_BANNERS_SELECT_CLIENT');
?>
</option>
				<?php 
echo JHtml::_('select.options', BannersHelper::getClientOptions(), 'value', 'text', $this->state->get('filter.client_id'));
?>
			</select>

			<label class="selectlabel" for="filter_category_id">
				<?php 
echo JText::_('JOPTION_SELECT_CATEGORY');
?>
			</label>
			<select name="filter_category_id" class="inputbox" id="filter_category_id">
				<option value=""><?php 
echo JText::_('JOPTION_SELECT_CATEGORY');
?>
</option>
				<?php 
echo JHtml::_('select.options', JHtml::_('category.options', 'com_banners'), 'value', 'text', $this->state->get('filter.category_id'));
 /**
  * Method to get the field options.
  *
  * @return	array	The field option objects.
  * @since	1.6
  */
 public function getOptions()
 {
     return BannersHelper::getClientOptions();
 }
Пример #4
0
 /**
  * Method to get the field options.
  *
  * @return  array  The field option objects.
  *
  * @since   1.6
  */
 public function getOptions()
 {
     return array_merge(parent::getOptions(), BannersHelper::getClientOptions());
 }
Пример #5
0
 /**
  * Add the page title and toolbar.
  *
  * @return  void
  *
  * @since   1.6
  */
 protected function addToolbar()
 {
     require_once JPATH_COMPONENT . '/helpers/banners.php';
     $canDo = BannersHelper::getActions($this->state->get('filter.category_id'));
     $user = JFactory::getUser();
     // Get the toolbar object instance
     $bar = JToolBar::getInstance('toolbar');
     JToolbarHelper::title(JText::_('COM_BANNERS_MANAGER_BANNERS'), 'banners.png');
     if (count($user->getAuthorisedCategories('com_banners', 'core.create')) > 0) {
         JToolbarHelper::addNew('banner.add');
     }
     if ($canDo->get('core.edit')) {
         JToolbarHelper::editList('banner.edit');
     }
     if ($canDo->get('core.edit.state')) {
         if ($this->state->get('filter.state') != 2) {
             JToolbarHelper::publish('banners.publish', 'JTOOLBAR_PUBLISH', true);
             JToolbarHelper::unpublish('banners.unpublish', 'JTOOLBAR_UNPUBLISH', true);
         }
         if ($this->state->get('filter.state') != -1) {
             if ($this->state->get('filter.state') != 2) {
                 JToolbarHelper::archiveList('banners.archive');
             } elseif ($this->state->get('filter.state') == 2) {
                 JToolbarHelper::unarchiveList('banners.publish');
             }
         }
     }
     if ($canDo->get('core.edit.state')) {
         JToolbarHelper::checkin('banners.checkin');
     }
     if ($this->state->get('filter.state') == -2 && $canDo->get('core.delete')) {
         JToolbarHelper::deleteList('', 'banners.delete', 'JTOOLBAR_EMPTY_TRASH');
     } elseif ($canDo->get('core.edit.state')) {
         JToolbarHelper::trash('banners.trash');
     }
     // Add a batch button
     if ($user->authorise('core.edit')) {
         JHtml::_('bootstrap.modal', 'collapseModal');
         $title = JText::_('JTOOLBAR_BATCH');
         $dhtml = "<button data-toggle=\"modal\" data-target=\"#collapseModal\" class=\"btn btn-small\">\n\t\t\t\t\t\t<i class=\"icon-checkbox-partial\" title=\"{$title}\"></i>\n\t\t\t\t\t\t{$title}</button>";
         $bar->appendButton('Custom', $dhtml, 'batch');
     }
     if ($canDo->get('core.admin')) {
         JToolbarHelper::preferences('com_banners');
     }
     JToolbarHelper::help('JHELP_COMPONENTS_BANNERS_BANNERS');
     JHtmlSidebar::setAction('index.php?option=com_banners&view=banners');
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.state'), true));
     JHtmlSidebar::addFilter(JText::_('COM_BANNERS_SELECT_CLIENT'), 'filter_client_id', JHtml::_('select.options', BannersHelper::getClientOptions(), 'value', 'text', $this->state->get('filter.client_id')));
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_CATEGORY'), 'filter_category_id', JHtml::_('select.options', JHtml::_('category.options', 'com_banners'), 'value', 'text', $this->state->get('filter.category_id')));
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_LANGUAGE'), 'filter_language', JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language')));
 }
Пример #6
0
 /**
  * Method to get the field options.
  *
  * @return  array  The field option objects.
  *
  * @since   1.6
  */
 public function getOptions()
 {
     $options = BannersHelper::getClientOptions();
     return array_merge(parent::getOptions(), $options);
 }