本文整理汇总了PHP中JToolBar类的典型用法代码示例。如果您正苦于以下问题:PHP JToolBar类的具体用法?PHP JToolBar怎么用?PHP JToolBar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JToolBar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$state = $this->get('State');
$canDo = MessagesHelper::getActions();
JToolBarHelper::title(JText::_('COM_MESSAGES_MANAGER_MESSAGES'), 'inbox.png');
if ($canDo->get('core.create')) {
JToolBarHelper::addNew('message.add');
}
if ($canDo->get('core.edit.state')) {
JToolBarHelper::divider();
JToolBarHelper::publish('messages.publish', 'COM_MESSAGES_TOOLBAR_MARK_AS_READ');
JToolBarHelper::unpublish('messages.unpublish', 'COM_MESSAGES_TOOLBAR_MARK_AS_UNREAD');
}
if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
JToolBarHelper::divider();
JToolBarHelper::deleteList('', 'messages.delete', 'JTOOLBAR_EMPTY_TRASH');
} else {
if ($canDo->get('core.edit.state')) {
JToolBarHelper::divider();
JToolBarHelper::trash('messages.trash');
}
}
//JToolBarHelper::addNew('module.add');
JToolBarHelper::divider();
$bar = JToolBar::getInstance('toolbar');
$bar->appendButton('Popup', 'options', 'COM_MESSAGES_TOOLBAR_MY_SETTINGS', 'index.php?option=com_messages&view=config&tmpl=component', 850, 400);
if ($canDo->get('core.admin')) {
JToolBarHelper::preferences('com_messages');
}
JToolBarHelper::divider();
JToolBarHelper::help('JHELP_COMPONENTS_MESSAGING_INBOX');
}
示例2: getToolbar
public static function getToolbar()
{
$bar = new JToolBar('toolbar');
$bar->appendButton('Standard', 'AG_apply', 'COM_ADMIRORGALLERY_APPLY_DESC', 'AG_apply', false);
$bar->appendButton('Standard', 'AG_reset', 'COM_ADMIRORGALLERY_RESET_DESC', 'AG_reset', false);
return $bar->render();
}
示例3: getToolbar
function getToolbar()
{
$bar = new JToolBar('toolbar');
// The first parameter is the button type. have a look a the JToolbar or JButton docs for a full list of these.
// The second parameter is the class to apply to the button ( this will help us to apply an image to it as in the backend )
// The third parameter is the text to display on the button.
// The fourth is the task to set. When the button is pressed the javascript submitButton function is called and the hidden field 'task' is set to this value. We will see this later in our template file.
// The fifth states whether a selection must be made from an admin list before continuing.
$bar->appendButton('Standard', 'AG_apply', JText::_('AG_APPLY DESC'), 'AG_apply', false);
$bar->appendButton('Standard', 'AG_reset', JText::_('AG_RESET DESC'), 'AG_reset', false);
return $bar->render();
}
示例4: display
function display()
{
$tpl = JRequest::getVar('tpl');
// Add toolbar buttons
JToolBarHelper::title(JText::_('JOOMLAPACK') . ': <small><small>' . JText::_('DBEF') . '</small></small>');
JToolBarHelper::back('Back', 'index.php?option=' . JRequest::getCmd('option'));
JToolBarHelper::spacer();
$bar =& JToolBar::getInstance('toolbar');
switch ($tpl) {
case 'tab':
JToolBarHelper::deleteList();
$bar->appendButton('Link', 'preview', JText::_('NORMALVIEW'), 'index.php?option=com_joomlapack&view=' . JRequest::getCmd('view'));
break;
case '':
default:
$bar->appendButton('Link', 'preview', JText::_('TABULARVIEW'), 'index.php?option=com_joomlapack&view=' . JRequest::getCmd('view') . '&tpl=tab');
break;
}
JToolBarHelper::spacer();
JoomlapackHelperUtils::addLiveHelp('dbef');
if ($tpl == 'tab') {
$model =& $this->getModel('Dbef');
$task = JRequest::getCmd('task', 'default');
$list =& $model->getRecordsList();
$this->assignRef('list', $list);
$this->assignRef('pagination', $model->getPagination());
$this->assignRef('class', $model->_filterclass);
}
$document =& JFactory::getDocument();
$document->addStyleSheet(JURI::base() . 'components/com_joomlapack/assets/css/joomlapack.css');
parent::display($tpl);
}
示例5: addToolBar
/**
* Setting the toolbar
*/
protected function addToolBar()
{
$state = $this->get('State');
$user = JFactory::getUser();
//$canDo = TSJsHelper::getActions('com_tsj', 'category', $state->get('filter.category_id'));
if (version_compare(JPlatform::RELEASE, '12', '<')) {
} else {
$categoryId = $this->state->get('filter.category_id');
}
JToolBarHelper::title(JText::_('COM_TSJ_MANAGER_TARIF'));
//Выводим кнопку настройки
/*if (JFactory::getUser()->authorise('core.admin', 'com_tsj')) {
JToolBarHelper::preferences('com_tsj');
JToolBarHelper::divider();
}*/
$toolbar = JToolBar::getInstance('toolbar');
$toolbar->addButtonPath(JPATH_COMPONENT . DS . 'buttons');
JToolBarHelper::addNew('tarif.add');
JToolBarHelper::editList('tarif.edit');
JToolBarHelper::deleteList('Вы действительно хотите удалить выбранные записи ?', 'tarif.remove');
JToolBarHelper::help('com_tsj', true);
if (version_compare(JPlatform::RELEASE, '12', '>=')) {
JHtmlSidebar::setAction('index.php?option=com_tsj&view=default');
}
}
示例6: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
require_once JPATH_COMPONENT . '/helpers/sibdiet.php';
$state = $this->get('State');
$canDo = SibdietHelper::getActions();
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
JToolBarHelper::title(JText::_('COM_SIBDIET_MANAGER_ACTIVITIES'), 'database activities');
if ($canDo->get('core.create')) {
JToolBarHelper::addNew('activity.add');
}
if ($canDo->get('core.edit') && isset($this->items[0])) {
JToolBarHelper::editList('activity.edit');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::checkin('activities.checkin');
}
if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
JToolbarHelper::publish('activities.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::deleteList('', 'activities.delete', 'JTOOLBAR_EMPTY_TRASH');
} elseif ($canDo->get('core.edit.state')) {
JToolbarHelper::trash('activities.trash');
}
if ($canDo->get('core.admin')) {
JToolBarHelper::preferences('com_sibdiet');
}
JHtmlSidebar::setAction('index.php?option=com_sibdiet&view=activities');
}
示例7: listing
function listing()
{
$app = JFactory::getApplication();
$config = acymailing_config();
if (!class_exists('plgSystemAcymailingClassMail')) {
$app->enqueueMessage('AcyMailing can customize some Joomla messages. If you want to do this, please first <a href="index.php?option=com_acymailing&ctrl=cpanel">enable the plugin acymailingclassmail</a>', 'notice');
}
$pageInfo = new stdClass();
$pageInfo->filter = new stdClass();
$pageInfo->filter->order = new stdClass();
$paramBase = ACYMAILING_COMPONENT . '.' . $this->getName();
$pageInfo->filter->order->value = $app->getUserStateFromRequest($paramBase . ".filter_order", 'filter_order', 'mailid', 'cmd');
$pageInfo->filter->order->dir = $app->getUserStateFromRequest($paramBase . ".filter_order_Dir", 'filter_order_Dir', 'desc', 'word');
$db = JFactory::getDBO();
$query = 'SELECT mailid, subject, alias, fromname, published, fromname, fromemail, replyname, replyemail FROM #__acymailing_mail WHERE `type` = ' . $db->Quote($this->type);
if (!empty($pageInfo->filter->order->value)) {
$query .= ' ORDER BY ' . $pageInfo->filter->order->value . ' ' . $pageInfo->filter->order->dir;
}
$db->setQuery($query);
$rows = $db->loadObjectList();
acymailing_setTitle(JText::_($this->nameListing), $this->icon, $this->ctrl);
$bar = JToolBar::getInstance('toolbar');
JToolBarHelper::custom('preview', 'acypreview', '', JText::_('ACY_PREVIEW'), true);
JToolBarHelper::editList();
JToolBarHelper::deleteList(JText::_('ACY_VALIDDELETEITEMS'));
JToolBarHelper::divider();
$bar->appendButton('Pophelp', $this->doc);
$bar->appendButton('Link', 'acymailing', JText::_('ACY_CPANEL'), acymailing_completeLink('dashboard'));
$toggleClass = acymailing_get('helper.toggle');
$this->assignRef('toggleClass', $toggleClass);
$this->assignRef('pageInfo', $pageInfo);
$this->assign('config', $config);
$this->assign('rows', $rows);
}
示例8: dropdown
/**
*
* Add an toolbar dropdown list
*
* @param String $text is text of parent
* @param String $title is title of parent
* @param String $icon is icon class prefix
* @param String $childs is HTML
* @param String $href is url of parent
* @param String $action is action you want when click on parent
*/
public static function dropdown($text = '', $title = '', $icon = 'jsn-parent', $childs = '', $href = '', $action = 'popup')
{
JSNFactory::localimport('helpers.html.toolbar.button.jsndropdown');
$bar = JToolBar::getInstance('toolbar');
// Add a standard button.
$bar->appendButton('JSNDropdown', $text, $title, $icon, $childs, $href, $action);
}
示例9: addToolBar
protected function addToolBar()
{
JToolBarHelper::title(JText::_('COM_JUDOWNLOAD_MANAGER_TAGS'), 'tags');
if ($this->groupCanDoManage) {
if ($this->canDo->get('core.create')) {
JToolBarHelper::addNew('tag.add');
}
if ($this->canDo->get('core.edit') || $this->canDo->get('core.edit.own')) {
JToolBarHelper::editList('tag.edit');
}
if ($this->canDo->get('core.edit.state')) {
JToolbarHelper::publish('tags.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('tags.unpublish', 'JTOOLBAR_UNPUBLISH', true);
}
}
if ($this->groupCanDoDelete) {
if ($this->canDo->get('core.delete')) {
JToolBarHelper::deleteList('COM_JUDOWNLOAD_ARE_YOU_SURE_YOU_WANT_TO_DELETE_THESE_ITEMS', 'tags.delete');
}
}
JToolBarHelper::divider();
$bar = JToolBar::getInstance('toolbar');
$bar->addButtonPath(JPATH_ADMINISTRATOR . "/components/com_judownload/helpers/button");
$bar->appendButton('JUHelp', 'help', JText::_('JTOOLBAR_HELP'));
}
示例10: display
function display($tpl = null)
{
$canDo = JCKHelper::getActions();
$app = JFactory::getApplication();
if (!$canDo->get('jckman.install')) {
$app->redirect(JRoute::_('index.php?option=com_jckman&view=cpanel', false), JText::_('COM_JCKMAN_PLUGIN_PERM_NO_INSTALL'), 'error');
return false;
}
//end if
/*
* Set toolbar items for the page
*/
$bar =& JToolBar::getInstance('toolbar');
// Add a Link button for Control Panel
$bar->appendButton('Link', 'cpanel', JText::_('COM_JCKMAN_SUBMENU_CPANEL_NAME'), 'index.php?option=com_jckman&controller=cpanel');
JToolBarHelper::help('screen.installer');
$paths = new stdClass();
$paths->first = '';
$lookup = array(JHTML::_('select.option', 0, JText::_('All')));
$selections =& $this->get('ToolbarList');
$lists['selections'] = JHTML::_('select.genericlist', $selections, 'selections[]', 'class="inputbox" size="15" multiple="multiple" style=width:182px;', 'value', 'text', $lookup, 'selections');
$this->assignRef('paths', $paths);
$this->assignRef('state', $this->get('state'));
$this->assignRef('lists', $lists);
parent::display($tpl);
}
示例11: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$state = $this->get('State');
$user = JFactory::getUser();
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
JToolbarHelper::title(JText::_('COM_WCATALOG_MANAGER_CATEGORIES'), 'categories.png');
JToolbarHelper::addNew('category.add');
JToolbarHelper::editList('category.edit');
JToolbarHelper::publish('categories.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('categories.unpublish', 'JTOOLBAR_UNPUBLISH', true);
//JToolbarHelper::archiveList('categories.archive');
//JToolbarHelper::checkin('categories.checkin');
JToolbarHelper::deleteList('', 'categories.delete', 'JTOOLBAR_DELETE');
//JToolbarHelper::preferences('com_wcatalog');
//JToolbarHelper::help('JHELP_COMPONENTS_WCATALOG_CATEGORIES');
JHtmlSidebar::setAction('index.php?option=com_wcatalog&view=categories');
/*
JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_PUBLISHED'),
'filter_published',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)
);
JHtmlSidebar::addFilter(
JText::_('COM_WCATALOG_PARENT_CATEGORY'),
'filter_category_id',
JHtml::_('select.options', JHtml::_('category.options', 'com_wcatalog'), 'value', 'text', $this->state->get('filter.category_id'))
);
*/
}
示例12: addToolbar
protected function addToolbar()
{
require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'phocagallerycs.php';
$state = $this->get('State');
$canDo = PhocaGalleryCsHelper::getActions($state->get('filter.category_id'));
$user = JFactory::getUser();
$bar = JToolBar::getInstance('toolbar');
JToolBarHelper::title(JText::_('COM_PHOCAGALLERY_CATEGORIES'), 'folder');
if ($canDo->get('core.create')) {
JToolBarHelper::addNew('phocagalleryc.add', 'JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolBarHelper::editList('phocagalleryc.edit', 'JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolBarHelper::divider();
JToolBarHelper::custom('phocagallerycs.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true);
JToolBarHelper::custom('phocagallerycs.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true);
JToolBarHelper::custom('phocagallerycs.approve', 'approve.png', '', 'COM_PHOCAGALLERY_APPROVE', true);
JToolBarHelper::custom('phocagallerycs.disapprove', 'disapprove.png', '', 'COM_PHOCAGALLERY_NOT_APPROVE', true);
JToolBarHelper::custom('phocagallerycs.cooliris', 'cooliris.png', '', 'COM_PHOCAGALLERY_COOLIRIS', true);
}
if ($canDo->get('core.delete')) {
JToolBarHelper::deleteList(JText::_('COM_PHOCAGALLERY_WARNING_DELETE_ITEMS'), 'phocagallerycs.delete', 'COM_PHOCAGALLERY_DELETE');
}
// Add a batch button
if ($user->authorise('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');
}
JToolBarHelper::divider();
JToolBarHelper::help('screen.phocagallery', true);
}
示例13: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
require_once JPATH_COMPONENT . '/helpers/languages.php';
$canDo = LanguagesHelper::getActions();
JToolBarHelper::title(JText::_('COM_LANGUAGES_VIEW_LANGUAGES_TITLE'), 'langmanager.png');
if ($canDo->get('core.create')) {
JToolBarHelper::addNew('language.add');
}
if ($canDo->get('core.edit')) {
JToolBarHelper::editList('language.edit');
JToolBarHelper::divider();
}
if ($canDo->get('core.edit.state')) {
if ($this->state->get('filter.published') != 2) {
JToolBarHelper::publishList('languages.publish');
JToolBarHelper::unpublishList('languages.unpublish');
}
}
if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) {
JToolBarHelper::deleteList('', 'languages.delete', 'JTOOLBAR_EMPTY_TRASH');
JToolBarHelper::divider();
} elseif ($canDo->get('core.edit.state')) {
JToolBarHelper::trash('languages.trash');
JToolBarHelper::divider();
}
if ($canDo->get('core.admin')) {
// Add install languages link to the lang installer component
$bar = JToolBar::getInstance('toolbar');
$bar->appendButton('Link', 'extension', 'COM_LANGUAGES_INSTALL', 'index.php?option=com_installer&view=languages');
JToolBarHelper::divider();
JToolBarHelper::preferences('com_languages');
JToolBarHelper::divider();
}
JToolBarHelper::help('JHELP_EXTENSIONS_LANGUAGE_MANAGER_CONTENT');
}
示例14: addToolbar
/**
* Add the page title and toolbar.
*
* @return void
*
* @since 1.6
*/
protected function addToolbar()
{
$state = $this->get('State');
$canDo = JHelperContent::getActions('com_messages');
JToolbarHelper::title(JText::_('COM_MESSAGES_MANAGER_MESSAGES'), 'envelope inbox');
if ($canDo->get('core.create')) {
JToolbarHelper::addNew('message.add');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::publish('messages.publish', 'COM_MESSAGES_TOOLBAR_MARK_AS_READ', true);
JToolbarHelper::unpublish('messages.unpublish', 'COM_MESSAGES_TOOLBAR_MARK_AS_UNREAD', true);
}
JToolbarHelper::divider();
$bar = JToolBar::getInstance('toolbar');
// Instantiate a new JLayoutFile instance and render the layout
JHtml::_('behavior.modal', 'a.messagesSettings');
$layout = new JLayoutFile('toolbar.mysettings');
$bar->appendButton('Custom', $layout->render(array()), 'upload');
if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
JToolbarHelper::divider();
JToolbarHelper::deleteList('', 'messages.delete', 'JTOOLBAR_EMPTY_TRASH');
} elseif ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::trash('messages.trash');
}
if ($canDo->get('core.admin')) {
JToolbarHelper::preferences('com_messages');
}
JToolbarHelper::divider();
JToolbarHelper::help('JHELP_COMPONENTS_MESSAGING_INBOX');
}
示例15: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$state = $this->get('State');
$canDo = MessagesHelper::getActions();
JToolbarHelper::title(JText::_('COM_MESSAGES_MANAGER_MESSAGES'), 'inbox.png');
if ($canDo->get('core.create')) {
JToolbarHelper::addNew('message.add');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::publish('messages.publish', 'COM_MESSAGES_TOOLBAR_MARK_AS_READ');
JToolbarHelper::unpublish('messages.unpublish', 'COM_MESSAGES_TOOLBAR_MARK_AS_UNREAD');
}
if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
JToolbarHelper::divider();
JToolbarHelper::deleteList('', 'messages.delete', 'JTOOLBAR_EMPTY_TRASH');
} elseif ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::trash('messages.trash');
}
//JToolbarHelper::addNew('module.add');
JToolbarHelper::divider();
$bar = JToolBar::getInstance('toolbar');
JHtml::_('bootstrap.modal', 'collapseModal');
$title = JText::_('COM_MESSAGES_TOOLBAR_MY_SETTINGS');
$dhtml = "<a class=\"btn modal btn-small\" href=\"index.php?option=com_messages&view=config&tmpl=component\"\n\t\t\t\t\trel=\"{handler:'iframe', size:{x:700,y:300}}\">\n\t\t\t\t\t<i class=\"icon-cog\" title=\"{$title}\"></i>{$title}</a>";
$bar->appendButton('Custom', $dhtml, 'config');
if ($canDo->get('core.admin')) {
JToolbarHelper::preferences('com_messages');
}
JToolbarHelper::divider();
JToolbarHelper::help('JHELP_COMPONENTS_MESSAGING_INBOX');
}