first commit
This commit is contained in:
22
layouts/joomla/toolbar/base.php
Normal file
22
layouts/joomla/toolbar/base.php
Normal 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;
|
||||
78
layouts/joomla/toolbar/basic.php
Normal file
78
layouts/joomla/toolbar/basic.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<?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;
|
||||
|
||||
Factory::getDocument()->getWebAssetManager()
|
||||
->useScript('core')
|
||||
->useScript('webcomponent.toolbar-button');
|
||||
|
||||
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
|
||||
*/
|
||||
$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 ($id === 'toolbar-help') {
|
||||
$title = ' title="' . 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>
|
||||
31
layouts/joomla/toolbar/batch.php
Normal file
31
layouts/joomla/toolbar/batch.php
Normal 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 = isset($displayData['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>
|
||||
15
layouts/joomla/toolbar/containerclose.php
Normal file
15
layouts/joomla/toolbar/containerclose.php
Normal 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>
|
||||
22
layouts/joomla/toolbar/containeropen.php
Normal file
22
layouts/joomla/toolbar/containeropen.php
Normal 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']; ?>">
|
||||
69
layouts/joomla/toolbar/dropdown.php
Normal file
69
layouts/joomla/toolbar/dropdown.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?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) : ?>
|
||||
<?php // @todo use a class instead of the inline style.
|
||||
// Reverse order solves a console err for dropdown ?>
|
||||
<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; ?>
|
||||
17
layouts/joomla/toolbar/iconclass.php
Normal file
17
layouts/joomla/toolbar/iconclass.php
Normal 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);
|
||||
19
layouts/joomla/toolbar/inlinehelp.php
Normal file
19
layouts/joomla/toolbar/inlinehelp.php
Normal 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);
|
||||
40
layouts/joomla/toolbar/link.php
Normal file
40
layouts/joomla/toolbar/link.php
Normal 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>
|
||||
55
layouts/joomla/toolbar/popup.php
Normal file
55
layouts/joomla/toolbar/popup.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?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, EXTR_OVERWRITE);
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
Factory::getDocument()->getWebAssetManager()
|
||||
->useScript('core')
|
||||
->useScript('webcomponent.toolbar-button');
|
||||
|
||||
$tagName = $tagName ?? 'button';
|
||||
|
||||
$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>
|
||||
37
layouts/joomla/toolbar/separator.php
Normal file
37
layouts/joomla/toolbar/separator.php
Normal 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; ?>
|
||||
70
layouts/joomla/toolbar/standard.php
Normal file
70
layouts/joomla/toolbar/standard.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?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;
|
||||
|
||||
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::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 (!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>
|
||||
21
layouts/joomla/toolbar/title.php
Normal file
21
layouts/joomla/toolbar/title.php
Normal 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>
|
||||
71
layouts/joomla/toolbar/versions.php
Normal file
71
layouts/joomla/toolbar/versions.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?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\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Session\Session;
|
||||
|
||||
extract($displayData, EXTR_OVERWRITE);
|
||||
|
||||
/**
|
||||
* 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::getDocument()->getWebAssetManager();
|
||||
$wa->getRegistry()->addExtensionRegistryFile('com_contenthistory');
|
||||
|
||||
$wa->useScript('core')
|
||||
->useScript('webcomponent.toolbar-button')
|
||||
->useScript('com_contenthistory.admin-history-versions');
|
||||
|
||||
echo HTMLHelper::_(
|
||||
'bootstrap.renderModal',
|
||||
'versionsModal',
|
||||
[
|
||||
'url' => 'index.php?' . http_build_query(
|
||||
[
|
||||
'option' => 'com_contenthistory',
|
||||
'view' => 'history',
|
||||
'layout' => 'modal',
|
||||
'tmpl' => 'component',
|
||||
'item_id' => $itemId,
|
||||
Session::getFormToken() => 1
|
||||
]
|
||||
),
|
||||
'title' => $title,
|
||||
'height' => '100%',
|
||||
'width' => '100%',
|
||||
'modalWidth' => '80',
|
||||
'bodyHeight' => '60',
|
||||
'footer' => '<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" aria-hidden="true">'
|
||||
. Text::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</button>'
|
||||
]
|
||||
);
|
||||
?>
|
||||
<joomla-toolbar-button id="toolbar-versions">
|
||||
<button
|
||||
class="btn btn-primary"
|
||||
type="button"
|
||||
data-bs-target="#versionsModal"
|
||||
data-bs-toggle="modal">
|
||||
<span class="icon-code-branch" aria-hidden="true"></span>
|
||||
<?php echo $title; ?>
|
||||
</button>
|
||||
</joomla-toolbar-button>
|
||||
Reference in New Issue
Block a user