diff --git a/administrator/components/com_categories/View/Categories/HtmlView.php b/administrator/components/com_categories/View/Categories/HtmlView.php index 89ecd29c04316..3807f029249a6 100644 --- a/administrator/components/com_categories/View/Categories/HtmlView.php +++ b/administrator/components/com_categories/View/Categories/HtmlView.php @@ -66,13 +66,6 @@ class HtmlView extends BaseHtmlView */ public $activeFilters; - /** - * The sidebar markup - * - * @var string - */ - protected $string; - /** * Display the view * @@ -105,7 +98,6 @@ public function display($tpl = null) if ($this->getLayout() !== 'modal') { $this->addToolbar(); - $this->sidebar = \JHtmlSidebar::render(); // We do not need to filter by language when multilingual is disabled if (!\JLanguageMultilang::isEnabled()) @@ -256,6 +248,8 @@ protected function addToolbar() } \JToolbarHelper::help($ref_key, ComponentHelper::getParams($component)->exists('helpURL'), $url); + + \JToolbarHelper::submenu(\JHtmlSidebar::getEntries(), ['label' => \JText::_('JGLOBAL_SUBMENU')]); } /** diff --git a/administrator/components/com_categories/tmpl/categories/default.php b/administrator/components/com_categories/tmpl/categories/default.php index 570172b5a1ec3..fbb34bfe71faf 100644 --- a/administrator/components/com_categories/tmpl/categories/default.php +++ b/administrator/components/com_categories/tmpl/categories/default.php @@ -49,12 +49,7 @@ ?>
- sidebar)) { ?> -
- sidebar; ?> -
- -
+
getLayout() !== 'modal') { $this->addToolbar(); - $this->sidebar = \JHtmlSidebar::render(); - // We do not need to filter by language when multilingual is disabled if (!\JLanguageMultilang::isEnabled()) { @@ -202,6 +193,10 @@ protected function addToolbar() } \JToolbarHelper::help('JHELP_CONTENT_ARTICLE_MANAGER'); + + if ($this->getLayout() !== 'modal') { + \JToolbarHelper::submenu(\JHtmlSidebar::getEntries(), ['label' => \JText::_('JGLOBAL_SUBMENU')]); + } } /** diff --git a/administrator/components/com_content/View/Featured/HtmlView.php b/administrator/components/com_content/View/Featured/HtmlView.php index 0b9325289f96c..c763a04109230 100644 --- a/administrator/components/com_content/View/Featured/HtmlView.php +++ b/administrator/components/com_content/View/Featured/HtmlView.php @@ -105,7 +105,6 @@ public function display($tpl = null) } $this->addToolbar(); - $this->sidebar = \JHtmlSidebar::render(); // We do not need to filter by language when multilingual is disabled if (!\JLanguageMultilang::isEnabled()) @@ -160,6 +159,8 @@ protected function addToolbar() } \JToolbarHelper::help('JHELP_CONTENT_FEATURED_ARTICLES'); + + \JToolbarHelper::submenu(\JHtmlSidebar::getEntries(), ['label' => \JText::_('JGLOBAL_SUBMENU')]); } /** diff --git a/administrator/components/com_content/tmpl/articles/default.php b/administrator/components/com_content/tmpl/articles/default.php index 72eaef5f2b445..49f7bbf3c2db5 100644 --- a/administrator/components/com_content/tmpl/articles/default.php +++ b/administrator/components/com_content/tmpl/articles/default.php @@ -64,12 +64,7 @@
- sidebar)) { ?> -
- sidebar; ?> -
- -
+
" method="post" name="adminForm" id="adminForm">
- sidebar)) { ?> -
- sidebar; ?> -
- -
+
state->get('filter.context'), 'fields'); - $this->sidebar = \JHtmlSidebar::render(); - return parent::display($tpl); } @@ -196,6 +186,9 @@ protected function addToolbar() } ToolbarHelper::help('JHELP_COMPONENTS_FIELDS_FIELDS'); + + \FieldsHelper::addSubmenu($this->state->get('filter.context'), 'fields'); + ToolbarHelper::submenu(\JHtmlSidebar::getEntries(), ['label' => \JText::_('JGLOBAL_SUBMENU')]); } /** diff --git a/administrator/components/com_fields/View/Groups/HtmlView.php b/administrator/components/com_fields/View/Groups/HtmlView.php index 43235a8cb34e3..77f140166c031 100644 --- a/administrator/components/com_fields/View/Groups/HtmlView.php +++ b/administrator/components/com_fields/View/Groups/HtmlView.php @@ -58,13 +58,6 @@ class HtmlView extends BaseHtmlView */ protected $state; - /** - * @var string - * - * @since 3.7.0 - */ - protected $sidebar; - /** * Execute and display a template script. * @@ -105,9 +98,6 @@ public function display($tpl = null) $this->filterForm->removeField('language', 'filter'); } - \FieldsHelper::addSubmenu($this->state->get('filter.context'), 'groups'); - $this->sidebar = \JHtmlSidebar::render(); - return parent::display($tpl); } @@ -199,6 +189,9 @@ protected function addToolbar() } ToolbarHelper::help('JHELP_COMPONENTS_FIELDS_FIELD_GROUPS'); + + \FieldsHelper::addSubmenu($this->state->get('filter.context'), 'groups'); + ToolbarHelper::submenu(\JHtmlSidebar::getEntries(), ['label' => \JText::_('JGLOBAL_SUBMENU')]); } /** diff --git a/administrator/components/com_fields/tmpl/fields/default.php b/administrator/components/com_fields/tmpl/fields/default.php index 896a10d01be44..8085f6c93a2fa 100644 --- a/administrator/components/com_fields/tmpl/fields/default.php +++ b/administrator/components/com_fields/tmpl/fields/default.php @@ -35,12 +35,7 @@
- sidebar)) { ?> -
- sidebar; ?> -
- -
+
$this, 'options' => array('selectorFieldName' => 'context'))); ?> items)) : ?> diff --git a/administrator/components/com_fields/tmpl/groups/default.php b/administrator/components/com_fields/tmpl/groups/default.php index 8689551e56a8c..1ab09ae0057c4 100644 --- a/administrator/components/com_fields/tmpl/groups/default.php +++ b/administrator/components/com_fields/tmpl/groups/default.php @@ -40,12 +40,7 @@
- sidebar)) { ?> -
- sidebar; ?> -
- -
+
$this, 'options' => array('selectorFieldName' => 'context'))); ?> items)) : ?> diff --git a/administrator/language/en-GB/en-GB.ini b/administrator/language/en-GB/en-GB.ini index 9f8f7e4913e96..9794a69b35b2b 100644 --- a/administrator/language/en-GB/en-GB.ini +++ b/administrator/language/en-GB/en-GB.ini @@ -618,6 +618,7 @@ JGLOBAL_VOTES_ASC="Votes ascending" JGLOBAL_VOTES_DESC="Votes descending" JGLOBAL_WARNJAVASCRIPT="Warning! JavaScript must be enabled for proper operation of the Administrator Backend." JGLOBAL_WIDTH="Width" +JGLOBAL_SUBMENU="Submenu" JGRID_HEADING_ACCESS="Access" JGRID_HEADING_ACCESS_ASC="Access ascending" diff --git a/layouts/joomla/toolbar/submenu.php b/layouts/joomla/toolbar/submenu.php new file mode 100644 index 0000000000000..f2b61f757164a --- /dev/null +++ b/layouts/joomla/toolbar/submenu.php @@ -0,0 +1,49 @@ +input->get('option'); +$elementId = 'js-submenu-'.$option; + +HTMLHelper::_('jquery.framework'); + +Factory::getDocument()->addScriptDeclaration(' + jQuery(document).ready(function($) { + $("#'.$elementId.'").change(function() { + window.location.href = $(this).val(); + }); + }); +'); + +if (count($entries) > 0) { ?> +
+ + +
+ diff --git a/libraries/src/Toolbar/ToolbarHelper.php b/libraries/src/Toolbar/ToolbarHelper.php index 95780d307ea0b..802c7098602ea 100644 --- a/libraries/src/Toolbar/ToolbarHelper.php +++ b/libraries/src/Toolbar/ToolbarHelper.php @@ -607,6 +607,26 @@ public static function preferences($component, $height = '550', $width = '875', ); } + /** + * Writes a configuration button and invokes a cancel operation (eg a checkin). + * + * + * @param array $entries + * @param array $options + * + * @return void + * + * @since 1.5 + */ + public static function submenu(array $entries, array $options = []) + { + $layout = new FileLayout('joomla.toolbar.submenu'); + + $bar = Toolbar::getInstance(); + $bar->appendButton('Custom', $layout->render(['entries' => $entries, 'options' => $options]), 'submenu'); + + } + /** * Writes a version history *