protected function addToolBar() { JToolbarHelper::title(JText::_("COM_DOWNFILES_MANAGER_NEW")); JToolbarHelper::save('item.save'); JToolBarHelper::cancel('item.cancel'); //JToolbarHelper::preferences('com_downfiles',550, 875, 'COM_DOWNFILES_PARAMETERS'); }
/** * Add the page title and toolbar. * */ protected function addToolbar() { $isNew = $this->item->id == 0; $canDo = SnippetsHelper::getActions(); JHtml::stylesheet('nnframework/style.min.css', false, true); JHtml::stylesheet('snippets/style.min.css', false, true); JFactory::getApplication()->input->set('hidemainmenu', true); // Set document title JFactory::getDocument()->setTitle(JText::_('SNIPPETS') . ': ' . JText::_('NN_ITEM')); // Set ToolBar title JToolbarHelper::title(JText::_('SNIPPETS') . ': ' . JText::_('NN_ITEM'), 'snippets icon-nonumber'); // If not checked out, can save the item. if ($canDo->get('core.edit')) { JToolbarHelper::apply('item.apply'); JToolbarHelper::save('item.save'); } if ($canDo->get('core.edit') && $canDo->get('core.create')) { JToolbarHelper::save2new('item.save2new'); } if (!$isNew && $canDo->get('core.create')) { JToolbarHelper::save2copy('item.save2copy'); } if (empty($this->item->id)) { JToolbarHelper::cancel('item.cancel'); } else { JToolbarHelper::cancel('item.cancel', 'JTOOLBAR_CLOSE'); } }
/** * 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')); // Since we don't track these assets at the item level, use the category id. $canDo = JHelperContent::getActions('com_newsfeeds', 'category', $this->item->catid); JToolbarHelper::title(JText::_('COM_NEWSFEEDS_MANAGER_NEWSFEED'), 'feed newsfeeds'); // If not checked out, can save the item. if (!$checkedOut && ($canDo->get('core.edit') || count($user->getAuthorisedCategories('com_newsfeeds', 'core.create')) > 0)) { JToolbarHelper::apply('newsfeed.apply'); JToolbarHelper::save('newsfeed.save'); } if (!$checkedOut && count($user->getAuthorisedCategories('com_newsfeeds', 'core.create')) > 0) { JToolbarHelper::save2new('newsfeed.save2new'); } // If an existing item, can save to a copy. if (!$isNew && $canDo->get('core.create')) { JToolbarHelper::save2copy('newsfeed.save2copy'); } if (empty($this->item->id)) { JToolbarHelper::cancel('newsfeed.cancel'); } else { if ($this->state->params->get('save_history', 0) && $user->authorise('core.edit')) { JToolbarHelper::versions('com_newsfeeds.newsfeed', $this->item->id); } JToolbarHelper::cancel('newsfeed.cancel', 'JTOOLBAR_CLOSE'); } JToolbarHelper::divider(); JToolbarHelper::help('JHELP_COMPONENTS_NEWSFEEDS_FEEDS_EDIT'); }
/** * Setting the toolbar */ public function addToolbar() { $input = JFactory::getApplication()->input; $input->set('hidemainmenu', true); $user = JFactory::getUser(); $userId = $user->id; $isNew = $this->item->id == 0; JToolbarHelper::title($isNew ? JText::_('COM_HELLOWORLD_MANAGER_HELLOWORLD_NEW') : JText::_('COM_HELLOWORLD_MANAGER_HELLOWORLD_EDIT')); if ($isNew) { if ($this->canDo->get('core.create')) { JToolBarHelper::apply('helloworld.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('helloworld.save', 'JTOOLBAR_SAVE'); JToolBarHelper::custom('helloworld.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); } JToolBarHelper::cancel('helloworld.cancel', 'JTOOLBAR_CANCEL'); JToolbarHelper::save('helloworld.save'); JToolbarHelper::cancel('helloworld.cancel', $isNew ? 'JTOOLBAR_CANCEL' : 'JTOOLBAR_CLOSE'); } else { if ($this->canDo->get('core.edit')) { // We can save the new record JToolBarHelper::apply('helloworld.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('helloworld.save', 'JTOOLBAR_SAVE'); // We can save this record, but check the create permission to see // if we can return to make a new one. if ($this->canDo->get('core.create')) { JToolBarHelper::custom('helloworld.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); } } if ($this->canDo->get('core.create')) { JToolBarHelper::custom('helloworld.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); } JToolBarHelper::cancel('helloworld.cancel', 'JTOOLBAR_CLOSE'); } }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { JFactory::getApplication()->input->set('hidemainmenu', true); $user = JFactory::getUser(); $canDo = PluginsHelper::getActions(); JToolbarHelper::title(JText::sprintf('COM_PLUGINS_MANAGER_PLUGIN', JText::_($this->item->name)), 'plugin'); // If not checked out, can save the item. if ($canDo->get('core.edit')) { JToolbarHelper::apply('plugin.apply'); JToolbarHelper::save('plugin.save'); } JToolbarHelper::cancel('plugin.cancel', 'JTOOLBAR_CLOSE'); JToolbarHelper::divider(); // Get the help information for the plugin item. $lang = JFactory::getLanguage(); $help = $this->get('Help'); if ($lang->hasKey($help->url)) { $debug = $lang->setDebug(false); $url = JText::_($help->url); $lang->setDebug($debug); } else { $url = null; } JToolbarHelper::help($help->key, false, $url); }
/** * Add the page title and toolbar. * * @return void * * @since 1.0.0 */ 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 = CMDonationHelper::getActions(); JToolbarHelper::title(JText::_('COM_CMDONATION_MANAGER_DONATIONS'), 'donation icon-heart-2'); // If not checked out, can save the item. if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) { JToolbarHelper::apply('donation.apply'); JToolbarHelper::save('donation.save'); } if (!$checkedOut && $canDo->get('core.create')) { JToolbarHelper::save2new('donation.save2new'); } // If an existing item, can save to a copy. if (!$isNew && $canDo->get('core.create')) { JToolbarHelper::save2copy('donation.save2copy'); } if (empty($this->item->id)) { JToolbarHelper::cancel('donation.cancel'); } else { JToolbarHelper::cancel('donation.cancel', 'JTOOLBAR_CLOSE'); } }
function display($tpl = null) { $db = JFactory::getDBO(); $query = "SELECT id FROM #__plugins WHERE element =".$db->quote(JRequest::getVar('plugin')); $db->setQuery($query); $id = $db->loadResult(); $row =& JTable::getInstance('plugin'); $row->load($id); $plugin = & JPluginHelper::getPlugin($row->folder, $row->element); if(is_object($plugin)){ $lang =& JFactory::getLanguage(); $lang->load( 'plg_' . trim( $row->folder ) . '_' . trim( $row->element ), JPATH_ADMINISTRATOR ); $doc =& JFactory::getDocument(); $doc->addStyleSheet( JURI::base().'/components/com_myapi/assets/styles.css' ); JToolBarHelper::title(JText::_(strtoupper($row->element).'_HEADER'), 'facebook.png'); $paramsdata = $plugin->params; $paramsdefs = JPATH_SITE.DS.'plugins'.DS.$row->folder.DS.$row->element.'.xml'; $params = new JParameter( $paramsdata, $paramsdefs ); $this->assignRef('params',$params); $this->assignRef('plugin',$row); $this->assignRef('description',JText::_(strtoupper($row->element).'_DESC')); JToolbarHelper::save('savePlugin',JText::_('SAVE')); $funcname = '_'.$row->element; if(method_exists('MyapiViewPlugin','_'.$row->element)) $this->$funcname(); }else{ global $mainframe; $mainframe->redirect('index.php?option=com_plugins&view=plugin&task=edit&cid='.$id,JText::_('ENABLE_PLUGIN')); } parent::display($tpl); }
protected function addToolbar() { JFactory::getApplication()->input->set('hidemainmenu', true); $user = JFactory::getUser(); $userId = $user->get('id'); $isNew = $this->item->id == 0; $canDo = ReservaHelper::getActions($this->item->catid, 0); JToolbarHelper::title(JText::_('COM_RESEVA_MANAGER_EVENTO'), ''); if ($canDo->get('core.edit') || count($user->getAuthorisedCategories('com_reserva', 'core.create'))) { JToolbarHelper::apply('evento.apply'); JToolbarHelper::save('evento.save'); } if (count($user->getAuthorisedCategories('com_reserva', 'core.create'))) { JToolbarHelper::save2new('evento.save2new'); } // If an existing item, can save to a copy. if (!$isNew && count($user->getAuthorisedCategories('com_reserva', 'core.create')) > 0) { JToolbarHelper::save2copy('evento.save2copy'); } if (empty($this->item->id)) { JToolbarHelper::cancel('evento.cancel'); } else { JToolbarHelper::cancel('evento.cancel', 'JTOOLBAR_CLOSE'); } }
/** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function addToolbar() { JFactory::getApplication()->input->set('hidemainmenu', true); $isNew = $this->item->id == 0; $canDo = $this->canDo; JToolbarHelper::title($isNew ? JText::_('COM_TEMPLATES_MANAGER_ADD_STYLE') : JText::_('COM_TEMPLATES_MANAGER_EDIT_STYLE'), 'eye thememanager'); // If not checked out, can save the item. if ($canDo->get('core.edit')) { JToolbarHelper::apply('style.apply'); JToolbarHelper::save('style.save'); } // If an existing item, can save to a copy. if (!$isNew && $canDo->get('core.create')) { JToolbarHelper::save2copy('style.save2copy'); } if (empty($this->item->id)) { JToolbarHelper::cancel('style.cancel'); } else { JToolbarHelper::cancel('style.cancel', 'JTOOLBAR_CLOSE'); } JToolbarHelper::divider(); // Get the help information for the template item. $lang = JFactory::getLanguage(); $help = $this->get('Help'); if ($lang->hasKey($help->url)) { $debug = $lang->setDebug(false); $url = JText::_($help->url); $lang->setDebug($debug); } else { $url = null; } JToolbarHelper::help($help->key, false, $url); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { JToolbarHelper::apply('tour.apply'); JToolbarHelper::save('tour.save'); JToolbarHelper::cancel('tour.cancel'); JToolbarHelper::divider(); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { $input = JFactory::getApplication()->input; $input->set('hidemainmenu', true); $isNew = $this->item->id == 0; $canDo = MenusHelper::getActions($this->state->get('filter.parent_id')); JToolbarHelper::title(JText::_($isNew ? 'COM_MENUS_VIEW_NEW_MENU_TITLE' : 'COM_MENUS_VIEW_EDIT_MENU_TITLE'), 'list menu'); // If a new item, can save the item. Allow users with edit permissions to apply changes to prevent returning to grid. if ($isNew && $canDo->get('core.create')) { if ($canDo->get('core.edit')) { JToolbarHelper::apply('menu.apply'); } JToolbarHelper::save('menu.save'); } // If user can edit, can save the item. if (!$isNew && $canDo->get('core.edit')) { JToolbarHelper::apply('menu.apply'); JToolbarHelper::save('menu.save'); } // If the user can create new items, allow them to see Save & New if ($canDo->get('core.create')) { JToolbarHelper::save2new('menu.save2new'); } if ($isNew) { JToolbarHelper::cancel('menu.cancel'); } else { JToolbarHelper::cancel('menu.cancel', 'JTOOLBAR_CLOSE'); } JToolbarHelper::divider(); JToolbarHelper::help('JHELP_MENUS_MENU_MANAGER_EDIT'); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { JFactory::getApplication()->input->set('hidemainmenu', true); $user = JFactory::getUser(); $userId = $user->get('id'); $isNew = $this->item->id == 0; $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId); // Since we don't track these assets at the item level, use the category id. $canDo = BannersHelper::getActions($this->item->catid, 0); JToolbarHelper::title($isNew ? JText::_('COM_BANNERS_MANAGER_BANNER_NEW') : JText::_('COM_BANNERS_MANAGER_BANNER_EDIT'), 'banners.png'); // If not checked out, can save the item. if (!$checkedOut && ($canDo->get('core.edit') || count($user->getAuthorisedCategories('com_banners', 'core.create')) > 0)) { JToolbarHelper::apply('banner.apply'); JToolbarHelper::save('banner.save'); if ($canDo->get('core.create')) { JToolbarHelper::save2new('banner.save2new'); } } // If an existing item, can save to a copy. if (!$isNew && $canDo->get('core.create')) { JToolbarHelper::save2copy('banner.save2copy'); } if (empty($this->item->id)) { JToolbarHelper::cancel('banner.cancel'); } else { JToolbarHelper::cancel('banner.cancel', 'JTOOLBAR_CLOSE'); } JToolbarHelper::divider(); JToolbarHelper::help('JHELP_COMPONENTS_BANNERS_BANNERS_EDIT'); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { JFactory::getApplication()->input->set('hidemainmenu', true); $isNew = $this->item->id == 0; $canDo = JHelperContent::getActions('com_users'); JToolbarHelper::title(JText::_($isNew ? 'COM_USERS_VIEW_NEW_LEVEL_TITLE' : 'COM_USERS_VIEW_EDIT_LEVEL_TITLE'), 'users 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'); }
/** * Add the page title and toolbar. * * @return void. * * @since 1.6 */ protected function addToolbar() { JFactory::getApplication()->input->set('hidemainmenu', true); $isNew = $this->item->id == 0; $canDo = JHelperContent::getActions('com_redirect'); JToolbarHelper::title($isNew ? JText::_('COM_REDIRECT_MANAGER_LINK_NEW') : JText::_('COM_REDIRECT_MANAGER_LINK_EDIT'), 'refresh redirect'); // If not checked out, can save the item. if ($canDo->get('core.edit')) { JToolbarHelper::apply('link.apply'); JToolbarHelper::save('link.save'); } /** * This component does not support Save as Copy due to uniqueness checks. * While it can be done, it causes too much confusion if the user does * not change the Old URL. */ if ($canDo->get('core.edit') && $canDo->get('core.create')) { JToolbarHelper::save2new('link.save2new'); } if (empty($this->item->id)) { JToolbarHelper::cancel('link.cancel'); } else { JToolbarHelper::cancel('link.cancel', 'JTOOLBAR_CLOSE'); } JToolbarHelper::help('JHELP_COMPONENTS_REDIRECT_MANAGER_EDIT'); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { require_once JPATH_COMPONENT . '/helpers/languages.php'; JFactory::getApplication()->input->set('hidemainmenu', 1); $isNew = empty($this->item->lang_id); $canDo = $this->canDo; JToolbarHelper::title(JText::_($isNew ? 'COM_LANGUAGES_VIEW_LANGUAGE_EDIT_NEW_TITLE' : 'COM_LANGUAGES_VIEW_LANGUAGE_EDIT_EDIT_TITLE'), 'comments-2 langmanager'); // If a new item, can save. if ($isNew && $canDo->get('core.create')) { JToolbarHelper::save('language.save'); } //If an existing item, allow to Apply and Save. if (!$isNew && $canDo->get('core.edit')) { JToolbarHelper::apply('language.apply'); JToolbarHelper::save('language.save'); } // If an existing item, can save to a copy only if we have create rights. if ($canDo->get('core.create')) { JToolbarHelper::save2new('language.save2new'); } if ($isNew) { JToolbarHelper::cancel('language.cancel'); } else { JToolbarHelper::cancel('language.cancel', 'JTOOLBAR_CLOSE'); } JToolbarHelper::divider(); JToolbarHelper::help('JHELP_EXTENSIONS_LANGUAGE_MANAGER_EDIT'); $this->sidebar = JHtmlSidebar::render(); }
protected function addToolbar($layout = null) { switch ($layout) { case 'export': JToolbarHelper::title(JText::_('COM_PRP') . ': ' . JText::_('COM_PRP_VIEW_EXPORT_TABLE_EXPORT')); JToolbarHelper::back('JTOOLBAR_BACK', JRoute::_('index.php?option=com_prp&view=exports'), false); JToolbarHelper::custom('export.xlsx', 'xlsx', 'xlsx', '', false); JToolbarHelper::custom('export.xls', 'xls', 'xls', '', false); JFactory::getDocument()->addStyleDeclaration( PRPHelperExport::getStyleDeclaration('xls') . "\n\n" . PRPHelperExport::getStyleDeclaration('xlsx') ); JFactory::getDocument()->addStyleSheet(JUri::root().'/media/com_prp/css/export.css'); break; default: JFactory::getApplication()->input->set('hidemainmenu', true); $isNew = ($this->item->id == 0); $title_sufix = ($isNew)?'_NEW':'_EDIT'; JToolbarHelper::title(JText::_('COM_PRP') . ': ' . JText::_('COM_PRP_VIEW_EXPORT'.$title_sufix)); JToolbarHelper::save('export.save'); JToolbarHelper::save2new('export.save2new'); if ($isNew) { JToolbarHelper::cancel('export.cancel'); } else { JToolbarHelper::cancel('export.cancel', 'JTOOLBAR_CLOSE'); } break; } }
/** * 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'); }
/** * Add the page title and toolbar. * * @return void * * @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')); $canDo = $this->canDo; JToolbarHelper::title($isNew ? JText::_('COM_BANNERS_MANAGER_CLIENT_NEW') : JText::_('COM_BANNERS_MANAGER_CLIENT_EDIT'), 'bookmark banners-clients'); // If not checked out, can save the item. if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) { JToolbarHelper::apply('client.apply'); JToolbarHelper::save('client.save'); } if (!$checkedOut && $canDo->get('core.create')) { JToolbarHelper::save2new('client.save2new'); } // If an existing item, can save to a copy. if (!$isNew && $canDo->get('core.create')) { JToolbarHelper::save2copy('client.save2copy'); } if (empty($this->item->id)) { JToolbarHelper::cancel('client.cancel'); } else { if ($this->state->params->get('save_history', 0) && $user->authorise('core.edit')) { JToolbarHelper::versions('com_banners.client', $this->item->id); } JToolbarHelper::cancel('client.cancel', 'JTOOLBAR_CLOSE'); } JToolbarHelper::divider(); JToolbarHelper::help('JHELP_COMPONENTS_BANNERS_CLIENTS_EDIT'); }
/** * Add the page title and toolbar. * */ protected function addToolbar() { if (version_compare(JVERSION, '3.0', 'lt')) { JRequest::setVar('hidemainmenu', true); } else { JFactory::getApplication()->input->set('hidemainmenu', true); } $user = JFactory::getUser(); $user_id = $user->get('id'); $is_new = $this->item->id == 0; $checkedOut = !($this->item->checked_out == 0 or $this->item->checked_out == $user_id); JToolbarHelper::title($is_new ? JText::_('COM_COMPONENTARCHITECT_COMPONENTOBJECTS_NEW_HEADER') : JText::_('COM_COMPONENTARCHITECT_COMPONENTOBJECTS_EDIT_HEADER'), 'componentobjects.png'); JToolbarHelper::apply('componentobject.apply', 'JTOOLBAR_APPLY'); JToolbarHelper::save('componentobject.save', 'JTOOLBAR_SAVE'); JToolbarHelper::custom('componentobject.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); // If an existing item, can save to a copy. if (!$is_new) { JToolbarHelper::custom('componentobject.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); } if ($is_new) { JToolbarHelper::cancel('componentobject.cancel', 'JTOOLBAR_CANCEL'); } else { JToolbarHelper::cancel('componentobject.cancel', 'JTOOLBAR_CLOSE'); } JToolbarHelper::divider(); $params = $this->state->get('params'); JToolbarHelper::help('JHELP_COMPONENTS_COMPONENTARCHITECT_COMPONENTOBJECT_EDIT', true, null, 'com_componentarchitect'); }
/** * 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 = !true; // Since we don't track these assets at the item level, use the category id. JToolbarHelper::title(JText::_('COM_HTRAININGLOGS_MANAGER_H_TR_SESSION'), 'link h_tr_sessions'); // If not checked out, can save the item. if (!$checkedOut || count($user->getAuthorisedCategories('com_htraininglogs', 'core.create'))) { JToolbarHelper::apply('h_tr_session.apply'); JToolbarHelper::save('h_tr_session.save'); } if (!$checkedOut && count($user->getAuthorisedCategories('com_htraininglogs', 'core.create'))) { JToolbarHelper::save2new('h_tr_session.save2new'); } // If an existing item, can save to a copy. if (!$isNew && count($user->getAuthorisedCategories('com_htraininglogs', 'core.create')) > 0) { JToolbarHelper::save2copy('h_tr_session.save2copy'); } if (empty($this->item->id)) { JToolbarHelper::cancel('h_tr_session.cancel'); } else { if ($this->state->params->get('save_history', 0) && $user->authorise('core.edit')) { JToolbarHelper::versions('com_htraininglogs.h_tr_session', $this->item->id); } JToolbarHelper::cancel('h_tr_session.cancel', 'JTOOLBAR_CLOSE'); } JToolbarHelper::divider(); JToolbarHelper::help('JHELP_COMPONENTS_H_tr_sessionS_LINKS_EDIT'); }
function display($tpl = null) { $db = JFactory::getDBO(); $query = "SELECT id FROM #__plugins WHERE element =".$db->quote('myApiComment'); $db->setQuery($query); $id = $db->loadResult(); $row =& JTable::getInstance('plugin'); $row->load($id); $plugin = & JPluginHelper::getPlugin('content', 'myApiComment'); if(is_object($plugin)){ $paramsdata = $plugin->params; $paramsdefs = JPATH_SITE.DS.'plugins'.DS.'content'.DS.'myApiComment.xml'; $params = new JParameter( $paramsdata, $paramsdefs ); $this->assignRef('params',$params); $this->assignRef('plugin',$row); JToolbarHelper::save('savePlugin','save content'); JToolbarHelper::preferences('com_myapi'); }else{ global $mainframe; $mainframe->redirect('index.php?option=com_plugins&view=plugin&task=edit&cid='.$id,'The myApiComment plugin needs to be ENABLED before you can configure it.'); } parent::display($tpl); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { JFactory::getApplication()->input->set('hidemainmenu', true); $user = JFactory::getUser(); $userId = $user->get('id'); $isNew = $this->item->id == 0; //$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id')); // Since we don't track these assets at the item level, use the category id. //$canDo = WcatalogHelper::getActions($this->item->catid, 0); JToolbarHelper::title(JText::_('COM_WCATALOG_MANAGER_CATEGORY'), 'categories.png'); // If not checked out, can save the item. //if (!$checkedOut && ($canDo->get('core.edit') || count($user->getAuthorisedCategories('com_wcatalog', 'core.create')) > 0)) //{ JToolbarHelper::apply('category.apply'); JToolbarHelper::save('category.save'); //} //if (!$checkedOut && count($user->getAuthorisedCategories('com_wcatalog', 'core.create')) > 0){ JToolbarHelper::save2new('category.save2new'); //} // If an existing item, can save to a copy. //if (!$isNew && $canDo->get('core.create')) //{ JToolbarHelper::save2copy('category.save2copy'); //} if (empty($this->item->id)) { JToolbarHelper::cancel('category.cancel'); } else { JToolbarHelper::cancel('category.cancel', 'JTOOLBAR_CLOSE'); } JToolbarHelper::divider(); JToolbarHelper::help('JHELP_COMPONENTS_WCATALOG_CATEGORIES_EDIT'); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { JFactory::getApplication()->input->set('hidemainmenu', true); JToolbarHelper::title(JText::_('Gestion des bénévoles : Editer un calendrier')); JToolbarHelper::apply('calendar.apply'); JToolbarHelper::save('calendar.save'); JToolbarHelper::cancel('calendar.cancel'); }
public function registerToolbar() { JToolBarHelper::title(JText::_('COM_EASYDISCUSS_EDITING_POST'), 'discussions'); JToolbarHelper::apply(); JToolbarHelper::save(); JToolBarHelper::divider(); JToolBarHelper::cancel(); }
/** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function addToolbar() { JToolBarHelper::title(JText::_('COM_NENO_VIEW_MOVELEMENTCONFIRM_TITLE'), 'move.png'); JToolbarHelper::save('moveelementconfirm.move', JText::_('COM_NENO_VIEW_MOVELEMENTCONFIRM_CONFIRM_BTN')); JToolbarHelper::cancel('moveelementconfirm.cancel'); // Set sidebar action - New in 3.0 JHtmlSidebar::setAction('index.php?option=com_neno&view=groupselements'); }
/** * Add the page title and toolbar. * * @access public * @return void * * @since 2.0 */ function addToolbar() { JToolBarHelper::title(JText::_('COM_JOOMGALLERY_IMGMAN_IMAGE_MANAGER') . ' :: ' . JText::_('COM_JOOMGALLERY_FIELDSET_EDITIMAGES'), 'images'); JToolbarHelper::apply('apply'); JToolbarHelper::save('save'); JToolbarHelper::cancel('cancel'); JToolbarHelper::spacer(); }
protected function addToolbar() { JToolbarHelper::title(JText::_('COM_JOOMDLE_VIEW_MAILINGLIST_TITLE_CONFIGURATION'), 'config.png'); JToolbarHelper::apply('config.apply'); JToolbarHelper::save('config.save'); JToolbarHelper::cancel('config.cancel'); JHtmlSidebar::setAction('index.php?option=com_joomdle&view=courseapplications'); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { JFactory::getApplication()->input->set('hidemainmenu', true); $this->documentTitle = JText::_('COM_CROWDFUNDING_EDIT_TRANSACTION'); JToolbarHelper::title($this->documentTitle); JToolbarHelper::apply('transaction.apply'); JToolbarHelper::save('transaction.save'); JToolbarHelper::cancel('transaction.cancel', 'JTOOLBAR_CANCEL'); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { JFactory::getApplication()->input->set('hidemainmenu', true); $this->documentTitle = JText::_('COM_IDENTITYPROOF_EDIT_USER'); JToolbarHelper::apply('user.apply'); JToolbarHelper::save('user.save'); JToolbarHelper::cancel('user.cancel', 'JTOOLBAR_CANCEL'); JToolbarHelper::title($this->documentTitle); }
/** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function addToolbar() { JFactory::getApplication()->input->set('hidemainmenu', true); $user = JFactory::getUser(); $userId = $user->get('id'); $isNew = $this->item->id == 0; $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId); // Since we don't track these assets at the item level, use the category id. /** @noinspection PhpUndefinedClassInspection */ $canDo = CatalogueHelper::getActions($this->item->id, 0); JToolbarHelper::title($isNew ? JText::_('COM_CATALOGUE_MANAGER_ITEM_NEW') : JText::_('COM_CATALOGUE_MANAGER_ITEM_EDIT'), 'banners.png'); // If not checked out, can save the item. if (!$checkedOut && $canDo->get('core.edit')) { JToolbarHelper::apply('item.apply'); JToolbarHelper::save('item.save'); if ($canDo->get('core.create')) { JToolbarHelper::save2new('item.save2new'); } } // If an existing item, can save to a copy. if (!$isNew && $canDo->get('core.create')) { JToolbarHelper::save2copy('item.save2copy'); } if (empty($this->item->id)) { JToolbarHelper::cancel('item.cancel'); } else { JToolbarHelper::cancel('item.cancel', 'JTOOLBAR_CLOSE'); } }