/**
  * Add the page title and toolbar.
  *
  * @since    1.1.0
  */
 protected function addToolbar()
 {
     $canDo = FieldsandfiltersHelper::getActions();
     JToolBarHelper::title(JText::_('COM_FIELDSANDFILTERS_TITLE_FIELDVALUES'), 'faf-field-values');
     if (FieldsandfiltersFactory::isVersion() && FieldsandfiltersFactory::isVersion('<', 3.2)) {
         JHtmlSidebar::setAction('index.php?option=com_fieldsandfilters&view=fieldvalues');
         JHtmlSidebar::addFilter(null, 'filter_field_id', JHtml::_('select.options', JHtml::_('FieldsandfiltersHtml.options.fields'), 'value', 'text', $this->state->get('filter.field_id'), false));
         JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('FieldsandfiltersHtml.options.states', array('adminonly' => false)), 'value', 'text', $this->state->get('filter.state'), false));
     }
     if ($canDo->get('core.create')) {
         JToolBarHelper::addNew('fieldvalue.add', 'JTOOLBAR_NEW');
     }
     if ($canDo->get('core.edit')) {
         JToolBarHelper::editList('fieldvalue.edit', 'JTOOLBAR_EDIT');
     }
     if ($canDo->get('core.edit.state')) {
         JToolBarHelper::divider();
         JToolBarHelper::custom('fieldvalues.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true);
         JToolBarHelper::custom('fieldvalues.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true);
         JToolBarHelper::deleteList('', 'fieldvalues.delete', 'JTOOLBAR_DELETE');
     }
     if ($canDo->get('core.admin')) {
         JToolBarHelper::divider();
         JToolBarHelper::preferences('com_fieldsandfilters');
     }
 }
 /**
  * Add the page title and toolbar.
  *
  * @since    1.1.0
  */
 protected function addToolbar()
 {
     $canDo = FieldsandfiltersHelper::getActions();
     JToolBarHelper::title(JText::_('COM_FIELDSANDFILTERS'), 'faf-fieldsandfilters');
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_fieldsandfilters');
     }
 }
 /**
  * Add the page title and toolbar.
  *
  * @since    1.1.0
  */
 protected function addToolbar()
 {
     JFactory::getApplication()->input->set('hidemainmenu', true);
     JToolBarHelper::title(JText::_('COM_FIELDSANDFILTERS_TITLE_ELEMENT'), 'faf-content');
     $canDo = FieldsandfiltersHelper::getActions();
     // If not checked out, can save the item.
     if ($canDo->get('core.edit') || $canDo->get('core.create')) {
         JToolBarHelper::apply('element.apply', 'JTOOLBAR_APPLY');
         JToolBarHelper::save('element.save', 'JTOOLBAR_SAVE');
     }
     $isNew = empty($this->item->field_value_id);
     if ($isNew) {
         JToolBarHelper::cancel('element.cancel', 'JTOOLBAR_CANCEL');
     } else {
         JToolBarHelper::cancel('element.cancel', 'JTOOLBAR_CLOSE');
     }
 }
 /**
  * Add the page title and toolbar.
  *
  * @since    1.1.0
  */
 protected function addToolbar()
 {
     $canDo = FieldsandfiltersHelper::getActions();
     JToolBarHelper::title(JText::_('COM_FIELDSANDFILTERS_TITLE_FIELDS'), 'faf-fields');
     if (FieldsandfiltersFactory::isVersion() && FieldsandfiltersFactory::isVersion('<', 3.2)) {
         JHtmlSidebar::setAction('index.php?option=com_fieldsandfilters&view=fields');
         JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('FieldsandfiltersHtml.options.states'), 'value', 'text', $this->state->get('filter.state'), false));
         JHtmlSidebar::addFilter(JText::_('COM_FIELDSANDFILTERS_OPTION_SELECT_EXTENSION'), 'filter_content_type_id', JHtml::_('select.options', JHtml::_('FieldsandfiltersHtml.options.extensions'), 'value', 'text', $this->state->get('filter.content_type_id'), false));
         JHtmlSidebar::addFilter(JText::_('COM_FIELDSANDFILTERS_OPTION_SELECT_TYPE'), 'filter_type', JHtml::_('select.options', JHtml::_('FieldsandfiltersHtml.options.types'), 'value', 'text', $this->state->get('filter.type'), false));
         /*
         JHtmlSidebar::addFilter(
         	JText::_('JOPTION_SELECT_ACCESS'),
         	'filter_access',
         	JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'), false)
         );
         
         JHtmlSidebar::addFilter(
         	JText::_('JOPTION_SELECT_LANGUAGE'),
         	'filter_language',
         	JHtml::_('select.options', JHtml::_('contentlanguage.existing'), 'value', 'text', $this->state->get('filter.language'), false)
         );
         */
     }
     if ($canDo->get('core.create')) {
         JToolBarHelper::addNew('field.add', 'JTOOLBAR_NEW');
     }
     if ($canDo->get('core.edit') && isset($this->items[0])) {
         JToolBarHelper::editList('field.edit', 'JTOOLBAR_EDIT');
     }
     if ($canDo->get('core.edit.state')) {
         JToolBarHelper::divider();
         JToolBarHelper::custom('fields.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true);
         JToolBarHelper::custom('fields.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true);
         JToolBarHelper::custom('fields.onlyadmin', 'dashboard.png', 'dashboard_f2.png', 'COM_FIELDSANDFILTERS_TOOLBAR_ONLYADMIN', true);
         JToolBarHelper::deleteList('', 'fields.delete', 'JTOOLBAR_DELETE');
         JToolBarHelper::divider();
         JToolBarHelper::custom('fields.required', 'star.png', 'star_f2.png', 'COM_FIELDSANDFILTERS_TOOLBAR_REQUIRED', true);
         JToolBarHelper::custom('fields.unrequired', 'star-empty.png', 'star-empty_f2.png', 'COM_FIELDSANDFILTERS_TOOLBAR_UNREQUIRED', true);
     }
     if ($canDo->get('core.admin')) {
         JToolBarHelper::divider();
         JToolBarHelper::preferences('com_fieldsandfilters');
     }
 }
 /**
  * Method to auto-populate the model state.
  *
  * Note. Calling getState in this method will result in recursion.
  *
  * @since    1.1.0
  */
 protected function populateState($ordering = null, $direction = null)
 {
     if (FieldsandfiltersHelper::setUserStateFieldID($this->context . '.filter')) {
         $this->setState('list.start', 0);
     }
     // If the context is set, assume that stateful lists are used.
     // @deprecated v.1.2 && J3.x
     if (!FieldsandfiltersFactory::isVersion() && $this->context) {
         // Receive & set filters
         if ($filters = JFactory::getApplication()->getUserStateFromRequest($this->context . '.filter', 'filter', array(), 'array')) {
             foreach ($filters as $name => $value) {
                 $this->setState('filter.' . $name, $value);
             }
         }
     }
     // Load the parameters.
     $params = JComponentHelper::getParams('com_fieldsandfilters');
     $this->setState('params', $params);
     // List state information.
     parent::populateState('fv.value', 'asc');
 }
 /**
  * Add the page title and toolbar.
  *
  * @since    1.1.0
  */
 protected function addToolbar()
 {
     JFactory::getApplication()->input->set('hidemainmenu', true);
     JToolBarHelper::title(JText::_('COM_FIELDSANDFILTERS_TITLE_FIELD'), 'faf-field');
     $canDo = FieldsandfiltersHelper::getActions();
     // If not checked out, can save the item.
     if ($canDo->get('core.edit') || $canDo->get('core.create')) {
         JToolBarHelper::apply('field.apply', 'JTOOLBAR_APPLY');
         JToolBarHelper::save('field.save', 'JTOOLBAR_SAVE');
     }
     if ($canDo->get('core.create')) {
         JToolBarHelper::custom('field.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
     }
     $isNew = empty($this->item->id);
     // If an existing item, can save to a copy.
     if (!$isNew && $canDo->get('core.create')) {
         JToolBarHelper::custom('field.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
     }
     if ($isNew) {
         JToolBarHelper::cancel('field.cancel', 'JTOOLBAR_CANCEL');
     } else {
         JToolBarHelper::cancel('field.cancel', 'JTOOLBAR_CLOSE');
     }
 }
 /**
  * Stock method to auto-populate the model state.
  *
  * @return  void
  *
  * @since   12.2
  */
 protected function populateState()
 {
     FieldsandfiltersHelper::setUserStateFieldID(sprintf('%s.%ss.filter', $this->option, $this->name));
     parent::populateState();
 }
 /**
  * Add the page title and toolbar.
  *
  * @since    1.1.0
  */
 protected function addToolbar()
 {
     $canDo = FieldsandfiltersHelper::getActions();
     JToolBarHelper::title(JText::_('COM_FIELDSANDFILTERS_TITLE_ELEMENTS'), 'faf-contents');
     if (FieldsandfiltersFactory::isVersion() && FieldsandfiltersFactory::isVersion('<', 3.2)) {
         JHtmlSidebar::setAction('index.php?option=com_fieldsandfilters&view=elements');
         JHtmlSidebar::addFilter(JText::_('COM_FIELDSANDFILTERS_OPTION_SELECT_EXTENSION'), 'filter_extension_type_id', JHtml::_('select.options', JHtml::_('FieldsandfiltersHtml.options.extensions', array('allextensions')), 'value', 'text', $this->state->get('filter.extension_type_id'), false));
         if (is_array($filtersOptions = $this->state->get('filters.options'))) {
             foreach ($filtersOptions as $name => &$filter) {
                 $filter = !is_array($filter) ? (array) $filter : $filter;
                 JHtmlSidebar::addFilter(JArrayHelper::getValue($filter, 'label'), 'filter_' . $name, JHtml::_('select.options', JArrayHelper::getValue($filter, 'options', array(), 'array'), 'value', 'text', $this->state->get('filter.' . $name), false));
             }
         }
     }
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_fieldsandfilters');
     }
 }