本文整理汇总了PHP中UsersHelper::getActions方法的典型用法代码示例。如果您正苦于以下问题:PHP UsersHelper::getActions方法的具体用法?PHP UsersHelper::getActions怎么用?PHP UsersHelper::getActions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UsersHelper
的用法示例。
在下文中一共展示了UsersHelper::getActions方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$canDo = UsersHelper::getActions();
JToolBarHelper::title(JText::_('COM_USERS_VIEW_USERS_TITLE'), 'user');
if ($canDo->get('core.create')) {
JToolBarHelper::addNew('user.add');
}
if ($canDo->get('core.edit')) {
JToolBarHelper::editList('user.edit');
}
if ($canDo->get('core.edit.state')) {
JToolBarHelper::divider();
JToolBarHelper::publish('users.activate', 'COM_USERS_TOOLBAR_ACTIVATE', true);
JToolBarHelper::unpublish('users.block', 'COM_USERS_TOOLBAR_BLOCK', true);
JToolBarHelper::custom('users.unblock', 'unblock.png', 'unblock_f2.png', 'COM_USERS_TOOLBAR_UNBLOCK', true);
JToolBarHelper::divider();
}
if ($canDo->get('core.delete')) {
JToolBarHelper::deleteList('', 'users.delete');
JToolBarHelper::divider();
}
if ($canDo->get('core.admin')) {
JToolBarHelper::preferences('com_users');
JToolBarHelper::divider();
}
JToolBarHelper::help('JHELP_USERS_USER_MANAGER');
}
示例2: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$canDo = UsersHelper::getActions();
JToolbarHelper::title(JText::_('COM_USERS_VIEW_USERS_TITLE'), 'user');
if ($canDo->get('core.create')) {
JToolbarHelper::addNew('user.add');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList('user.edit');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::publish('users.activate', 'COM_USERS_TOOLBAR_ACTIVATE', true);
JToolbarHelper::unpublish('users.block', 'COM_USERS_TOOLBAR_BLOCK', true);
JToolbarHelper::custom('users.unblock', 'unblock.png', 'unblock_f2.png', 'COM_USERS_TOOLBAR_UNBLOCK', true);
JToolbarHelper::divider();
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'users.delete');
JToolbarHelper::divider();
}
if ($canDo->get('core.admin')) {
JToolbarHelper::preferences('com_users');
JToolbarHelper::divider();
}
JToolbarHelper::help('JHELP_USERS_USER_MANAGER');
JHtmlSidebar::setAction('index.php?option=com_users&view=users');
JHtmlSidebar::addFilter(JText::_('COM_USERS_FILTER_STATE'), 'filter_state', JHtml::_('select.options', UsersHelper::getStateOptions(), 'value', 'text', $this->state->get('filter.state')));
JHtmlSidebar::addFilter(JText::_('COM_USERS_FILTER_ACTIVE'), 'filter_active', JHtml::_('select.options', UsersHelper::getActiveOptions(), 'value', 'text', $this->state->get('filter.active')));
JHtmlSidebar::addFilter(JText::_('COM_USERS_FILTER_USERGROUP'), 'filter_group_id', JHtml::_('select.options', UsersHelper::getGroups(), 'value', 'text', $this->state->get('filter.group_id')));
JHtmlSidebar::addFilter(JText::_('COM_USERS_OPTION_FILTER_DATE'), 'filter_range', JHtml::_('select.options', Usershelper::getRangeOptions(), 'value', 'text', $this->state->get('filter.range')));
}
示例3: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
JRequest::setVar('hidemainmenu', 1);
$user = JFactory::getUser();
$isNew = $this->item->id == 0;
$canDo = UsersHelper::getActions();
JToolBarHelper::title(JText::_($isNew ? 'COM_USERS_VIEW_NEW_GROUP_TITLE' : 'COM_USERS_VIEW_EDIT_GROUP_TITLE'), 'groups-add');
if ($canDo->get('core.edit') || $canDo->get('core.create')) {
JToolBarHelper::apply('group.apply');
JToolBarHelper::save('group.save');
}
if ($canDo->get('core.create')) {
JToolBarHelper::save2new('group.save2new');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolBarHelper::save2copy('group.save2copy');
}
if (empty($this->item->id)) {
JToolBarHelper::cancel('group.cancel');
} else {
JToolBarHelper::cancel('group.cancel', 'JTOOLBAR_CLOSE');
}
JToolBarHelper::divider();
JToolBarHelper::help('JHELP_USERS_GROUPS_EDIT');
}
示例4: addToolbar
/**
* Display the toolbar.
*
* @return void
*
* @since 2.5
*/
protected function addToolbar()
{
Request::setVar('hidemainmenu', 1);
$isNew = $this->item->id == 0;
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == User::get('id'));
$canDo = UsersHelper::getActions($this->state->get('filter.category_id'), $this->item->id);
Toolbar::title(Lang::txt('COM_USERS_NOTES'), 'user');
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || count(User::getAuthorisedCategories('com_users', 'core.create')))) {
Toolbar::apply('note.apply');
Toolbar::save('note.save');
}
if (!$checkedOut && count(User::getAuthorisedCategories('com_users', 'core.create'))) {
Toolbar::save2new('note.save2new');
}
// If an existing item, can save to a copy.
if (!$isNew && count(User::getAuthorisedCategories('com_users', 'core.create')) > 0) {
Toolbar::save2copy('note.save2copy');
}
if (empty($this->item->id)) {
Toolbar::cancel('note.cancel');
} else {
Toolbar::cancel('note.cancel', 'JTOOLBAR_CLOSE');
}
Toolbar::divider();
Toolbar::help('note');
}
示例5: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
$isNew = $this->item->id == 0;
$canDo = UsersHelper::getActions();
JToolbarHelper::title(JText::_($isNew ? 'COM_USERS_VIEW_NEW_LEVEL_TITLE' : 'COM_USERS_VIEW_EDIT_LEVEL_TITLE'), 'levels-add');
if ($canDo->get('core.edit') || $canDo->get('core.create')) {
JToolbarHelper::apply('level.apply');
JToolbarHelper::save('level.save');
}
if ($canDo->get('core.create')) {
JToolbarHelper::save2new('level.save2new');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolbarHelper::save2copy('level.save2copy');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel('level.cancel');
} else {
JToolbarHelper::cancel('level.cancel', 'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help('JHELP_USERS_ACCESS_LEVELS_EDIT');
}
示例6: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
JRequest::setVar('hidemainmenu', 1);
$user = JFactory::getUser();
$isNew = $this->item->id == 0;
$canDo = UsersHelper::getActions();
JToolBarHelper::title(JText::_($isNew ? 'COM_USERS_VIEW_NEW_LEVEL_TITLE' : 'COM_USERS_VIEW_EDIT_LEVEL_TITLE'), 'levels-add');
if ($canDo->get('core.edit') || $canDo->get('core.create')) {
JToolBarHelper::apply('level.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('level.save', 'JTOOLBAR_SAVE');
}
if ($canDo->get('core.create')) {
JToolBarHelper::custom('level.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('level.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
if (empty($this->item->id)) {
JToolBarHelper::cancel('level.cancel', 'JTOOLBAR_CANCEL');
} else {
JToolBarHelper::cancel('level.cancel', 'JTOOLBAR_CLOSE');
}
JToolBarHelper::divider();
JToolBarHelper::help('JHELP_USERS_ACCESS_LEVELS_EDIT');
}
示例7: _setToolbar
/**
* Setup the Toolbar.
*/
protected function _setToolbar()
{
$canDo = UsersHelper::getActions();
JToolBarHelper::title(JText::_('Users_View_Users_Title'), 'user');
if ($canDo->get('core.edit.state')) {
JToolBarHelper::custom('users.activate', 'publish.png', 'publish_f2.png', 'Activate', true);
JToolBarHelper::custom('users.block', 'unpublish.png', 'unpublish_f2.png', 'Block', true);
JToolBarHelper::divider();
}
if ($canDo->get('core.create')) {
JToolBarHelper::custom('user.add', 'new.png', 'new_f2.png', 'New', false);
}
if ($canDo->get('core.edit')) {
JToolBarHelper::custom('user.edit', 'edit.png', 'edit_f2.png', 'Edit', true);
}
if ($canDo->get('core.delete')) {
JToolBarHelper::deleteList('', 'users.delete');
}
JToolBarHelper::divider();
if ($canDo->get('core.admin')) {
JToolBarHelper::preferences('com_users');
}
JToolBarHelper::divider();
JToolBarHelper::help('screen.users.users');
}
示例8: defaultTpl
function defaultTpl($tpl = null)
{
JToolBarHelper::title(JText::_('STOP WORDS'), 'tag.png');
$canDo = UsersHelper::getActions();
if ($canDo->get('core.create')) {
JToolBarHelper::apply();
JToolBarHelper::spacer();
JToolBarHelper::save();
JToolBarHelper::spacer();
JToolBarHelper::custom('restore', 'default', '', JText::_('RESTORE DEFAULT'), false);
JToolBarHelper::spacer();
}
JToolBarHelper::back(JText::_('CEDTAG_CONTROL_PANEL'), 'index.php?option=com_cedtag');
$lang = strval(JFactory::getLanguage()->getDefault());
$file = JPATH_ADMINISTRATOR . '/components/com_cedtag/stopwords/stopwords_' . $lang . '.php';
if (!is_file($file)) {
JFile::copy(JPATH_ADMINISTRATOR . '/components/com_cedtag/stopwords/stopwords_en-GB-default.php', $file);
}
$isWritable = is_writable($file);
$FileContent = trim(file_get_contents($file));
$this->assign('isWritable', $isWritable);
$this->assignRef('FileName', $file);
$this->assignRef('FileContent', $FileContent);
parent::display($tpl);
}
示例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'));
$canDo = UsersHelper::getActions($this->state->get('filter.category_id'), $this->item->id);
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) && $user->authorise('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
function addToolbar()
{
JToolBarHelper::title(JText::_('EXPORT TAGS TO OTHER COMPONENTS'), 'tag.png');
$canDo = UsersHelper::getActions();
if ($canDo->get('core.create')) {
$bar = JToolBar::getInstance('toolbar');
$bar->appendButton('Confirm', JText::_('Are you sure you want to export?'), 'default', JText::_('Export'), 'export', false);
JToolBarHelper::spacer();
}
JToolBarHelper::back(JText::_('CEDTAG_CONTROL_PANEL'), 'index.php?option=com_cedtag');
}
示例11: canView
/**
* Checks whether a user can see this view.
*
* @param string $view The view name.
*
* @return boolean
* @since 1.6
*/
protected function canView($view)
{
$canDo = UsersHelper::getActions();
switch ($view) {
// Special permissions.
case 'groups':
case 'group':
case 'levels':
case 'level':
return $canDo->get('core.admin');
break;
// Default permissions.
// Default permissions.
default:
return true;
}
}
示例12: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$canDo = UsersHelper::getActions();
$user = JFactory::getUser();
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
JToolbarHelper::title(JText::_('COM_USERS_VIEW_USERS_TITLE'), 'user');
if ($canDo->get('core.create')) {
JToolbarHelper::addNew('user.add');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList('user.edit');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::publish('users.activate', 'COM_USERS_TOOLBAR_ACTIVATE', true);
JToolbarHelper::unpublish('users.block', 'COM_USERS_TOOLBAR_BLOCK', true);
JToolbarHelper::custom('users.unblock', 'unblock.png', 'unblock_f2.png', 'COM_USERS_TOOLBAR_UNBLOCK', true);
JToolbarHelper::divider();
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'users.delete');
JToolbarHelper::divider();
}
// Add a batch button
if ($user->authorise('core.create', 'com_users') && $user->authorise('core.edit', 'com_users') && $user->authorise('core.edit.state', 'com_users')) {
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_users');
JToolbarHelper::divider();
}
JToolbarHelper::help('JHELP_USERS_USER_MANAGER');
JHtmlSidebar::setAction('index.php?option=com_users&view=users');
JHtmlSidebar::addFilter(JText::_('COM_USERS_FILTER_STATE'), 'filter_state', JHtml::_('select.options', UsersHelper::getStateOptions(), 'value', 'text', $this->state->get('filter.state')));
JHtmlSidebar::addFilter(JText::_('COM_USERS_FILTER_ACTIVE'), 'filter_active', JHtml::_('select.options', UsersHelper::getActiveOptions(), 'value', 'text', $this->state->get('filter.active')));
JHtmlSidebar::addFilter(JText::_('COM_USERS_FILTER_USERGROUP'), 'filter_group_id', JHtml::_('select.options', UsersHelper::getGroups(), 'value', 'text', $this->state->get('filter.group_id')));
JHtmlSidebar::addFilter(JText::_('COM_USERS_OPTION_FILTER_DATE'), 'filter_range', JHtml::_('select.options', Usershelper::getRangeOptions(), 'value', 'text', $this->state->get('filter.range')));
}
示例13: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
JRequest::setVar('hidemainmenu', 1);
$user = JFactory::getUser();
$isNew = $this->item->id == 0;
$canDo = UsersHelper::getActions();
$isNew = $this->item->id == 0;
$isProfile = $this->item->id == $user->id;
JToolBarHelper::title(JText::_($isNew ? 'COM_USERS_VIEW_NEW_USER_TITLE' : ($isProfile ? 'COM_USERS_VIEW_EDIT_PROFILE_TITLE' : 'User Manager: Edit User')), $isNew ? 'user-add' : ($isProfile ? 'user-profile' : 'user-edit'));
if ($canDo->get('core.edit') || $canDo->get('core.create')) {
JToolBarHelper::apply('user.apply');
JToolBarHelper::save('user.save');
}
if (empty($this->item->id)) {
JToolBarHelper::cancel('user.cancel');
} else {
JToolBarHelper::cancel('user.cancel', 'JTOOLBAR_CLOSE');
}
}
示例14: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$canDo = UsersHelper::getActions();
if ($canDo->get('core.create')) {
JToolBarHelper::addNew('group.add');
}
if ($canDo->get('core.edit')) {
JToolBarHelper::editList('group.edit');
JToolBarHelper::divider();
}
if ($canDo->get('core.delete')) {
JToolBarHelper::deleteList('', 'groups.delete');
JToolBarHelper::divider();
}
if ($canDo->get('core.admin')) {
JToolBarHelper::preferences('com_users');
JToolBarHelper::divider();
}
JToolBarHelper::help('JHELP_USERS_GROUPS');
}
示例15: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$canDo = UsersHelper::getActions();
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
JToolbarHelper::title(JText::_('COM_USERS_VIEW_USERS_TITLE'), 'user');
if ($canDo->get('core.create')) {
JToolbarHelper::addNew('user.add');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList('user.edit');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::publish('users.activate', 'COM_USERS_TOOLBAR_ACTIVATE', true);
JToolbarHelper::unpublish('users.block', 'COM_USERS_TOOLBAR_BLOCK', true);
JToolbarHelper::custom('users.unblock', 'unblock.png', 'unblock_f2.png', 'COM_USERS_TOOLBAR_UNBLOCK', true);
JToolbarHelper::divider();
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'users.delete');
JToolbarHelper::divider();
}
// 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<i class=\"icon-checkbox-partial\" title=\"{$title}\"></i>\n\t\t\t{$title}</button>";
$bar->appendButton('Custom', $dhtml, 'batch');
}
if ($canDo->get('core.admin')) {
JToolbarHelper::preferences('com_users');
JToolbarHelper::divider();
}
JToolbarHelper::help('JHELP_USERS_USER_MANAGER');
JHtmlSidebar::setAction('index.php?option=com_users&view=users');
JHtmlSidebar::addFilter(JText::_('COM_USERS_FILTER_STATE'), 'filter_state', JHtml::_('select.options', UsersHelper::getStateOptions(), 'value', 'text', $this->state->get('filter.state')));
JHtmlSidebar::addFilter(JText::_('COM_USERS_FILTER_ACTIVE'), 'filter_active', JHtml::_('select.options', UsersHelper::getActiveOptions(), 'value', 'text', $this->state->get('filter.active')));
JHtmlSidebar::addFilter(JText::_('COM_USERS_FILTER_USERGROUP'), 'filter_group_id', JHtml::_('select.options', UsersHelper::getGroups(), 'value', 'text', $this->state->get('filter.group_id')));
JHtmlSidebar::addFilter(JText::_('COM_USERS_OPTION_FILTER_DATE'), 'filter_range', JHtml::_('select.options', Usershelper::getRangeOptions(), 'value', 'text', $this->state->get('filter.range')));
}