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,22 @@
<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData, EXTR_OVERWRITE);
/**
* Layout variables
* -----------------
* @var string $action
* @var array $options
*/
echo $action;

View File

@ -0,0 +1,85 @@
<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2018 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\Factory;
use Joomla\CMS\Language\Text;
extract($displayData, EXTR_OVERWRITE);
/**
* Layout variables
* -----------------
* @var int $id
* @var string $onclick
* @var string $class
* @var string $text
* @var string $btnClass
* @var string $tagName
* @var string $htmlAttributes
* @var string $task The task which should be executed
* @var bool $listCheck Boolean, whether selection from a list is needed
* @var string $form CSS selector for a target form
* @var bool $formValidation Whether the form need to be validated before run the task
* @var string $dropdownItems The dropdown HTML
* @var string $hasButtons
* @var string $caretClass
* @var string $toggleSplit
*/
Factory::getApplication()->getDocument()->getWebAssetManager()
->useScript('core')
->useScript('webcomponent.toolbar-button');
$tagName = $tagName ?? 'button';
$taskAttr = '';
$title = '';
$idAttr = !empty($id) ? ' id="' . $id . '"' : '';
$listAttr = !empty($listCheck) ? ' list-selection' : '';
$formAttr = !empty($form) ? ' form="' . $this->escape($form) . '"' : '';
$validate = !empty($formValidation) ? ' form-validation' : '';
$msgAttr = !empty($message) ? ' confirm-message="' . $this->escape($message) . '"' : '';
if ($msgAttr) {
Text::script('WARNING');
Text::script('JYES');
Text::script('JNO');
}
if ($id === 'toolbar-help') {
$title = ' title="' . $this->escape(Text::_('JGLOBAL_OPENS_IN_A_NEW_WINDOW')) . '"';
}
if (!empty($task)) {
$taskAttr = ' task="' . $task . '"';
} elseif (!empty($onclick)) {
$htmlAttributes .= ' onclick="' . $onclick . '"';
}
$direction = Factory::getLanguage()->isRtl() ? 'dropdown-menu-end' : '';
?>
<joomla-toolbar-button <?php echo $idAttr . $taskAttr . $listAttr . $formAttr . $validate . $msgAttr; ?>>
<<?php echo $tagName; ?>
class="<?php echo $btnClass ?? ''; ?>"
<?php echo $htmlAttributes ?? ''; ?>
<?php echo $title; ?>
>
<span class="<?php echo trim($class ?? ''); ?>" aria-hidden="true"></span>
<?php echo $text ?? ''; ?>
</<?php echo $tagName; ?>>
<?php // If there is no toggle split then ensure the drop down items are rendered inside the custom element ?>
<?php if (!($toggleSplit ?? true) && isset($dropdownItems) && trim($dropdownItems) !== '') : ?>
<div class="dropdown-menu<?php echo ' ' . $direction; ?>">
<?php echo $dropdownItems; ?>
</div>
<?php endif; ?>
</joomla-toolbar-button>

View File

@ -0,0 +1,31 @@
<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 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;
// @todo: Deprecate this file since we can use popup button to raise batch modal.
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = \Joomla\CMS\Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->useScript('core');
$id = $displayData['id'] ?? '';
$title = $displayData['title'];
Text::script('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST');
Text::script('ERROR');
$message = "{'error': [Joomla.Text._('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST')]}";
$alert = "Joomla.renderMessages(" . $message . ")";
?>
<button<?php echo $id; ?> type="button" onclick="if (document.adminForm.boxchecked.value==0){<?php echo $alert; ?>}else{document.getElementById('collapseModal').open(); return true;}" class="btn btn-primary">
<span class="icon-square" aria-hidden="true"></span>
<?php echo $title; ?>
</button>

View File

@ -0,0 +1,15 @@
<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
?>
</div>
</nav>

View File

@ -0,0 +1,22 @@
<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 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\Factory;
use Joomla\CMS\Language\Text;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->registerAndUseScript('joomla.toolbar', 'legacy/toolbar.min.js', [], ['defer' => true], ['core']);
?>
<nav aria-label="<?php echo Text::_('JTOOLBAR'); ?>">
<div class="btn-toolbar d-flex" role="toolbar" id="<?php echo $displayData['id']; ?>">

View File

