本文整理汇总了PHP中UsersHelper::getStateOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP UsersHelper::getStateOptions方法的具体用法?PHP UsersHelper::getStateOptions怎么用?PHP UsersHelper::getStateOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UsersHelper
的用法示例。
在下文中一共展示了UsersHelper::getStateOptions方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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');
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')));
}
示例2: 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')));
}
示例3:
echo JText::_('COM_USERS_FILTER_LABEL');
?>
</span>
<label class="selectlabel" for="filter_state">
<?php
echo JText::_('COM_USERS_FILTER_LABEL');
?>
</label>
<select name="filter_state" id="filter_state">
<option value="*"><?php
echo JText::_('COM_USERS_FILTER_STATE');
?>
</option>
<?php
echo JHtml::_('select.options', UsersHelper::getStateOptions(), 'value', 'text', $this->state->get('filter.state'));
?>
</select>
<label class="selectlabel" for="filter_active">
<?php
echo JText::_('COM_USERS_FILTER_ACTIVE');
?>
</label>
<select name="filter_active" id="filter_active">
<option value="*"><?php
echo JText::_('COM_USERS_FILTER_ACTIVE');
?>
</option>
<?php
echo JHtml::_('select.options', UsersHelper::getActiveOptions(), 'value', 'text', $this->state->get('filter.active'));
示例4: 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')));
}