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 #42610

Merged
merged 5 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')) {
LadySolveig marked this conversation as resolved.
Show resolved Hide resolved
$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');
}
}
2 changes: 2 additions & 0 deletions administrator/language/en-GB/com_installer.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down