/** * 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'))); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void * * @since 3.1 */ protected function setUp() { $this->toolbar = JToolbar::getInstance(); $this->object = $this->toolbar->loadButtonType('link'); $this->saveFactoryState(); JFactory::$application = $this->getMockApplication(); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void * * @since 3.0 */ protected function setUp() { $this->toolbar = JToolbar::getInstance(); $this->object = $this->toolbar->loadButtonType('confirm'); $this->saveFactoryState(); JFactory::$application = $this->getMockCmsApp(); $this->backupServer = $_SERVER; $_SERVER['HTTP_HOST'] = 'example.com'; $_SERVER['SCRIPT_NAME'] = ''; }
public function testAddButtonPathArray() { $initialValue = $this->readAttribute($this->object, '_buttonPath'); $this->object->addButtonPath(array('MyTestPath1', 'MyTestPath2')); $newValue = $this->readAttribute($this->object, '_buttonPath'); $this->assertThat($newValue[0], $this->equalTo('MyTestPath2' . DIRECTORY_SEPARATOR)); $this->assertThat($newValue[1], $this->equalTo('MyTestPath1' . DIRECTORY_SEPARATOR)); $initialCount = count($initialValue); for ($i = 0; $i < $initialCount; $i++) { $this->assertThat($initialValue[$i], $this->equalTo($newValue[$i + 2])); } }
/** * 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'); }
/** * 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'))); }
protected function addToolbar() { JToolBarHelper::title(JText::sprintf('COM_TZ_PORTFOLIO_PLUS_ADDONS_MANAGER_TASK', 'Manager Data'), 'puzzle'); $bar = JToolbar::getInstance(); $return = '<a class="btn btn-small" href="' . JRoute::_('index.php?option=com_tz_portfolio_plus&view=addons') . '">' . '<span class="icon-puzzle"></span> ' . JText::_('COM_TZ_PORTFOLIO_PLUS_ADDONS_MANAGER') . '</a>'; $bar->appendButton('Custom', $return, 'manager'); }
/** * 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_FILTERS_TOOLBAR_TITLE'), 'zoom-in 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.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_SEARCH_FILTERS'); if ($canDo->get('core.delete')) { JToolbarHelper::deleteList('', 'filters.delete'); JToolbarHelper::divider(); } }
/** * 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'); }
/** * 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. * * @return void * * @since 1.6 */ protected function addToolbar() { // Get the toolbar object instance $bar = JToolbar::getInstance('toolbar'); $user = JFactory::getUser(); // Set the titlebar text JToolbarHelper::title(JText::_('COM_MEDIA'), 'images mediamanager'); // Add an upload button if ($user->authorise('core.create', 'com_media')) { // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('toolbar.uploadmedia'); $bar->appendButton('Custom', $layout->render(array()), 'upload'); JToolbarHelper::divider(); } // Add a create folder button if ($user->authorise('core.create', 'com_media')) { // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('toolbar.newfolder'); $bar->appendButton('Custom', $layout->render(array()), 'upload'); JToolbarHelper::divider(); } // Add a delete button if ($user->authorise('core.delete', 'com_media')) { // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('toolbar.deletemedia'); $bar->appendButton('Custom', $layout->render(array()), 'upload'); JToolbarHelper::divider(); } // Add a preferences button if ($user->authorise('core.admin', 'com_media') || $user->authorise('core.options', 'com_media')) { JToolbarHelper::preferences('com_media'); JToolbarHelper::divider(); } JToolbarHelper::help('JHELP_CONTENT_MEDIA_MANAGER'); }
public function __construct($config = array()) { $document = JFactory::getDocument(); //load dialog stylesheet in backend KomentoDocumentHelper::loadHeaders(); $config = Komento::getConfig(); $konfig = Komento::getKonfig(); $toolbar = JToolbar::getInstance('toolbar'); $toolbar->addButtonPath(KOMENTO_ADMIN_ROOT . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'images'); if ($document->getType() == 'html') { require_once KOMENTO_CLASSES . DIRECTORY_SEPARATOR . 'configuration.php'; $configuration = KomentoConfiguration::getInstance(); $configuration->attach(); } $version = str_ireplace('.', '', Komento::komentoVersion()); $document->addScript(rtrim(JURI::root(), '/') . '/administrator/components/com_komento/assets/js/admin.js?' . $version); $document->addStyleSheet(rtrim(JURI::root(), '/') . '/administrator/components/com_komento/assets/css/reset.css?' . $version); $document->addStyleSheet(rtrim(JURI::root(), '/') . '/components/com_komento/assets/css/common.css?' . $version); $document->addStyleSheet(rtrim(JURI::root(), '/') . '/administrator/components/com_komento/assets/css/style.css?' . $version); // For the sake of loading the core.js in Joomla 1.6 (1.6.2 onwards) if (Komento::joomlaVersion() >= '1.6') { JHTML::_('behavior.framework'); } parent::__construct($config); }
/** * Add the page title and toolbar. * * @return void * * @since 2.0 */ protected function addToolbar() { \JToolBarHelper::title(\JText::_('COM_PATCHTESTER'), 'patchtester icon-apply'); if (!count($this->envErrors)) { \JToolbar::getInstance('toolbar')->appendButton('Popup', 'refresh', 'COM_PATCHTESTER_TOOLBAR_FETCH_DATA', 'index.php?option=com_patchtester&view=fetch&tmpl=component', 500, 210, 0, 0, 'window.parent.location.reload()', 'COM_PATCHTESTER_HEADING_FETCH_DATA'); } \JToolBarHelper::preferences('com_patchtester'); }
/** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function addToolbar() { // Set sidebar action - New in 3.0 JHtmlSidebar::setAction('index.php?option=com_neno&view=strings'); $toolbar = JToolbar::getInstance(); $toolbar->addButtonPath(JPATH_NENO . '/button'); $toolbar->appendButton('TC', NenoHelperApi::getTCAvailable()); }
/** * Add the page title and toolbar. * * @return void */ protected function addToolbar() { JToolBarHelper::editList('passenger.edit'); JToolbarHelper::deleteList('', 'passengers.delete', 'JTOOLBAR_TRASH'); JToolBarHelper::custom('passengers.exportpdf', 'download', 'icon over', JText::_('Export PDF'), false, false); $toolbar = JToolbar::getInstance('toolbar'); $toolbar->appendButton('Link', 'print', JText::_('COM_BOOKPRO_PRINT'), JUri::base() . 'index.php?option=com_bookpro&view=passengers&tmpl=component&layout=report'); JToolBarHelper::title(JText::_('COM_BOOPRO_MANAGER_PASSENGERS')); }
private function addToolbar() { $text = JText::_('Edit') . ' ' . $this->item->file; $bar = JToolbar::getInstance('toolbar'); JToolbarHelper::title(JText::_('COM_EVENTGALLERY_FILES') . ': <small>[ ' . $text . ' ]</small>'); JToolbarHelper::apply('file.apply'); JToolbarHelper::save('file.save'); JToolbarHelper::cancel('file.cancel', JText::_('JTOOLBAR_CLOSE')); }
/** * Add the toolbar and toolbar title. * * @return void * @since 2.0 */ protected function addToolbar() { require_once JPATH_COMPONENT . '/includes/popup.php'; JToolBarHelper::title(JText::_('COM_JOOMGALLERY_CONFIGS_CONFIGURATION_MANAGER'), 'equalizer'); $toolbar = JToolbar::getInstance('toolbar'); $toolbar->appendButton('Popup', 'new', 'JTOOLBAR_NEW', 'index.php?option=' . _JOOM_OPTION . '&controller=config&layout=new&tmpl=component', 400, 350, 0, 0, '', 'COM_JOOMGALLERY_CONFIGS_NEW_HEADING', 'jg-new-popup', 'new'); JToolbarHelper::editList('edit'); JToolbarHelper::deleteList('', 'remove'); }
/** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function addToolbar() { JToolbarHelper::addNew('addGroup', JText::_('COM_NENO_VIEW_GROUPSELEMENTS_BTN_ADD_GROUP')); JToolbarHelper::custom('moveelementconfirm.show', 'move', 'move', JText::_('COM_NENO_VIEW_GROUPSELEMENTS_BTN_MOVE_ELEMENTS'), true); $toolbar = JToolbar::getInstance(); $toolbar->addButtonPath(JPATH_NENO . '/button'); $toolbar->appendButton('TC', NenoHelperApi::getTCAvailable()); $this->extraSidebar = NenoHelperBackend::getSidebarInfobox('groupselements'); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { JToolbarHelper::title(JText::_("COM_CROWDFUNDINGFINANCE_DASHBOARD")); JToolbarHelper::preferences('com_crowdfundingfinance'); JToolbarHelper::divider(); // Help button $bar = JToolbar::getInstance('toolbar'); $bar->appendButton('Link', 'help', JText::_('JHELP'), JText::_('COM_CROWDFUNDINGFINANCE_HELP_URL')); }
/** * Set a modal button. */ public static function modal($title = 'JTOOLBAR_BATCH', $selector = 'myModal', $icon = 'checkbox-partial') { AKHelper::_('ui.modal', $selector); $bar = JToolbar::getInstance('toolbar'); $title = JText::_($title); $option = array('class' => 'btn btn-small ' . $selector . '-link', 'icon' => JVERSION >= 3 ? 'icon-' . $icon : $icon); $dhtml = AKHelper::_('ui.modalLink', $title, $selector, $option); $bar->appendButton('Custom', $dhtml, 'batch'); }
public static function customButton($text, $class, $id, $link) { $bar = JToolbar::getInstance('toolbar'); $html = "<a href=\"{$link}\" class=\"toolbar\">\n"; $html .= "<span class=\"{$class}\" title=\"{$text}\">\n"; $html .= "</span>\n"; $html .= "{$text}\n"; $html .= "</a>\n"; $bar->appendButton('Custom', $html, $id); }
public static function link($name, $text, $url) { $bar = JToolbar::getInstance('toolbar'); $img = JHtml::image("com_ostoolbar/icon-32-{$name}.png", null, null, true, true); if ($img) { $doc = JFactory::getDocument(); $doc->addStyleDeclaration(".icon-32-{$name} { background-image: url({$img}); }"); } $bar->appendButton('link', $name, $text, $url); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { // Set toolbar items for the page JToolbarHelper::title(JText::_('COM_GAMIFICATION_TOOLS')); // Add custom buttons $bar = JToolbar::getInstance('toolbar'); // Go to script manager $link = JRoute::_('index.php?option=com_gamification&view=dashboard', false); $bar->appendButton('Link', 'dashboard', JText::_('COM_GAMIFICATION_DASHBOARD'), $link); }
/** * Add the page title and toolbar. * * */ protected function addToolbar() { JToolBarHelper::title(JText::_('COM_COMPONENTARCHITECT_VIEW_LOGS_HEADER'), 'logs.png'); JToolbarHelper::preferences('com_componentarchitect'); JToolbarHelper::help('JHELP_COMPONENTS_COMPONENTARCHITECT_VIEW_LOGS', true, null, 'com_componentarchitect'); // Add a dashboard button. $bar = JToolbar::getInstance('toolbar'); $bar->appendButton('Link', 'dashboard', JText::_('COM_COMPONENTARCHITECT_DASHBOARD'), 'index.php?option=com_componentarchitect&view=dashboard'); JToolBarHelper::divider(); }
private function addToolbar() { JToolbarHelper::title(JText::_('COM_EVENTGALLERY_ORDER') . ' ' . $this->item->getDocumentNumber()); JToolbarHelper::apply('order.apply'); JToolbarHelper::save('order.save'); JToolbarHelper::cancel('order.cancel', JText::_('JTOOLBAR_CLOSE')); $bar = JToolbar::getInstance('toolbar'); // Add a resend mail button. $bar->appendButton('Confirm', 'COM_EVENTGALLERY_ORDER_RESEND_MAIL_ALERT', 'mail', 'COM_EVENTGALLERY_ORDER_RESEND_MAIL', 'order.resendmail', false); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { // Set toolbar items for the page JToolbarHelper::title(JText::_('COM_CROWDFUNDING_TOOLS')); // Add custom buttons $bar = JToolbar::getInstance('toolbar'); // Go to script manager $link = JRoute::_('index.php?option=com_crowdfunding&view=dashboard', false); $bar->appendButton('Link', 'dashboard', JText::_("COM_CROWDFUNDING_DASHBOARD"), $link); }
/** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function addToolbar() { // Add page title JToolbarHelper::title(JText::_('COM_MODULES_MANAGER_MODULES'), 'cube module'); // Get the toolbar object instance $bar = JToolbar::getInstance('toolbar'); // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('toolbar.cancelselect'); $bar->appendButton('Custom', $layout->render(array()), 'new'); }
protected function addCollapseButton($text, $target, $class = 'btn btn-small') { JHtml::_('fufhtml.bootstrap.framework'); $bar = JToolbar::getInstance('toolbar'); $bar->appendButton('Custom', ' <button class="' . $this->escape($class) . '" type="button" data-toggle="collapse" data-target="' . $this->escape($target) . '"> ' . $text . ' </button> '); }
protected function addToolbar() { JToolbarHelper::title(JText::_('Event') . ': <small><small>[ upload ]</small></small>'); JToolbarHelper::cancel('upload.cancel', 'Close'); $bar = JToolbar::getInstance('toolbar'); if ($this->folder->getFolderType()->getName() == 'local') { JToolbarHelper::spacer(100); $bar->appendButton('Link', 'folder', 'COM_EVENTGALLERY_BUTTON_FILES_DESC', JRoute::_('index.php?option=com_eventgallery&view=files&folderid=' . $this->item->id), false); $bar->appendButton('Link', 'edit', 'COM_EVENTGALLERY_BUTTON_EDIT_DESC', JRoute::_('index.php?option=com_eventgallery&task=event.edit&id=' . $this->item->id), false); } }
/** * Add the page title and toolbar. * * @return void * * @since 3.0 */ protected function addToolbar() { // Add page title JToolbarHelper::title(JText::_('COM_MENUS'), 'list menumgr'); // Get the toolbar object instance $bar = JToolbar::getInstance('toolbar'); // Cancel $title = JText::_('JTOOLBAR_CANCEL'); $dhtml = "<button onClick=\"location.href='index.php?option=com_menus&view=items'\" class=\"btn\">\n\t\t\t\t\t<span class=\"icon-remove\" title=\"{$title}\"></span>\n\t\t\t\t\t{$title}</button>"; $bar->appendButton('Custom', $dhtml, 'new'); }