first commit

This commit is contained in:
2025-06-17 11:53:18 +02:00
commit 9f0f7ba12b
8804 changed files with 1369176 additions and 0 deletions

View File

@ -0,0 +1,142 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_languages
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\String\PunycodeHelper;
use Joomla\CMS\Version;
/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('table.columns');
$user = $this->getCurrentUser();
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
?>
<form action="<?php echo Route::_('index.php?option=com_languages&view=installed'); ?>" method="post" id="adminForm" name="adminForm">
<div class="row">
<div class="col-md-12">
<div id="j-main-container" class="j-main-container">
<?php echo LayoutHelper::render('joomla.searchtools.default', ['view' => $this]); ?>
<?php if (empty($this->rows)) : ?>
<div class="alert alert-info">
<span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
<?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table">
<caption class="visually-hidden">
<?php echo Text::_('COM_LANGUAGES_INSTALLED_TABLE_CAPTION'); ?>,
<span id="orderedBy"><?php echo Text::_('JGLOBAL_SORTED_BY'); ?> </span>,
<span id="filteredBy"><?php echo Text::_('JGLOBAL_FILTERED_BY'); ?></span>
</caption>
<thead>
<tr>
<td class="w-1">
&#160;
</td>
<th scope="col" class="w-15">
<?php echo HTMLHelper::_('searchtools.sort', 'JGLOBAL_TITLE', 'name', $listDirn, $listOrder); ?>
</th>
<th scope="col" class="w-15 d-none d-md-table-cell">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_LANGUAGES_HEADING_TITLE_NATIVE', 'nativeName', $listDirn, $listOrder); ?>
</th>
<th scope="col" class="text-center">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_LANGUAGES_HEADING_LANG_TAG', 'language', $listDirn, $listOrder); ?>
</th>
<th scope="col" class="w-5 text-center">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_LANGUAGES_HEADING_DEFAULT', 'published', $listDirn, $listOrder); ?>
</th>
<th scope="col" class="w-5 d-none d-md-table-cell text-center">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_LANGUAGES_HEADING_VERSION', 'version', $listDirn, $listOrder); ?>
</th>
<th scope="col" class="w-10 d-none d-md-table-cell text-center">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_LANGUAGES_HEADING_DATE', 'creationDate', $listDirn, $listOrder); ?>
</th>
<th scope="col" class="w-10 d-none d-md-table-cell text-center">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_LANGUAGES_HEADING_AUTHOR', 'author', $listDirn, $listOrder); ?>
</th>
<th scope="col" class="w-10 d-none d-md-table-cell text-center">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_LANGUAGES_HEADING_AUTHOR_EMAIL', 'authorEmail', $listDirn, $listOrder); ?>
</th>
<th scope="col" class="w-5 d-none d-md-table-cell text-center">
<?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ID', 'extension_id', $listDirn, $listOrder); ?>
</th>
</tr>
</thead>
<tbody>
<?php
$version = new Version();
$currentShortVersion = preg_replace('#^([0-9\.]+)(|.*)$#', '$1', $version->getShortVersion());
foreach ($this->rows as $i => $row) :
$canCreate = $user->authorise('core.create', 'com_languages');
$canEdit = $user->authorise('core.edit', 'com_languages');
$canChange = $user->authorise('core.edit.state', 'com_languages');
?>
<tr class="row<?php echo $i % 2; ?>">
<td>
<?php echo HTMLHelper::_('languages.id', $i, $row->language); ?>
</td>
<th scope="row">
<label for="cb<?php echo $i; ?>">
<?php echo $this->escape($row->name); ?>
</label>
</th>
<td class="d-none d-md-table-cell">
<?php echo $this->escape($row->nativeName); ?>
</td>
<td class="text-center">
<?php echo $this->escape($row->language); ?>
</td>
<td class="text-center">
<?php echo HTMLHelper::_('jgrid.isdefault', $row->published, $i, 'installed.', !$row->published && $canChange); ?>
</td>
<td class="d-none d-md-table-cell text-center">
<?php $minorVersion = $version::MAJOR_VERSION . '.' . $version::MINOR_VERSION; ?>
<?php // Display a Note if language pack version is not equal to Joomla version ?>
<?php if (strpos($row->version, $minorVersion) !== 0 || strpos($row->version, $currentShortVersion) !== 0) : ?>
<span class="badge bg-warning text-dark" title="<?php echo Text::_('JGLOBAL_LANGUAGE_VERSION_NOT_PLATFORM'); ?>"><?php echo $row->version; ?></span>
<?php else : ?>
<span class="badge bg-success"><?php echo $row->version; ?></span>
<?php endif; ?>
</td>
<td class="d-none d-md-table-cell text-center">
<?php echo $this->escape($row->creationDate); ?>
</td>
<td class="d-none d-md-table-cell text-center">
<?php echo $this->escape($row->author); ?>
</td>
<td class="d-none d-md-table-cell text-center">
<?php echo PunycodeHelper::emailToUTF8($this->escape($row->authorEmail)); ?>
</td>
<td class="d-none d-md-table-cell text-center">
<?php echo $this->escape($row->extension_id); ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php // load the pagination. ?>
<?php echo $this->pagination->getListFooter(); ?>
<?php endif; ?>
<input type="hidden" name="task" value="">
<input type="hidden" name="boxchecked" value="0">
<?php echo HTMLHelper::_('form.token'); ?>
</div>
</div>
</div>
</form>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<layout title="COM_LANGUAGES_INSTALLED_VIEW_DEFAULT_TITLE">
<message>
<![CDATA[COM_LANGUAGES_INSTALLED_VIEW_DEFAULT_DESC]]>
</message>
</layout>
</metadata>

