/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { $state = $this->get('State'); $canDo = ModulesHelper::getActions(); Toolbar::title(Lang::txt('COM_MODULES_MANAGER_MODULES'), 'module.png'); if ($canDo->get('core.create')) { //Toolbar::addNew('module.add'); Toolbar::appendButton('Popup', 'new', 'JTOOLBAR_NEW', 'index.php?option=com_modules&view=select&tmpl=component', 850, 400); } if ($canDo->get('core.edit')) { Toolbar::editList('module.edit'); } if ($canDo->get('core.create')) { Toolbar::custom('modules.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true); } if ($canDo->get('core.edit.state')) { Toolbar::divider(); Toolbar::publish('modules.publish', 'JTOOLBAR_PUBLISH', true); Toolbar::unpublish('modules.unpublish', 'JTOOLBAR_UNPUBLISH', true); Toolbar::divider(); Toolbar::checkin('modules.checkin'); } if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) { Toolbar::deleteList('', 'modules.delete', 'JTOOLBAR_EMPTY_TRASH'); Toolbar::divider(); } elseif ($canDo->get('core.edit.state')) { Toolbar::trash('modules.trash'); Toolbar::divider(); } if ($canDo->get('core.admin')) { Toolbar::preferences('com_modules'); Toolbar::divider(); } Toolbar::help('modules'); }
/** * Setup the Toolbar * * @since 1.6 */ protected function _setToolbar() { 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 = ModulesHelper::getActions($this->state->get('filter.category_id'), $this->item->id); $client = $this->get('client'); JToolBarHelper::title(JText::_('Modules_Manager_Module')); if ($this->item->module == 'mod_custom') { JToolBarHelper::Preview('index.php?option=com_modules&tmpl=component&client=' . $client->id . '&pollid=' . $this->item->id); } // If not checked out, can save the item. if (!$checkedOut && $canDo->get('core.edit')) { JToolBarHelper::apply('module.apply', 'JToolbar_Apply'); JToolBarHelper::save('module.save', 'JToolbar_Save'); JToolBarHelper::addNew('module.save2new', 'JToolbar_Save_and_new'); } // If an existing item, can save to a copy. if (!$isNew && $canDo->get('core.create')) { JToolBarHelper::custom('module.save2copy', 'copy.png', 'copy_f2.png', 'JToolbar_Save_as_Copy', false); } if (empty($this->item->id)) { JToolBarHelper::cancel('module.cancel', 'JToolbar_Cancel'); } else { JToolBarHelper::cancel('module.cancel', 'JToolbar_Close'); } JToolBarHelper::help('screen.module.edit'); }
/** * Setup the Toolbar. */ protected function _setToolbar() { $state = $this->get('State'); $canDo = ModulesHelper::getActions(); JToolBarHelper::title(JText::_('Modules_Manager_Modules'), 'module.png'); if ($canDo->get('core.create')) { //JToolBarHelper::addNew('module.add'); $bar =& JToolBar::getInstance('toolbar'); $bar->appendButton('Popup', 'new', 'New', 'index.php?option=com_modules&view=select&tmpl=component', 850, 400); } if ($canDo->get('core.edit')) { JToolBarHelper::editList('module.edit'); } if ($canDo->get('core.create')) { JToolBarHelper::custom('modules.duplicate', 'copy.png', 'copy_f2.png', 'JToolbar_Duplicate', true); } if ($canDo->get('core.edit')) { JToolBarHelper::custom('modules.publish', 'publish.png', 'publish_f2.png', 'JToolbar_Enable', true); JToolBarHelper::custom('modules.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JToolbar_Disable', true); } if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) { JToolBarHelper::deleteList('', 'modules.delete'); } else { if ($canDo->get('core.edit.state')) { JToolBarHelper::trash('modules.trash'); } } if ($canDo->get('core.admin')) { JToolBarHelper::preferences('com_modules'); } JToolBarHelper::help('screen.module'); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { $state = $this->get('State'); $canDo = ModulesHelper::getActions(); $user = JFactory::getUser(); // Get the toolbar object instance $bar = JToolBar::getInstance('toolbar'); JToolbarHelper::title(JText::_('COM_MODULES_MANAGER_MODULES'), 'cube module'); if ($canDo->get('core.create')) { // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('toolbar.newmodule'); $bar->appendButton('Custom', $layout->render(array()), 'new'); } if ($canDo->get('core.edit')) { JToolbarHelper::editList('module.edit'); } if ($canDo->get('core.create')) { JToolbarHelper::custom('modules.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true); } if ($canDo->get('core.edit.state')) { JToolbarHelper::publish('modules.publish', 'JTOOLBAR_PUBLISH', true); JToolbarHelper::unpublish('modules.unpublish', 'JTOOLBAR_UNPUBLISH', true); JToolbarHelper::checkin('modules.checkin'); } if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) { JToolbarHelper::deleteList('', 'modules.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($canDo->get('core.edit.state')) { JToolbarHelper::trash('modules.trash'); } // Add a batch button if ($user->authorise('core.create', 'com_modules') && $user->authorise('core.edit', 'com_modules') && $user->authorise('core.edit.state', 'com_modules')) { JHtml::_('bootstrap.modal', 'collapseModal'); $title = JText::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button $layout = new JLayoutFile('joomla.toolbar.batch'); $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); } if ($canDo->get('core.admin')) { JToolbarHelper::preferences('com_modules'); } JToolbarHelper::help('JHELP_EXTENSIONS_MODULE_MANAGER'); JHtmlSidebar::addEntry(JText::_('JSITE'), 'index.php?option=com_modules&filter_client_id=0', $this->state->get('filter.client_id') == 0); JHtmlSidebar::addEntry(JText::_('JADMINISTRATOR'), 'index.php?option=com_modules&filter_client_id=1', $this->state->get('filter.client_id') == 1); JHtmlSidebar::setAction('index.php?option=com_modules'); JHtmlSidebar::addFilter('', 'filter_client_id', JHtml::_('select.options', ModulesHelper::getClientOptions(), 'value', 'text', $this->state->get('filter.client_id')), false); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', ModulesHelper::getStateOptions(), 'value', 'text', $this->state->get('filter.state'))); JHtmlSidebar::addFilter(JText::_('COM_MODULES_OPTION_SELECT_POSITION'), 'filter_position', JHtml::_('select.options', ModulesHelper::getPositions($this->state->get('filter.client_id')), 'value', 'text', $this->state->get('filter.position'))); JHtmlSidebar::addFilter(JText::_('COM_MODULES_OPTION_SELECT_MODULE'), 'filter_module', JHtml::_('select.options', ModulesHelper::getModules($this->state->get('filter.client_id')), 'value', 'text', $this->state->get('filter.module'))); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_LANGUAGE'), 'filter_language', JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language'))); $this->sidebar = JHtmlSidebar::render(); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { $state = $this->get('State'); $canDo = ModulesHelper::getActions(); // Get the toolbar object instance $bar = JToolBar::getInstance('toolbar'); JToolbarHelper::title(JText::_($this->config->list_title ? 'COM_MODULES_MANAGER_MODULES' : 'AMM_ADVANCED_MODULES_MANAGER'), 'module.png'); if ($canDo->get('core.create')) { $title = JText::_('JTOOLBAR_NEW'); $dhtml = "<button onClick=\"location.href='index.php?option=com_advancedmodules&view=select'\" class=\"btn btn-small btn-success\">\n\t\t\t\t\t\t<i class=\"icon-plus icon-white\" title=\"{$title}\"></i>\n\t\t\t\t\t\t{$title}</button>"; $bar->appendButton('Custom', $dhtml, 'new'); } if ($canDo->get('core.edit')) { JToolbarHelper::editList('module.edit'); } if ($canDo->get('core.create')) { JToolbarHelper::custom('modules.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true); } if ($canDo->get('core.edit.state')) { JToolbarHelper::publish('modules.publish', 'JTOOLBAR_PUBLISH', true); JToolbarHelper::unpublish('modules.unpublish', 'JTOOLBAR_UNPUBLISH', true); JToolbarHelper::checkin('modules.checkin'); } if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) { JToolbarHelper::deleteList('', 'modules.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($canDo->get('core.edit.state')) { JToolbarHelper::trash('modules.trash'); } // Add a batch button if ($canDo->get('core.edit')) { JHtml::_('bootstrap.modal', 'collapseModal'); $title = JText::_('JTOOLBAR_BATCH'); $dhtml = "<button data-toggle=\"modal\" data-target=\"#collapseModal\" class=\"btn btn-small\">\n\t\t\t\t\t\t<i class=\"icon-checkbox-partial\" title=\"{$title}\"></i>\n\t\t\t\t\t\t{$title}</button>"; $bar->appendButton('Custom', $dhtml, 'batch'); } if ($canDo->get('core.admin')) { JToolbarHelper::preferences('com_advancedmodules', 600, 900); } JToolbarHelper::help('JHELP_EXTENSIONS_MODULE_MANAGER'); JHtmlSidebar::addEntry(JText::_('JSITE'), 'index.php?option=com_advancedmodules&filter_client_id=0', $this->state->get('filter.client_id') == 0); JHtmlSidebar::addEntry(JText::_('JADMINISTRATOR'), 'index.php?option=com_advancedmodules&filter_client_id=1', $this->state->get('filter.client_id') == 1); JHtmlSidebar::setAction('index.php?option=com_modules'); JHtmlSidebar::addFilter('', 'filter_client_id', JHtml::_('select.options', ModulesHelper::getClientOptions(), 'value', 'text', $this->state->get('filter.client_id')), false); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', ModulesHelper::getStateOptions(), 'value', 'text', $this->state->get('filter.state'))); JHtmlSidebar::addFilter(JText::_('COM_MODULES_OPTION_SELECT_POSITION'), 'filter_position', JHtml::_('select.options', ModulesHelper::getPositions($this->state->get('filter.client_id')), 'value', 'text', $this->state->get('filter.position'))); JHtmlSidebar::addFilter(JText::_('COM_MODULES_OPTION_SELECT_MODULE'), 'filter_module', JHtml::_('select.options', ModulesHelper::getModules($this->state->get('filter.client_id')), 'value', 'text', $this->state->get('filter.module'))); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_LANGUAGE'), 'filter_language', JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language'))); $this->sidebar = JHtmlSidebar::render(); }
/** * 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')); $canDo = ModulesHelper::getActions($this->item->id); JToolbarHelper::title(JText::sprintf('COM_MODULES_MANAGER_MODULE', JText::_($this->item->module)), 'cube module'); // For new records, check the create permission. if ($isNew && $canDo->get('core.create')) { JToolbarHelper::apply('module.apply'); JToolbarHelper::save('module.save'); JToolbarHelper::save2new('module.save2new'); JToolbarHelper::cancel('module.cancel'); } else { // Can't save the record if it's checked out. if (!$checkedOut) { // Since it's an existing record, check the edit permission. if ($canDo->get('core.edit')) { JToolbarHelper::apply('module.apply'); JToolbarHelper::save('module.save'); // We can save this record, but check the create permission to see if we can return to make a new one. if ($canDo->get('core.create')) { JToolbarHelper::save2new('module.save2new'); } } } // If checked out, we can still save if ($canDo->get('core.create')) { JToolbarHelper::save2copy('module.save2copy'); } JToolbarHelper::cancel('module.cancel', 'JTOOLBAR_CLOSE'); } // Get the help information for the menu 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() { 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 = ModulesHelper::getActions($this->state->get('filter.category_id'), $this->item->id); $item = $this->get('Item'); JToolBarHelper::title(JText::sprintf('COM_MODULES_MANAGER_MODULE', JText::_($this->item->module)), 'module.png'); // If not checked out, can save the item. if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) { JToolBarHelper::apply('module.apply'); JToolBarHelper::save('module.save'); } if (!$checkedOut && $canDo->get('core.create')) { JToolBarHelper::save2new('module.save2new'); } // If an existing item, can save to a copy. if (!$isNew && $canDo->get('core.create')) { JToolBarHelper::save2copy('module.save2copy'); } if (empty($this->item->id)) { JToolBarHelper::cancel('module.cancel'); } else { JToolBarHelper::cancel('module.cancel', 'JTOOLBAR_CLOSE'); } // Get the help information for the menu 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() { $state = $this->get('State'); $canDo = ModulesHelper::getActions(); JToolBarHelper::title(JText::_('COM_MODULES_MANAGER_MODULES'), 'module.png'); if ($canDo->get('core.create')) { //JToolBarHelper::addNew('module.add'); $bar = JToolBar::getInstance('toolbar'); $bar->appendButton('Popup', 'new', 'JTOOLBAR_NEW', 'index.php?option=com_modules&view=select&tmpl=component', 850, 400); } if ($canDo->get('core.edit')) { JToolBarHelper::editList('module.edit', 'JTOOLBAR_EDIT'); } if ($canDo->get('core.create')) { JToolBarHelper::custom('modules.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true); } if ($canDo->get('core.edit.state')) { JToolBarHelper::divider(); JToolBarHelper::custom('modules.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true); JToolBarHelper::custom('modules.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true); JToolBarHelper::divider(); JToolBarHelper::custom('modules.checkin', 'checkin.png', 'checkin_f2.png', 'JTOOLBAR_CHECKIN', true); } if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) { JToolBarHelper::deleteList('', 'modules.delete', 'JTOOLBAR_EMPTY_TRASH'); JToolBarHelper::divider(); } else { if ($canDo->get('core.edit.state')) { JToolBarHelper::trash('modules.trash', 'JTOOLBAR_TRASH'); JToolBarHelper::divider(); } } if ($canDo->get('core.admin')) { JToolBarHelper::preferences('com_modules'); JToolBarHelper::divider(); } JToolBarHelper::help('JHELP_EXTENSIONS_MODULE_MANAGER'); }
/** * 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')); $canDo = ModulesHelper::getActions($this->item->id); $title = $this->item->module; if ($this->item->xml) { $title = JText::_((string) $this->item->xml->name) . ' [' . $title . ']'; } JToolbarHelper::title(JText::sprintf('AMM_MODULE_EDIT', $title), 'module.png'); // If not checked out, can save the item. if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) { JToolbarHelper::apply('module.apply'); JToolbarHelper::save('module.save'); } if (!$checkedOut && $canDo->get('core.create')) { JToolbarHelper::save2new('module.save2new'); } // If an existing item, can save to a copy. if (!$isNew && $canDo->get('core.create')) { JToolbarHelper::save2copy('module.save2copy'); } if (empty($this->item->id)) { JToolbarHelper::cancel('module.cancel'); } else { JToolbarHelper::cancel('module.cancel', 'JTOOLBAR_CLOSE'); } $tmpl = JFactory::getApplication()->input->get('tmpl'); if ($tmpl != 'component') { if ($canDo->get('core.admin')) { JToolbarHelper::preferences('com_advancedmodules', 600, 900); } // Get the help information for the menu 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); } }