diff --git a/administrator/components/com_admin/views/profile/view.html.php b/administrator/components/com_admin/views/profile/view.html.php index 1599098639..a6879f36a6 100644 --- a/administrator/components/com_admin/views/profile/view.html.php +++ b/administrator/components/com_admin/views/profile/view.html.php @@ -83,8 +83,15 @@ protected function addToolbar() JFactory::getApplication()->input->set('hidemainmenu', 1); JToolbarHelper::title(JText::_('COM_ADMIN_VIEW_PROFILE_TITLE'), 'user user-profile'); - JToolbarHelper::apply('profile.apply'); - JToolbarHelper::save('profile.save'); + + JToolbarHelper::saveGroup( + [ + ['apply', 'profile.apply'], + ['save', 'profile.save'] + ], + 'btn-success' + ); + JToolbarHelper::cancel('profile.cancel', 'JTOOLBAR_CLOSE'); JToolbarHelper::divider(); JToolbarHelper::help('JHELP_ADMIN_USER_PROFILE_EDIT'); diff --git a/administrator/components/com_banners/views/banner/view.html.php b/administrator/components/com_banners/views/banner/view.html.php index 855cdf1a3f..930de4badb 100644 --- a/administrator/components/com_banners/views/banner/view.html.php +++ b/administrator/components/com_banners/views/banner/view.html.php @@ -88,24 +88,31 @@ protected function addToolbar() JToolbarHelper::title($isNew ? JText::_('COM_BANNERS_MANAGER_BANNER_NEW') : JText::_('COM_BANNERS_MANAGER_BANNER_EDIT'), 'bookmark banners'); + $toolbarButtons = []; + // 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'); + $toolbarButtons[] = ['apply', 'banner.apply']; + $toolbarButtons[] = ['save', 'banner.save']; if ($canDo->get('core.create')) { - JToolbarHelper::save2new('banner.save2new'); + $toolbarButtons[] = ['save2new', 'banner.save2new']; } } // If an existing item, can save to a copy. if (!$isNew && $canDo->get('core.create')) { - JToolbarHelper::save2copy('banner.save2copy'); + $toolbarButtons[] = ['save2copy', 'banner.save2copy']; } + JToolbarHelper::saveGroup( + $toolbarButtons, + 'btn-success' + ); + if (empty($this->item->id)) { JToolbarHelper::cancel('banner.cancel'); diff --git a/administrator/components/com_banners/views/client/view.html.php b/administrator/components/com_banners/views/client/view.html.php index 3ae6d6df85..f36f03c5cf 100644 --- a/administrator/components/com_banners/views/client/view.html.php +++ b/administrator/components/com_banners/views/client/view.html.php @@ -94,24 +94,31 @@ protected function addToolbar() 'bookmark banners-clients' ); + $toolbarButtons = []; + // 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'); + $toolbarButtons[] = ['apply', 'client.apply']; + $toolbarButtons[] = ['save', 'client.save']; } if (!$checkedOut && $canDo->get('core.create')) { - JToolbarHelper::save2new('client.save2new'); + $toolbarButtons[] = ['save2new', 'client.save2new']; } // If an existing item, can save to a copy. if (!$isNew && $canDo->get('core.create')) { - JToolbarHelper::save2copy('client.save2copy'); + $toolbarButtons[] = ['save2copy', 'client.save2copy']; } + JToolbarHelper::saveGroup( + $toolbarButtons, + 'btn-success' + ); + if (empty($this->item->id)) { JToolbarHelper::cancel('client.cancel'); diff --git a/administrator/components/com_categories/views/category/view.html.php b/administrator/components/com_categories/views/category/view.html.php index 0885a62b96..00aa3baf02 100644 --- a/administrator/components/com_categories/views/category/view.html.php +++ b/administrator/components/com_categories/views/category/view.html.php @@ -182,9 +182,15 @@ protected function addToolbar() // For new records, check the create permission. if ($isNew && (count($user->getAuthorisedCategories($component, 'core.create')) > 0)) { - JToolbarHelper::apply('category.apply'); - JToolbarHelper::save('category.save'); - JToolbarHelper::save2new('category.save2new'); + JToolbarHelper::saveGroup( + [ + ['apply', 'category.apply'], + ['save', 'category.save'], + ['save2new', 'category.save2new'] + ], + 'btn-success' + ); + JToolbarHelper::cancel('category.cancel'); } @@ -194,24 +200,31 @@ protected function addToolbar() // Since it's an existing record, check the edit permission, or fall back to edit own if the owner. $itemEditable = $canDo->get('core.edit') || ($canDo->get('core.edit.own') && $this->item->created_user_id == $userId); + $toolbarButtons = []; + // Can't save the record if it's checked out and editable if (!$checkedOut && $itemEditable) { - JToolbarHelper::apply('category.apply'); - JToolbarHelper::save('category.save'); + $toolbarButtons[] = ['apply', 'category.apply']; + $toolbarButtons[] = ['save', 'category.save']; if ($canDo->get('core.create')) { - JToolbarHelper::save2new('category.save2new'); + $toolbarButtons[] = ['save2new', 'category.save2new']; } } // If an existing item, can save to a copy. if ($canDo->get('core.create')) { - JToolbarHelper::save2copy('category.save2copy'); + $toolbarButtons[] = ['save2copy', 'category.save2copy']; } + JToolbarHelper::saveGroup( + $toolbarButtons, + 'btn-success' + ); + if ($componentParams->get('save_history', 0) && $itemEditable) { $typeAlias = $extension . '.category'; diff --git a/administrator/components/com_config/view/application/html.php b/administrator/components/com_config/view/application/html.php index 2cb2d56d15..d864bd9faa 100644 --- a/administrator/components/com_config/view/application/html.php +++ b/administrator/components/com_config/view/application/html.php @@ -63,13 +63,12 @@ public function render() // Load settings for the FTP layer. $ftp = JClientHelper::setCredentialsFromRequest('ftp'); - $this->form = &$form; - $this->data = &$data; - $this->ftp = &$ftp; + $this->form = &$form; + $this->data = &$data; + $this->ftp = &$ftp; $this->usersParams = &$usersParams; $this->mediaParams = &$mediaParams; - - $this->components = ConfigHelperConfig::getComponentsWithConfig(); + $this->components = ConfigHelperConfig::getComponentsWithConfig(); ConfigHelperConfig::loadLanguageForComponents($this->components); $this->userIsSuperAdmin = $user->authorise('core.admin'); @@ -89,8 +88,13 @@ public function render() protected function addToolbar() { JToolbarHelper::title(JText::_('COM_CONFIG_GLOBAL_CONFIGURATION'), 'equalizer config'); - JToolbarHelper::apply('config.save.application.apply'); - JToolbarHelper::save('config.save.application.save'); + JToolbarHelper::saveGroup( + [ + ['apply', 'config.save.application.apply'], + ['save', 'config.save.application.save'] + ], + 'btn-success' + ); JToolbarHelper::divider(); JToolbarHelper::cancel('config.cancel.application'); JToolbarHelper::divider(); diff --git a/administrator/components/com_config/view/component/html.php b/administrator/components/com_config/view/component/html.php index 1fdf484e4e..5bbbbfd797 100644 --- a/administrator/components/com_config/view/component/html.php +++ b/administrator/components/com_config/view/component/html.php @@ -86,8 +86,13 @@ public function render() protected function addToolbar() { JToolbarHelper::title(JText::_($this->component->option . '_configuration'), 'equalizer config'); - JToolbarHelper::apply('config.save.component.apply'); - JToolbarHelper::save('config.save.component.save'); + JToolbarHelper::saveGroup( + [ + ['apply', 'config.save.component.apply'], + ['save', 'config.save.component.save'] + ], + 'btn-success' + ); JToolbarHelper::divider(); JToolbarHelper::cancel('config.cancel.component'); JToolbarHelper::divider(); diff --git a/administrator/components/com_contact/views/contact/view.html.php b/administrator/components/com_contact/views/contact/view.html.php index 4249b17f8c..3af6e1b5fa 100644 --- a/administrator/components/com_contact/views/contact/view.html.php +++ b/administrator/components/com_contact/views/contact/view.html.php @@ -152,16 +152,16 @@ protected function addToolbar() $toolbarButtons[] = ['save2copy', 'contact.save2copy']; } - if ($this->state->params->get('save_history', 0) && $itemEditable) - { - JToolbarHelper::versions('com_contact.contact', $this->item->id); - } - JToolbarHelper::saveGroup( $toolbarButtons, 'btn-success' ); + if ($this->state->params->get('save_history', 0) && $itemEditable) + { + JToolbarHelper::versions('com_contact.contact', $this->item->id); + } + JToolbarHelper::cancel('contact.cancel', 'JTOOLBAR_CLOSE'); } diff --git a/administrator/components/com_content/views/article/view.html.php b/administrator/components/com_content/views/article/view.html.php index eeb5867e7d..ae0994f0bb 100644 --- a/administrator/components/com_content/views/article/view.html.php +++ b/administrator/components/com_content/views/article/view.html.php @@ -133,9 +133,15 @@ protected function addToolbar() // For new records, check the create permission. if ($isNew && (count($user->getAuthorisedCategories('com_content', 'core.create')) > 0)) { - JToolbarHelper::apply('article.apply'); - JToolbarHelper::save('article.save'); - JToolbarHelper::save2new('article.save2new'); + JToolbarHelper::saveGroup( + [ + ['apply', 'article.apply'], + ['save', 'article.save'], + ['save2new', 'article.save2new'] + ], + 'btn-success' + ); + JToolbarHelper::cancel('article.cancel'); } else @@ -143,25 +149,32 @@ protected function addToolbar() // Since it's an existing record, check the edit permission, or fall back to edit own if the owner. $itemEditable = $canDo->get('core.edit') || ($canDo->get('core.edit.own') && $this->item->created_by == $userId); + $toolbarButtons = []; + // Can't save the record if it's checked out and editable if (!$checkedOut && $itemEditable) { - JToolbarHelper::apply('article.apply'); - JToolbarHelper::save('article.save'); + $toolbarButtons[] = ['apply', 'article.apply']; + $toolbarButtons[] = ['save', 'article.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('article.save2new'); + $toolbarButtons[] = ['save2new', 'article.save2new']; } } // If checked out, we can still save if ($canDo->get('core.create')) { - JToolbarHelper::save2copy('article.save2copy'); + $toolbarButtons[] = ['save2copy', 'article.save2copy']; } + JToolbarHelper::saveGroup( + $toolbarButtons, + 'btn-success' + ); + if ($this->state->params->get('save_history', 0) && $itemEditable) { JToolbarHelper::versions('com_content.article', $this->item->id); diff --git a/administrator/components/com_cpanel/views/cpanel/tmpl/default.php b/administrator/components/com_cpanel/views/cpanel/tmpl/default.php index eac2a8e51e..17715b96d2 100644 --- a/administrator/components/com_cpanel/views/cpanel/tmpl/default.php +++ b/administrator/components/com_cpanel/views/cpanel/tmpl/default.php @@ -13,10 +13,35 @@ $user = JFactory::getUser(); ?> + +authorise('core.manage', 'com_postinstall') && $this->postinstall_message_count) : ?> +
+
+
+

