Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.1] Add toolbar buttons in language installation toolbar #3085

Closed
jgerman-bot opened this issue Jan 17, 2024 · 1 comment · Fixed by #3086
Closed

[5.1] Add toolbar buttons in language installation toolbar #3085

jgerman-bot opened this issue Jan 17, 2024 · 1 comment · Fixed by #3086

Comments

@jgerman-bot
Copy link

New language relevant PR in upstream repo: joomla/joomla-cms#42610 Here are the upstream changes:

Click to expand the diff!
diff --git a/administrator/components/com_installer/src/View/Languages/HtmlView.php b/administrator/components/com_installer/src/View/Languages/HtmlView.php
index 4cd75a8a0c5ae..0081169df0382 100644
--- a/administrator/components/com_installer/src/View/Languages/HtmlView.php
+++ b/administrator/components/com_installer/src/View/Languages/HtmlView.php
@@ -16,7 +16,6 @@
 use Joomla\CMS\Language\Text;
 use Joomla\CMS\MVC\View\GenericDataException;
 use Joomla\CMS\Toolbar\Toolbar;
-use Joomla\CMS\Toolbar\ToolbarHelper;
 use Joomla\Component\Installer\Administrator\View\Installer\HtmlView as InstallerViewDefault;
 
 // phpcs:disable PSR1.Files.SideEffects
@@ -75,15 +74,19 @@ public function display($tpl = null)
      */
     protected function addToolbar()
     {
-        $canDo   = ContentHelper::getActions('com_installer');
+        $canDo   = ContentHelper::getActions('com_languages');
         $toolbar = Toolbar::getInstance();
 
-        ToolbarHelper::title(Text::_('COM_INSTALLER_HEADER_' . $this->getName()), 'puzzle-piece install');
+        if ($canDo->get('core.manage')) {
+            $toolbar->linkButton('list', 'COM_INSTALLER_TOOLBAR_MANAGE_LANGUAGES')
+                ->url('index.php?option=com_languages&view=installed');
+            $toolbar->linkButton('comments', 'COM_INSTALLER_TOOLBAR_MANAGE_CONTENT_LANGUAGES')
+                ->url('index.php?option=com_languages&view=languages');
+            $toolbar->divider();
+        }
 
-        if ($canDo->get('core.admin')) {
-            parent::addToolbar();
+        parent::addToolbar();
 
-            $toolbar->help('Extensions:_Languages');
-        }
+        $toolbar->help('Extensions:_Languages');
     }
 }
diff --git a/administrator/language/en-GB/com_installer.ini b/administrator/language/en-GB/com_installer.ini
index fa3a097afedcf..0522dc8f2c372 100644
--- a/administrator/language/en-GB/com_installer.ini
+++ b/administrator/language/en-GB/com_installer.ini
@@ -229,6 +229,8 @@ COM_INSTALLER_TOOLBAR_FIND_UPDATES="Check For Updates"
 COM_INSTALLER_TOOLBAR_INSTALL="Install"
 COM_INSTALLER_TOOLBAR_INSTALL_EXTENSIONS="Install Extensions"
 COM_INSTALLER_TOOLBAR_MANAGE="Manage Extensions"
+COM_INSTALLER_TOOLBAR_MANAGE_CONTENT_LANGUAGES="Content Languages"
+COM_INSTALLER_TOOLBAR_MANAGE_LANGUAGES="Manage Languages"
 COM_INSTALLER_TOOLBAR_PURGE="Clear Cache"
 COM_INSTALLER_TOOLBAR_UPDATE="Update"
 COM_INSTALLER_TYPE_CLIENT="Location"
@tecpromotion
Copy link
Member

We can wait for joomla/joomla-cms#42663

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

4 participants