first commit
This commit is contained in:
185
layouts/plugins/editors/tinymce/field/tinymcebuilder.php
Normal file
185
layouts/plugins/editors/tinymce/field/tinymcebuilder.php
Normal file
@ -0,0 +1,185 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage Editors.tinymce
|
||||
*
|
||||
* @copyright (C) 2016 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\Document\HtmlDocument;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Form\Form;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Layout\FileLayout;
|
||||
|
||||
extract($displayData);
|
||||
|
||||
/**
|
||||
* Layout variables
|
||||
* -----------------
|
||||
* @var string $autocomplete Autocomplete attribute for the field.
|
||||
* @var boolean $autofocus Is autofocus enabled?
|
||||
* @var string $class Classes for the input.
|
||||
* @var string $description Description of the field.
|
||||
* @var boolean $disabled Is this field disabled?
|
||||
* @var string $group Group the field belongs to. <fields> section in form XML.
|
||||
* @var boolean $hidden Is this field hidden in the form?
|
||||
* @var string $hint Placeholder for the field.
|
||||
* @var string $id DOM id of the field.
|
||||
* @var string $label Label of the field.
|
||||
* @var string $labelclass Classes to apply to the label.
|
||||
* @var boolean $multiple Does this field support multiple values?
|
||||
* @var string $name Name of the input field.
|
||||
* @var string $onchange Onchange attribute for the field.
|
||||
* @var string $onclick Onclick attribute for the field.
|
||||
* @var string $pattern Pattern (Reg Ex) of value of the form field.
|
||||
* @var boolean $readonly Is this field read only?
|
||||
* @var boolean $repeat Allows extensions to duplicate elements.
|
||||
* @var boolean $required Is this field required?
|
||||
* @var integer $size Size attribute of the input.
|
||||
* @var boolean $spellcheck Spellcheck state for the form field.
|
||||
* @var string $validate Validation rules to apply.
|
||||
* @var array $value Value of the field.
|
||||
* @var array $menus List of the menu items
|
||||
* @var array $menubarSource Menu items for builder
|
||||
* @var array $buttons List of the buttons
|
||||
* @var array $buttonsSource Buttons by group, for the builder
|
||||
* @var array $toolbarPreset Toolbar preset (default values)
|
||||
* @var int $setsAmount Amount of sets
|
||||
* @var array $setsNames List of Sets names
|
||||
* @var Form[] $setsForms Form with extra options for an each set
|
||||
* @var string $languageFile TinyMCE language file to translate the buttons
|
||||
* @var FileLayout $this Context
|
||||
*/
|
||||
|
||||
/** @var HtmlDocument $doc */
|
||||
$doc = Factory::getApplication()->getDocument();
|
||||
$wa = $doc->getWebAssetManager();
|
||||
|
||||
$wa->getRegistry()->addExtensionRegistryFile('plg_editors_tinymce');
|
||||
$wa->registerAndUseStyle('tinymce.skin', 'media/vendor/tinymce/skins/ui/oxide/skin.min.css')
|
||||
->registerAndUseStyle('plg_editors_tinymce.builder', 'plg_editors_tinymce/tinymce-builder.css', [], [], ['tinymce.skin', 'dragula'])
|
||||
->registerScript('plg_editors_tinymce.builder', 'plg_editors_tinymce/tinymce-builder.js', [], ['type' => 'module'], ['dragula', 'plg_editors_tinymce'])
|
||||
->useScript('plg_editors_tinymce.builder')
|
||||
->useStyle('webcomponent.joomla-tab')
|
||||
->useScript('webcomponent.joomla-tab');
|
||||
|
||||
// Add TinyMCE language file to translate the buttons
|
||||
if ($languageFile) {
|
||||
$wa->registerAndUseScript('tinymce.language', $languageFile, [], ['defer' => true], []);
|
||||
}
|
||||
|
||||
// Add the builder options
|
||||
$doc->addScriptOptions(
|
||||
'plg_editors_tinymce_builder',
|
||||
[
|
||||
'menus' => $menus,
|
||||
'buttons' => $buttons,
|
||||
'toolbarPreset' => $toolbarPreset,
|
||||
'formControl' => $name . '[toolbars]',
|
||||
]
|
||||
);
|
||||
|
||||
?>
|
||||
<div id="joomla-tinymce-builder">
|
||||
<h3><?php echo Text::_('PLG_TINY_SET_TARGET_PANEL_TITLE'); ?></h3>
|
||||
<p><?php echo Text::_('PLG_TINY_SET_TARGET_PANEL_DESCRIPTION'); ?></p>
|
||||
<p><?php echo Text::_('PLG_TINY_SET_SOURCE_PANEL_DESCRIPTION'); ?></p>
|
||||
<div class="tox tox-tinymce">
|
||||
<div class="tox-editor-container">
|
||||
<div class="tox-menubar tinymce-builder-menu source" data-group="menu"
|
||||
data-value="<?php echo $this->escape(json_encode($menubarSource)); ?>">
|
||||
</div>
|
||||
<div class="tox-toolbar tinymce-builder-toolbar source" data-group="toolbar"
|
||||
data-value="<?php echo $this->escape(json_encode($buttonsSource)); ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<joomla-tab orientation="vertical" id="joomla-tinymce-builder-sets" recall breakpoint="974">
|
||||
<?php foreach ($setsNames as $num => $title) : ?>
|
||||
<?php $isActive = $num === $setsAmount - 1; ?>
|
||||
<joomla-tab-element class="tab-pane" id="set-<?php echo $num; ?>" <?php echo $isActive; ?> name="<?php echo $title; ?>">
|
||||
<?php // Render tab content for each set ?>
|
||||
<?php
|
||||
$presetButtonClasses = [
|
||||
'simple' => 'btn-success',
|
||||
'medium' => 'btn-info',
|
||||
'advanced' => 'btn-warning',
|
||||
];
|
||||
// Check whether the values exists, and if empty then use from preset
|
||||
if (
|
||||
empty($value['toolbars'][$num]['menu'])
|
||||
&& empty($value['toolbars'][$num]['toolbar1'])
|
||||
&& empty($value['toolbars'][$num]['toolbar2'])
|
||||
) {
|
||||
// Take the preset for default value
|
||||
switch ($num) {
|
||||
case 0:
|
||||
$preset = $toolbarPreset['advanced'];
|
||||
break;
|
||||
case 1:
|
||||
$preset = $toolbarPreset['medium'];
|
||||
break;
|
||||
default:
|
||||
$preset = $toolbarPreset['simple'];
|
||||
}
|
||||
|
||||
$value['toolbars'][$num] = $preset;
|
||||
}
|
||||
|
||||
// Take existing values
|
||||
$valMenu = empty($value['toolbars'][$num]['menu']) ? [] : $value['toolbars'][$num]['menu'];
|
||||
$valBar1 = empty($value['toolbars'][$num]['toolbar1']) ? [] : $value['toolbars'][$num]['toolbar1'];
|
||||
$valBar2 = empty($value['toolbars'][$num]['toolbar2']) ? [] : $value['toolbars'][$num]['toolbar2'];
|
||||
|
||||
?>
|
||||
<?php echo $this->sublayout('setaccess', ['form' => $setsForms[$num]]); ?>
|
||||
<div class="btn-toolbar float-end mt-3">
|
||||
<div class="btn-group btn-group-sm">
|
||||
|
||||
<?php foreach (array_keys($toolbarPreset) as $presetName) :
|
||||
$btnClass = empty($presetButtonClasses[$presetName]) ? 'btn-primary' : $presetButtonClasses[$presetName];
|
||||
?>
|
||||
<button type="button" class="btn <?php echo $btnClass; ?> button-action"
|
||||
data-action="setPreset" data-preset="<?php echo $presetName; ?>" data-set="<?php echo $num; ?>">
|
||||
<?php echo Text::_('PLG_TINY_SET_PRESET_BUTTON_' . $presetName); ?>
|
||||
</button>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<button type="button" class="btn btn-danger button-action"
|
||||
data-action="clearPane" data-set="<?php echo $num; ?>">
|
||||
<?php echo Text::_('JCLEAR'); ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clearfix mb-1"></div>
|
||||
|
||||
<div class="tox tox-tinymce mb-3">
|
||||
<div class="tox-editor-container">
|
||||
<div class="tox-menubar tinymce-builder-menu target"
|
||||
data-group="menu" data-set="<?php echo $num; ?>"
|
||||
data-value="<?php echo $this->escape(json_encode($valMenu)); ?>">
|
||||
</div>
|
||||
<div class="tox-toolbar tinymce-builder-toolbar target"
|
||||
data-group="toolbar1" data-set="<?php echo $num; ?>"
|
||||
data-value="<?php echo $this->escape(json_encode($valBar1)); ?>">
|
||||
</div>
|
||||
<div class="tox-toolbar tinymce-builder-toolbar target"
|
||||
data-group="toolbar2" data-set="<?php echo $num; ?>"
|
||||
data-value="<?php echo $this->escape(json_encode($valBar2)); ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php // Render the form for extra options ?>
|
||||
<?php echo $this->sublayout('setoptions', ['form' => $setsForms[$num]]); ?>
|
||||
</joomla-tab-element>
|
||||
<?php endforeach; ?>
|
||||
</joomla-tab>
|
||||
</div>
|
||||
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage Editors.tinymce
|
||||
*
|
||||
* @copyright (C) 2021 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);
|
||||
|
||||
/**
|
||||
* Layout variables
|
||||
* -----------------
|
||||
* @var \Joomla\CMS\Form\Form $form Form with extra options for the set
|
||||
* @var \Joomla\CMS\Layout\FileLayout $this Context
|
||||
*/
|
||||
?>
|
||||
<div class="setaccess-form-wrapper">
|
||||
<?php echo $form->renderField('access'); ?>
|
||||
</div>
|
||||
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage Editors.tinymce
|
||||
*
|
||||
* @copyright (C) 2016 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);
|
||||
|
||||
/**
|
||||
* Layout variables
|
||||
* -----------------
|
||||
* @var \Joomla\CMS\Form\Form $form Form with extra options for the set
|
||||
* @var \Joomla\CMS\Layout\FileLayout $this Context
|
||||
*/
|
||||
?>
|
||||
<div class="setoptions-form-wrapper">
|
||||
<?php foreach ($form->getFieldset('basic') as $field) : ?>
|
||||
<?php echo $field->renderField(); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
94
layouts/plugins/system/privacyconsent/label.php
Normal file
94
layouts/plugins/system/privacyconsent/label.php
Normal file
@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage System.privacyconsent
|
||||
*
|
||||
* @copyright (C) 2019 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;
|
||||
|
||||
extract($displayData);
|
||||
|
||||
/**
|
||||
* Layout variables
|
||||
* -----------------
|
||||
* @var string $autocomplete Autocomplete attribute for the field.
|
||||
* @var boolean $autofocus Is autofocus enabled?
|
||||
* @var string $class Classes for the input.
|
||||
* @var boolean $disabled Is this field disabled?
|
||||
* @var string $group Group the field belongs to. <fields> section in form XML.
|
||||
* @var boolean $hidden Is this field hidden in the form?
|
||||
* @var string $hint Placeholder for the field.
|
||||
* @var string $id DOM id of the field.
|
||||
* @var string $label Label of the field.
|
||||
* @var string $labelclass Classes to apply to the label.
|
||||
* @var boolean $multiple Does this field support multiple values?
|
||||
* @var string $name Name of the input field.
|
||||
* @var string $onchange Onchange attribute for the field.
|
||||
* @var string $onclick Onclick attribute for the field.
|
||||
* @var string $pattern Pattern (Reg Ex) of value of the form field.
|
||||
* @var boolean $readonly Is this field read only?
|
||||
* @var boolean $repeat Allows extensions to duplicate elements.
|
||||
* @var boolean $required Is this field required?
|
||||
* @var integer $size Size attribute of the input.
|
||||
* @var boolean $spellcheck Spellcheck state for the form field.
|
||||
* @var string $validate Validation rules to apply.
|
||||
* @var string $value Value attribute of the field.
|
||||
* @var array $options Options available for this field.
|
||||
* @var array $privacynote The privacy note that needs to be displayed
|
||||
* @var array $translateLabel Should the label be translated?
|
||||
* @var array $translateHint Should the hint be translated?
|
||||
* @var array $privacyArticle The Article ID holding the Privacy Article.
|
||||
* @var object $article The Article object.
|
||||
* @var object $privacyLink Link to the privacy article or menu item.
|
||||
*/
|
||||
|
||||
// Get the label text from the XML element, defaulting to the element name.
|
||||
$text = $label ? (string) $label : (string) $name;
|
||||
$text = $translateLabel ? Text::_($text) : $text;
|
||||
|
||||
// Set required to true as this field is not displayed at all if not required.
|
||||
$required = true;
|
||||
|
||||
// Build the class for the label.
|
||||
$class = 'required';
|
||||
$class = !empty($labelclass) ? $class . ' ' . $labelclass : $class;
|
||||
|
||||
if ($privacyLink) {
|
||||
$attribs = [
|
||||
'data-bs-toggle' => 'modal',
|
||||
'data-bs-target' => '#consentModal',
|
||||
'class' => 'required',
|
||||
];
|
||||
|
||||
$link = HTMLHelper::_('link', Route::_($privacyLink . '&tmpl=component'), $text, $attribs);
|
||||
|
||||
echo HTMLHelper::_(
|
||||
'bootstrap.renderModal',
|
||||
'consentModal',
|
||||
[
|
||||
'url' => Route::_($privacyLink . '&tmpl=component'),
|
||||
'title' => $text,
|
||||
'height' => '100%',
|
||||
'width' => '100%',
|
||||
'bodyHeight' => 70,
|
||||
'modalWidth' => 80,
|
||||
'footer' => '<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" aria-hidden="true">'
|
||||
. Text::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</button>',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
$link = '<span class="' . $class . '">' . $text . '</span>';
|
||||
}
|
||||
|
||||
// Add the label text and star.
|
||||
$label = $link . '<span class="star" aria-hidden="true"> *</span>';
|
||||
|
||||
echo $label;
|
||||
47
layouts/plugins/system/privacyconsent/message.php
Normal file
47
layouts/plugins/system/privacyconsent/message.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage System.privacyconsent
|
||||
*
|
||||
* @copyright (C) 2019 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);
|
||||
|
||||
/**
|
||||
* Layout variables
|
||||
* -----------------
|
||||
* @var string $autocomplete Autocomplete attribute for the field.
|
||||
* @var boolean $autofocus Is autofocus enabled?
|
||||
* @var string $class Classes for the input.
|
||||
* @var boolean $disabled Is this field disabled?
|
||||
* @var string $group Group the field belongs to. <fields> section in form XML.
|
||||
* @var boolean $hidden Is this field hidden in the form?
|
||||
* @var string $hint Placeholder for the field.
|
||||
* @var string $id DOM id of the field.
|
||||
* @var string $label Label of the field.
|
||||
* @var string $labelclass Classes to apply to the label.
|
||||
* @var boolean $multiple Does this field support multiple values?
|
||||
* @var string $name Name of the input field.
|
||||
* @var string $onchange Onchange attribute for the field.
|
||||
* @var string $onclick Onclick attribute for the field.
|
||||
* @var string $pattern Pattern (Reg Ex) of value of the form field.
|
||||
* @var boolean $readonly Is this field read only?
|
||||
* @var boolean $repeat Allows extensions to duplicate elements.
|
||||
* @var boolean $required Is this field required?
|
||||
* @var integer $size Size attribute of the input.
|
||||
* @var boolean $spellcheck Spellcheck state for the form field.
|
||||
* @var string $validate Validation rules to apply.
|
||||
* @var string $value Value attribute of the field.
|
||||
* @var array $options Options available for this field.
|
||||
* @var string $privacynote The privacy note that needs to be displayed
|
||||
* @var array $translateLabel Should the label be translated?
|
||||
* @var array $translateHint Should the hint be translated?
|
||||
* @var array $privacyArticle The Article ID holding the Privacy Article
|
||||
*/
|
||||
|
||||
echo '<div class="alert alert-info">' . $privacynote . '</div>';
|
||||
149
layouts/plugins/system/webauthn/manage.php
Normal file
149
layouts/plugins/system/webauthn/manage.php
Normal file
@ -0,0 +1,149 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage System.webauthn
|
||||
*
|
||||
* @copyright (C) 2020 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\Layout\FileLayout;
|
||||
use Joomla\CMS\User\User;
|
||||
use Webauthn\PublicKeyCredentialSource;
|
||||
|
||||
/**
|
||||
* Passwordless Login management interface
|
||||
*
|
||||
* Generic data
|
||||
*
|
||||
* @var FileLayout $this The Joomla layout renderer
|
||||
* @var array $displayData The data in array format. DO NOT USE.
|
||||
*
|
||||
* Layout specific data
|
||||
*
|
||||
* @var User $user The Joomla user whose passwordless login we are managing
|
||||
* @var bool $allow_add Are we allowed to add passwordless login methods
|
||||
* @var array $credentials The already stored credentials for the user
|
||||
* @var string $error Any error messages
|
||||
* @var array $knownAuthenticators Known authenticator metadata
|
||||
* @var boolean $attestationSupport Is authenticator attestation supported in the plugin?
|
||||
*/
|
||||
|
||||
// Extract the data. Do not remove until the unset() line.
|
||||
try {
|
||||
$app = Factory::getApplication();
|
||||
$loggedInUser = $app->getIdentity();
|
||||
|
||||
$app->getDocument()->getWebAssetManager()
|
||||
->registerAndUseStyle('plg_system_webauthn.backend', 'plg_system_webauthn/backend.css');
|
||||
} catch (Exception $e) {
|
||||
$loggedInUser = new User();
|
||||
}
|
||||
|
||||
$defaultDisplayData = [
|
||||
'user' => $loggedInUser,
|
||||
'allow_add' => false,
|
||||
'credentials' => [],
|
||||
'error' => '',
|
||||
'knownAuthenticators' => [],
|
||||
'attestationSupport' => true,
|
||||
];
|
||||
extract(array_merge($defaultDisplayData, $displayData));
|
||||
|
||||
if ($displayData['allow_add'] === false) {
|
||||
$error = Text::_('PLG_SYSTEM_WEBAUTHN_CANNOT_ADD_FOR_A_USER');
|
||||
$allow_add = false;
|
||||
}
|
||||
|
||||
// Ensure the GMP or BCmath extension is loaded in PHP - as this is required by third party library
|
||||
if ($allow_add && function_exists('gmp_intval') === false && function_exists('bccomp') === false) {
|
||||
$error = Text::_('PLG_SYSTEM_WEBAUTHN_REQUIRES_GMP');
|
||||
$allow_add = false;
|
||||
}
|
||||
|
||||
Text::script('JGLOBAL_CONFIRM_DELETE');
|
||||
|
||||
HTMLHelper::_('bootstrap.tooltip', '.plg_system_webauth-has-tooltip');
|
||||
?>
|
||||
<div class="plg_system_webauthn" id="plg_system_webauthn-management-interface">
|
||||
<?php
|
||||
if (is_string($error) && !empty($error)) : ?>
|
||||
<div class="alert alert-danger">
|
||||
<?php echo htmlentities($error) ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<table class="table table-striped">
|
||||
<caption class="visually-hidden">
|
||||
<?php echo Text::_('PLG_SYSTEM_WEBAUTHN_TABLE_CAPTION'); ?>,
|
||||
</caption>
|
||||
<thead class="table-dark">
|
||||
<tr>
|
||||
<th <?php if ($attestationSupport) :
|
||||
?>colspan="2"<?php
|
||||
endif; ?> scope="col">
|
||||
<?php echo Text::_('PLG_SYSTEM_WEBAUTHN_MANAGE_FIELD_KEYLABEL_LABEL') ?>
|
||||
</th>
|
||||
<th scope="col"><?php echo Text::_('PLG_SYSTEM_WEBAUTHN_MANAGE_HEADER_ACTIONS_LABEL') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($credentials as $method) : ?>
|
||||
<tr data-credential_id="<?php echo $method['id'] ?>">
|
||||
<?php
|
||||
if ($attestationSupport) :
|
||||
$aaguid = ($method['credential'] instanceof PublicKeyCredentialSource) ? $method['credential']->getAaguid() : '';
|
||||
$authMetadata = $knownAuthenticators[$aaguid->toString()] ?? $knownAuthenticators[''];
|
||||
?>
|
||||
<td class="text-center">
|
||||
<img class="plg_system_webauth-has-tooltip bg-secondary"
|
||||
style="max-width: 6em; max-height: 3em"
|
||||
src="<?php echo $authMetadata->icon ?>"
|
||||
alt="<?php echo $authMetadata->description ?>"
|
||||
title="<?php echo $authMetadata->description ?>">
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
<th scope="row" class="webauthnManagementCell"><?php echo htmlentities($method['label']) ?></th>
|
||||
<td class="webauthnManagementCell">
|
||||
<button class="plg_system_webauthn-manage-edit btn btn-secondary">
|
||||
<span class="icon-edit" aria-hidden="true"></span>
|
||||
<?php echo Text::_('PLG_SYSTEM_WEBAUTHN_MANAGE_BTN_EDIT_LABEL') ?>
|
||||
</button>
|
||||
<button class="plg_system_webauthn-manage-delete btn btn-danger">
|
||||
<span class="icon-minus" aria-hidden="true"></span>
|
||||
<?php echo Text::_('PLG_SYSTEM_WEBAUTHN_MANAGE_BTN_DELETE_LABEL') ?>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php
|
||||
if (empty($credentials)) : ?>
|
||||
<tr>
|
||||
<td colspan="<?php echo $attestationSupport ? '3' : '2'; ?>">
|
||||
<?php echo Text::_('PLG_SYSTEM_WEBAUTHN_MANAGE_HEADER_NOMETHODS_LABEL') ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
if ($allow_add) : ?>
|
||||
<p class="plg_system_webauthn-manage-add-container">
|
||||
<button
|
||||
type="button"
|
||||
id="plg_system_webauthn-manage-add"
|
||||
class="btn btn-success w-100">
|
||||
<span class="icon-plus" aria-hidden="true"></span>
|
||||
<?php echo Text::_('PLG_SYSTEM_WEBAUTHN_MANAGE_BTN_ADD_LABEL') ?>
|
||||
</button>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
93
layouts/plugins/user/terms/label.php
Normal file
93
layouts/plugins/user/terms/label.php
Normal file
@ -0,0 +1,93 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage User.terms
|
||||
*
|
||||
* @copyright (C) 2019 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;
|
||||
|
||||
extract($displayData);
|
||||
|
||||
/**
|
||||
* Layout variables
|
||||
* -----------------
|
||||
* @var string $autocomplete Autocomplete attribute for the field.
|
||||
* @var boolean $autofocus Is autofocus enabled?
|
||||
* @var string $class Classes for the input.
|
||||
* @var boolean $disabled Is this field disabled?
|
||||
* @var string $group Group the field belongs to. <fields> section in form XML.
|
||||
* @var boolean $hidden Is this field hidden in the form?
|
||||
* @var string $hint Placeholder for the field.
|
||||
* @var string $id DOM id of the field.
|
||||
* @var string $label Label of the field.
|
||||
* @var string $labelclass Classes to apply to the label.
|
||||
* @var boolean $multiple Does this field support multiple values?
|
||||
* @var string $name Name of the input field.
|
||||
* @var string $onchange Onchange attribute for the field.
|
||||
* @var string $onclick Onclick attribute for the field.
|
||||
* @var string $pattern Pattern (Reg Ex) of value of the form field.
|
||||
* @var boolean $readonly Is this field read only?
|
||||
* @var boolean $repeat Allows extensions to duplicate elements.
|
||||
* @var boolean $required Is this field required?
|
||||
* @var integer $size Size attribute of the input.
|
||||
* @var boolean $spellcheck Spellcheck state for the form field.
|
||||
* @var string $validate Validation rules to apply.
|
||||
* @var string $value Value attribute of the field.
|
||||
* @var array $options Options available for this field.
|
||||
* @var array $termsnote The terms note that needs to be displayed
|
||||
* @var array $translateLabel Should the label be translated?
|
||||
* @var array $translateHint Should the hint be translated?
|
||||
* @var array $termsArticle The Article ID holding the Terms Article
|
||||
* @var object $article The Article object
|
||||
*/
|
||||
|
||||
// Get the label text from the XML element, defaulting to the element name.
|
||||
$text = $label ? (string) $label : (string) $name;
|
||||
$text = $translateLabel ? Text::_($text) : $text;
|
||||
|
||||
// Set required to true as this field is not displayed at all if not required.
|
||||
$required = true;
|
||||
|
||||
// Build the class for the label.
|
||||
$class = 'required';
|
||||
$class = !empty($labelclass) ? $class . ' ' . $labelclass : $class;
|
||||
|
||||
if ($article) {
|
||||
$attribs = [
|
||||
'data-bs-toggle' => 'modal',
|
||||
'data-bs-target' => '#tosModal',
|
||||
'class' => 'required',
|
||||
];
|
||||
|
||||
$link = HTMLHelper::_('link', Route::_($article->link . '&tmpl=component'), $text, $attribs);
|
||||
|
||||
echo HTMLHelper::_(
|
||||
'bootstrap.renderModal',
|
||||
'tosModal',
|
||||
[
|
||||
'url' => Route::_($article->link . '&tmpl=component'),
|
||||
'title' => $text,
|
||||
'height' => '100%',
|
||||
'width' => '100%',
|
||||
'bodyHeight' => 70,
|
||||
'modalWidth' => 80,
|
||||
'footer' => '<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" aria-hidden="true">'
|
||||
. Text::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</button>',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
$link = '<span class="' . $class . '">' . $text . '</span>';
|
||||
}
|
||||
|
||||
// Add the label text and star.
|
||||
$label = $link . '<span class="star" aria-hidden="true"> *</span>';
|
||||
|
||||
echo $label;
|
||||
47
layouts/plugins/user/terms/message.php
Normal file
47
layouts/plugins/user/terms/message.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage User.terms
|
||||
*
|
||||
* @copyright (C) 2019 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);
|
||||
|
||||
/**
|
||||
* Layout variables
|
||||
* -----------------
|
||||
* @var string $autocomplete Autocomplete attribute for the field.
|
||||
* @var boolean $autofocus Is autofocus enabled?
|
||||
* @var string $class Classes for the input.
|
||||
* @var boolean $disabled Is this field disabled?
|
||||
* @var string $group Group the field belongs to. <fields> section in form XML.
|
||||
* @var boolean $hidden Is this field hidden in the form?
|
||||
* @var string $hint Placeholder for the field.
|
||||
* @var string $id DOM id of the field.
|
||||
* @var string $label Label of the field.
|
||||
* @var string $labelclass Classes to apply to the label.
|
||||
* @var boolean $multiple Does this field support multiple values?
|
||||
* @var string $name Name of the input field.
|
||||
* @var string $onchange Onchange attribute for the field.
|
||||
* @var string $onclick Onclick attribute for the field.
|
||||
* @var string $pattern Pattern (Reg Ex) of value of the form field.
|
||||
* @var boolean $readonly Is this field read only?
|
||||
* @var boolean $repeat Allows extensions to duplicate elements.
|
||||
* @var boolean $required Is this field required?
|
||||
* @var integer $size Size attribute of the input.
|
||||
* @var boolean $spellcheck Spellcheck state for the form field.
|
||||
* @var string $validate Validation rules to apply.
|
||||
* @var string $value Value attribute of the field.
|
||||
* @var array $options Options available for this field.
|
||||
* @var string $termsnote The terms note that needs to be displayed
|
||||
* @var array $translateLabel Should the label be translated?
|
||||
* @var array $translateHint Should the hint be translated?
|
||||
* @var array $termsArticle The Article ID holding the Terms Article
|
||||
*/
|
||||
|
||||
echo '<div class="alert alert-info">' . $termsnote . '</div>';
|
||||
48
layouts/plugins/user/token/token.php
Normal file
48
layouts/plugins/user/token/token.php
Normal file
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage Layout
|
||||
*
|
||||
* @copyright (C) 2020 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);
|
||||
|
||||
/**
|
||||
* Layout variables
|
||||
* -----------------
|
||||
* @var string $id DOM id of the field.
|
||||
* @var string $label Label of the field.
|
||||
* @var string $name Name of the input field.
|
||||
* @var string $value Value attribute of the field.
|
||||
*/
|
||||
|
||||
Text::script('ERROR');
|
||||
Text::script('MESSAGE');
|
||||
Text::script('PLG_USER_TOKEN_COPY_SUCCESS');
|
||||
Text::script('PLG_USER_TOKEN_COPY_FAIL');
|
||||
|
||||
Factory::getApplication()->getDocument()->getWebAssetManager()
|
||||
->registerAndUseScript('plg_user_token.token', 'plg_user_token/token.js', [], ['defer' => true], ['core']);
|
||||
?>
|
||||
<div class="input-group">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
name="<?php echo $name; ?>"
|
||||
id="<?php echo $id; ?>"
|
||||
readonly
|
||||
value="<?php echo htmlspecialchars($value, ENT_COMPAT, 'UTF-8'); ?>">
|
||||
<button
|
||||
class="btn btn-primary"
|
||||
type="button"
|
||||
id="token-copy"
|
||||
title="<?php echo Text::_('PLG_USER_TOKEN_COPY_DESC'); ?>"><?php echo Text::_('PLG_USER_TOKEN_COPY'); ?></button>
|
||||
</div>
|
||||
Reference in New Issue
Block a user