@ -0,0 +1,67 @@
<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2018 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\Factory;
use Joomla\CMS\Language\Text;
extract($displayData, EXTR_OVERWRITE);
/**
* Layout variables
* -----------------
* @var string $id
* @var string $onclick
* @var string $class
* @var string $text
* @var string $btnClass
* @var string $tagName
* @var string $htmlAttributes
* @var string $hasButtons
* @var string $button
* @var string $dropdownItems
* @var string $caretClass
* @var string $toggleSplit
*/
$direction = Factory::getLanguage()->isRtl() ? 'dropdown-menu-end' : '';
/**
* The dropdown class is also injected on the button from \Joomla\CMS\Toolbar\ToolbarButton::prepareOptions() and therefore we need the dropdown script whether we
* are in split toggle mode or not
*/
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->useScript('bootstrap.dropdown');
?>
<?php if ($hasButtons && trim($button) !== '') : ?>
<?php // If there is a toggle split then render the items. Else render the parent button which has the items in the custom element. ?>
<?php if ($toggleSplit ?? true) : ?>
<div id="<?php echo $id; ?>" class="btn-group dropdown-<?php echo $name ?? ''; ?>" role="group">
<button type="button" class="<?php echo $caretClass ?? ''; ?> dropdown-toggle-split"
data-bs-toggle="dropdown" data-bs-target=".dropdown-menu" data-bs-display="static" aria-haspopup="true" aria-expanded="false">
<span class="visually-hidden"><?php echo Text::_('JGLOBAL_TOGGLE_DROPDOWN'); ?></span>
<span class="icon-chevron-down" aria-hidden="true"></span>
</button>
<?php echo $button; ?>
<?php if (trim($dropdownItems) !== '') : ?>
<div class="dropdown-menu <?php echo $direction; ?>">
<?php echo $dropdownItems; ?>
</div>
<?php endif; ?>
</div>
<?php else : ?>
<?php echo $button; ?>
<?php endif; ?>
<?php endif; ?>

View File

@ -0,0 +1,17 @@
<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 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\Layout\LayoutHelper;
$displayData['html'] = false;
echo LayoutHelper::render('joomla.icon.iconclass', $displayData);

View File

@ -0,0 +1,19 @@
<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2022 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\Factory;
use Joomla\CMS\Layout\LayoutHelper;
Factory::getApplication()->getDocument()
->getWebAssetManager()->useScript('inlinehelp');
echo LayoutHelper::render('joomla.toolbar.standard', $displayData);

View File

@ -0,0 +1,40 @@
<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData, EXTR_OVERWRITE);
/**
* Layout variables
* -----------------
* @var int $id
* @var string $name
* @var string $class
* @var string $text
* @var string $btnClass
* @var string $tagName
* @var string $htmlAttributes
*/
$margin = (strpos($url ?? '', 'index.php?option=com_config') === false) ? '' : 'ms-auto';
$target = empty($target) ? '' : 'target="' . $target . '"';
?>
<joomla-toolbar-button class="<?php echo $margin; ?>">
<a
id="<?php echo $id; ?>"
class="<?php echo $btnClass; ?>"
href="<?php echo $url; ?>"
<?php echo $target; ?>
<?php echo $htmlAttributes; ?>>
<span class="<?php echo $class; ?> icon-fw" aria-hidden="true"></span>
<?php echo $text ?: ''; ?>
</a>
</joomla-toolbar-button>

View File

@ -0,0 +1,77 @@
<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 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\Factory;
use Joomla\Utilities\ArrayHelper;
extract($displayData);
/**
* Layout variables
* -----------------
* @var int $id
* @var string $name
* @var string $doTask
* @var string $class
* @var string $text
* @var string $btnClass
* @var string $tagName
* @var bool $listCheck
* @var string $htmlAttributes
* @var string $modalWidth
* @var string $modalHeight
* @var string $popupType
* @var string $url
* @var string $textHeader
*/
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
Factory::getApplication()->getDocument()->getWebAssetManager()
->useScript('core')
->useScript('joomla.dialog-autocreate')
->useScript('webcomponent.toolbar-button');
$tagName = $tagName ?? 'button';
$modalAttrs = [];
// Check for use of Joomla Dialog, otherwise fallback to BS Modal
if (!empty($popupType)) {
$popupOptions = [
'popupType' => $popupType,
'src' => $url,
'textHeader' => $textHeader ?? '',
'width' => $modalWidth ?? null,
'height' => $modalHeight ?? null,
];
$modalAttrs['data-joomla-dialog'] = $this->escape(json_encode($popupOptions));
} else {
// @TODO: Remove this fallback in Joomla 6. Deprecation already triggered in PopupButton class.
$modalAttrs['data-bs-toggle'] = 'modal';
$modalAttrs['data-bs-target'] = '#' . $selector;
}
$idAttr = !empty($id) ? ' id="' . $id . '"' : '';
$listAttr = !empty($listCheck) ? ' list-selection' : '';
?>
<joomla-toolbar-button <?php echo $idAttr . $listAttr; ?>>
<<?php echo $tagName; ?>
value="<?php echo $doTask; ?>"
class="<?php echo $btnClass; ?>"
<?php echo $htmlAttributes; ?>
<?php echo ArrayHelper::toString($modalAttrs); ?>
>
<span class="<?php echo $class; ?>" aria-hidden="true"></span>
<?php echo $text; ?>
</<?php echo $tagName; ?>>
</joomla-toolbar-button>

