/** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function addToolbar() { $canDo = CatalogueHelper::getActions($this->state->get('filter.ctr_id')); JToolbarHelper::title(JText::_('COM_COUNTRY_MANAGER'), 'component.png'); if ($canDo->get('core.create')) { JToolbarHelper::addNew('country.add'); } if ($canDo->get('core.edit')) { JToolbarHelper::editList('country.edit'); } if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) { JToolbarHelper::deleteList('', 'countries.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($canDo->get('core.edit.state')) { JToolbarHelper::trash('countries.trash'); } JHtmlSidebar::setAction('index.php?option=com_catalogue&view=countries'); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)); }
/** * 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('attrdir.add'); } if ($canDo->get('core.edit')) { JToolbarHelper::editList('attrdir.edit'); } if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) { JToolbarHelper::deleteList('', 'attrdirs.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($canDo->get('core.edit.state')) { JToolbarHelper::trash('attrdirs.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)); }
/** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function addToolbar() { /** @noinspection PhpIncludeInspection */ require_once JPATH_COMPONENT . '/helpers/catalogue.php'; /** @noinspection PhpUndefinedClassInspection */ $canDo = CatalogueHelper::getActions(); JToolbarHelper::title(JText::_('COM_CATALOGUE_MANAGER'), 'component.png'); if ($canDo->get('core.create')) { JToolbarHelper::addNew('item.add'); } if ($canDo->get('core.edit')) { JToolbarHelper::editList('item.edit'); } if ($canDo->get('core.edit.state')) { if ($this->state->get('filter.state') != 2) { JToolbarHelper::publish('item.publish', 'JTOOLBAR_PUBLISH', true); JToolbarHelper::unpublish('item.unpublish', 'JTOOLBAR_UNPUBLISH', true); } if ($this->state->get('filter.state') != -1) { if ($this->state->get('filter.published') != 2) { JToolbarHelper::archiveList('item.archive'); } elseif ($this->state->get('filter.state') == 2) { JToolbarHelper::unarchiveList('item.publish'); } } } if ($canDo->get('core.edit.state')) { JToolbarHelper::checkin('item.checkin'); } if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) { JToolbarHelper::deleteList('', 'catalogue.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($canDo->get('core.edit.state')) { JToolbarHelper::trash('catalogue.trash'); } if ($canDo->get('core.admin')) { JToolbarHelper::preferences('com_catalogue'); } }
/** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function addToolbar() { JFactory::getApplication()->input->set('hidemainmenu', true); $user = JFactory::getUser(); $userId = $user->get('id'); $isNew = $this->item->id == 0; $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId); // Since we don't track these assets at the item level, use the category id. /** @noinspection PhpUndefinedClassInspection */ $canDo = CatalogueHelper::getActions($this->item->id, 0); JToolbarHelper::title($isNew ? JText::_('COM_CATALOGUE_MANAGER_ITEM_NEW') : JText::_('COM_CATALOGUE_MANAGER_ITEM_EDIT'), 'banners.png'); // If not checked out, can save the item. if (!$checkedOut && $canDo->get('core.edit')) { JToolbarHelper::apply('item.apply'); JToolbarHelper::save('item.save'); if ($canDo->get('core.create')) { JToolbarHelper::save2new('item.save2new'); } } // If an existing item, can save to a copy. if (!$isNew && $canDo->get('core.create')) { JToolbarHelper::save2copy('item.save2copy'); } if (empty($this->item->id)) { JToolbarHelper::cancel('item.cancel'); } else { JToolbarHelper::cancel('item.cancel', 'JTOOLBAR_CLOSE'); } }