本文整理汇总了PHP中JToolbarHelper::archiveList方法的典型用法代码示例。如果您正苦于以下问题:PHP JToolbarHelper::archiveList方法的具体用法?PHP JToolbarHelper::archiveList怎么用?PHP JToolbarHelper::archiveList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JToolbarHelper
的用法示例。
在下文中一共展示了JToolbarHelper::archiveList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addToolbar
protected function addToolbar()
{
require_once JPATH_COMPONENT . '/helpers/authorlist.php';
$canDo = JHelperContent::getActions('com_authorlist');
$user = JFactory::getUser();
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
JToolbarHelper::title(JText::_('COM_AUTHORLIST_MANAGER_AUTHORS'), 'authorlist.png');
if ($canDo->get('core.create') || count($user->getAuthorisedCategories('com_authorlist', 'core.create')) > 0) {
JToolbarHelper::addNew('author.add');
}
if ($canDo->get('core.edit') || $canDo->get('core.edit.own')) {
JToolbarHelper::editList('author.edit');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::publish('authors.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('authors.unpublish', 'JTOOLBAR_UNPUBLISH', true);
JToolbarHelper::archiveList('authors.archive');
}
if ($this->state->get('filter.state') == -2 && $canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'authors.delete', 'JTOOLBAR_EMPTY_TRASH');
} elseif ($canDo->get('core.edit.state')) {
JToolbarHelper::trash('authors.trash');
}
if ($canDo->get('core.admin')) {
JToolbarHelper::preferences('com_authorlist');
}
JHtmlSidebar::setAction('index.php?option=com_authorlist');
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::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')));
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_LANGUAGE'), 'filter_language', JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language')));
}
示例2: addToolbar
/**
* Add the page title and toolbar.
*
* @return void
*
* @since 1.6
*/
protected function addToolbar()
{
$state = $this->get('State');
$canDo = JHelperContent::getActions('com_content', 'category', $this->state->get('filter.category_id'));
JToolbarHelper::title(JText::_('COM_CONTENT_FEATURED_TITLE'), 'star featured');
if ($canDo->get('core.create')) {
JToolbarHelper::addNew('article.add');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList('article.edit');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::publish('articles.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('articles.unpublish', 'JTOOLBAR_UNPUBLISH', true);
JToolbarHelper::custom('articles.unfeatured', 'unfeatured.png', 'featured_f2.png', 'JUNFEATURE', true);
JToolbarHelper::archiveList('articles.archive');
JToolbarHelper::checkin('articles.checkin');
}
if ($state->get('filter.published') == -2 && $canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'articles.delete', 'JTOOLBAR_EMPTY_TRASH');
} elseif ($canDo->get('core.edit.state')) {
JToolbarHelper::trash('articles.trash');
}
if ($canDo->get('core.admin') || $canDo->get('core.options')) {
JToolbarHelper::preferences('com_content');
}
JToolbarHelper::help('JHELP_CONTENT_FEATURED_ARTICLES');
}
示例3: addToolBar
/**
* Setting the toolbar
*/
protected function addToolBar($total = NULL)
{
JToolBarHelper::title(JText::_('COM_AGENDADIRIGENTES') . ': ' . JText::_('COM_AGENDADIRIGENTES_MANAGER_COMPROMISSOS') . ($total ? ' <span style="font-size: 0.5em; vertical-align: middle;">(' . $total . ' ' . JText::_('COM_AGENDADIRIGENTES_ITEMS') . ')</span>' : ''));
if ($this->canDo->get('core.create')) {
JToolBarHelper::addNew('compromisso.add');
}
if ($this->canDo->get('core.edit') || $this->canDo->get('core.edit.own')) {
JToolBarHelper::editList('compromisso.edit');
}
if ($this->canDo->get('core.edit.state')) {
$allowFeature = $this->state->get('params')->get('allowFeature', 'state');
$isSuperUser = array_search(8, $this->user->groups) !== false;
JToolBarHelper::publishList('compromissos.publish');
JToolBarHelper::unpublishList('compromissos.unpublish');
if ($allowFeature == 'state' || $allowFeature == 'edit' && $this->canDo->get('core.edit') || $allowFeature == 'superuser' && $isSuperUser) {
JToolbarHelper::custom('compromissos.featured', 'featured.png', 'featured_f2.png', 'JFEATURED', true);
}
JToolbarHelper::archiveList('compromissos.archive');
}
if ($this->state->get('filter.state') == -2 && $this->canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'compromissos.delete');
} elseif ($this->canDo->get('core.edit.state')) {
JToolbarHelper::trash('compromissos.trash');
}
// Options button.
if ($this->canDo->get('core.admin')) {
JToolBarHelper::preferences('com_agendadirigentes');
}
}
示例4: addToolbar
protected function addToolbar()
{
$canDo = FolioHelper::getActions();
$bar = JToolBar::getInstance('toolbar');
JToolbarHelper::title(JText::_('COM_FOLIO_MANAGER_FOLIOS'), '');
JToolbarHelper::addNew('folio.add');
if ($canDo->get('core.edit')) {
JToolbarHelper::editList('folio.edit');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::publish('folios.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('folios.unpublish', 'JTOOLBAR_UNPUBLISH', true);
JToolbarHelper::archiveList('folios.archive');
JToolbarHelper::checkin('folios.checkin');
}
$state = $this->get('State');
if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'folios.delete', 'JTOOLBAR_EMPTY_TRASH');
} elseif ($canDo->get('core.edit.state')) {
JToolbarHelper::trash('folios.trash');
}
if ($canDo->get('core.admin')) {
JToolbarHelper::preferences('com_folio');
}
JHtmlSidebar::setAction('index.php?option=com_folio&view=folios');
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.state'), true));
}
示例5: addToolbar
/**
* Add the page title and toolbar.
*
* @return void
*
* @since 1.6
*/
protected function addToolbar()
{
$canDo = JHelperContent::getActions('com_banners');
JToolbarHelper::title(JText::_('COM_BANNERS_MANAGER_CLIENTS'), 'bookmark banners-clients');
if ($canDo->get('core.create')) {
JToolbarHelper::addNew('client.add');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList('client.edit');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::publish('clients.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('clients.unpublish', 'JTOOLBAR_UNPUBLISH', true);
JToolbarHelper::archiveList('clients.archive');
JToolbarHelper::checkin('clients.checkin');
}
if ($this->state->get('filter.state') == -2 && $canDo->get('core.delete')) {
JToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', 'clients.delete', 'JTOOLBAR_EMPTY_TRASH');
} elseif ($canDo->get('core.edit.state')) {
JToolbarHelper::trash('clients.trash');
}
if ($canDo->get('core.admin') || $canDo->get('core.options')) {
JToolbarHelper::preferences('com_banners');
}
JToolbarHelper::help('JHELP_COMPONENTS_BANNERS_CLIENTS');
}
示例6: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
require_once JPATH_COMPONENT . '/helpers/banners.php';
$canDo = BannersHelper::getActions();
JToolbarHelper::title(JText::_('COM_BANNERS_MANAGER_CLIENTS'), 'banners-clients.png');
if ($canDo->get('core.create')) {
JToolbarHelper::addNew('client.add');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList('client.edit');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::publish('clients.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('clients.unpublish', 'JTOOLBAR_UNPUBLISH', true);
JToolbarHelper::archiveList('clients.archive');
JToolbarHelper::checkin('clients.checkin');
}
if ($this->state->get('filter.state') == -2 && $canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'clients.delete', 'JTOOLBAR_EMPTY_TRASH');
} elseif ($canDo->get('core.edit.state')) {
JToolbarHelper::trash('clients.trash');
}
if ($canDo->get('core.admin')) {
JToolbarHelper::preferences('com_banners');
}
JToolbarHelper::help('JHELP_COMPONENTS_BANNERS_CLIENTS');
JHtmlSidebar::setAction('index.php?option=com_banners&view=clients');
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.state'), true));
}
示例7: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$state = $this->get('State');
$canDo = JHelperContent::getActions('com_edashboard', 'category', $state->get('filter.category_id'));
$user = JFactory::getUser();
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
JToolbarHelper::title(JText::_('COM_EDASHBOARD_MANAGER'), 'calendar-3');
if (count($user->getAuthorisedCategories('com_edashboard', 'core.create')) > 0) {
JToolbarHelper::addNew('post.add');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList('post.edit');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::publish('edashboard.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('edashboard.unpublish', 'JTOOLBAR_UNPUBLISH', true);
JToolbarHelper::archiveList('edashboard.archive');
}
if ($canDo->get('core.admin')) {
JToolbarHelper::checkin('post.checkin');
}
if ($state->get('filter.published') == -2 && $canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'edashboard.delete', 'JTOOLBAR_EMPTY_TRASH');
} elseif ($canDo->get('core.edit.state')) {
JToolbarHelper::trash('edashboard.trash');
}
if ($user->authorise('core.admin', 'com_edashboard')) {
JToolbarHelper::preferences('com_edashboard');
}
JToolbarHelper::help('JHELP_COMPONENTS_ACT');
JHtmlSidebar::setAction('index.php?option=com_edashboard&view=edashboard');
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_CATEGORY'), 'filter_category_id', JHtml::_('select.options', JHtml::_('category.options', 'com_edashboard'), 'value', 'text', $this->state->get('filter.category_id')));
}
示例8: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$state = $this->get('State');
$canDo = ContentHelper::getActions($this->state->get('filter.category_id'));
JToolbarHelper::title(JText::_('COM_CONTENT_FEATURED_TITLE'), 'featured.png');
if ($canDo->get('core.create')) {
JToolbarHelper::addNew('article.add');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList('article.edit');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::publish('articles.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('articles.unpublish', 'JTOOLBAR_UNPUBLISH', true);
JToolbarHelper::custom('featured.delete', 'remove.png', 'remove_f2.png', 'JTOOLBAR_REMOVE', true);
JToolbarHelper::archiveList('articles.archive');
JToolbarHelper::checkin('articles.checkin');
}
if ($state->get('filter.published') == -2 && $canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'articles.delete', 'JTOOLBAR_EMPTY_TRASH');
} elseif ($canDo->get('core.edit.state')) {
JToolbarHelper::trash('articles.trash');
}
if ($canDo->get('core.admin')) {
JToolbarHelper::preferences('com_content');
}
JToolbarHelper::help('JHELP_CONTENT_FEATURED_ARTICLES');
JHtmlSidebar::setAction('index.php?option=com_content&view=featured');
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_CATEGORY'), 'filter_category_id', JHtml::_('select.options', JHtml::_('category.options', 'com_content'), 'value', 'text', $this->state->get('filter.category_id')));
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_MAX_LEVELS'), 'filter_level', JHtml::_('select.options', $this->f_levels, 'value', 'text', $this->state->get('filter.level')));
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')));
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_AUTHOR'), 'filter_author_id', JHtml::_('select.options', $this->authors, 'value', 'text', $this->state->get('filter.author_id')));
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_LANGUAGE'), 'filter_language', JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language')));
}
示例9: addToolbar
protected function addToolbar()
{
$canDo = ReservaHelper::getActions();
$bar = JToolBar::getInstance('toolbar');
JToolbarHelper::title(JText::_('COM_RESERVA_MANAGER_EVENTOS'), '');
JToolbarHelper::addNew('evento.add');
if ($canDo->get('core.edit')) {
JToolbarHelper::editList('evento.edit');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::publish('eventos.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('eventos.unpublish', 'JTOOLBAR_UNPUBLISH', true);
JToolbarHelper::archiveList('eventos.archive');
JToolbarHelper::checkin('eventos.checkin');
}
//agregar filtro a la vista para busqueda
JHtmlSidebar::setAction('index.php?option=com_reserva&view=eventos');
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.state'), true));
/*
if ($canDo->get('core.delete'))
{
JToolBarHelper::deleteList('', 'eventos.delete', 'JTOOLBAR_DELETE');
}
se replaza el boton de borrado por envio a la papelera en vez de borrado completamente
*/
$state = $this->get('State');
if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'eventos.delete', 'JTOOLBAR_EMPTY_TRASH');
} elseif ($canDo->get('core.edit.state')) {
JToolbarHelper::trash('eventos.trash');
}
if ($canDo->get('core.admin')) {
JToolbarHelper::preferences('com_reserva');
}
}
示例10: addToolbar
protected function addToolbar()
{
$canDo = DeviceHelper::getActions();
$bar = JToolBar::getInstance('toolbar');
JToolbarHelper::title(JText::_('COM_DEVICE_MANAGER_DEVICES'), 'folder categories');
JToolbarHelper::addNew('device.add');
if ($canDo->get('core.edit')) {
JToolbarHelper::editList('device.edit');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::publish('devices.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('devices.unpublish', 'JTOOLBAR_UNPUBLISH', true);
JToolbarHelper::archiveList('devices.archive');
JToolbarHelper::checkin('devices.checkin');
}
/*将信息直接删除
if($canDo->get('core.delete')){
JToolbarHelper::deleteList('', 'labs.delete', 'JTOOLBAR_DELETE');
}*/
$state = $this->get('State');
if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'devices.delete', 'JTOOLBAR_EMPTY_TRASH');
} else {
if ($canDo->get('core.edit.state')) {
JToolbarHelper::trash('devices.trash');
}
}
if ($canDo->get('core.admin')) {
JToolbarHelper::preferences('com_device');
}
JHtmlSidebar::setAction('index.php?option=com_device&view=devices');
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.state'), true));
}
示例11: addToolbar
/**
* Add the page title and toolbar.
*
* @return void
*
* @since 1.6
*/
protected function addToolbar()
{
$canDo = JHelperContent::getActions('com_sibdiet');
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
$bar->addButtonPath(JPATH_COMPONENT . '/toolbar/button/');
JToolBarHelper::title(JText::_('COM_SIBDIET_MANAGER_CONTROLLER'), 'cogs controller');
if (in_array('requestschecks', $this->permissions)) {
if (isset($this->items[0])) {
if ($canDo->get('core.edit')) {
JToolBarHelper::editList('request.edit');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::checkin('requests.checkin');
JToolbarHelper::publish('requests.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('requests.unpublish', 'JTOOLBAR_UNPUBLISH', true);
JToolbarHelper::archiveList('requests.archive', 'COM_SIBDIET_TOOLBAR_WAITING_LIST');
}
if ($this->state->get('filter.published') == -2) {
JToolbarHelper::deleteList('', 'requests.delete', 'JTOOLBAR_EMPTY_TRASH');
} else {
JToolbarHelper::trash('requests.trash');
}
// Add a batch button for tags
if ($canDo->get('core.edit') && $canDo->get('core.edit.state')) {
JToolbarHelper::modal('collapseModal', 'icon-checkbox-partial', JText::_('JTOOLBAR_BATCH'));
}
}
}
}
示例12: addToolbar
/**
* Add the page title and toolbar.
*
* @return void.
*
* @since 1.6
*/
protected function addToolbar()
{
$state = $this->get('State');
$canDo = JHelperContent::getActions('com_redirect');
JToolbarHelper::title(JText::_('COM_REDIRECT_MANAGER_LINKS'), 'refresh redirect');
if ($canDo->get('core.create')) {
JToolbarHelper::addNew('link.add');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList('link.edit');
}
if ($canDo->get('core.edit.state')) {
if ($state->get('filter.state') != 2) {
JToolbarHelper::divider();
JToolbarHelper::publish('links.publish', 'JTOOLBAR_ENABLE', true);
JToolbarHelper::unpublish('links.unpublish', 'JTOOLBAR_DISABLE', true);
}
if ($state->get('filter.state') != -1) {
JToolbarHelper::divider();
if ($state->get('filter.state') != 2) {
JToolbarHelper::archiveList('links.archive');
} elseif ($state->get('filter.state') == 2) {
JToolbarHelper::unarchiveList('links.publish', 'JTOOLBAR_UNARCHIVE');
}
}
}
if ($canDo->get('core.create')) {
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
JHtml::_('bootstrap.modal', 'collapseModal');
$title = JText::_('JTOOLBAR_BATCH');
// Instantiate a new JLayoutFile instance and render the batch button
$layout = new JLayoutFile('joomla.toolbar.batch');
$dhtml = $layout->render(array('title' => $title));
$bar->appendButton('Custom', $dhtml, 'batch');
}
if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'links.delete', 'JTOOLBAR_EMPTY_TRASH');
JToolbarHelper::divider();
} elseif ($canDo->get('core.edit.state')) {
JToolbarHelper::trash('links.trash');
JToolbarHelper::divider();
}
if ($canDo->get('core.admin')) {
JToolbarHelper::preferences('com_redirect');
JToolbarHelper::divider();
}
JToolbarHelper::help('JHELP_COMPONENTS_REDIRECT_MANAGER');
JHtmlSidebar::setAction('index.php?option=com_redirect&view=links');
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', RedirectHelper::publishedOptions(), 'value', 'text', $this->state->get('filter.state'), true));
}
示例13: addToolbar
/**
* Add the page title and toolbar.
*
* @return void.
*
* @since 1.6
*/
protected function addToolbar()
{
$state = $this->get('State');
$canDo = JHelperContent::getActions('com_redirect');
JToolbarHelper::title(JText::_('COM_REDIRECT_MANAGER_LINKS'), 'refresh redirect');
if ($canDo->get('core.create')) {
JToolbarHelper::addNew('link.add');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList('link.edit');
}
if ($canDo->get('core.edit.state')) {
if ($state->get('filter.state') != 2) {
JToolbarHelper::divider();
JToolbarHelper::publish('links.publish', 'JTOOLBAR_ENABLE', true);
JToolbarHelper::unpublish('links.unpublish', 'JTOOLBAR_DISABLE', true);
}
if ($state->get('filter.state') != -1) {
JToolbarHelper::divider();
if ($state->get('filter.state') != 2) {
JToolbarHelper::archiveList('links.archive');
} elseif ($state->get('filter.state') == 2) {
JToolbarHelper::unarchiveList('links.publish', 'JTOOLBAR_UNARCHIVE');
}
}
}
if ($canDo->get('core.create')) {
// Get the toolbar object instance
$bar = JToolbar::getInstance('toolbar');
$title = JText::_('JTOOLBAR_BATCH');
// Instantiate a new JLayoutFile instance and render the batch button
$layout = new JLayoutFile('joomla.toolbar.batch');
$dhtml = $layout->render(array('title' => $title));
$bar->appendButton('Custom', $dhtml, 'batch');
}
if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
JToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', 'links.delete', 'JTOOLBAR_EMPTY_TRASH');
JToolbarHelper::divider();
} elseif ($canDo->get('core.edit.state')) {
JToolbarHelper::custom('links.purge', 'purge', 'purge', 'COM_REDIRECT_TOOLBAR_PURGE', false);
JToolbarHelper::trash('links.trash');
JToolbarHelper::divider();
}
if ($canDo->get('core.admin') || $canDo->get('core.options')) {
JToolbarHelper::preferences('com_redirect');
JToolbarHelper::divider();
}
JToolbarHelper::help('JHELP_COMPONENTS_REDIRECT_MANAGER');
}
示例14: addToolbar
/**
* Add the page title and toolbar.
*
* @return void
*
* @since 1.6
*/
protected function addToolbar()
{
require_once JPATH_COMPONENT . '/helpers/banners.php';
$canDo = JHelperContent::getActions('com_banners', 'category', $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'), 'bookmark banners');
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');
}
// Add a batch button
if ($user->authorise('core.create', 'com_banners') && $user->authorise('core.edit', 'com_banners') && $user->authorise('core.edit.state', 'com_banners')) {
JHtml::_('bootstrap.modal', 'collapseModal');
$title = JText::_('JTOOLBAR_BATCH');
// Instantiate a new JLayoutFile instance and render the batch button
$layout = new JLayoutFile('joomla.toolbar.batch');
$dhtml = $layout->render(array('title' => $title));
$bar->appendButton('Custom', $dhtml, 'batch');
}
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');
}
if ($user->authorise('core.admin', 'com_banners')) {
JToolbarHelper::preferences('com_banners');
}
JToolbarHelper::help('JHELP_COMPONENTS_BANNERS_BANNERS');
}
示例15: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$canDo = ContentHelper::getActions($this->state->get('filter.category_id'));
$user = JFactory::getUser();
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
JToolbarHelper::title(JText::_('COM_CONTENT_ARTICLES_TITLE'), 'article.png');
if ($canDo->get('core.create') || count($user->getAuthorisedCategories('com_content', 'core.create')) > 0) {
JToolbarHelper::addNew('article.add');
}
if ($canDo->get('core.edit') || $canDo->get('core.edit.own')) {
JToolbarHelper::editList('article.edit');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::publish('articles.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('articles.unpublish', 'JTOOLBAR_UNPUBLISH', true);
JToolbarHelper::custom('articles.featured', 'featured.png', 'featured_f2.png', 'JFEATURED', true);
JToolbarHelper::archiveList('articles.archive');
JToolbarHelper::checkin('articles.checkin');
}
if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'articles.delete', 'JTOOLBAR_EMPTY_TRASH');
} elseif ($canDo->get('core.edit.state')) {
JToolbarHelper::trash('articles.trash');
}
// Add a batch button
if ($user->authorise('core.create', 'com_content') && $user->authorise('core.edit', 'com_content') && $user->authorise('core.edit.state', 'com_content')) {
JHtml::_('bootstrap.modal', 'collapseModal');
$title = JText::_('JTOOLBAR_BATCH');
// Instantiate a new JLayoutFile instance and render the batch button
$layout = new JLayoutFile('joomla.toolbar.batch');
$dhtml = $layout->render(array('title' => $title));
$bar->appendButton('Custom', $dhtml, 'batch');
}
if ($canDo->get('core.admin')) {
JToolbarHelper::preferences('com_content');
}
JToolbarHelper::help('JHELP_CONTENT_ARTICLE_MANAGER');
JHtmlSidebar::setAction('index.php?option=com_content&view=articles');
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_CATEGORY'), 'filter_category_id', JHtml::_('select.options', JHtml::_('category.options', 'com_content'), 'value', 'text', $this->state->get('filter.category_id')));
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_MAX_LEVELS'), 'filter_level', JHtml::_('select.options', $this->f_levels, 'value', 'text', $this->state->get('filter.level')));
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')));
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_AUTHOR'), 'filter_author_id', JHtml::_('select.options', $this->authors, 'value', 'text', $this->state->get('filter.author_id')));
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_LANGUAGE'), 'filter_language', JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language')));
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_TAG'), 'filter_tag', JHtml::_('select.options', JHtml::_('tag.options', true, true), 'value', 'text', $this->state->get('filter.tag')));
}