View File

@ -0,0 +1,37 @@
<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData, EXTR_OVERWRITE);
/**
* Layout variables
* -----------------
* @var bool $is_child
* @var string $id
* @var string $doTask
* @var string $class
* @var string $text
* @var string $btnClass
* @var string $tagName
* @var string $htmlAttributes
*/
?>
<?php if ($is_child) : ?>
<?php if (!empty($text)) : ?>
<h6 class="dropdown-header <?php echo $btnClass ?? ''; ?>">
<?php echo $text; ?>
</h6>
<?php else : ?>
<div class="dropdown-divider <?php echo $btnClass ?? ''; ?>"></div>
<?php endif; ?>
<?php endif; ?>

View File

@ -0,0 +1,77 @@
<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 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\Factory;
use Joomla\CMS\Language\Text;
extract($displayData, EXTR_OVERWRITE);
/**
* Layout variables
* -----------------
* @var string $id
* @var string $onclick
* @var string $class
* @var string $text
* @var string $btnClass
* @var string $tagName
* @var string $htmlAttributes
* @var string $task The task which should be executed
* @var bool $listCheck Boolean, whether selection from a list is needed
* @var string $form CSS selector for a target form
* @var bool $formValidation Whether the form need to be validated before run the task
* @var string $message Confirmation message before run the task
*/
Factory::getApplication()->getDocument()->getWebAssetManager()
->useScript('core')
->useScript('webcomponent.toolbar-button');
$tagName = $tagName ?? 'button';
$taskAttr = '';
$idAttr = !empty($id) ? ' id="' . $id . '"' : '';
$listAttr = !empty($listCheck) ? ' list-selection' : '';
$formAttr = !empty($form) ? ' form="' . $this->escape($form) . '"' : '';
$validate = !empty($formValidation) ? ' form-validation' : '';
$msgAttr = !empty($message) ? ' confirm-message="' . $this->escape($message) . '"' : '';
if ($msgAttr) {
Text::script('WARNING');
Text::script('JYES');
Text::script('JNO');
}
if (!empty($task)) {
$taskAttr = ' task="' . $task . '"';
} elseif (!empty($onclick)) {
$htmlAttributes .= ' onclick="' . $onclick . '"';
}
?>
<joomla-toolbar-button <?php echo $idAttr . $taskAttr . $listAttr . $formAttr . $validate . $msgAttr; ?>>
<?php if (!empty($group)) : ?>
<a href="#" class="dropdown-item">
<span class="<?php echo trim($class ?? ''); ?>"></span>
<?php echo $text ?? ''; ?>
</a>
<?php else : ?>
<<?php echo $tagName; ?>
class="<?php echo $btnClass ?? ''; ?>"
<?php echo $htmlAttributes ?? ''; ?>
>
<span class="<?php echo trim($class ?? ''); ?>" aria-hidden="true"></span>
<?php echo $text ?? ''; ?>
</<?php echo $tagName; ?>>
<?php endif; ?>
</joomla-toolbar-button>

View File

@ -0,0 +1,21 @@
<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 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\Layout\LayoutHelper;
// Strip extension if given
$icon = empty($displayData['icon']) ? 'dot-circle' : preg_replace('#\.[^ .]*$#', '', $displayData['icon']);
?>
<h1 class="page-title">
<?php echo LayoutHelper::render('joomla.icon.iconclass', ['icon' => $icon]); ?>
<?php echo $displayData['title']; ?>
</h1>

View File

@ -0,0 +1,60 @@
<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 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\Factory;
use Joomla\CMS\Session\Session;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $id
* @var string $itemId
* @var string $typeId
* @var string $typeAlias
* @var string $title
*/
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->useScript('core')
->useScript('joomla.dialog-autocreate')
->useScript('webcomponent.toolbar-button');
$url = 'index.php?' . http_build_query([
'option' => 'com_contenthistory',
'view' => 'history',
'layout' => 'modal',
'tmpl' => 'component',
'item_id' => $itemId,
Session::getFormToken() => 1,
]);
$dialogOptions = [
'popupType' => 'iframe',
'src' => $url,
'textHeader' => $title ?? '',
];
?>
<joomla-toolbar-button id="toolbar-versions">
<button
class="btn btn-primary"
data-joomla-dialog="<?php echo $this->escape(json_encode($dialogOptions)); ?>"
type="button">
<span class="icon-code-branch" aria-hidden="true"></span>
<?php echo $title; ?>
</button>
</joomla-toolbar-button>