+ +

+

+ +

+

+ +

+

+ + + +

+
+
+
+ +
+ -
+
-
- authorise('core.manage', 'com_postinstall') && $this->postinstall_message_count) : ?> -
-
-
-

- -

-

- -

-

- -

-

- - - -

-
-
-
- -
- modules as $module) - { - // Get module parameters - $params = new Registry; - $params->loadString($module->params); - $bootstrapSize = $params->get('bootstrap_size', 6); + modules as $module) + { + // Get module parameters + $params = new Registry; + $params->loadString($module->params); + $bootstrapSize = $params->get('bootstrap_size', 6); - $cols += $bootstrapSize; - if ($cols > 12) - { - echo '
'; - $cols = $bootstrapSize; - } + $cols += $bootstrapSize; + if ($cols > 12) + { + echo '
'; + $cols = $bootstrapSize; + } - echo JModuleHelper::renderModule($module, array('style' => 'well')); - } - ?> -
-
+ echo JModuleHelper::renderModule($module, array('style' => 'well')); + } + ?>
diff --git a/administrator/components/com_finder/views/filter/view.html.php b/administrator/components/com_finder/views/filter/view.html.php index 9e86009528..54d3428722 100644 --- a/administrator/components/com_finder/views/filter/view.html.php +++ b/administrator/components/com_finder/views/filter/view.html.php @@ -106,28 +106,35 @@ protected function addToolbar() // For new records, check the create permission. if ($canDo->get('core.create')) { - JToolbarHelper::apply('filter.apply'); - JToolbarHelper::save('filter.save'); - JToolbarHelper::save2new('filter.save2new'); + JToolbarHelper::saveGroup( + [ + ['apply', 'filter.apply'], + ['save', 'filter.save'], + ['save2new', 'filter.save2new'] + ], + 'btn-success' + ); } JToolbarHelper::cancel('filter.cancel'); } else { + $toolbarButtons = []; + // 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('filter.apply'); - JToolbarHelper::save('filter.save'); + $toolbarButtons[] = ['apply', 'filter.apply']; + $toolbarButtons[] = ['save', 'filter.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('filter.save2new'); + $toolbarButtons[] = ['save2new', 'filter.save2new']; } } } @@ -135,9 +142,14 @@ protected function addToolbar() // If an existing item, can save as a copy if ($canDo->get('core.create')) { - JToolbarHelper::save2copy('filter.save2copy'); + $toolbarButtons[] = ['save2copy', 'filter.save2copy']; } + JToolbarHelper::saveGroup( + $toolbarButtons, + 'btn-success' + ); + JToolbarHelper::cancel('filter.cancel', 'JTOOLBAR_CLOSE'); } diff --git a/administrator/components/com_languages/views/language/view.html.php b/administrator/components/com_languages/views/language/view.html.php index 07471d5876..bdb6bbe0be 100644 --- a/administrator/components/com_languages/views/language/view.html.php +++ b/administrator/components/com_languages/views/language/view.html.php @@ -67,18 +67,25 @@ protected function addToolbar() JText::_($isNew ? 'COM_LANGUAGES_VIEW_LANGUAGE_EDIT_NEW_TITLE' : 'COM_LANGUAGES_VIEW_LANGUAGE_EDIT_EDIT_TITLE'), 'comments-2 langmanager' ); + $toolbarButtons = []; + if (($isNew && $canDo->get('core.create')) || (!$isNew && $canDo->get('core.edit'))) { - JToolbarHelper::apply('language.apply'); - JToolbarHelper::save('language.save'); + $toolbarButtons[] = ['apply', 'language.apply']; + $toolbarButtons[] = ['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'); + $toolbarButtons[] = ['save2new', 'language.save2new']; } + JToolbarHelper::saveGroup( + $toolbarButtons, + 'btn-success' + ); + if ($isNew) { JToolbarHelper::cancel('language.cancel'); diff --git a/administrator/components/com_languages/views/override/view.html.php b/administrator/components/com_languages/views/override/view.html.php index 623a4be2b0..65a42c2b88 100644 --- a/administrator/components/com_languages/views/override/view.html.php +++ b/administrator/components/com_languages/views/override/view.html.php @@ -95,18 +95,25 @@ protected function addToolbar() JToolbarHelper::title(JText::_('COM_LANGUAGES_VIEW_OVERRIDE_EDIT_TITLE'), 'comments-2 langmanager'); + $toolbarButtons = []; + if ($canDo->get('core.edit')) { - JToolbarHelper::apply('override.apply'); - JToolbarHelper::save('override.save'); + $toolbarButtons[] = ['apply', 'override.apply']; + $toolbarButtons[] = ['save', 'override.save']; } // This component does not support Save as Copy. if ($canDo->get('core.edit') && $canDo->get('core.create')) { - JToolbarHelper::save2new('override.save2new'); + $toolbarButtons[] = ['save2new', 'override.save2new']; } + JToolbarHelper::saveGroup( + $toolbarButtons, + 'btn-success' + ); + if (empty($this->item->key)) { JToolbarHelper::cancel('override.cancel'); diff --git a/administrator/components/com_menus/views/item/view.html.php b/administrator/components/com_menus/views/item/view.html.php index 073f10e094..d2c520865d 100644 --- a/administrator/components/com_menus/views/item/view.html.php +++ b/administrator/components/com_menus/views/item/view.html.php @@ -114,36 +114,43 @@ protected function addToolbar() JToolbarHelper::title(JText::_($isNew ? 'COM_MENUS_VIEW_NEW_ITEM_TITLE' : 'COM_MENUS_VIEW_EDIT_ITEM_TITLE'), 'list menu-add'); + $toolbarButtons = []; + // 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('item.apply'); + $toolbarButtons[] = ['apply', 'item.apply']; } - JToolbarHelper::save('item.save'); + $toolbarButtons[] = ['save', 'item.save']; } // If not checked out, can save the item. if (!$isNew && !$checkedOut && $canDo->get('core.edit')) { - JToolbarHelper::apply('item.apply'); - JToolbarHelper::save('item.save'); + $toolbarButtons[] = ['apply', 'item.apply']; + $toolbarButtons[] = ['save', 'item.save']; } // If the user can create new items, allow them to see Save & New if ($canDo->get('core.create')) { - JToolbarHelper::save2new('item.save2new'); + $toolbarButtons[] = ['save2new', 'item.save2new']; } // If an existing item, can save to a copy only if we have create rights. if (!$isNew && $canDo->get('core.create')) { - JToolbarHelper::save2copy('item.save2copy'); + $toolbarButtons[] = ['save2copy', 'item.save2copy']; } + JToolbarHelper::saveGroup( + $toolbarButtons, + 'btn-success' + ); + if ($isNew) { JToolbarHelper::cancel('item.cancel'); diff --git a/administrator/components/com_menus/views/menu/view.html.php b/administrator/components/com_menus/views/menu/view.html.php index f4dbeba7e3..d0a6205bda 100644 --- a/administrator/components/com_menus/views/menu/view.html.php +++ b/administrator/components/com_menus/views/menu/view.html.php @@ -82,30 +82,37 @@ protected function addToolbar() JToolbarHelper::title(JText::_($isNew ? 'COM_MENUS_VIEW_NEW_MENU_TITLE' : 'COM_MENUS_VIEW_EDIT_MENU_TITLE'), 'list menu'); + $toolbarButtons = []; + // If a new item, can save the item. Allow users with edit permissions to apply changes to prevent returning to grid. if ($isNew && $this->canDo->get('core.create')) { if ($this->canDo->get('core.edit')) { - JToolbarHelper::apply('menu.apply'); + $toolbarButtons[] = ['apply', 'menu.apply']; } - JToolbarHelper::save('menu.save'); + $toolbarButtons[] = ['save', 'menu.save']; } // If user can edit, can save the item. if (!$isNew && $this->canDo->get('core.edit')) { - JToolbarHelper::apply('menu.apply'); - JToolbarHelper::save('menu.save'); + $toolbarButtons[] = ['apply', 'menu.apply']; + $toolbarButtons[] = ['save', 'menu.save']; } // If the user can create new items, allow them to see Save & New if ($this->canDo->get('core.create')) { - JToolbarHelper::save2new('menu.save2new'); + $toolbarButtons[] = ['save2new', 'menu.save2new']; } + JToolbarHelper::saveGroup( + $toolbarButtons, + 'btn-success' + ); + if ($isNew) { JToolbarHelper::cancel('menu.cancel'); diff --git a/administrator/components/com_modules/views/module/view.html.php b/administrator/components/com_modules/views/module/view.html.php index e46468ade7..b3021cd369 100644 --- a/administrator/components/com_modules/views/module/view.html.php +++ b/administrator/components/com_modules/views/module/view.html.php @@ -69,26 +69,34 @@ protected function addToolbar() // 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::saveGroup( + [ + ['apply', 'module.apply'], + ['save', 'module.save'], + ['save2new', 'module.save2new'] + ], + 'btn-success' + ); + JToolbarHelper::cancel('module.cancel'); } else { + $toolbarButtons = []; + // 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'); + $toolbarButtons[] = ['apply', 'module.apply']; + $toolbarButtons[] = ['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'); + $toolbarButtons[] = ['save2new', 'module.save2new']; } } } @@ -96,9 +104,14 @@ protected function addToolbar() // If checked out, we can still save if ($canDo->get('core.create')) { - JToolbarHelper::save2copy('module.save2copy'); + $toolbarButtons[] = ['save2copy', 'module.save2copy']; } + JToolbarHelper::saveGroup( + $toolbarButtons, + 'btn-success' + ); + JToolbarHelper::cancel('module.cancel', 'JTOOLBAR_CLOSE'); } diff --git a/administrator/components/com_newsfeeds/views/newsfeed/view.html.php b/administrator/components/com_newsfeeds/views/newsfeed/view.html.php index 9507878cc5..3fafc3d426 100644 --- a/administrator/components/com_newsfeeds/views/newsfeed/view.html.php +++ b/administrator/components/com_newsfeeds/views/newsfeed/view.html.php @@ -110,21 +110,28 @@ protected function addToolbar() JToolbarHelper::title($isNew ? JText::_('COM_NEWSFEEDS_MANAGER_NEWSFEED_NEW') : JText::_('COM_NEWSFEEDS_MANAGER_NEWSFEED_EDIT'), 'feed newsfeeds'); + $toolbarButtons = []; + // 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'); + $toolbarButtons[] = ['apply', 'newsfeed.apply']; + $toolbarButtons[] = ['save', 'newsfeed.save']; } if (!$checkedOut && count($user->getAuthorisedCategories('com_newsfeeds', 'core.create')) > 0) { - JToolbarHelper::save2new('newsfeed.save2new'); + $toolbarButtons[] = ['save2new', 'newsfeed.save2new']; } // If an existing item, can save to a copy. if (!$isNew && $canDo->get('core.create')) { - JToolbarHelper::save2copy('newsfeed.save2copy'); + $toolbarButtons[] = ['save2copy', 'newsfeed.save2copy']; } + + JToolbarHelper::saveGroup( + $toolbarButtons, + 'btn-success' + ); if (empty($this->item->id)) { diff --git a/administrator/components/com_plugins/views/plugin/view.html.php b/administrator/components/com_plugins/views/plugin/view.html.php index 2b62ea4ada..2044393f01 100644 --- a/administrator/components/com_plugins/views/plugin/view.html.php +++ b/administrator/components/com_plugins/views/plugin/view.html.php @@ -65,8 +65,13 @@ protected function addToolbar() // If not checked out, can save the item. if ($canDo->get('core.edit')) { - JToolbarHelper::apply('plugin.apply'); - JToolbarHelper::save('plugin.save'); + JToolbarHelper::saveGroup( + [ + ['apply', 'plugin.apply'], + ['save', 'plugin.save'] + ], + 'btn-success' + ); } JToolbarHelper::cancel('plugin.cancel', 'JTOOLBAR_CLOSE'); diff --git a/administrator/components/com_redirect/views/link/view.html.php b/administrator/components/com_redirect/views/link/view.html.php index 4e7f53436a..369336e397 100644 --- a/administrator/components/com_redirect/views/link/view.html.php +++ b/administrator/components/com_redirect/views/link/view.html.php @@ -65,11 +65,13 @@ protected function addToolbar() JToolbarHelper::title($isNew ? JText::_('COM_REDIRECT_MANAGER_LINK_NEW') : JText::_('COM_REDIRECT_MANAGER_LINK_EDIT'), 'refresh redirect'); + $toolbarButtons = []; + // If not checked out, can save the item. if ($canDo->get('core.edit')) { - JToolbarHelper::apply('link.apply'); - JToolbarHelper::save('link.save'); + $toolbarButtons[] = ['apply', 'link.apply']; + $toolbarButtons[] = ['save', 'link.save']; } /** @@ -79,9 +81,14 @@ protected function addToolbar() */ if ($canDo->get('core.edit') && $canDo->get('core.create')) { - JToolbarHelper::save2new('link.save2new'); + $toolbarButtons[] = ['save2new', 'link.save2new']; } + JToolbarHelper::saveGroup( + $toolbarButtons, + 'btn-success' + ); + if (empty($this->item->id)) { JToolbarHelper::cancel('link.cancel'); diff --git a/administrator/components/com_tags/views/tag/view.html.php b/administrator/components/com_tags/views/tag/view.html.php index 2315fe51a2..682b799d69 100644 --- a/administrator/components/com_tags/views/tag/view.html.php +++ b/administrator/components/com_tags/views/tag/view.html.php @@ -87,9 +87,15 @@ protected function addToolbar() // For new records, check the create permission. if ($isNew) { - JToolbarHelper::apply('tag.apply'); - JToolbarHelper::save('tag.save'); - JToolbarHelper::save2new('tag.save2new'); + JToolbarHelper::saveGroup( + [ + ['apply', 'tag.apply'], + ['save', 'tag.save'], + ['save2new', 'tag.save2new'] + ], + 'btn-success' + ); + JToolbarHelper::cancel('tag.cancel'); } @@ -99,24 +105,31 @@ protected function addToolbar() // Since it's an existing record, check the edit permission, or fall back to edit own if the owner. $itemEditable = $canDo->get('core.edit') || ($canDo->get('core.edit.own') && $this->item->created_user_id == $userId); + $toolbarButtons = []; + // Can't save the record if it's checked out and editable if (!$checkedOut && $itemEditable) { - JToolbarHelper::apply('tag.apply'); - JToolbarHelper::save('tag.save'); + $toolbarButtons[] = ['apply', 'tag.apply']; + $toolbarButtons[] = ['save', 'tag.save']; if ($canDo->get('core.create')) { - JToolbarHelper::save2new('tag.save2new'); + $toolbarButtons[] = ['save2new', 'tag.save2new']; } } // If an existing item, can save to a copy. if ($canDo->get('core.create')) { - JToolbarHelper::save2copy('tag.save2copy'); + $toolbarButtons[] = ['save2copy', 'tag.save2copy']; } + JToolbarHelper::saveGroup( + $toolbarButtons, + 'btn-success' + ); + if ($this->state->params->get('save_history', 0) && $itemEditable) { JToolbarHelper::versions('com_tags.tag', $this->item->id); diff --git a/administrator/components/com_templates/models/template.php b/administrator/components/com_templates/models/template.php index 94650451fb..edaacbdc55 100644 --- a/administrator/components/com_templates/models/template.php +++ b/administrator/components/com_templates/models/template.php @@ -116,7 +116,7 @@ public function getDirectoryTree($dir) foreach ($dirFiles as $key => $value) { - if (!in_array($value, array(".", ".."))) + if (!in_array($value, array('.', '..', 'node_modules'))) { if (is_dir($dir . $value)) { diff --git a/administrator/components/com_templates/views/style/view.html.php b/administrator/components/com_templates/views/style/view.html.php index e49858eca1..099d9d8cde 100644 --- a/administrator/components/com_templates/views/style/view.html.php +++ b/administrator/components/com_templates/views/style/view.html.php @@ -85,19 +85,26 @@ protected function addToolbar() : JText::_('COM_TEMPLATES_MANAGER_EDIT_STYLE'), 'eye thememanager' ); + $toolbarButtons = []; + // If not checked out, can save the item. if ($canDo->get('core.edit')) { - JToolbarHelper::apply('style.apply'); - JToolbarHelper::save('style.save'); + $toolbarButtons[] = ['apply', 'style.apply']; + $toolbarButtons[] = ['save', 'style.save']; } // If an existing item, can save to a copy. if (!$isNew && $canDo->get('core.create')) { - JToolbarHelper::save2copy('style.save2copy'); + $toolbarButtons[] = ['save2copy', 'style.save2copy']; } + JToolbarHelper::saveGroup( + $toolbarButtons, + 'btn-success' + ); + if (empty($this->item->id)) { JToolbarHelper::cancel('style.cancel'); diff --git a/administrator/components/com_templates/views/template/view.html.php b/administrator/components/com_templates/views/template/view.html.php index eeab5e9840..b0dcdbc241 100644 --- a/administrator/components/com_templates/views/template/view.html.php +++ b/administrator/components/com_templates/views/template/view.html.php @@ -188,8 +188,13 @@ protected function addToolbar() // Add an Apply and save button if ($this->type == 'file') { - JToolbarHelper::apply('template.apply'); - JToolbarHelper::save('template.save'); + JToolbarHelper::saveGroup( + [ + ['apply', 'template.apply'], + ['save', 'template.save'] + ], + 'btn-success' + ); } // Add a Crop and Resize button elseif ($this->type == 'image') diff --git a/administrator/components/com_users/views/group/view.html.php b/administrator/components/com_users/views/group/view.html.php index 2143050713..bc8a56ef60 100644 --- a/administrator/components/com_users/views/group/view.html.php +++ b/administrator/components/com_users/views/group/view.html.php @@ -75,23 +75,30 @@ protected function addToolbar() JToolbarHelper::title(JText::_($isNew ? 'COM_USERS_VIEW_NEW_GROUP_TITLE' : 'COM_USERS_VIEW_EDIT_GROUP_TITLE'), 'users groups-add'); + $toolbarButtons = []; + if ($canDo->get('core.edit') || $canDo->get('core.create')) { - JToolbarHelper::apply('group.apply'); - JToolbarHelper::save('group.save'); + $toolbarButtons[] = ['apply', 'group.apply']; + $toolbarButtons[] = ['save', 'group.save']; } if ($canDo->get('core.create')) { - JToolbarHelper::save2new('group.save2new'); + $toolbarButtons[] = ['save2new', 'group.save2new']; } // If an existing item, can save to a copy. if (!$isNew && $canDo->get('core.create')) { - JToolbarHelper::save2copy('group.save2copy'); + $toolbarButtons[] = ['save2copy', 'group.save2copy']; } + JToolbarHelper::saveGroup( + $toolbarButtons, + 'btn-success' + ); + if (empty($this->item->id)) { JToolbarHelper::cancel('group.cancel'); diff --git a/administrator/components/com_users/views/level/view.html.php b/administrator/components/com_users/views/level/view.html.php index 70c4c91efe..09e1135c76 100644 --- a/administrator/components/com_users/views/level/view.html.php +++ b/administrator/components/com_users/views/level/view.html.php @@ -75,23 +75,30 @@ protected function addToolbar() JToolbarHelper::title(JText::_($isNew ? 'COM_USERS_VIEW_NEW_LEVEL_TITLE' : 'COM_USERS_VIEW_EDIT_LEVEL_TITLE'), 'users levels-add'); + $toolbarButtons = []; + if ($canDo->get('core.edit') || $canDo->get('core.create')) { - JToolbarHelper::apply('level.apply'); - JToolbarHelper::save('level.save'); + $toolbarButtons[] = ['apply', 'level.apply']; + $toolbarButtons[] = ['save', 'level.save']; } if ($canDo->get('core.create')) { - JToolbarHelper::save2new('level.save2new'); + $toolbarButtons[] = ['save2new', 'level.save2new']; } // If an existing item, can save to a copy. if (!$isNew && $canDo->get('core.create')) { - JToolbarHelper::save2copy('level.save2copy'); + $toolbarButtons[] = ['save2copy', 'level.save2copy']; } + JToolbarHelper::saveGroup( + $toolbarButtons, + 'btn-success' + ); + if (empty($this->item->id)) { JToolbarHelper::cancel('level.cancel'); diff --git a/administrator/components/com_users/views/note/view.html.php b/administrator/components/com_users/views/note/view.html.php index 37476dcbe5..626a4c1a7e 100644 --- a/administrator/components/com_users/views/note/view.html.php +++ b/administrator/components/com_users/views/note/view.html.php @@ -90,24 +90,31 @@ protected function addToolbar() JToolbarHelper::title(JText::_('COM_USERS_NOTES'), 'users user'); + $toolbarButtons = []; + // 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'); + $toolbarButtons[] = ['apply', 'note.apply']; + $toolbarButtons[] = ['save', 'note.save']; } if (!$checkedOut && (count($user->getAuthorisedCategories('com_users', 'core.create')))) { - JToolbarHelper::save2new('note.save2new'); + $toolbarButtons[] = ['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'); + $toolbarButtons[] = ['save2copy', 'note.save2copy']; } + JToolbarHelper::saveGroup( + $toolbarButtons, + 'btn-success' + ); + if (empty($this->item->id)) { JToolbarHelper::cancel('note.cancel'); diff --git a/administrator/components/com_users/views/user/view.html.php b/administrator/components/com_users/views/user/view.html.php index 60d07cc20a..717bcbaf35 100644 --- a/administrator/components/com_users/views/user/view.html.php +++ b/administrator/components/com_users/views/user/view.html.php @@ -90,17 +90,24 @@ protected function addToolbar() 'user ' . ($isNew ? 'user-add' : ($isProfile ? 'user-profile' : 'user-edit')) ); + $toolbarButtons = []; + if ($canDo->get('core.edit') || $canDo->get('core.create')) { - JToolbarHelper::apply('user.apply'); - JToolbarHelper::save('user.save'); + $toolbarButtons[] = ['apply', 'user.apply']; + $toolbarButtons[] = ['save', 'user.save']; } if ($canDo->get('core.create') && $canDo->get('core.manage')) { - JToolbarHelper::save2new('user.save2new'); + $toolbarButtons[] = ['save2new', 'user.save2new']; } + JToolbarHelper::saveGroup( + $toolbarButtons, + 'btn-success' + ); + if (empty($this->item->id)) { JToolbarHelper::cancel('user.cancel'); diff --git a/administrator/modules/mod_logged/tmpl/default.php b/administrator/modules/mod_logged/tmpl/default.php index 0e39a1246e..6cd4e8a3ae 100644 --- a/administrator/modules/mod_logged/tmpl/default.php +++ b/administrator/modules/mod_logged/tmpl/default.php @@ -42,9 +42,12 @@
-
- time, JText::_('DATE_FORMAT_LC5')); ?> -
+ + + + time, JText::_('DATE_FORMAT_LC5')); ?> + +
diff --git a/administrator/modules/mod_menu/tmpl/default_disabled.php b/administrator/modules/mod_menu/tmpl/default_disabled.php index e80738ae9a..1caa09f29b 100644 --- a/administrator/modules/mod_menu/tmpl/default_disabled.php +++ b/administrator/modules/mod_menu/tmpl/default_disabled.php @@ -32,6 +32,14 @@ $menu->addChild(new JMenuNode(JText::_('MOD_MENU_MENUS'), null, 'class:list fa-fw')); } +/** + * Media Submenu + */ +if ($user->authorise('core.manage', 'com_media')) +{ + $menu->addChild(new JMenuNode(JText::_('MOD_MENU_MEDIA_MANAGER'), null, 'class:file-picture-o fa-fw')); +} + /** * Content Submenu */ diff --git a/administrator/modules/mod_menu/tmpl/default_enabled.php b/administrator/modules/mod_menu/tmpl/default_enabled.php index fa61aac771..93e7790f66 100644 --- a/administrator/modules/mod_menu/tmpl/default_enabled.php +++ b/administrator/modules/mod_menu/tmpl/default_enabled.php @@ -186,6 +186,15 @@ $menu->getParent(); } +/** + * Media Submenu + */ +if ($user->authorise('core.manage', 'com_media')) +{ + $menu->addChild(new JMenuNode(JText::_('MOD_MENU_MEDIA_MANAGER'), 'index.php?option=com_media', 'class:file-picture-o fa-fw'), true); + $menu->getParent(); +} + /** * Content Submenu */ @@ -212,11 +221,6 @@ $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_CONTENT_FEATURED'), 'index.php?option=com_content&view=featured')); - if ($user->authorise('core.manage', 'com_media')) - { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_MEDIA_MANAGER'), 'index.php?option=com_media')); - } - $menu->getParent(); } diff --git a/administrator/modules/mod_quickicon/helper.php b/administrator/modules/mod_quickicon/helper.php index b9673e639a..d7aae3a4a8 100644 --- a/administrator/modules/mod_quickicon/helper.php +++ b/administrator/modules/mod_quickicon/helper.php @@ -51,91 +51,31 @@ public static function &getButtons($params) self::$buttons[$key] = array( array( 'link' => JRoute::_('index.php?option=com_content&task=article.add'), - 'image' => 'pencil-2', - 'icon' => 'header/icon-48-article-add.png', + 'image' => 'fa fa-pencil-square', 'text' => JText::_('MOD_QUICKICON_ADD_NEW_ARTICLE'), 'access' => array('core.manage', 'com_content', 'core.create', 'com_content'), 'group' => 'MOD_QUICKICON_CONTENT' ), - array( - 'link' => JRoute::_('index.php?option=com_content'), - 'image' => 'stack', - 'icon' => 'header/icon-48-article.png', - 'text' => JText::_('MOD_QUICKICON_ARTICLE_MANAGER'), - 'access' => array('core.manage', 'com_content'), - 'group' => 'MOD_QUICKICON_CONTENT' - ), - array( - 'link' => JRoute::_('index.php?option=com_categories&extension=com_content'), - 'image' => 'folder', - 'icon' => 'header/icon-48-category.png', - 'text' => JText::_('MOD_QUICKICON_CATEGORY_MANAGER'), - 'access' => array('core.manage', 'com_content'), - 'group' => 'MOD_QUICKICON_CONTENT' - ), array( 'link' => JRoute::_('index.php?option=com_media'), - 'image' => 'pictures', - 'icon' => 'header/icon-48-media.png', + 'image' => 'fa fa-file-image-o', 'text' => JText::_('MOD_QUICKICON_MEDIA_MANAGER'), 'access' => array('core.manage', 'com_media'), 'group' => 'MOD_QUICKICON_CONTENT' ), - array( - 'link' => JRoute::_('index.php?option=com_menus'), - 'image' => 'list-view', - 'icon' => 'header/icon-48-menumgr.png', - 'text' => JText::_('MOD_QUICKICON_MENU_MANAGER'), - 'access' => array('core.manage', 'com_menus'), - 'group' => 'MOD_QUICKICON_STRUCTURE' - ), - array( - 'link' => JRoute::_('index.php?option=com_users'), - 'image' => 'users', - 'icon' => 'header/icon-48-user.png', - 'text' => JText::_('MOD_QUICKICON_USER_MANAGER'), - 'access' => array('core.manage', 'com_users'), - 'group' => 'MOD_QUICKICON_USERS' - ), - array( - 'link' => JRoute::_('index.php?option=com_modules'), - 'image' => 'cube', - 'icon' => 'header/icon-48-module.png', - 'text' => JText::_('MOD_QUICKICON_MODULE_MANAGER'), - 'access' => array('core.manage', 'com_modules'), - 'group' => 'MOD_QUICKICON_STRUCTURE' - ), array( 'link' => JRoute::_('index.php?option=com_config'), - 'image' => 'cog', - 'icon' => 'header/icon-48-config.png', + 'image' => 'fa fa-cog', 'text' => JText::_('MOD_QUICKICON_GLOBAL_CONFIGURATION'), 'access' => array('core.manage', 'com_config', 'core.admin', 'com_config'), 'group' => 'MOD_QUICKICON_CONFIGURATION' ), array( - 'link' => JRoute::_('index.php?option=com_templates'), - 'image' => 'eye', - 'icon' => 'header/icon-48-themes.png', - 'text' => JText::_('MOD_QUICKICON_TEMPLATE_MANAGER'), - 'access' => array('core.manage', 'com_templates'), - 'group' => 'MOD_QUICKICON_CONFIGURATION' - ), - array( - 'link' => JRoute::_('index.php?option=com_languages'), - 'image' => 'comments-2', - 'icon' => 'header/icon-48-language.png', - 'text' => JText::_('MOD_QUICKICON_LANGUAGE_MANAGER'), - 'access' => array('core.manage', 'com_languages'), - 'group' => 'MOD_QUICKICON_CONFIGURATION' - ), - array( - 'link' => JRoute::_('index.php?option=com_installer'), - 'image' => 'download', - 'icon' => 'header/icon-48-extension.png', - 'text' => JText::_('MOD_QUICKICON_INSTALL_EXTENSIONS'), - 'access' => array('core.manage', 'com_installer'), - 'group' => 'MOD_QUICKICON_EXTENSIONS' + 'link' => JRoute::_('index.php?option=com_modules'), + 'image' => 'fa fa-cube', + 'text' => JText::_('MOD_QUICKICON_MODULE_MANAGER'), + 'access' => array('core.manage', 'com_modules'), + 'group' => 'MOD_QUICKICON_STRUCTURE' ) ); } @@ -173,27 +113,6 @@ public static function &getButtons($params) return self::$buttons[$key]; } - /** - * Classifies the $buttons by group - * - * @param array $buttons The buttons - * - * @return array The buttons sorted by groups - * - * @since 3.2 - */ - public static function groupButtons($buttons) - { - $groupedButtons = array(); - - foreach ($buttons as $button) - { - $groupedButtons[$button['group']][] = $button; - } - - return $groupedButtons; - } - /** * Get the alternate title for the module * diff --git a/administrator/modules/mod_quickicon/tmpl/default.php b/administrator/modules/mod_quickicon/tmpl/default.php index cd6eb483e6..9c0b5b9bae 100644 --- a/administrator/modules/mod_quickicon/tmpl/default.php +++ b/administrator/modules/mod_quickicon/tmpl/default.php @@ -9,10 +9,12 @@ defined('_JEXEC') or die; -$html = JHtml::_('links.linksgroups', ModQuickIconHelper::groupButtons($buttons)); +$html = JHtml::_('icons.buttons', $buttons); ?> -