本文整理汇总了PHP中ModulesHelper::getActions方法的典型用法代码示例。如果您正苦于以下问题:PHP ModulesHelper::getActions方法的具体用法?PHP ModulesHelper::getActions怎么用?PHP ModulesHelper::getActions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModulesHelper
的用法示例。
在下文中一共展示了ModulesHelper::getActions方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$state = $this->get('State');
$canDo = ModulesHelper::getActions();
Toolbar::title(Lang::txt('COM_MODULES_MANAGER_MODULES'), 'module.png');
if ($canDo->get('core.create')) {
//Toolbar::addNew('module.add');
Toolbar::appendButton('Popup', 'new', 'JTOOLBAR_NEW', 'index.php?option=com_modules&view=select&tmpl=component', 850, 400);
}
if ($canDo->get('core.edit')) {
Toolbar::editList('module.edit');
}
if ($canDo->get('core.create')) {
Toolbar::custom('modules.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true);
}
if ($canDo->get('core.edit.state')) {
Toolbar::divider();
Toolbar::publish('modules.publish', 'JTOOLBAR_PUBLISH', true);
Toolbar::unpublish('modules.unpublish', 'JTOOLBAR_UNPUBLISH', true);
Toolbar::divider();
Toolbar::checkin('modules.checkin');
}
if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
Toolbar::deleteList('', 'modules.delete', 'JTOOLBAR_EMPTY_TRASH');
Toolbar::divider();
} elseif ($canDo->get('core.edit.state')) {
Toolbar::trash('modules.trash');
Toolbar::divider();
}
if ($canDo->get('core.admin')) {
Toolbar::preferences('com_modules');
Toolbar::divider();
}
Toolbar::help('modules');
}
示例2: _setToolbar
/**
* Setup the Toolbar
*
* @since 1.6
*/
protected function _setToolbar()
{
JRequest::setVar('hidemainmenu', true);
$user = JFactory::getUser();
$isNew = $this->item->id == 0;
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
$canDo = ModulesHelper::getActions($this->state->get('filter.category_id'), $this->item->id);
$client = $this->get('client');
JToolBarHelper::title(JText::_('Modules_Manager_Module'));
if ($this->item->module == 'mod_custom') {
JToolBarHelper::Preview('index.php?option=com_modules&tmpl=component&client=' . $client->id . '&pollid=' . $this->item->id);
}
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')) {
JToolBarHelper::apply('module.apply', 'JToolbar_Apply');
JToolBarHelper::save('module.save', 'JToolbar_Save');
JToolBarHelper::addNew('module.save2new', 'JToolbar_Save_and_new');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolBarHelper::custom('module.save2copy', 'copy.png', 'copy_f2.png', 'JToolbar_Save_as_Copy', false);
}
if (empty($this->item->id)) {
JToolBarHelper::cancel('module.cancel', 'JToolbar_Cancel');
} else {
JToolBarHelper::cancel('module.cancel', 'JToolbar_Close');
}
JToolBarHelper::help('screen.module.edit');
}
示例3: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$state = $this->get('State');
$canDo = ModulesHelper::getActions();
$user = JFactory::getUser();
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
JToolbarHelper::title(JText::_('COM_MODULES_MANAGER_MODULES'), 'cube module');
if ($canDo->get('core.create')) {
// Instantiate a new JLayoutFile instance and render the layout
$layout = new JLayoutFile('toolbar.newmodule');
$bar->appendButton('Custom', $layout->render(array()), 'new');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList('module.edit');
}
if ($canDo->get('core.create')) {
JToolbarHelper::custom('modules.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true);
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::publish('modules.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('modules.unpublish', 'JTOOLBAR_UNPUBLISH', true);
JToolbarHelper::checkin('modules.checkin');
}
if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'modules.delete', 'JTOOLBAR_EMPTY_TRASH');
} elseif ($canDo->get('core.edit.state')) {
JToolbarHelper::trash('modules.trash');
}
// Add a batch button
if ($user->authorise('core.create', 'com_modules') && $user->authorise('core.edit', 'com_modules') && $user->authorise('core.edit.state', 'com_modules')) {
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_modules');
}
JToolbarHelper::help('JHELP_EXTENSIONS_MODULE_MANAGER');
JHtmlSidebar::addEntry(JText::_('JSITE'), 'index.php?option=com_modules&filter_client_id=0', $this->state->get('filter.client_id') == 0);
JHtmlSidebar::addEntry(JText::_('JADMINISTRATOR'), 'index.php?option=com_modules&filter_client_id=1', $this->state->get('filter.client_id') == 1);
JHtmlSidebar::setAction('index.php?option=com_modules');
JHtmlSidebar::addFilter('', 'filter_client_id', JHtml::_('select.options', ModulesHelper::getClientOptions(), 'value', 'text', $this->state->get('filter.client_id')), false);
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', ModulesHelper::getStateOptions(), 'value', 'text', $this->state->get('filter.state')));
JHtmlSidebar::addFilter(JText::_('COM_MODULES_OPTION_SELECT_POSITION'), 'filter_position', JHtml::_('select.options', ModulesHelper::getPositions($this->state->get('filter.client_id')), 'value', 'text', $this->state->get('filter.position')));
JHtmlSidebar::addFilter(JText::_('COM_MODULES_OPTION_SELECT_MODULE'), 'filter_module', JHtml::_('select.options', ModulesHelper::getModules($this->state->get('filter.client_id')), 'value', 'text', $this->state->get('filter.module')));
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')));
$this->sidebar = JHtmlSidebar::render();
}
示例4: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$state = $this->get('State');
$canDo = ModulesHelper::getActions();
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
JToolbarHelper::title(JText::_($this->config->list_title ? 'COM_MODULES_MANAGER_MODULES' : 'AMM_ADVANCED_MODULES_MANAGER'), 'module.png');
if ($canDo->get('core.create')) {
$title = JText::_('JTOOLBAR_NEW');
$dhtml = "<button onClick=\"location.href='index.php?option=com_advancedmodules&view=select'\" class=\"btn btn-small btn-success\">\n\t\t\t\t\t\t<i class=\"icon-plus icon-white\" title=\"{$title}\"></i>\n\t\t\t\t\t\t{$title}</button>";
$bar->appendButton('Custom', $dhtml, 'new');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList('module.edit');
}
if ($canDo->get('core.create')) {
JToolbarHelper::custom('modules.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true);
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::publish('modules.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('modules.unpublish', 'JTOOLBAR_UNPUBLISH', true);
JToolbarHelper::checkin('modules.checkin');
}
if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'modules.delete', 'JTOOLBAR_EMPTY_TRASH');
} elseif ($canDo->get('core.edit.state')) {
JToolbarHelper::trash('modules.trash');
}
// Add a batch button
if ($canDo->get('core.edit')) {
JHtml::_('bootstrap.modal', 'collapseModal');
$title = JText::_('JTOOLBAR_BATCH');
$dhtml = "<button data-toggle=\"modal\" data-target=\"#collapseModal\" class=\"btn btn-small\">\n\t\t\t\t\t\t<i class=\"icon-checkbox-partial\" title=\"{$title}\"></i>\n\t\t\t\t\t\t{$title}</button>";
$bar->appendButton('Custom', $dhtml, 'batch');
}
if ($canDo->get('core.admin')) {
JToolbarHelper::preferences('com_advancedmodules', 600, 900);
}
JToolbarHelper::help('JHELP_EXTENSIONS_MODULE_MANAGER');
JHtmlSidebar::addEntry(JText::_('JSITE'), 'index.php?option=com_advancedmodules&filter_client_id=0', $this->state->get('filter.client_id') == 0);
JHtmlSidebar::addEntry(JText::_('JADMINISTRATOR'), 'index.php?option=com_advancedmodules&filter_client_id=1', $this->state->get('filter.client_id') == 1);
JHtmlSidebar::setAction('index.php?option=com_modules');
JHtmlSidebar::addFilter('', 'filter_client_id', JHtml::_('select.options', ModulesHelper::getClientOptions(), 'value', 'text', $this->state->get('filter.client_id')), false);
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', ModulesHelper::getStateOptions(), 'value', 'text', $this->state->get('filter.state')));
JHtmlSidebar::addFilter(JText::_('COM_MODULES_OPTION_SELECT_POSITION'), 'filter_position', JHtml::_('select.options', ModulesHelper::getPositions($this->state->get('filter.client_id')), 'value', 'text', $this->state->get('filter.position')));
JHtmlSidebar::addFilter(JText::_('COM_MODULES_OPTION_SELECT_MODULE'), 'filter_module', JHtml::_('select.options', ModulesHelper::getModules($this->state->get('filter.client_id')), 'value', 'text', $this->state->get('filter.module')));
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')));
$this->sidebar = JHtmlSidebar::render();
}
示例5: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
JRequest::setVar('hidemainmenu', true);
$user = JFactory::getUser();
$isNew = $this->item->id == 0;
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
$canDo = ModulesHelper::getActions($this->state->get('filter.category_id'), $this->item->id);
$item = $this->get('Item');
JToolBarHelper::title(JText::sprintf('COM_MODULES_MANAGER_MODULE', JText::_($this->item->module)), 'module.png');
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) {
JToolBarHelper::apply('module.apply');
JToolBarHelper::save('module.save');
}
if (!$checkedOut && $canDo->get('core.create')) {
JToolBarHelper::save2new('module.save2new');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolBarHelper::save2copy('module.save2copy');
}
if (empty($this->item->id)) {
JToolBarHelper::cancel('module.cancel');
} else {
JToolBarHelper::cancel('module.cancel', 'JTOOLBAR_CLOSE');
}
// Get the help information for the menu item.
$lang = JFactory::getLanguage();
$help = $this->get('Help');
if ($lang->hasKey($help->url)) {
$debug = $lang->setDebug(false);
$url = JText::_($help->url);
$lang->setDebug($debug);
} else {
$url = null;
}
JToolBarHelper::help($help->key, false, $url);
}
示例6: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$state = $this->get('State');
$canDo = ModulesHelper::getActions();
JToolBarHelper::title(JText::_('COM_MODULES_MANAGER_MODULES'), 'module.png');
if ($canDo->get('core.create')) {
//JToolBarHelper::addNew('module.add');
$bar = JToolBar::getInstance('toolbar');
$bar->appendButton('Popup', 'new', 'JTOOLBAR_NEW', 'index.php?option=com_modules&view=select&tmpl=component', 850, 400);
}
if ($canDo->get('core.edit')) {
JToolBarHelper::editList('module.edit', 'JTOOLBAR_EDIT');
}
if ($canDo->get('core.create')) {
JToolBarHelper::custom('modules.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true);
}
if ($canDo->get('core.edit.state')) {
JToolBarHelper::divider();
JToolBarHelper::custom('modules.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true);
JToolBarHelper::custom('modules.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true);
JToolBarHelper::divider();
JToolBarHelper::custom('modules.checkin', 'checkin.png', 'checkin_f2.png', 'JTOOLBAR_CHECKIN', true);
}
if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
JToolBarHelper::deleteList('', 'modules.delete', 'JTOOLBAR_EMPTY_TRASH');
JToolBarHelper::divider();
} else {
if ($canDo->get('core.edit.state')) {
JToolBarHelper::trash('modules.trash', 'JTOOLBAR_TRASH');
JToolBarHelper::divider();
}
}
if ($canDo->get('core.admin')) {
JToolBarHelper::preferences('com_modules');
JToolBarHelper::divider();
}
JToolBarHelper::help('JHELP_EXTENSIONS_MODULE_MANAGER');
}