View File

@ -0,0 +1,86 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_languages
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('keepalive')
->useScript('form.validate')
->useScript('com_languages.admin-language-edit-change-flag');
?>
<h2><?php echo $this->escape($this->form->getValue('title', null, Text::_('COM_LANGUAGES_LANGUAGE_NEW_LANGUAGE_TITLE'))); ?></h2>
<form action="<?php echo Route::_('index.php?option=com_languages&view=language&layout=edit&lang_id=' . (int) $this->item->lang_id); ?>" method="post" name="adminForm" id="language-form" aria-label="<?php echo Text::_('COM_LANGUAGES_LANGUAGE_FORM_' . ((int) $this->item->lang_id === 0 ? 'NEW' : 'EDIT'), true); ?>" class="main-card form-validate">
<?php echo HTMLHelper::_('uitab.startTabSet', 'myTab', ['active' => 'details', 'recall' => true, 'breakpoint' => 768]); ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'details', Text::_('JDETAILS')); ?>
<fieldset id="fieldset-details" class="options-form">
<legend><?php echo Text::_('JDETAILS'); ?></legend>
<div>
<?php echo $this->form->renderField('title'); ?>
<?php echo $this->form->renderField('title_native'); ?>
<?php echo $this->form->renderField('lang_code'); ?>
<?php echo $this->form->renderField('sef'); ?>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('image'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('image'); ?>
<span id="flag">
<?php echo HTMLHelper::_('image', 'mod_languages/' . $this->form->getValue('image') . '.gif', $this->form->getValue('image'), null, true); ?>
</span>
</div>
</div>
<?php if ($this->canDo->get('core.edit.state')) : ?>
<?php echo $this->form->renderField('published'); ?>
<?php endif; ?>
<?php echo $this->form->renderField('access'); ?>
<?php echo $this->form->renderField('description'); ?>
<?php echo $this->form->renderField('lang_id'); ?>
</div>
</fieldset>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'metadata', Text::_('JGLOBAL_FIELDSET_OPTIONS')); ?>
<div class="row">
<div class="col-md-6 mb-3">
<fieldset id="fieldset-sitename" class="options-form">
<legend><?php echo Text::_('COM_LANGUAGES_FIELDSET_SITE_NAME_LABEL'); ?></legend>
<div>
<?php echo $this->form->renderFieldset('site_name'); ?>
</div>
</fieldset>
</div>
<div class="col-md-6 mb-3">
<fieldset id="fieldset-metadata" class="options-form">
<legend><?php echo Text::_('JGLOBAL_FIELDSET_METADATA_OPTIONS'); ?></legend>
<div>
<?php echo $this->form->renderFieldset('metadata'); ?>
</div>
</fieldset>
</div>
</div>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php echo HTMLHelper::_('uitab.endTabSet'); ?>
<input type="hidden" name="task" value="">
<?php echo HTMLHelper::_('form.token'); ?>
</form>

View File

