本文整理汇总了PHP中BannersHelper::getActions方法的典型用法代码示例。如果您正苦于以下问题:PHP BannersHelper::getActions方法的具体用法?PHP BannersHelper::getActions怎么用?PHP BannersHelper::getActions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BannersHelper
的用法示例。
在下文中一共展示了BannersHelper::getActions方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
JRequest::setVar('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.
$canDo = BannersHelper::getActions($this->item->catid, 0);
JToolBarHelper::title($isNew ? JText::_('COM_BANNERS_MANAGER_BANNER_NEW') : JText::_('COM_BANNERS_MANAGER_BANNER_EDIT'), 'banners.png');
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || count($user->getAuthorisedCategories('com_banners', 'core.create')) > 0)) {
JToolBarHelper::apply('banner.apply');
JToolBarHelper::save('banner.save');
if ($canDo->get('core.create')) {
JToolBarHelper::save2new('banner.save2new');
}
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolBarHelper::save2copy('banner.save2copy');
}
if (empty($this->item->id)) {
JToolBarHelper::cancel('banner.cancel');
} else {
JToolBarHelper::cancel('banner.cancel', 'JTOOLBAR_CLOSE');
}
JToolBarHelper::divider();
JToolBarHelper::help('JHELP_COMPONENTS_BANNERS_BANNERS_EDIT');
}
示例2: 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 = BannersHelper::getActions();
JToolBarHelper::title($isNew ? JText::_('COM_BANNERS_MANAGER_CLIENT_NEW') : JText::_('COM_BANNERS_MANAGER_CLIENT_EDIT'), 'banners-clients.png');
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) {
JToolBarHelper::apply('client.apply');
JToolBarHelper::save('client.save');
}
if (!$checkedOut && $canDo->get('core.create')) {
JToolBarHelper::save2new('client.save2new');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolBarHelper::save2copy('client.save2copy');
}
if (empty($this->item->id)) {
JToolBarHelper::cancel('client.cancel');
} else {
JToolBarHelper::cancel('client.cancel', 'JTOOLBAR_CLOSE');
}
JToolBarHelper::divider();
JToolBarHelper::help('JHELP_COMPONENTS_BANNERS_CLIENTS_EDIT');
}
示例3: _setToolbar
/**
* Setup the Toolbar.
*/
protected function _setToolbar()
{
require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'banners.php';
$state = $this->get('State');
$canDo = BannersHelper::getActions($state->get('filter.category_id'));
JToolBarHelper::title(JText::_('Banners_Manager_Banners'), 'generic.png');
if ($canDo->get('core.create')) {
JToolBarHelper::addNew('banner.add');
}
if ($canDo->get('core.edit')) {
JToolBarHelper::editList('banner.edit');
}
JToolBarHelper::divider();
if ($canDo->get('core.edit.state')) {
JToolBarHelper::custom('banners.publish', 'publish.png', 'publish_f2.png', 'Publish', true);
JToolBarHelper::custom('banners.unpublish', 'unpublish.png', 'unpublish_f2.png', 'Unpublish', true);
JToolBarHelper::divider();
if ($state->get('filter.published') != -1) {
JToolBarHelper::archiveList('banners.archive');
}
}
if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
JToolBarHelper::deleteList('', 'banners.delete');
} else {
if ($canDo->get('core.edit.state')) {
JToolBarHelper::trash('banners.trash');
}
}
if ($canDo->get('core.admin')) {
JToolBarHelper::divider();
JToolBarHelper::preferences('com_banners');
}
JToolBarHelper::divider();
JToolBarHelper::help('screen.banners.banners');
}
示例4: 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));
}
示例5: 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', 'JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolBarHelper::editList('client.edit', 'JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolBarHelper::divider();
JToolBarHelper::custom('clients.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true);
JToolBarHelper::custom('clients.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true);
JToolBarHelper::divider();
JToolBarHelper::archiveList('clients.archive', 'JTOOLBAR_ARCHIVE');
JToolBarHelper::custom('clients.checkin', 'checkin.png', 'checkin_f2.png', 'JTOOLBAR_CHECKIN', true);
}
if ($canDo->get('core.edit.state')) {
JToolBarHelper::trash('clients.trash', 'JTOOLBAR_TRASH');
}
if ($canDo->get('core.delete')) {
JToolBarHelper::deleteList('', 'clients.delete', 'JTOOLBAR_EMPTY_TRASH');
JToolBarHelper::divider();
}
if ($canDo->get('core.admin')) {
JToolBarHelper::preferences('com_banners');
JToolBarHelper::divider();
}
JToolBarHelper::help('JHELP_COMPONENTS_BANNERS_CLIENTS');
}
示例6: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
JRequest::setVar('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);
$canDo = BannersHelper::getActions($this->state->get('filter.category_id'));
JToolBarHelper::title($isNew ? JText::_('COM_BANNERS_MANAGER_BANNER_NEW') : JText::_('COM_BANNERS_MANAGER_BANNER_EDIT'), 'banners.png');
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) {
JToolBarHelper::apply('banner.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('banner.save', 'JTOOLBAR_SAVE');
if ($canDo->get('core.create')) {
JToolBarHelper::custom('banner.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
}
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolBarHelper::custom('banner.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
if (empty($this->item->id)) {
JToolBarHelper::cancel('banner.cancel', 'JTOOLBAR_CANCEL');
} else {
JToolBarHelper::cancel('banner.cancel', 'JTOOLBAR_CLOSE');
}
JToolBarHelper::divider();
JToolBarHelper::help('JHELP_COMPONENTS_BANNERS_BANNERS_EDIT');
}
示例7: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
require_once JPATH_COMPONENT.'/helpers/banners.php';
$canDo = BannersHelper::getActions($this->state->get('filter.category_id'));
$user = JFactory::getUser();
JToolBarHelper::title(JText::_('COM_BANNERS_MANAGER_BANNERS'), 'banners.png');
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::divider();
JToolBarHelper::publish('banners.publish', 'JTOOLBAR_PUBLISH', true);
JToolBarHelper::unpublish('banners.unpublish', 'JTOOLBAR_UNPUBLISH', true);
}
if ($this->state->get('filter.state') != -1 ) {
JToolBarHelper::divider();
if ($this->state->get('filter.state') != 2) {
JToolBarHelper::archiveList('banners.archive');
}
else if ($this->state->get('filter.state') == 2) {
JToolBarHelper::unarchiveList('banners.publish');
}
}
}
if ($canDo->get('core.edit.state')) {
JToolBarHelper::checkin('banners.checkin');
}
if ($this->state->get('filter.state') == -2 && $canDo->get('core.delete')) {
JToolBarHelper::deleteList('', 'banners.delete', 'JTOOLBAR_EMPTY_TRASH');
JToolBarHelper::divider();
} else if ($canDo->get('core.edit.state')) {
JToolBarHelper::trash('banners.trash');
JToolBarHelper::divider();
}
if ($canDo->get('core.admin')) {
JToolBarHelper::preferences('com_banners');
JToolBarHelper::divider();
}
JToolBarHelper::help('JHELP_COMPONENTS_BANNERS_BANNERS');
}
示例8: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
require_once JPATH_COMPONENT . '/helpers/banners.php';
$canDo = BannersHelper::getActions($this->state->get('filter.category_id'));
JToolBarHelper::title(JText::_('COM_BANNERS_MANAGER_TRACKS'), 'banners-tracks.png');
$bar = JToolBar::getInstance('toolbar');
$bar->appendButton('Popup', 'export', 'JTOOLBAR_EXPORT', 'index.php?option=com_banners&view=download&tmpl=component', 600, 300);
$document = JFactory::getDocument();
$app = JFactory::getApplication();
if ($canDo->get('core.delete')) {
$bar->appendButton('Confirm', 'COM_BANNERS_DELETE_MSG', 'delete', 'COM_BANNERS_TRACKS_DELETE', 'tracks.delete', false);
JToolBarHelper::divider();
}
if ($canDo->get('core.admin')) {
JToolBarHelper::preferences('com_banners');
JToolBarHelper::divider();
}
JToolBarHelper::help('JHELP_COMPONENTS_BANNERS_TRACKS');
}
示例9: defined
<?php
/**
* @package Joomla.Administrator
* @subpackage Templates.hathor
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// no direct access
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
$canDo = BannersHelper::getActions();
?>
<script type="text/javascript">
Joomla.submitbutton = function(task)
{
if (task == 'client.cancel' || document.formvalidator.isValid(document.id('client-form'))) {
Joomla.submitform(task, document.getElementById('client-form'));
}
}
</script>
<form action="<?php
echo JRoute::_('index.php?option=com_banners&layout=edit&id=' . (int) $this->item->id);
?>
" method="post" name="adminForm" id="client-form" class="form-validate">
<div class="col main-section">
<fieldset class="adminform">