本文整理汇总了PHP中JUDirectoryHelper::getActions方法的典型用法代码示例。如果您正苦于以下问题:PHP JUDirectoryHelper::getActions方法的具体用法?PHP JUDirectoryHelper::getActions怎么用?PHP JUDirectoryHelper::getActions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JUDirectoryHelper
的用法示例。
在下文中一共展示了JUDirectoryHelper::getActions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addToolBar
protected function addToolBar()
{
$app = JFactory::getApplication();
$app->input->set('hidemainmenu', true);
$isNew = $this->item->id == 0;
$canDo = JUDirectoryHelper::getActions('com_judirectory');
$user = JFactory::getUser();
$userId = $user->id;
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId);
JToolBarHelper::title(JText::_('COM_JUDIRECTORY_PAGE_' . ($checkedOut ? 'VIEW_TEMPLATE_STYLE' : ($isNew ? 'ADD_TEMPLATE_STYLE' : 'EDIT_TEMPLATE_STYLE'))), 'style-add');
if ($isNew) {
if ($canDo->get('core.create')) {
JToolBarHelper::apply('style.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('style.save2new', 'JTOOLBAR_SAVE_AND_NEW');
JToolBarHelper::save('style.save', 'JTOOLBAR_SAVE');
}
JToolBarHelper::cancel('style.cancel', 'JTOOLBAR_CANCEL');
} else {
if ($canDo->get('core.edit')) {
JToolBarHelper::apply('style.apply', 'JTOOLBAR_APPLY');
if ($canDo->get('core.create')) {
JToolBarHelper::save('style.save2new', 'JTOOLBAR_SAVE_AND_NEW');
}
JToolBarHelper::save('style.save', 'JTOOLBAR_SAVE');
}
JToolBarHelper::cancel('style.cancel', 'JTOOLBAR_CLOSE');
}
JToolBarHelper::divider();
$bar = JToolBar::getInstance('toolbar');
$bar->addButtonPath(JPATH_ADMINISTRATOR . "/components/com_judirectory/helpers/button");
$bar->appendButton('JUHelp', 'help', JText::_('JTOOLBAR_HELP'));
}
示例2: display
public function display($tpl = null)
{
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode('<br />', $errors));
return false;
}
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->canDo = JUDirectoryHelper::getActions('com_judirectory');
$this->addToolBar();
if (JUDirectoryHelper::isJoomla3x()) {
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
}
$options = array();
$options[] = JHtml::_('select.option', '1', JText::_('J1'));
$options[] = JHtml::_('select.option', '2', JText::_('J2'));
$options[] = JHtml::_('select.option', '3', JText::_('J3'));
$options[] = JHtml::_('select.option', '4', JText::_('J4'));
$options[] = JHtml::_('select.option', '5', JText::_('J5'));
$options[] = JHtml::_('select.option', '6', JText::_('J6'));
$options[] = JHtml::_('select.option', '7', JText::_('J7'));
$options[] = JHtml::_('select.option', '8', JText::_('J8'));
$options[] = JHtml::_('select.option', '9', JText::_('J9'));
$options[] = JHtml::_('select.option', '10', JText::_('J10'));
$this->f_levels = $options;
$optionsPublished = array();
$optionsPublished[] = JHtml::_('select.option', '1', JText::_('COM_JUDIRECTORY_PUBLISHED'));
$optionsPublished[] = JHtml::_('select.option', '0', JText::_('COM_JUDIRECTORY_UNPUBLISHED'));
$this->published_options = $optionsPublished;
parent::display($tpl);
$this->setDocument();
}
示例3: defined
* @copyright Copyright (C) 2010-2015 JoomUltra Co., Ltd. All Rights Reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author JoomUltra Co., Ltd
* @website http://www.joomultra.com
* @----------------------------------------------------------------------@
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$rootCat = JUDirectoryFrontHelperCategory::getRootCategory();
$cat_id = JFactory::getApplication()->input->getInt("cat_id", $rootCat->id);
$search_in = $this->state->get('filter.search_in');
?>
<ul class="manager-actions nav nav-list" style="margin-bottom: 20px;">
<?php
$actions = JUDirectoryHelper::getActions('com_judirectory', 'category', $cat_id);
if ($actions->get("judir.listing.create")) {
if ($this->listingGroupCanDoManage && $this->allowAddListing) {
echo "<li><a class='add-listing' href='index.php?option=com_judirectory&task=listing.add&cat_id={$cat_id}'><i class='icon-file-add'></i>" . JText::_('COM_JUDIRECTORY_ADD_LISTING') . "</a></li>";
}
}
if ($actions->get("judir.category.create")) {
if ($this->catGroupCanDoManage) {
echo "<li><a class='add-category' href='index.php?option=com_judirectory&task=category.add&parent_id={$cat_id}'><i class='icon-folder-plus'></i>" . JText::_('COM_JUDIRECTORY_ADD_CATEGORY') . "</a></li>";
}
}
if (JUDirectoryHelper::checkGroupPermission(null, "pendinglistings") && JUDIRPROVERSION) {
echo "<li><a class='approved' href='index.php?option=com_judirectory&view=pendinglistings'><i class='icon-clock'></i>" . JText::sprintf('COM_JUDIRECTORY_PENDING_LISTINGS_N', JUDirectoryHelper::getTotalPendingListings()) . "</a></li>";
}
?>
</ul>