本文整理汇总了PHP中JToolBarHelper类的典型用法代码示例。如果您正苦于以下问题:PHP JToolBarHelper类的具体用法?PHP JToolBarHelper怎么用?PHP JToolBarHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JToolBarHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _setToolbar
/**
* Setup the Toolbar.
*/
protected function _setToolbar()
{
$state = $this->get('State');
$canDo = TemplatesHelper::getActions();
$isSite = $state->get('filter.client_id') == 0;
if ($canDo->get('core.edit')) {
JToolBarHelper::editList('style.edit');
}
if ($canDo->get('core.edit.state')) {
JToolBarHelper::custom('styles.sethome', 'default.png', 'default_f2.png', 'Templates_Toolbar_Set_Home', true);
}
JToolBarHelper::title(JText::_('Templates_Manager_Styles'), 'thememanager');
if ($canDo->get('core.create') && $isSite) {
JToolBarHelper::addNew('styles.duplicate', 'Templates_Toolbar_Save_Copy');
}
if ($canDo->get('core.delete') && $isSite) {
JToolBarHelper::deleteList('', 'styles.delete');
}
if ($canDo->get('core.admin')) {
JToolBarHelper::divider();
JToolBarHelper::preferences('com_templates');
}
JToolBarHelper::divider();
JToolBarHelper::help('screen.templates');
}
示例2: addToolbar
/**
* Add the page title and toolbar.
*/
protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
$isNew = $this->item->id == 0;
if (isset($this->item->checked_out)) {
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
} else {
$checkedOut = false;
}
$canDo = SomosmaestrosHelper::getActions();
JToolBarHelper::title(JText::_('COM_SOMOSMAESTROS_TITLE_FORMACION'), 'formacion.png');
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) {
JToolBarHelper::apply('formacion.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('formacion.save', 'JTOOLBAR_SAVE');
}
if (!$checkedOut && $canDo->get('core.create')) {
JToolBarHelper::custom('formacion.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('formacion.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
if (empty($this->item->id)) {
JToolBarHelper::cancel('formacion.cancel', 'JTOOLBAR_CANCEL');
} else {
JToolBarHelper::cancel('formacion.cancel', 'JTOOLBAR_CLOSE');
}
}
示例3: display
function display($tpl = null)
{
JToolBarHelper::title(JText::_('COM_REDSOCIALSTREAM_CONFIGURE'), 'configure.png');
JToolBarHelper::apply();
JToolBarHelper::cancel('cancel', 'COM_REDSOCIALSTREAM_CLOSE');
//DEVNOTE: set document title
$document = JFactory::getDocument();
$document->setTitle(JText::_('COM_REDSOCIALSTREAM_REDSOCIALSTREAMS'));
$mainframe = JFactory::getApplication();
$context = "config";
$model = $this->getModel('configure');
$db = JFactory::getDbo();
$q = "SELECT * FROM #__redsocialstream_settings";
$db->setQuery($q);
$this->settingsrows = $db->loadObjectList();
$typelist = $this->get('type_list_sorted');
$pagination = $this->get('Pagination');
//DEVNOTE:give me ordering from request
$filter_order = $mainframe->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'ordering');
$filter_order_Dir = $mainframe->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', '');
$this->assignRef('lists', $lists);
$this->assignRef("typelist", $typelist);
$this->assignRef('pagination', $pagination);
parent::display($tpl);
}
示例4: addToolbar
/**
* Add the page title and toolbar.
*/
protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
$isNew = $this->item->id == 0;
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
$canDo = SibdietHelper::getActions();
JToolBarHelper::title(JText::_('COM_SIBDIET_MANAGER_ERRAND'), 'database errands');
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) {
JToolBarHelper::apply('errand.apply');
JToolBarHelper::save('errand.save');
}
if (!$checkedOut && $canDo->get('core.create')) {
JToolbarHelper::save2new('errand.save2new');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolbarHelper::save2copy('errand.save2copy');
}
if (empty($this->item->id)) {
JToolBarHelper::cancel('errand.cancel');
} else {
JToolBarHelper::cancel('errand.cancel', 'JTOOLBAR_CLOSE');
}
}
示例5: _setToolBar
/**
* Установки тулбара
*/
protected function _setToolBar()
{
require_once JPATH_COMPONENT . '/helpers/smfaq.php';
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
SmFaqHelper::addSubmenu($this->_name);
$canDo = SmFaqHelper::getActions($this->state->get('filter.category_id'));
// Выводим нужные кнопки и заголовок
JToolBarHelper::title(JText::_('COM_SMFAQ_MANAGER_QUESTIONS'), 'smfaq');
if ($canDo->get('core.create')) {
JToolBarHelper::addNewX('smfaq.add', 'JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolBarHelper::editListX('smfaq.edit', 'JTOOLBAR_EDIT');
}
JToolBarHelper::divider();
JToolBarHelper::custom('smfaqlist.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true);
JToolBarHelper::custom('smfaqlist.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true);
JToolBarHelper::divider();
JToolBarHelper::checkin('smfaqlist.checkin');
// Замена тулбара карзины на удаление
if ($this->state->get('filter.published') == -2) {
JToolBarHelper::deleteList('COM_SMFAQ_YOU_WANT_DELETE_THIS', 'smfaqlist.delete', 'JTOOLBAR_EMPTY_TRASH');
} else {
JToolBarHelper::trash('smfaqlist.trash', 'JTOOLBAR_TRASH');
}
JToolBarHelper::divider();
if ($canDo->get('core.admin')) {
JToolBarHelper::preferences('com_smfaq');
}
}
示例6: addToolbar
/**
* Add the page title and toolbar.
*
*
*/
protected function addToolbar()
{
require_once JPATH_COMPONENT . '/helpers/jdownloadshelper.php';
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 = JDownloadsHelper::getActions();
$document = JFactory::getDocument();
$document->addStyleSheet('components/com_jdownloads/assets/css/style.css');
$title = $isNew ? JText::_('COM_JDOWNLOADS_LICEDIT_ADD') : JText::_('COM_JDOWNLOADS_LICEDIT_EDIT');
JToolBarHelper::title(JText::_('COM_JDOWNLOADS') . ': ' . $title, 'jdlicenses');
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) {
JToolBarHelper::apply('license.apply');
JToolBarHelper::save('license.save');
}
if (!$checkedOut && $canDo->get('core.create')) {
JToolBarHelper::save2new('license.save2new');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolBarHelper::save2copy('license.save2copy');
}
if (empty($this->item->id)) {
JToolBarHelper::cancel('license.cancel');
} else {
JToolBarHelper::cancel('license.cancel', 'JTOOLBAR_CLOSE');
}
JToolBarHelper::divider();
JToolBarHelper::help('help.license', true);
}
示例7: addToolBar
/**
* Setting the toolbar
*/
protected function addToolBar()
{
JToolBarHelper::title(JText::_('COM_BOOKINGFORCONNECTOR_ADMINISTRATION_TITLE'), 'BookingFor Connector');
// JToolBarHelper::title('BookingFor Connector');
//JToolBarHelper::addNew('helloworld.add');
JToolBarHelper::preferences('com_bookingforconnector');
}
示例8: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'jms.php';
$state = $this->get('State');
$canDo = JmsHelper::getActions($state->get('filter.category_id'));
JToolBarHelper::title(JText::_('COM_JMS_TITLE_COUPONS'), 'coupon.png');
//Check if the form exists before showing the add/edit buttons
$formPath = JPATH_COMPONENT_ADMINISTRATOR . DS . 'views' . DS . 'coupon';
if (file_exists($formPath)) {
if ($canDo->get('core.create')) {
JToolBarHelper::addNew('coupon.add', 'JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolBarHelper::editList('coupon.edit', 'JTOOLBAR_EDIT');
}
}
if ($canDo->get('core.admin')) {
JToolBarHelper::divider();
JToolBarHelper::custom('coupons.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true);
JToolBarHelper::custom('coupons.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.admin')) {
JToolBarHelper::archiveList('coupons.archive', 'JTOOLBAR_ARCHIVE');
}
if ($canDo->get('core.delete')) {
JToolBarHelper::divider();
JToolBarHelper::deleteList('', 'coupons.delete', 'JTOOLBAR_DELETE');
}
if ($canDo->get('core.admin')) {
JToolBarHelper::divider();
JToolBarHelper::preferences('com_jms');
}
}
示例9: display
function display($tpl = null)
{
$entry = $this->get('Data');
$characters_length = $this->get('CharactersLength');
$robots_array = array('', 'index, follow', 'noindex, follow', 'index, nofollow', 'noindex, nofollow');
if (empty($entry->id)) {
JToolBarHelper::title(JText::_('COM_EASYFRONTENDSEO') . ' - ' . JText::_('COM_EASYFRONTENDSEO_NEWENTRY'), 'easyfrontendseo-add');
JToolBarHelper::save('save');
JToolBarHelper::cancel('cancel');
} else {
JToolBarHelper::title(JText::_('COM_EASYFRONTENDSEO') . ' - ' . JText::_('COM_EASYFRONTENDSEO_EDITENTRY'), 'easyfrontendseo-edit');
JToolbarHelper::apply('apply');
JToolBarHelper::save('save');
JToolBarHelper::cancel('cancel', 'Close');
}
JHTML::_('behavior.framework');
$document = JFactory::getDocument();
$document->addStyleSheet('components/com_easyfrontendseo/css/easyfrontendseo.css');
$document->addScript('components/com_easyfrontendseo/js/wordcount.js', 'text/javascript');
$output = "window.addEvent('domready', function(){";
$output .= "new WordCount('counter_title', {inputName:'title', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'}); new WordCount('counter_title', {inputName:'title', eventTrigger: 'click', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'});\n";
$output .= "new WordCount('counter_description', {inputName:'description', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'}); new WordCount('counter_description', {inputName:'description', eventTrigger: 'click', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'});\n";
$output .= "new WordCount('counter_keywords', {inputName:'keywords', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'}); new WordCount('counter_keywords', {inputName:'keywords', eventTrigger: 'click', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'});\n";
$output .= "new WordCount('counter_generator', {inputName:'generator', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'}); new WordCount('counter_generator', {inputName:'generator', eventTrigger: 'click', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'});\n";
$output .= " });";
$document->addScriptDeclaration($output, 'text/javascript');
$this->entry = $entry;
$this->characters_length = $characters_length;
$this->robots_array = $robots_array;
// Get donation code message
require_once JPATH_COMPONENT . '/helpers/easyfrontendseo.php';
$donation_code_message = EasyFrontendSeoHelper::getDonationCodeMessage();
$this->donation_code_message = $donation_code_message;
parent::display($tpl);
}
示例10: 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');
}
示例11: 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;
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
// Built the actions for new and existing records.
$canDo = JHelperContent::getActions('com_testyourself');
JToolBarHelper::title(JText::_('COM_TESTYOURSELF_MANAGER_QUESTION'), 'question questions');
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) {
JToolBarHelper::apply('question.apply');
JToolBarHelper::save('question.save');
}
if (!$checkedOut && $canDo->get('core.create')) {
JToolbarHelper::save2new('question.save2new');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolbarHelper::save2copy('question.save2copy');
}
if (empty($this->item->id)) {
JToolBarHelper::cancel('question.cancel');
} else {
JToolBarHelper::cancel('question.cancel', 'JTOOLBAR_CLOSE');
}
}
示例12: addToolbar
/**
* Add the page title and toolbar.
*/
protected function addToolbar()
{
$canDo = JfoobarsHelper::getActions($this->state->get('filter.category_id'));
$user = JFactory::getUser();
JToolBarHelper::title(JText::_('COM_JFOOBARS_JFOOBARS_TITLE'), 'jfoobar.png');
if ($canDo->get('core.create') || count($user->getAuthorisedCategories('com_jfoobars', 'core.create')) > 0) {
JToolBarHelper::addNew('jfoobar.add');
}
if ($canDo->get('core.edit') || $canDo->get('core.edit.own')) {
JToolBarHelper::editList('jfoobar.edit');
}
if ($canDo->get('core.edit.state')) {
JToolBarHelper::divider();
JToolBarHelper::publish('jfoobars.publish', 'JTOOLBAR_PUBLISH', true);
JToolBarHelper::unpublish('jfoobars.unpublish', 'JTOOLBAR_UNPUBLISH', true);
JToolBarHelper::divider();
JToolBarHelper::checkin('jfoobars.checkin');
}
if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) {
JToolBarHelper::deleteList('', 'jfoobars.delete', 'JTOOLBAR_EMPTY_TRASH');
JToolBarHelper::divider();
} else {
if ($canDo->get('core.edit.state')) {
JToolBarHelper::trash('jfoobars.trash');
JToolBarHelper::divider();
}
}
if ($canDo->get('core.admin')) {
JToolBarHelper::preferences('com_jfoobars');
JToolBarHelper::divider();
}
}
示例13: display
function display ($tpl = null) {
// Load the helper(s)
jimport('joomla.filesystem.file');
$config = JFactory::getConfig();
$log_path = $config->get('log_path', VMPATH_ROOT . "/log");
$layoutName = vRequest::getCmd('layout', 'default');
VmConfig::loadJLang('com_virtuemart_log');
if ($layoutName == 'edit') {
$logFile = vRequest::getString('logfile', '');
$this->SetViewTitle('LOG', $logFile);
$fileContent = file_get_contents($log_path . DS . $logFile);
$fileContentByLine = explode("\n", $fileContent);
$this->assignRef('fileContentByLine', $fileContentByLine);
JToolBarHelper::cancel();
} else {
if(!class_exists('JFolder')) require(VMPATH_LIBS.DS.'joomla'.DS.'filesystem'.DS.'folder.php');
$logFiles = JFolder::files($log_path, $filter = '.', true, false, array('index.html'));
$this->SetViewTitle('LOG');
$this->assignRef('logFiles', $logFiles);
$this->assignRef('path', $log_path);
}
parent::display($tpl);
}
示例14: addToolBar
/**
* Add toolbar for this view
*/
protected function addToolBar()
{
JSNFactory::localimport('helpers.html.jsntoolbar');
JToolbarHelper::title(JText::_('JSN_RAW_LAYOUT_MANAGER_TITLE'), 'poweradmin-rawmode');
JSNToolBarHelper::switchmode('poweradmin-rawmode-help', JText::_('JSN_RAWMODE_HELP_CONTENT_TEXT', true), JText::_('JSN_RAWMODE_HELP_CONTENT_TITLE_SHOW', true), JText::_('JSN_RAWMODE_HELP_CONTENT_TITLE_HIDE', true));
JToolBarHelper::spacer(5);
}
示例15: display
function display($tpl = null)
{
$mainframe = JFactory::getApplication();
$user = JFactory::getUser();
$option = JRequest::getCmd('option');
$view = JRequest::getCmd('view');
$limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
$limitstart = $mainframe->getUserStateFromRequest($option . $view . '.limitstart', 'limitstart', 0, 'int');
$filter_order = $mainframe->getUserStateFromRequest($option . $view . 'filter_order', 'filter_order', '', 'cmd');
$filter_order_Dir = $mainframe->getUserStateFromRequest($option . $view . 'filter_order_Dir', 'filter_order_Dir', '', 'word');
$model = $this->getModel();
$total = $model->getTotalGroups();
if ($limitstart > $total - $limit) {
$limitstart = max(0, (int) (ceil($total / $limit) - 1) * $limit);
JRequest::setVar('limitstart', $limitstart);
}
$extraFieldGroups = $model->getGroups();
$this->assignRef('rows', $extraFieldGroups);
jimport('joomla.html.pagination');
$pageNav = new JPagination($total, $limitstart, $limit);
$this->assignRef('page', $pageNav);
JToolBarHelper::title(JText::_('K2_EXTRA_FIELD_GROUPS'), 'k2.png');
JToolBarHelper::deleteList('', 'remove', 'K2_DELETE');
JToolBarHelper::editList();
JToolBarHelper::addNew();
if (K2_JVERSION != '15') {
JToolBarHelper::preferences('com_k2', 550, 875, 'K2_PARAMETERS');
} else {
$toolbar = JToolBar::getInstance('toolbar');
$toolbar->appendButton('Popup', 'config', 'Parameters', 'index.php?option=com_k2&view=settings');
}
$this->loadHelper('html');
K2HelperHTML::subMenu();
parent::display($tpl);
}