/** * Method to configure the toolbar for this view. * * @return void * * @since 2.5 */ protected function addToolbar() { $canDo = JHelperContent::getActions('com_finder'); JToolbarHelper::title(JText::_('COM_FINDER_MAPS_TOOLBAR_TITLE'), 'zoom-in finder'); $toolbar = JToolbar::getInstance('toolbar'); if ($canDo->get('core.edit.state')) { JToolbarHelper::publishList('maps.publish'); JToolbarHelper::unpublishList('maps.unpublish'); JToolbarHelper::divider(); } if ($canDo->get('core.admin') || $canDo->get('core.options')) { JToolbarHelper::preferences('com_finder'); } JToolbarHelper::divider(); $toolbar->appendButton('Popup', 'bars', 'COM_FINDER_STATISTICS', 'index.php?option=com_finder&view=statistics&tmpl=component', 550, 350); JToolbarHelper::divider(); JToolbarHelper::help('JHELP_COMPONENTS_FINDER_MANAGE_CONTENT_MAPS'); if ($canDo->get('core.delete')) { JToolbarHelper::deleteList('', 'maps.delete'); JToolbarHelper::divider(); } JHtmlSidebar::setAction('index.php?option=com_finder&view=maps'); JHtmlSidebar::addFilter('', 'filter_branch', JHtml::_('select.options', JHtml::_('finder.mapslist'), 'value', 'text', $this->state->get('filter.branch')), true); JHtmlSidebar::addFilter(JText::_('COM_FINDER_INDEX_FILTER_BY_STATE'), 'filter_state', JHtml::_('select.options', JHtml::_('finder.statelist'), 'value', 'text', $this->state->get('filter.state'))); }
protected function addToolbar() { require_once JPATH_COMPONENT . '/helpers/jcomments.php'; JFactory::getApplication()->input->set('hidemainmenu', 1); $userId = JFactory::getUser()->get('id'); $canDo = JCommentsHelper::getActions(); $isNew = $this->item->id == 0; $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId); if (version_compare(JVERSION, '3.0', 'ge')) { JToolbarHelper::title($isNew ? JText::_('A_SMILIES_SMILEY_NEW') : JText::_('A_SMILIES_SMILEY_EDIT'), 'smilies.png'); } else { JToolbarHelper::title($isNew ? JText::_('A_SMILIES_SMILEY_NEW') : JText::_('A_SMILIES_SMILEY_EDIT'), 'jcomments-smilies'); } if (!$checkedOut && $canDo->get('core.edit')) { JToolBarHelper::apply('smiley.apply'); JToolBarHelper::save('smiley.save'); } if (!$isNew && $canDo->get('core.create')) { JToolbarHelper::save2new('smiley.save2new'); } if ($isNew) { JToolBarHelper::cancel('smiley.cancel'); } else { JToolBarHelper::cancel('smiley.cancel', 'JTOOLBAR_CLOSE'); } }
/** * 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. * * @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'); }
/** * Setting the toolbar */ protected function addToolBar() { JFactory::getApplication()->input->set('hidemainmenu', true); $user = JFactory::getUser(); $userId = $user->id; $isNew = $this->item->id == 0; JToolbarHelper::title(JText::_($isNew ? 'COM_COMPONENTBUILDER_FIELD_NEW' : 'COM_COMPONENTBUILDER_FIELD_EDIT'), 'pencil-2 article-add'); // Built the actions for new and existing records. if ($this->refid || $this->ref) { if ($this->canDo->get('field.create') && $isNew) { // We can create the record. JToolBarHelper::save('field.save', 'JTOOLBAR_SAVE'); } elseif ($this->canDo->get('field.edit')) { // We can save the record. JToolBarHelper::save('field.save', 'JTOOLBAR_SAVE'); } if ($isNew) { // Do not creat but cancel. JToolBarHelper::cancel('field.cancel', 'JTOOLBAR_CANCEL'); } else { // We can close it. JToolBarHelper::cancel('field.cancel', 'JTOOLBAR_CLOSE'); } } else { if ($isNew) { // For new records, check the create permission. if ($this->canDo->get('field.create')) { JToolBarHelper::apply('field.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('field.save', 'JTOOLBAR_SAVE'); JToolBarHelper::custom('field.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); } JToolBarHelper::cancel('field.cancel', 'JTOOLBAR_CANCEL'); } else { if ($this->canDo->get('field.edit')) { // We can save the new record JToolBarHelper::apply('field.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('field.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('field.create')) { JToolBarHelper::custom('field.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); } } $canVersion = $this->canDo->get('core.version') && $this->canDo->get('field.version'); if ($this->state->params->get('save_history', 1) && $this->canDo->get('field.edit') && $canVersion) { JToolbarHelper::versions('com_componentbuilder.field', $this->item->id); } if ($this->canDo->get('field.create')) { JToolBarHelper::custom('field.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); } JToolBarHelper::cancel('field.cancel', 'JTOOLBAR_CLOSE'); } } JToolbarHelper::divider(); // set help url for this view if found $help_url = ComponentbuilderHelper::getHelpUrl('field'); if (ComponentbuilderHelper::checkString($help_url)) { JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); } }
/** * 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'); }
protected function addToolbar() { $canDo = JHelperContent::getActions('com_jvisualcontent'); $user = JFactory::getUser(); JToolbarHelper::title(JText::_('COM_JVISUALCONTENT_EXTRAFIELDS_MANAGER')); // Create new button if ($canDo->get('core.create')) { JToolbarHelper::addNew('extrafield.add'); JToolbarHelper::divider(); } // Create edit button if ($canDo->get('core.edit') || $canDo->get('core.edit.own')) { JToolbarHelper::editList('type.edit'); } // Create publish, unpublish buttons if ($canDo->get('core.edit.state')) { JToolbarHelper::publish('extrafields.publish'); JToolbarHelper::unpublish('extrafields.unpublish'); JToolbarHelper::divider(); } if ($this->state->get('filter.published') == -2 && $user->authorise('core.delete')) { JToolbarHelper::deleteList('', 'extrafields.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($canDo->get('core.edit.state')) { JToolbarHelper::trash('extrafields.trash'); } // Create options button if ($canDo->get('core.admin')) { JToolbarHelper::preferences('com_jvisualcontent'); } if (version_compare(JVERSION, '3.0', '>=')) { $fieldsType = array('textfield' => JText::_('COM_JVISUALCONTENT_TEXT_FIELD'), 'textarea' => JText::_('COM_JVISUALCONTENT_TEXTAREA'), 'select' => JText::_('COM_JVISUALCONTENT_DROPDOWN_SELECT'), 'multiselect' => JText::_('COM_JVISUALCONTENT_DROPDOWN_LIST'), 'radio' => JText::_('COM_JVISUALCONTENT_RADIO'), 'checkbox' => JText::_('COM_JVISUALCONTENT_CHECKBOX'), 'editor' => JText::_('COM_JVISUALCONTENT_EDITOR'), 'calendar' => JText::_('COM_JVISUALCONTENT_CALENDAR'), 'file' => JText::_('COM_JVISUALCONTENT_FILE')); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('archived' => false)), 'value', 'text', $this->state->get('filter.published'), true)); JHtmlSidebar::addFilter(JText::_('COM_JVISUALCONTENT_OPTION_SELECT_TYPE'), 'filter_type', JHtml::_('select.options', $fieldsType, 'value', 'text', $this->state->get('filter.type'))); } }
/** * 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')) ); */ }
/** * Method to configure the toolbar for this view. * * @return void * * @since 2.5 */ protected function addToolbar() { $canDo = FinderHelper::getActions(); JToolbarHelper::title(JText::_('COM_FINDER_INDEX_TOOLBAR_TITLE'), 'zoom-in finder'); $toolbar = JToolbar::getInstance('toolbar'); $toolbar->appendButton('Popup', 'archive', 'COM_FINDER_INDEX', 'index.php?option=com_finder&view=indexer&tmpl=component', 500, 210, 0, 0, 'window.parent.location.reload()', 'COM_FINDER_HEADING_INDEXER'); if ($canDo->get('core.edit.state')) { JToolbarHelper::publishList('index.publish'); JToolbarHelper::unpublishList('index.unpublish'); } if ($canDo->get('core.delete')) { JToolbarHelper::deleteList('', 'index.delete'); } if ($canDo->get('core.edit.state')) { JToolbarHelper::trash('index.purge', 'COM_FINDER_INDEX_TOOLBAR_PURGE', false); } if ($canDo->get('core.admin')) { JToolbarHelper::preferences('com_finder'); } $toolbar->appendButton('Popup', 'stats', 'COM_FINDER_STATISTICS', 'index.php?option=com_finder&view=statistics&tmpl=component', 550, 350); JToolbarHelper::help('JHELP_COMPONENTS_FINDER_MANAGE_INDEXED_CONTENT'); JHtmlSidebar::setAction('index.php?option=com_finder&view=index'); JHtmlSidebar::addFilter(JText::_('COM_FINDER_INDEX_FILTER_BY_STATE'), 'filter_state', JHtml::_('select.options', JHtml::_('finder.statelist'), 'value', 'text', $this->state->get('filter.state'))); JHtmlSidebar::addFilter(JText::_('COM_FINDER_INDEX_TYPE_FILTER'), 'filter_type', JHtml::_('select.options', JHtml::_('finder.typeslist'), 'value', 'text', $this->state->get('filter.type'))); }
/** * 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'); }
/** * 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. * * @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'); }
/** * 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. * * @param object $campaign Campaign object. * @param array $statistics Array or statistics. * * @return void * * @since 1.0.0 */ protected function addToolbar($campaign, $statistics) { JToolbarHelper::title(JText::_('COM_CMDONATION_MANAGER_STATISTICS'), 'statistics icon-bars'); if (!empty($campaign) && !empty($statistics['donations'])) { JToolbarHelper::custom('statistics.export_donors', 'export out', 'export out', 'COM_CMDONATION_EXPORT_DONORS', false); } }
/** * 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'); } }
/** * Renders the view * * @param string $tpl Template name * * @return void * * @since 2.5.4 */ public function display($tpl = null) { // Get data from the model $this->state = $this->get('State'); // Load useful classes $model = $this->getModel(); $this->loadHelper('select'); // Assign view variables $ftp = $model->getFTPOptions(); $this->assign('updateInfo', $model->getUpdateInformation()); $this->assign('methodSelect', JoomlaupdateHelperSelect::getMethods($ftp['enabled'])); // Set the toolbar information JToolbarHelper::title(JText::_('COM_JOOMLAUPDATE_OVERVIEW'), 'install'); JToolbarHelper::custom('update.purge', 'purge', 'purge', 'JTOOLBAR_PURGE_CACHE', false, false); // Add toolbar buttons JToolbarHelper::preferences('com_joomlaupdate'); // Load mooTools JHtml::_('behavior.framework', true); // Load our Javascript $document = JFactory::getDocument(); $document->addScript('../media/com_joomlaupdate/default.js'); JHtml::_('stylesheet', 'media/mediamanager.css', array(), true); // Render the view parent::display($tpl); }
/** * 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'); }
/** * 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'); }
/** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function addToolbar() { $canDo = JHelperContent::getActions('com_languages'); JToolbarHelper::title(JText::_('COM_LANGUAGES_VIEW_LANGUAGES_TITLE'), 'comments-2 langmanager'); 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('JGLOBAL_CONFIRM_DELETE', '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', 'upload', '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'); JHtmlSidebar::setAction('index.php?option=com_languages&view=languages'); }
/** * Renders the view * * @param string $tpl Template name * * @return void */ public function display($tpl = null) { $password = JFactory::getApplication()->getUserState('com_joomlaupdate.password', null); $filesize = JFactory::getApplication()->getUserState('com_joomlaupdate.filesize', null); $ajaxUrl = JUri::base() . 'components/com_joomlaupdate/restore.php'; $returnUrl = 'index.php?option=com_joomlaupdate&task=update.finalise'; // Set the toolbar information JToolbarHelper::title(JText::_('COM_JOOMLAUPDATE_OVERVIEW'), 'install'); JToolBarHelper::divider(); JToolBarHelper::help('JHELP_COMPONENTS_JOOMLA_UPDATE'); // Add toolbar buttons if (JFactory::getUser()->authorise('core.admin', 'com_joomlaupdate')) { JToolbarHelper::preferences('com_joomlaupdate'); } // Load mooTools JHtml::_('behavior.framework', true); $updateScript = <<<ENDSCRIPT var joomlaupdate_password = '******'; var joomlaupdate_totalsize = '{$filesize}'; var joomlaupdate_ajax_url = '{$ajaxUrl}'; var joomlaupdate_return_url = '{$returnUrl}'; ENDSCRIPT; // Load our Javascript $document = JFactory::getDocument(); $document->addScript('../media/com_joomlaupdate/json2.js'); $document->addScript('../media/com_joomlaupdate/encryption.js'); $document->addScript('../media/com_joomlaupdate/update.js'); JHtml::_('script', 'system/progressbar.js', true, true); JHtml::_('stylesheet', 'media/mediamanager.css', array(), true); $document->addScriptDeclaration($updateScript); // Render the view parent::display($tpl); }
/** * 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(); }
/** * 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); }
/** * 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. * * @return void * * @since 1.6 */ protected function addToolbar() { $state = $this->get('State'); $canDo = JHelperContent::getActions('com_content', 'category', $this->state->get('filter.category_id')); JToolbarHelper::title(JText::_('COM_CONTENT_FEATURED_TITLE'), 'star featured'); if ($canDo->get('core.create')) { JToolbarHelper::addNew('article.add'); } if ($canDo->get('core.edit')) { JToolbarHelper::editList('article.edit'); } if ($canDo->get('core.edit.state')) { JToolbarHelper::publish('articles.publish', 'JTOOLBAR_PUBLISH', true); JToolbarHelper::unpublish('articles.unpublish', 'JTOOLBAR_UNPUBLISH', true); JToolbarHelper::custom('articles.unfeatured', 'unfeatured.png', 'featured_f2.png', 'JUNFEATURE', true); JToolbarHelper::archiveList('articles.archive'); JToolbarHelper::checkin('articles.checkin'); } if ($state->get('filter.published') == -2 && $canDo->get('core.delete')) { JToolbarHelper::deleteList('', 'articles.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($canDo->get('core.edit.state')) { JToolbarHelper::trash('articles.trash'); } if ($canDo->get('core.admin') || $canDo->get('core.options')) { JToolbarHelper::preferences('com_content'); } JToolbarHelper::help('JHELP_CONTENT_FEATURED_ARTICLES'); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { // Set toolbar items for the page JToolbarHelper::title(JText::_('COM_CROWDFUNDING_LOCATIONS_MANAGER')); JToolbarHelper::addNew('location.add'); JToolbarHelper::editList('location.edit'); JToolbarHelper::divider(); // Add custom buttons $bar = JToolbar::getInstance('toolbar'); // Import $link = JRoute::_('index.php?option=com_crowdfunding&view=import&type=locations'); $bar->appendButton('Link', 'upload', JText::_("COM_CROWDFUNDING_IMPORT_LOCATIONS"), $link); $link = JRoute::_('index.php?option=com_crowdfunding&view=import&type=states'); $bar->appendButton('Link', 'upload', JText::_("COM_CROWDFUNDING_IMPORT_STATES"), $link); // Export $link = JRoute::_('index.php?option=com_crowdfunding&task=export.download&format=raw&type=locations'); $bar->appendButton('Link', 'download', JText::_("COM_CROWDFUNDING_EXPORT_LOCATIONS"), $link); $link = JRoute::_('index.php?option=com_crowdfunding&task=export.download&format=raw&type=states'); $bar->appendButton('Link', 'download', JText::_("COM_CROWDFUNDING_EXPORT_STATES"), $link); JToolbarHelper::divider(); JToolbarHelper::publishList("locations.publish"); JToolbarHelper::unpublishList("locations.unpublish"); JToolbarHelper::divider(); JToolbarHelper::deleteList(JText::_("COM_CROWDFUNDING_DELETE_ITEMS_QUESTION"), "locations.delete"); JToolbarHelper::divider(); JToolbarHelper::custom('locations.backToDashboard', "dashboard", "", JText::_("COM_CROWDFUNDING_DASHBOARD"), false); }
/** * Method to configure the toolbar for this view. * * @return void * * @since 2.5 */ protected function addToolbar() { $canDo = FinderHelper::getActions(); JToolbarHelper::title(JText::_('COM_FINDER_FILTERS_TOOLBAR_TITLE'), 'finder'); $toolbar = JToolbar::getInstance('toolbar'); if ($canDo->get('core.create')) { JToolbarHelper::addNew('filter.add'); JToolbarHelper::editList('filter.edit'); JToolbarHelper::divider(); } if ($canDo->get('core.edit.state')) { JToolbarHelper::publishList('filters.publish'); JToolbarHelper::unpublishList('filters.unpublish'); JToolbarHelper::divider(); } if ($canDo->get('core.delete')) { JToolbarHelper::deleteList('', 'filters.delete'); JToolbarHelper::divider(); } if ($canDo->get('core.admin')) { JToolbarHelper::preferences('com_finder'); } JToolbarHelper::divider(); $toolbar->appendButton('Popup', 'stats', 'COM_FINDER_STATISTICS', 'index.php?option=com_finder&view=statistics&tmpl=component', 550, 350); JToolbarHelper::divider(); JToolbarHelper::help('JHELP_COMPONENTS_FINDER_MANAGE_SEARCH_FILTERS'); JHtmlSidebar::setAction('index.php?option=com_finder&view=filters'); JHtmlSidebar::addFilter(JText::_('COM_FINDER_INDEX_FILTER_BY_STATE'), 'filter_state', JHtml::_('select.options', JHtml::_('finder.statelist'), 'value', 'text', $this->state->get('filter.state'))); }
/** * 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. * * @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. * * @return void * * @since 1.6 */ protected function addToolbar() { $canDo = JHelperContent::getActions('com_templates'); JToolbarHelper::title(JText::_('COM_TEMPLATES_MANAGER_STYLES'), 'eye thememanager'); if ($canDo->get('core.edit.state')) { JToolbarHelper::makeDefault('styles.setDefault', 'COM_TEMPLATES_TOOLBAR_SET_HOME'); JToolbarHelper::divider(); } if ($canDo->get('core.edit')) { JToolbarHelper::editList('style.edit'); } if ($canDo->get('core.create')) { JToolbarHelper::custom('styles.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true); JToolbarHelper::divider(); } if ($canDo->get('core.delete')) { JToolbarHelper::deleteList('', 'styles.delete'); JToolbarHelper::divider(); } if ($canDo->get('core.admin')) { JToolbarHelper::preferences('com_templates'); JToolbarHelper::divider(); } JToolbarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_STYLES'); JHtmlSidebar::setAction('index.php?option=com_templates&view=styles'); JHtmlSidebar::addFilter(JText::_('COM_TEMPLATES_FILTER_TEMPLATE'), 'filter_template', JHtml::_('select.options', TemplatesHelper::getTemplateOptions($this->state->get('filter.client_id')), 'value', 'text', $this->state->get('filter.template'))); JHtmlSidebar::addFilter(JText::_('JGLOBAL_FILTER_CLIENT'), 'filter_client_id', JHtml::_('select.options', TemplatesHelper::getClientOptions(), 'value', 'text', $this->state->get('filter.client_id'))); }
/** * 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'); } }