本文整理汇总了PHP中JHelperContent::getActions方法的典型用法代码示例。如果您正苦于以下问题:PHP JHelperContent::getActions方法的具体用法?PHP JHelperContent::getActions怎么用?PHP JHelperContent::getActions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JHelperContent
的用法示例。
在下文中一共展示了JHelperContent::getActions方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addToolbar
/**
* Method to configure the toolbar for this view.
*
* @return void
*
* @since 2.5
*/
protected function addToolbar()
{
$canDo = JHelperContent::getActions('com_finder');
JToolbarHelper::title(JText::_('COM_FINDER_MAPS_TOOLBAR_TITLE'), 'zoom-in finder');
$toolbar = JToolbar::getInstance('toolbar');
if ($canDo->get('core.edit.state')) {
JToolbarHelper::publishList('maps.publish');
JToolbarHelper::unpublishList('maps.unpublish');
JToolbarHelper::divider();
}
if ($canDo->get('core.admin') || $canDo->get('core.options')) {
JToolbarHelper::preferences('com_finder');
}
JToolbarHelper::divider();
$toolbar->appendButton('Popup', 'bars', 'COM_FINDER_STATISTICS', 'index.php?option=com_finder&view=statistics&tmpl=component', 550, 350);
JToolbarHelper::divider();
JToolbarHelper::help('JHELP_COMPONENTS_FINDER_MANAGE_CONTENT_MAPS');
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'maps.delete');
JToolbarHelper::divider();
}
JHtmlSidebar::setAction('index.php?option=com_finder&view=maps');
JHtmlSidebar::addFilter('', 'filter_branch', JHtml::_('select.options', JHtml::_('finder.mapslist'), 'value', 'text', $this->state->get('filter.branch')), true);
JHtmlSidebar::addFilter(JText::_('COM_FINDER_INDEX_FILTER_BY_STATE'), 'filter_state', JHtml::_('select.options', JHtml::_('finder.statelist'), 'value', 'text', $this->state->get('filter.state')));
}
示例2: addToolbar
/**
* Method to configure the toolbar for this view.
*
* @return void
*
* @since 2.5
*/
protected function addToolbar()
{
$canDo = JHelperContent::getActions('com_finder');
JToolbarHelper::title(JText::_('COM_FINDER_FILTERS_TOOLBAR_TITLE'), 'zoom-in finder');
$toolbar = JToolbar::getInstance('toolbar');
if ($canDo->get('core.create')) {
JToolbarHelper::addNew('filter.add');
JToolbarHelper::editList('filter.edit');
JToolbarHelper::divider();
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::publishList('filters.publish');
JToolbarHelper::unpublishList('filters.unpublish');
JToolbarHelper::divider();
}
if ($canDo->get('core.admin') || $canDo->get('core.options')) {
JToolbarHelper::preferences('com_finder');
}
JToolbarHelper::divider();
$toolbar->appendButton('Popup', 'bars', 'COM_FINDER_STATISTICS', 'index.php?option=com_finder&view=statistics&tmpl=component', 550, 350);
JToolbarHelper::divider();
JToolbarHelper::help('JHELP_COMPONENTS_FINDER_MANAGE_SEARCH_FILTERS');
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'filters.delete');
JToolbarHelper::divider();
}
}
示例3: addToolbar
/**
* Add the page title and toolbar.
*
* @return void
*
* @since 1.6
*/
protected function addToolbar()
{
$canDo = JHelperContent::getActions('com_templates');
JToolbarHelper::title(JText::_('COM_TEMPLATES_MANAGER_STYLES'), 'eye thememanager');
if ($canDo->get('core.edit.state')) {
JToolbarHelper::makeDefault('styles.setDefault', 'COM_TEMPLATES_TOOLBAR_SET_HOME');
JToolbarHelper::divider();
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList('style.edit');
}
if ($canDo->get('core.create')) {
JToolbarHelper::custom('styles.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true);
JToolbarHelper::divider();
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'styles.delete');
JToolbarHelper::divider();
}
if ($canDo->get('core.admin') || $canDo->get('core.options')) {
JToolbarHelper::preferences('com_templates');
JToolbarHelper::divider();
}
JToolbarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_STYLES');
JHtmlSidebar::setAction('index.php?option=com_templates&view=styles');
}
示例4: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$canDo = JHelperContent::getActions('com_digicom', 'category', $this->state->get('filter.category_id'));
$user = JFactory::getUser();
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
JToolbarHelper::title(JText::_('COM_DIGICOM_PRODUCTS_TOOLBAR_TITLE'), 'stack product');
if ($canDo->get('core.create') || count($user->getAuthorisedCategories('com_digicom', 'core.create')) > 0) {
//JToolbarHelper::addNew('product.add');
$layout = new JLayoutFile('toolbar.products');
$bar->appendButton('Custom', $layout->render(array()), 'products');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::publish('products.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('products.unpublish', 'JTOOLBAR_UNPUBLISH', true);
//JToolbarHelper::custom('products.featured', 'featured.png', 'featured_f2.png', 'JFEATURE', true);
//JToolbarHelper::custom('products.unfeatured', 'unfeatured.png', 'featured_f2.png', 'JUNFEATURE', true);
//JToolbarHelper::archiveList('products.archive');
//JToolbarHelper::checkin('products.checkin');
}
if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'products.delete', 'JTOOLBAR_EMPTY_TRASH');
} elseif ($canDo->get('core.edit.state')) {
JToolbarHelper::trash('products.trash');
}
// Instantiate a new JLayoutFile instance and render the layout
$layout = new JLayoutFile('toolbar.title');
$title = array('title' => JText::_('COM_DIGICOM_PRODUCTS_TOOLBAR_TITLE'), 'class' => 'product');
$bar->appendButton('Custom', $layout->render($title), 'title');
$layout = new JLayoutFile('toolbar.settings');
$bar->appendButton('Custom', $layout->render(array()), 'settings');
}
示例5: 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')));
}
示例6: display
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise a Error object.
*/
public function display($tpl = null)
{
if ($this->getLayout() == 'pagebreak') {
// TODO: This is really dogy - should change this one day.
$input = JFactory::getApplication()->input;
$eName = $input->getCmd('e_name');
$eName = preg_replace('#[^A-Z0-9\\-\\_\\[\\]]#i', '', $eName);
$document = JFactory::getDocument();
$document->setTitle(JText::_('COM_KNVBAPI_PAGEBREAK_DOC_TITLE'));
$this->eName =& $eName;
parent::display($tpl);
return;
}
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->state = $this->get('State');
$this->can_do = JHelperContent::getActions('com_knvbapi', 'team', $this->item->id);
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
if ($this->getLayout() == 'modal') {
$this->form->setFieldAttribute('language', 'readonly', 'true');
}
$this->addToolbar();
$this->prepareDocument();
parent::display($tpl);
}
示例7: addToolbar
protected function addToolbar()
{
$canDo = JHelperContent::getActions('com_jvisualcontent');
$user = JFactory::getUser();
JToolbarHelper::title(JText::_('COM_JVISUALCONTENT_EXTRAFIELDS_MANAGER'));
// Create new button
if ($canDo->get('core.create')) {
JToolbarHelper::addNew('extrafield.add');
JToolbarHelper::divider();
}
// Create edit button
if ($canDo->get('core.edit') || $canDo->get('core.edit.own')) {
JToolbarHelper::editList('type.edit');
}
// Create publish, unpublish buttons
if ($canDo->get('core.edit.state')) {
JToolbarHelper::publish('extrafields.publish');
JToolbarHelper::unpublish('extrafields.unpublish');
JToolbarHelper::divider();
}
if ($this->state->get('filter.published') == -2 && $user->authorise('core.delete')) {
JToolbarHelper::deleteList('', 'extrafields.delete', 'JTOOLBAR_EMPTY_TRASH');
} elseif ($canDo->get('core.edit.state')) {
JToolbarHelper::trash('extrafields.trash');
}
// Create options button
if ($canDo->get('core.admin')) {
JToolbarHelper::preferences('com_jvisualcontent');
}
if (version_compare(JVERSION, '3.0', '>=')) {
$fieldsType = array('textfield' => JText::_('COM_JVISUALCONTENT_TEXT_FIELD'), 'textarea' => JText::_('COM_JVISUALCONTENT_TEXTAREA'), 'select' => JText::_('COM_JVISUALCONTENT_DROPDOWN_SELECT'), 'multiselect' => JText::_('COM_JVISUALCONTENT_DROPDOWN_LIST'), 'radio' => JText::_('COM_JVISUALCONTENT_RADIO'), 'checkbox' => JText::_('COM_JVISUALCONTENT_CHECKBOX'), 'editor' => JText::_('COM_JVISUALCONTENT_EDITOR'), 'calendar' => JText::_('COM_JVISUALCONTENT_CALENDAR'), 'file' => JText::_('COM_JVISUALCONTENT_FILE'));
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('archived' => false)), 'value', 'text', $this->state->get('filter.published'), true));
JHtmlSidebar::addFilter(JText::_('COM_JVISUALCONTENT_OPTION_SELECT_TYPE'), 'filter_type', JHtml::_('select.options', $fieldsType, 'value', 'text', $this->state->get('filter.type')));
}
}
示例8: addToolbar
/**
* Method to configure the toolbar for this view.
*
* @return void
*
* @since 2.5
*/
protected function addToolbar()
{
$canDo = JHelperContent::getActions('com_finder');
JToolbarHelper::title(JText::_('COM_FINDER_INDEX_TOOLBAR_TITLE'), 'zoom-in finder');
$toolbar = JToolbar::getInstance('toolbar');
$toolbar->appendButton('Popup', 'archive', 'COM_FINDER_INDEX', 'index.php?option=com_finder&view=indexer&tmpl=component', 500, 210, 0, 0, 'window.parent.location.reload()', 'COM_FINDER_HEADING_INDEXER');
if ($canDo->get('core.edit.state')) {
JToolbarHelper::publishList('index.publish');
JToolbarHelper::unpublishList('index.unpublish');
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'index.delete');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::trash('index.purge', 'COM_FINDER_INDEX_TOOLBAR_PURGE', false);
}
if ($canDo->get('core.admin')) {
JToolbarHelper::preferences('com_finder');
}
$toolbar->appendButton('Popup', 'stats', 'COM_FINDER_STATISTICS', 'index.php?option=com_finder&view=statistics&tmpl=component', 550, 350);
JToolbarHelper::help('JHELP_COMPONENTS_FINDER_MANAGE_INDEXED_CONTENT');
JHtmlSidebar::setAction('index.php?option=com_finder&view=index');
JHtmlSidebar::addFilter(JText::_('COM_FINDER_INDEX_FILTER_BY_STATE'), 'filter_state', JHtml::_('select.options', JHtml::_('finder.statelist'), 'value', 'text', $this->state->get('filter.state')));
JHtmlSidebar::addFilter(JText::_('COM_FINDER_INDEX_TYPE_FILTER'), 'filter_type', JHtml::_('select.options', JHtml::_('finder.typeslist'), 'value', 'text', $this->state->get('filter.type')));
}
示例9: addToolbar
/**
* Display the toolbar.
*
* @return void
*
* @since 2.5
*/
protected function addToolbar()
{
$input = JFactory::getApplication()->input;
$input->set('hidemainmenu', 1);
$user = JFactory::getUser();
$isNew = $this->item->id == 0;
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
// Since we don't track these assets at the item level, use the category id.
$canDo = JHelperContent::getActions('com_users', 'category', $this->item->catid);
JToolbarHelper::title(JText::_('COM_USERS_NOTES'), 'users user');
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || count($user->getAuthorisedCategories('com_users', 'core.create')))) {
JToolbarHelper::apply('note.apply');
JToolbarHelper::save('note.save');
}
if (!$checkedOut && count($user->getAuthorisedCategories('com_users', 'core.create'))) {
JToolbarHelper::save2new('note.save2new');
}
// If an existing item, can save to a copy.
if (!$isNew && count($user->getAuthorisedCategories('com_users', 'core.create')) > 0) {
JToolbarHelper::save2copy('note.save2copy');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel('note.cancel');
} else {
if ($this->state->params->get('save_history', 0) && $canDo->get('core.edit')) {
JToolbarHelper::versions('com_users.note', $this->item->id);
}
JToolbarHelper::cancel('note.cancel', 'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help('JHELP_USERS_USER_NOTES_EDIT');
}
示例10: 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');
JToolBarHelper::title(JText::_('COM_SIBDIET_MANAGER_PROFILES'), 'users profiles');
if (in_array('profiles', $this->permissions)) {
if ($canDo->get('core.create')) {
JToolBarHelper::addNew('profile.add');
}
if (isset($this->items[0])) {
if ($canDo->get('core.edit')) {
JToolBarHelper::editList('profile.edit');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::checkin('profiles.checkin');
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'profiles.delete');
}
// Add a batch button for Merge Files
if (JFactory::getUser()->get('isRoot')) {
JToolbarHelper::modal('collapseModal', 'icon-users', JText::_('COM_SIBDIET_TOOLBAR_MERGE_FILES'));
}
}
}
JToolBarHelper::help('screen.profiles', true);
}
示例11: addToolbar
protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$doc = JFactory::getDocument();
$bar = JToolBar::getInstance();
$user = JFactory::getUser();
$canDo = JHelperContent::getActions('com_tz_portfolio_plus');
$isNew = $this->item->id == 0;
JToolBarHelper::title(JText::sprintf('COM_TZ_PORTFOLIO_PLUS_TEMPLATES_MANAGER_TASK', JText::_($isNew ? 'COM_TZ_PORTFOLIO_PLUS_PAGE_ADD_TEMPLATE' : 'COM_TZ_PORTFOLIO_PLUS_PAGE_EDIT_TEMPLATE')), 'palette');
if ($canDo->get('core.edit')) {
JToolBarHelper::apply('template_style.apply');
JToolBarHelper::save('template_style.save');
}
// If checked out, we can still save
if (!$isNew && $user->authorise('core.edit.state', 'com_tz_portfolio_plus')) {
JToolBarHelper::save2copy('template_style.save2copy');
}
JToolBarHelper::cancel('template_style.cancel', JText::_('JTOOLBAR_CLOSE'));
JToolBarHelper::divider();
JToolBarHelper::help('JHELP_CONTENT_ARTICLE_MANAGER', false, 'http://wiki.templaza.com/TZ_Portfolio_Plus_v3:Administration#How_to_Add_or_Edit_3');
$doc->addStyleSheet(JURI::base(true) . '/components/com_tz_portfolio_plus/fonts/font-awesome-4.5.0/css/font-awesome.min.css');
$doc->addStyleSheet(JURI::base(true) . '/components/com_tz_portfolio_plus/css/style.min.css');
// Special HTML workaround to get send popup working
$docClass = ' class="btn btn-small"';
$youtubeIcon = '<i class="tz-icon-youtube tz-icon-14"></i> ';
$wikiIcon = '<i class="tz-icon-wikipedia tz-icon-14"></i> ';
$youtubeTitle = JText::_('COM_TZ_PORTFOLIO_PLUS_VIDEO_TUTORIALS');
$wikiTitle = JText::_('COM_TZ_PORTFOLIO_PLUS_WIKIPEDIA_TUTORIALS');
$videoTutorial = '<a' . $docClass . ' onclick="Joomla.popupWindow(\'http://www.youtube.com/channel/UCykS6SX6L2GOI-n3IOPfTVQ/videos\', \'' . $youtubeTitle . '\', 800, 500, 1)"' . ' href="#">' . $youtubeIcon . $youtubeTitle . '</a>';
$wikiTutorial = '<a' . $docClass . ' onclick="Joomla.popupWindow(\'http://wiki.templaza.com/Main_Page\', \'' . $wikiTitle . '\', 800, 500, 1)"' . ' href="#">' . $wikiIcon . $wikiTitle . '</a>';
$bar->appendButton('Custom', $videoTutorial, 'youtube');
$bar->appendButton('Custom', $wikiTutorial, 'wikipedia');
}
示例12: installPaExtension
public function installPaExtension()
{
$this->model = $this->getModel('installer');
$canDo = JHelperContent::getActions('com_installer');
if ($canDo->get('core.manage')) {
try {
$rs = $this->model->download();
$this->input->set('package', $rs);
// Set extension parameters
$_GET['package'] = $rs;
$_GET['type'] = 'plugin';
$_GET['folder'] = 'jsnpoweradmin';
$_GET['publish'] = 1;
$_GET['client'] = 'site';
$_GET['name'] = str_ireplace(JSN_POWERADMIN_EXT_IDENTIFIED_NAME_PREFIX, '', $_GET['identified_name']);
if ($this->model->install($rs)) {
require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/extensions.php';
// Enable extension suport
$_GET['name'] = str_ireplace(JSN_POWERADMIN_EXT_IDENTIFIED_NAME_PREFIX, '', $_GET['identified_name']);
try {
JSNPaExtensionsHelper::enableExt($identifiedName);
} catch (Exception $ex) {
exit('notenabled');
}
}
} catch (Exception $ex) {
exit($ex->getMessage());
}
exit('success');
}
}
示例13: addToolbar
protected function addToolbar()
{
$canDo = JHelperContent::getActions($this->option, $this->edit_view, $this->state->get('filter.category_id'));
$user = JFactory::getUser();
JToolbarHelper::title(ucfirst($this->view), 'address contact');
if ($canDo->get('core.create') || count($user->getAuthorisedCategories($this->option, 'core.create')) > 0) {
JToolbarHelper::addNew($this->edit_view . '.add');
}
if ($canDo->get('core.edit') || $canDo->get('core.edit.own')) {
JToolbarHelper::editList($this->edit_view . '.edit');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::publish($this->view . '.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish($this->view . '.unpublish', 'JTOOLBAR_UNPUBLISH', true);
}
if ($user->authorise('core.create', $this->option) && $user->authorise('core.edit', $this->option) && $user->authorise('core.edit.state', $this->option)) {
$title = JText::_('JTOOLBAR_BATCH');
$layout = new JLayoutFile('joomla.toolbar.batch');
$dhtml = $layout->render(array('title' => $title));
}
if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) {
JToolbarHelper::deleteList('', $this->view . '.delete', 'JTOOLBAR_EMPTY_TRASH');
} elseif ($canDo->get('core.edit.state')) {
JToolbarHelper::deleteList($this->option, $this->view . '.delete', 'Delete');
}
if ($user->authorise('core.admin', $this->option) || $user->authorise('core.options', $this->option)) {
JToolbarHelper::preferences($this->option);
}
JHtmlSidebar::setAction('index.php?option=' . $this->option);
}
示例14: 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');
}
示例15: addToolbar
/**
* Add the page title and toolbar.
*
* @return void
*
* @since 1.6
*/
protected function addToolbar()
{
$state = $this->get('State');
$canDo = JHelperContent::getActions('com_messages');
JToolbarHelper::title(JText::_('COM_MESSAGES_MANAGER_MESSAGES'), 'envelope inbox');
if ($canDo->get('core.create')) {
JToolbarHelper::addNew('message.add');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::publish('messages.publish', 'COM_MESSAGES_TOOLBAR_MARK_AS_READ', true);
JToolbarHelper::unpublish('messages.unpublish', 'COM_MESSAGES_TOOLBAR_MARK_AS_UNREAD', true);
}
JToolbarHelper::divider();
$bar = JToolBar::getInstance('toolbar');
// Instantiate a new JLayoutFile instance and render the layout
JHtml::_('behavior.modal', 'a.messagesSettings');
$layout = new JLayoutFile('toolbar.mysettings');
$bar->appendButton('Custom', $layout->render(array()), 'upload');
if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
JToolbarHelper::divider();
JToolbarHelper::deleteList('', 'messages.delete', 'JTOOLBAR_EMPTY_TRASH');
} elseif ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::trash('messages.trash');
}
if ($canDo->get('core.admin')) {
JToolbarHelper::preferences('com_messages');
}
JToolbarHelper::divider();
JToolbarHelper::help('JHELP_COMPONENTS_MESSAGING_INBOX');
}