Example #1
0
 /**
  * Method to get the field options.
  *
  * @return  array  The field option objects.
  *
  * @since   11.1
  */
 public function getOptions()
 {
     $hash = md5($this->element);
     if (!isset(static::$options[$hash])) {
         static::$options[$hash] = parent::getOptions();
         /** @noinspection PhpUndefinedClassInspection */
         $options = CatalogueHelper::getAttrDirsOptions();
         static::$options[$hash] = array_merge(static::$options[$hash], $options);
     }
     return static::$options[$hash];
 }
 /**
  * Add the page title and toolbar.
  *
  * @return  void
  *
  * @since    1.6
  */
 protected function addToolbar()
 {
     /** @noinspection PhpIncludeInspection */
     require_once JPATH_COMPONENT . '/helpers/catalogue.php';
     $canDo = CatalogueHelper::getActions($this->state->get('filter.attr_id'));
     JToolbarHelper::title(JText::_('COM_MANUFACTURER_MANAGER'), 'component.png');
     if ($canDo->get('core.create')) {
         JToolbarHelper::addNew('attr.add');
     }
     if ($canDo->get('core.edit')) {
         JToolbarHelper::editList('attr.edit');
     }
     if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) {
         JToolbarHelper::deleteList('', 'attrs.delete', 'JTOOLBAR_EMPTY_TRASH');
     } elseif ($canDo->get('core.edit.state')) {
         JToolbarHelper::trash('attrs.trash');
     }
     JHtmlSidebar::setAction('index.php?option=com_catalogue&view=manfacturers');
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true));
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_ATTRDIR'), 'filter_attrdir_id', JHtml::_('select.options', CatalogueHelper::getAttrDirsOptions(), 'value', 'text', $this->state->get('filter.attrdir_id')));
 }