@ -0,0 +1,172 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_languages
*
* @copyright (C) 2008 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('table.columns')
->useScript('multiselect');
$user = $this->getCurrentUser();
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$saveOrder = $listOrder == 'a.ordering';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = 'index.php?option=com_languages&task=languages.saveOrderAjax&tmpl=component&' . Session::getFormToken() . '=1';
HTMLHelper::_('draggablelist.draggable');
}
?>
<form action="<?php echo Route::_('index.php?option=com_languages&view=languages'); ?>" method="post" name="adminForm" id="adminForm">
<div class="row">
<div class="col-md-12">
<div id="j-main-container" class="j-main-container">
<?php echo LayoutHelper::render('joomla.searchtools.default', ['view' => $this]); ?>
<?php if (empty($this->items)) : ?>
<div class="alert alert-info">
<span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
<?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table" id="languageList">
<caption class="visually-hidden">
<?php echo Text::_('COM_LANGUAGES_CONTENT_TABLE_CAPTION'); ?>,
<span id="orderedBy"><?php echo Text::_('JGLOBAL_SORTED_BY'); ?> </span>,
<span id="filteredBy"><?php echo Text::_('JGLOBAL_FILTERED_BY'); ?></span>
</caption>
<thead>
<tr>
<td class="w-1 text-center">
<?php echo HTMLHelper::_('grid.checkall'); ?>
</td>
<th scope="col" class="w-1 text-center d-none d-md-table-cell">
<?php echo HTMLHelper::_('searchtools.sort', '', 'a.ordering', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-sort'); ?>
</th>
<th scope="col" class="w-1 text-center">
<?php echo HTMLHelper::_('searchtools.sort', 'JSTATUS', 'a.published', $listDirn, $listOrder); ?>
</th>
<th scope="col" class="title">
<?php echo HTMLHelper::_('searchtools.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?>
</th>
<th scope="col" class="title d-none d-md-table-cell">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_LANGUAGES_HEADING_TITLE_NATIVE', 'a.title_native', $listDirn, $listOrder); ?>
</th>
<th scope="col" class="w-10 d-none d-md-table-cell text-center">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_LANGUAGES_HEADING_LANG_TAG', 'a.lang_code', $listDirn, $listOrder); ?>
</th>
<th scope="col" class="w-10 d-none d-md-table-cell text-center">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_LANGUAGES_HEADING_LANG_CODE', 'a.sef', $listDirn, $listOrder); ?>
</th>
<th scope="col" class="w-10 d-none d-md-table-cell">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_LANGUAGES_HEADING_LANG_IMAGE', 'a.image', $listDirn, $listOrder); ?>
</th>
<th scope="col" class="w-10 d-none d-md-table-cell text-center">
<?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ACCESS', 'a.access', $listDirn, $listOrder); ?>
</th>
<th scope="col" class="w-10 d-none d-md-table-cell text-center">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_LANGUAGES_HEADING_HOMEPAGE', 'l.home', $listDirn, $listOrder); ?>
</th>
<th scope="col" class="w-5 d-none d-md-table-cell text-center">
<?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ID', 'a.lang_id', $listDirn, $listOrder); ?>
</th>
</tr>
</thead>
<tbody<?php if ($saveOrder) :
?> class="js-draggable" data-url="<?php echo $saveOrderingUrl; ?>" data-direction="<?php echo strtolower($listDirn); ?>"<?php
endif; ?>>
<?php
foreach ($this->items as $i => $item) :
$canCreate = $user->authorise('core.create', 'com_languages');
$canEdit = $user->authorise('core.edit', 'com_languages');
$canChange = $user->authorise('core.edit.state', 'com_languages');
?>
<tr class="row<?php echo $i % 2; ?>">
<td>
<?php echo HTMLHelper::_('grid.id', $i, $item->lang_id, false, 'cid', 'cb', $item->title); ?>
</td>
<td class="text-center d-none d-md-table-cell">
<?php if ($canChange) :
$disableClassName = '';
$disabledLabel = '';
if (!$saveOrder) :
$disabledLabel = Text::_('JORDERINGDISABLED');
$disableClassName = 'inactive';
endif; ?>
<span class="sortable-handler <?php echo $disableClassName; ?>" title="<?php echo $disabledLabel; ?>">
<span class="icon-ellipsis-v" aria-hidden="true"></span>
</span>
<input type="text" name="order[]" size="5" value="<?php echo $item->ordering; ?>" class="width-20 text-area-order hidden">
<?php else : ?>
<span class="sortable-handler inactive">
<span class="icon-ellipsis-v" aria-hidden="true"></span>
</span>
<?php endif; ?>
</td>
<td class="text-center">
<?php echo HTMLHelper::_('jgrid.published', $item->published, $i, 'languages.', $canChange); ?>
</td>
<th scope="row">
<?php if ($canEdit) : ?>
<a href="<?php echo Route::_('index.php?option=com_languages&task=language.edit&lang_id=' . (int) $item->lang_id); ?>" title="<?php echo Text::_('JACTION_EDIT'); ?> <?php echo $this->escape($item->title); ?>">
<?php echo $this->escape($item->title); ?></a>
<?php else : ?>
<?php echo $this->escape($item->title); ?>
<?php endif; ?>
</th>
<td class="d-none d-md-table-cell">
<?php echo $this->escape($item->title_native); ?>
</td>
<td class="d-none d-md-table-cell text-center">
<?php echo $this->escape($item->lang_code); ?>
</td>
<td class="d-none d-md-table-cell text-center">
<?php echo $this->escape($item->sef); ?>
</td>
<td class="d-none d-md-table-cell">
<?php if ($item->image) : ?>
<?php echo HTMLHelper::_('image', 'mod_languages/' . $item->image . '.gif', $item->image, ['class' => 'me-1'], true); ?><?php echo $this->escape($item->image); ?>
<?php else : ?>
<?php echo Text::_('JNONE'); ?>
<?php endif; ?>
</td>
<td class="d-none d-md-table-cell text-center">
<?php echo $this->escape($item->access_level); ?>
</td>
<td class="d-none d-md-table-cell text-center">
<?php echo ($item->home == '1') ? Text::_('JYES') : Text::_('JNO'); ?>
</td>
<td class="d-none d-md-table-cell text-center">
<?php echo $this->escape($item->lang_id); ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php // load the pagination. ?>
<?php echo $this->pagination->getListFooter(); ?>
<?php endif; ?>
<input type="hidden" name="task" value="">
<input type="hidden" name="boxchecked" value="0">
<?php echo HTMLHelper::_('form.token'); ?>
</div>
</div>
</div>
</form>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<layout title="COM_LANGUAGES_LANGUAGES_VIEW_DEFAULT_TITLE">
<message>
<![CDATA[COM_LANGUAGES_LANGUAGES_VIEW_DEFAULT_DESC]]>
</message>
</layout>
</metadata>

View File

@ -0,0 +1,335 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_languages
*
* @copyright (C) 2011 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
$notice_disabled = !$this->language_filter && ($this->homes > 1 || $this->switchers != 0);
$notice_switchers = !$this->switchers && ($this->homes > 1 || $this->language_filter);
// Defining arrays
$content_languages = array_column($this->contentlangs, 'lang_code');
$sitelangs = array_column($this->site_langs, 'element');
$home_pages = array_column($this->homepages, 'language');
?>
<div class="mod-multilangstatus">
<?php if (!$this->language_filter && $this->switchers == 0) : ?>
<?php if ($this->homes == 1) : ?>
<div class="alert alert-info">
<span class="icon-info-circle" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
<?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_NONE'); ?>
</div>
<?php else : ?>
<div class="alert alert-info">
<span class="icon-info-circle" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
<?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_USELESS_HOMES'); ?>
</div>
<?php endif; ?>
<?php else : ?>
<?php if (!in_array($this->default_lang, $content_languages)) : ?>
<div class="alert alert-error">
<span class="icon-exclamation" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('ERROR'); ?></span>
<?php echo Text::sprintf('COM_LANGUAGES_MULTILANGSTATUS_ERROR_DEFAULT_CONTENT_LANGUAGE', $this->default_lang); ?>
</div>
<?php else : ?>
<?php foreach ($this->contentlangs as $contentlang) : ?>
<?php if ($contentlang->lang_code == $this->default_lang && $contentlang->published != 1) : ?>
<div class="alert alert-error">
<span class="icon-exclamation" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('ERROR'); ?></span>
<?php echo Text::sprintf('COM_LANGUAGES_MULTILANGSTATUS_ERROR_DEFAULT_CONTENT_LANGUAGE', $this->default_lang); ?>
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php if ($this->defaultHome == true) : ?>
<div class="alert alert-warning">
<span class="icon-exclamation-triangle" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
<?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_DEFAULT_HOME_MODULE_PUBLISHED'); ?>
</div>
<?php endif; ?>
<?php foreach ($this->statuses as $status) : ?>
<?php // Displays error when Site language and Content language are published but Home page is unpublished, trashed or missing. ?>
<?php if ($status->lang_code && $status->published == 1 && $status->home_published != 1) : ?>
<div class="alert alert-warning">
<span class="icon-exclamation-triangle" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
<?php echo Text::sprintf('COM_LANGUAGES_MULTILANGSTATUS_HOME_UNPUBLISHED', $status->lang_code, $status->lang_code); ?>
</div>
<?php endif; ?>
<?php // Displays error when both Content Language and Home page are unpublished. ?>
<?php if ($status->lang_code && $status->published == 0 && $status->home_published != 1) : ?>
<div class="alert alert-warning">
<span class="icon-exclamation-triangle" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
<?php echo Text::sprintf('COM_LANGUAGES_MULTILANGSTATUS_CONTENT_LANGUAGE_HOME_UNPUBLISHED', $status->lang_code, $status->lang_code); ?>
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php if ($notice_disabled) : ?>
<div class="alert alert-warning">
<span class="icon-exclamation-triangle" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
<?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_LANGUAGEFILTER_DISABLED'); ?>
</div>
<?php endif; ?>
<?php if ($notice_switchers) : ?>
<div class="alert alert-warning">
<span class="icon-exclamation-triangle" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
<?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_LANGSWITCHER_UNPUBLISHED'); ?>
</div>
<?php endif; ?>
<?php foreach ($this->contentlangs as $contentlang) : ?>
<?php if (array_key_exists($contentlang->lang_code, $this->homepages) && (!array_key_exists($contentlang->lang_code, $this->site_langs) || $contentlang->published != 1)) : ?>
<div class="alert alert-warning">
<span class="icon-exclamation-triangle" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
<?php echo Text::sprintf('COM_LANGUAGES_MULTILANGSTATUS_ERROR_CONTENT_LANGUAGE', $contentlang->lang_code); ?>
</div>
<?php endif; ?>
<?php if (!array_key_exists($contentlang->lang_code, $this->site_langs)) : ?>
<div class="alert alert-warning">
<span class="icon-exclamation-triangle" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
<?php echo Text::sprintf('COM_LANGUAGES_MULTILANGSTATUS_ERROR_LANGUAGE_TAG', $contentlang->lang_code); ?>
</div>
<?php endif; ?>
<?php if ($contentlang->published == -2) : ?>
<div class="alert alert-warning">
<span class="icon-exclamation-triangle" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
<?php echo Text::sprintf('COM_LANGUAGES_MULTILANGSTATUS_CONTENT_LANGUAGE_TRASHED', $contentlang->lang_code); ?>
</div>
<?php endif; ?>
<?php if (empty($contentlang->sef)) : ?>
<div class="alert alert-error">
<span class="icon-exclamation" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('ERROR'); ?></span>
<?php echo Text::sprintf('COM_LANGUAGES_MULTILANGSTATUS_CONTENT_LANGUAGE_SEF_MISSING', $contentlang->lang_code); ?>
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php if ($this->listUsersError) : ?>
<div class="alert alert-warning">
<span class="icon-exclamation-triangle" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
<?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_CONTACTS_ERROR_TIP'); ?>
<ul>
<?php foreach ($this->listUsersError as $user) : ?>
<li>
<?php echo Text::sprintf('COM_LANGUAGES_MULTILANGSTATUS_CONTACTS_ERROR', $user->name); ?>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
<?php // Displays error when the Content Language has been deleted ?>
<?php foreach ($sitelangs as $sitelang) : ?>
<?php if (!in_array($sitelang, $content_languages) && in_array($sitelang, $home_pages)) : ?>
<div class="alert alert-warning">
<span class="icon-exclamation-triangle" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
<?php echo Text::sprintf('COM_LANGUAGES_MULTILANGSTATUS_CONTENT_LANGUAGE_MISSING', $sitelang); ?>
</div>
<?php endif; ?>
<?php endforeach; ?>
<table class="table table-sm">
<caption class="visually-hidden"><?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_TABLE_CAPTION'); ?></caption>
<thead>
<tr>
<th scope="col">
<?php echo Text::_('JDETAILS'); ?>
</th>
<th class="text-center" scope="col">
<?php echo Text::_('JSTATUS'); ?>
</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">
<?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_LANGUAGEFILTER'); ?>
</th>
<td class="text-center">
<?php if ($this->language_filter) : ?>
<?php echo Text::_('JENABLED'); ?>
<?php else : ?>
<?php echo Text::_('JDISABLED'); ?>
<?php endif; ?>
</td>
</tr>
<tr>
<th scope="row">
<?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_LANGSWITCHER_PUBLISHED'); ?>
</th>
<td class="text-center">
<?php if ($this->switchers != 0) : ?>
<?php echo $this->switchers; ?>
<?php else : ?>
<?php echo Text::_('JNONE'); ?>
<?php endif; ?>
</td>
</tr>
<tr>
<th scope="row">
<?php if ($this->homes > 1) : ?>
<?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_HOMES_PUBLISHED_INCLUDING_ALL'); ?>
<?php else : ?>
<?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_HOMES_PUBLISHED'); ?>
<?php endif; ?>
</th>
<td class="text-center">
<?php if ($this->homes > 1) : ?>
<?php echo $this->homes; ?>
<?php else : ?>
<?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_HOMES_PUBLISHED_ALL'); ?>
<?php endif; ?>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm">
<caption class="visually-hidden"><?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_CONTENT_TABLE_CAPTION'); ?></caption>
<thead>
<tr>
<th scope="col">
<?php echo Text::_('JGRID_HEADING_LANGUAGE'); ?>
</th>
<th class="text-center" scope="col">
<?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_SITE_LANG_PUBLISHED'); ?>
</th>
<th class="text-center" scope="col">
<?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_CONTENT_LANGUAGE_PUBLISHED'); ?>
</th>
<th class="text-center" scope="col">
<?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_HOMES_PUBLISHED'); ?>
</th>
</tr>
</thead>
<tbody>
<?php foreach ($this->statuses as $status) : ?>
<?php if ($status->element) : ?>
<tr>
<th scope="row">
<?php echo $status->element; ?>
</th>
<?php endif; ?>
<?php // Published Site languages ?>
<?php if ($status->element) : ?>
<td class="text-center">
<span class="text-success icon-check" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('JYES'); ?></span>
</td>
<?php else : ?>
<td class="text-center">
<?php echo Text::_('JNO'); ?>
</td>
<?php endif; ?>
<?php // Published Content languages ?>
<td class="text-center">
<?php if ($status->lang_code && $status->published == 1) : ?>
<span class="text-success icon-check" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('JYES'); ?></span>
<?php elseif ($status->lang_code && $status->published == 0) : ?>
<span class="text-danger icon-times" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
<?php elseif ($status->lang_code && $status->published == -2) : ?>
<span class="icon-trash" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
<?php else : ?>
<span class="icon-exclamation-triangle" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
<?php endif; ?>
</td>
<?php // Published Home pages ?>
<td class="text-center">
<?php if ($status->home_published == 1) : ?>
<span class="text-success icon-check" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('JYES'); ?></span>
<?php elseif ($status->home_published == 0) : ?>
<span class="text-danger icon-times" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('JNO'); ?></span>
<?php elseif ($status->home_published == -2) : ?>
<span class="icon-trash" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
<?php else : ?>
<span class="icon-exclamation-triangle" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
<?php foreach ($this->contentlangs as $contentlang) : ?>
<?php if (!array_key_exists($contentlang->lang_code, $this->site_langs)) : ?>
<tr>
<th scope="row">
<?php echo $contentlang->lang_code; ?>
</th>
<td class="text-center">
<span class="icon-exclamation-triangle" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
</td>
<td class="text-center">
<?php if ($contentlang->published == 1) : ?>
<span class="text-success icon-check" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('JYES'); ?></span>
<?php elseif ($contentlang->published == 0 && array_key_exists($contentlang->lang_code, $this->homepages)) : ?>
<span class="text-danger icon-times" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('JNO'); ?></span>
<?php elseif ($contentlang->published == -2 && array_key_exists($contentlang->lang_code, $this->homepages)) : ?>
<span class="icon-trash" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
<?php endif; ?>
</td>
<td class="text-center">
<?php if (!array_key_exists($contentlang->lang_code, $this->homepages)) : ?>
<span class="icon-exclamation-triangle" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
<?php else : ?>
<span class="text-success icon-check" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('JYES'); ?></span>
<?php endif; ?>
</td>
</tr>
<?php endif; ?>
<?php endforeach; ?>
<?php // Display error when the Content Language has been deleted ?>
<?php foreach ($sitelangs as $sitelang) : ?>
<?php if (!in_array($sitelang, $content_languages) && in_array($sitelang, $home_pages)) : ?>
<tr>
<th scope="row">
<?php echo $sitelang; ?>
</th>
<td class="text-center">
<span class="text-success icon-check" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('JYES'); ?></span>
</td>
<td class="text-center">
<span class="icon-exclamation-triangle" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
</td>
<td class="text-center">
<span class="text-success icon-check" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('JYES'); ?></span>
</td>
</tr>
<?php endif; ?>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>

View File

@ -0,0 +1,90 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_languages
*
* @copyright (C) 2011 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
$expired = ($this->state->get('cache_expired') == 1 ) ? '1' : '';
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('keepalive')
->useScript('form.validate')
->usePreset('com_languages.overrider')
->useScript('com_languages.admin-override-edit-refresh-searchstring');
?>
<form action="<?php echo Route::_('index.php?option=com_languages&id=' . $this->item->key); ?>" method="post" name="adminForm" id="override-form" aria-label="<?php echo Text::_('COM_LANGUAGES_VIEW_OVERRIDE_FORM_' . ((int) $this->item->key === 0 ? 'NEW' : 'EDIT'), true); ?>" class="main-card form-validate p-4 mt-4">
<div class="row">
<div class="col-md-6">
<fieldset id="fieldset-override" class="options-form">
<legend><?php echo empty($this->item->key) ? Text::_('COM_LANGUAGES_VIEW_OVERRIDE_EDIT_NEW_OVERRIDE_LEGEND') : Text::_('COM_LANGUAGES_VIEW_OVERRIDE_EDIT_EDIT_OVERRIDE_LEGEND'); ?></legend>
<div>
<?php echo $this->form->renderField('language'); ?>
<?php echo $this->form->renderField('client'); ?>
<?php echo $this->form->renderField('key'); ?>
<?php echo $this->form->renderField('override'); ?>
<?php echo $this->form->renderField('both'); ?>
<?php echo $this->form->renderField('file'); ?>
</div>
</fieldset>
</div>
<div class="col-md-6">
<fieldset id="fieldset-override-search" class="options-form">
<legend><?php echo Text::_('COM_LANGUAGES_VIEW_OVERRIDE_SEARCH_LEGEND'); ?></legend>
<div>
<div class="alert alert-info">
<span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
<?php echo Text::_('COM_LANGUAGES_VIEW_OVERRIDE_SEARCH_TIP'); ?>
</div>
<?php echo $this->form->renderField('searchtype'); ?>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('searchstring'); ?>
</div>
<div class="controls">
<div class="input-group">
<?php echo $this->form->getInput('searchstring'); ?>
<button type="submit" class="btn btn-primary" onclick="Joomla.overrider.searchStrings();return false;" formnovalidate>
<?php echo Text::_('COM_LANGUAGES_VIEW_OVERRIDE_SEARCH_BUTTON'); ?>
</button>
<span id="refresh-status" class="form-text">
<span class="icon-sync icon-spin" aria-hidden="true"></span>
<?php echo Text::_('COM_LANGUAGES_VIEW_OVERRIDE_REFRESHING'); ?>
</span>
</div>
</div>
</div>
</div>
</fieldset>
<fieldset id="results-container" class="adminform">
<legend><?php echo Text::_('COM_LANGUAGES_VIEW_OVERRIDE_RESULTS_LEGEND'); ?></legend>
<div id="overrider-spinner" class="overrider-spinner text-center" data-search-string-expired="<?php echo $expired; ?>"><span class="icon-spinner icon-spin" aria-hidden="true"></span></div>
<span id="more-results" class="mt-2">
<button type="button" id="more-results-button" class="btn btn-secondary" disabled>
<span id="overrider-spinner-btn" class="overrider-spinner-btn icon-spinner icon-spin" aria-hidden="true"></span>
<?php echo Text::_('COM_LANGUAGES_VIEW_OVERRIDE_MORE_RESULTS'); ?>
</button>
</span>
</fieldset>
<input type="hidden" name="task" value="">
<input type="hidden" name="id" value="<?php echo $this->item->key; ?>">
<?php echo HTMLHelper::_('form.token'); ?>
</div>
</div>
</form>

View File

@ -0,0 +1,119 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_languages
*
* @copyright (C) 2011 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\LanguageHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('table.columns')
->useScript('multiselect');
$client = $this->state->get('filter.client') == 'site' ? Text::_('JSITE') : Text::_('JADMINISTRATOR');
$language = $this->state->get('filter.language');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$oppositeClient = $this->state->get('filter.client') == 'administrator' ? Text::_('JSITE') : Text::_('JADMINISTRATOR');
$oppositeFilename = constant('JPATH_' . strtoupper($this->state->get('filter.client') === 'site' ? 'administrator' : 'site'))
. '/language/overrides/' . $this->state->get('filter.language', 'en-GB') . '.override.ini';
$oppositeStrings = LanguageHelper::parseIniFile($oppositeFilename);
?>
<form action="<?php echo Route::_('index.php?option=com_languages&view=overrides'); ?>" method="post" name="adminForm" id="adminForm">
<div class="row">
<div class="col-md-12">
<div id="j-main-container" class="j-main-container">
<?php echo LayoutHelper::render('joomla.searchtools.default', ['view' => $this, 'options' => ['selectorFieldName' => 'language_client']]); ?>
<div class="clearfix"></div>
<?php if (empty($this->items)) : ?>
<div class="alert alert-info">
<span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
<?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table" id="overrideList">
<caption class="visually-hidden">
<?php echo Text::_('COM_LANGUAGES_OVERRIDES_TABLE_CAPTION'); ?>,
<span id="orderedBy"><?php echo Text::_('JGLOBAL_SORTED_BY'); ?> </span>,
<span id="filteredBy"><?php echo Text::_('JGLOBAL_FILTERED_BY'); ?></span>
</caption>
<thead>
<tr>
<td class="w-1 text-center">
<?php echo HTMLHelper::_('grid.checkall'); ?>
</td>
<th scope="col" class="w-30">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_LANGUAGES_VIEW_OVERRIDES_KEY', 'key', $listDirn, $listOrder); ?>
</th>
<th scope="col" class="d-none d-md-table-cell">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_LANGUAGES_VIEW_OVERRIDES_TEXT', 'text', $listDirn, $listOrder); ?>
</th>
<th scope="col" class="d-none d-md-table-cell">
<?php echo Text::_('COM_LANGUAGES_FIELD_LANG_TAG_LABEL'); ?>
</th>
<th scope="col" class="d-none d-md-table-cell">
<?php echo Text::_('JCLIENT'); ?>
</th>
</tr>
</thead>
<tbody>
<?php $canEdit = $this->getCurrentUser()->authorise('core.edit', 'com_languages'); ?>
<?php $i = 0; ?>
<?php foreach ($this->items as $key => $text) : ?>
<tr class="row<?php echo $i % 2; ?>" id="overriderrow<?php echo $i; ?>">
<td class="text-center">
<?php echo HTMLHelper::_('grid.id', $i, $key, false, 'cid', 'cb', $key); ?>
</td>
<th scope="row">
<?php if ($canEdit) : ?>
<a id="key[<?php echo $this->escape($key); ?>]" href="<?php echo Route::_('index.php?option=com_languages&task=override.edit&id=' . $key); ?>" title="<?php echo Text::_('JACTION_EDIT'); ?> <?php echo $this->escape($key); ?>">
<?php echo $this->escape($key); ?></a>
<?php else : ?>
<?php echo $this->escape($key); ?>
<?php endif; ?>
</th>
<td class="d-none d-md-table-cell">
<span id="string[<?php echo $this->escape($key); ?>]"><?php echo HTMLHelper::_('string.truncate', $this->escape($text), 200); ?></span>
</td>
<td class="d-none d-md-table-cell">
<?php echo $language; ?>
</td>
<td class="d-none d-md-table-cell">
<?php
echo $client;
if (isset($oppositeStrings[$key]) && $oppositeStrings[$key] === $text) :
echo '/' . $oppositeClient;
endif;
?>
</td>
</tr>
<?php $i++; ?>
<?php endforeach; ?>
</tbody>
</table>
<?php // load the pagination. ?>
<?php echo $this->pagination->getListFooter(); ?>
<?php endif; ?>
<input type="hidden" name="task" value="">
<input type="hidden" name="boxchecked" value="0">
<?php echo HTMLHelper::_('form.token'); ?>
</div>
</div>
</div>
</form>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<layout title="COM_LANGUAGES_OVERRIDE_VIEW_DEFAULT_TITLE">
<message>
<![CDATA[COM_LANGUAGES_OVERRIDE_VIEW_DEFAULT_DESC]]>
</message>
</layout>
</metadata>