diff --git a/layouts/joomla/form/field/calendar.php b/layouts/joomla/form/field/calendar.php index 450b687766e79..5db6fcce32357 100644 --- a/layouts/joomla/form/field/calendar.php +++ b/layouts/joomla/form/field/calendar.php @@ -9,12 +9,15 @@ defined('JPATH_BASE') or die; +use Joomla\CMS\Factory; +use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Language\Text; use Joomla\Utilities\ArrayHelper; extract($displayData); // Get some system objects. -$document = JFactory::getDocument(); +$document = Factory::getDocument(); /** * Layout variables @@ -81,7 +84,7 @@ // Handle the special case for "now". if (strtoupper($value) == 'NOW') { - $value = JFactory::getDate()->format('Y-m-d H:i:s'); + $value = Factory::getDate()->format('Y-m-d H:i:s'); } $readonly = isset($attributes['readonly']) && $attributes['readonly'] == 'readonly'; @@ -95,10 +98,10 @@ $cssFileExt = ($direction === 'rtl') ? '-rtl.css' : '.css'; // The static assets for the calendar -JHtml::_('script', $localesPath, false, true, false, false, true); -JHtml::_('script', $helperPath, false, true, false, false, true); -JHtml::_('script', 'system/fields/calendar.min.js', false, true, false, false, true); -JHtml::_('stylesheet', 'system/fields/calendar' . $cssFileExt, array(), true); +HTMLHelper::_('script', $localesPath, false, true, false, false, true); +HTMLHelper::_('script', $helperPath, false, true, false, false, true); +HTMLHelper::_('script', 'system/fields/calendar.min.js', false, true, false, false, true); +HTMLHelper::_('stylesheet', 'system/fields/calendar' . $cssFileExt, array(), true); ?>
@@ -118,8 +121,8 @@ data-inputfield="" data-dayformat="" data-button="_btn" - data-firstday="getFirstDay(); ?>" - data-weekend="getWeekEnd(); ?>" + data-firstday="getFirstDay(); ?>" + data-weekend="getWeekEnd(); ?>" data-today-btn="" data-week-numbers="" data-show-time="" diff --git a/layouts/joomla/form/field/color/advanced.php b/layouts/joomla/form/field/color/advanced.php index 7b43e801e861d..e6f4e52898c1d 100644 --- a/layouts/joomla/form/field/color/advanced.php +++ b/layouts/joomla/form/field/color/advanced.php @@ -9,6 +9,8 @@ defined('JPATH_BASE') or die; +use Joomla\CMS\HTML\HTMLHelper; + extract($displayData); /** @@ -70,10 +72,10 @@ // Force LTR input value in RTL, due to display issues with rgba/hex colors $direction = $lang->isRtl() ? ' dir="ltr" style="text-align:right"' : ''; -JHtml::_('jquery.framework'); -JHtml::_('script', 'vendor/minicolors/jquery.minicolors.min.js', array('version' => 'auto', 'relative' => true)); -JHtml::_('stylesheet', 'vendor/minicolors/jquery.minicolors.css', array('version' => 'auto', 'relative' => true)); -JHtml::_('script', 'system/fields/color-field-adv-init.min.js', array('version' => 'auto', 'relative' => true)); +HTMLHelper::_('jquery.framework'); +HTMLHelper::_('script', 'vendor/minicolors/jquery.minicolors.min.js', array('version' => 'auto', 'relative' => true)); +HTMLHelper::_('stylesheet', 'vendor/minicolors/jquery.minicolors.css', array('version' => 'auto', 'relative' => true)); +HTMLHelper::_('script', 'system/fields/color-field-adv-init.min.js', array('version' => 'auto', 'relative' => true)); ?> 'auto', 'relative' => true)); -JHtml::_('stylesheet', 'system/simplecolors.css', array('version' => 'auto', 'relative' => true)); -JHtml::_('script', 'system/fields/color-field-init.min.js', array('version' => 'auto', 'relative' => true)); +HTMLHelper::_('jquery.framework'); +HTMLHelper::_('script', 'system/fields/simplecolors.min.js', array('version' => 'auto', 'relative' => true)); +HTMLHelper::_('stylesheet', 'system/simplecolors.css', array('version' => 'auto', 'relative' => true)); +HTMLHelper::_('script', 'system/fields/color-field-init.min.js', array('version' => 'auto', 'relative' => true)); ?> >
- + diff --git a/layouts/joomla/form/field/media.php b/layouts/joomla/form/field/media.php index 192dcea98b2bb..d7356387e9e1a 100644 --- a/layouts/joomla/form/field/media.php +++ b/layouts/joomla/form/field/media.php @@ -10,6 +10,9 @@ defined('JPATH_BASE') or die; use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Uri\Uri; /** * Layout variables @@ -65,7 +68,7 @@ { if ($value && file_exists(JPATH_ROOT . '/' . $value)) { - $src = JUri::root() . $value; + $src = Uri::root() . $value; } else { @@ -83,11 +86,11 @@ 'style' => $style, ); - $img = JHtml::_('image', $src, JText::_('JLIB_FORM_MEDIA_PREVIEW_ALT'), $imgattr); + $img = HTMLHelper::_('image', $src, Text::_('JLIB_FORM_MEDIA_PREVIEW_ALT'), $imgattr); $previewImg = '
' . $img . '
'; $previewImgEmpty = ''; + . Text::_('JLIB_FORM_MEDIA_PREVIEW_EMPTY') . '
'; $showPreview = 'static'; } @@ -101,7 +104,7 @@ ?> - base-path="" + base-path="" root-folder="get('file_path', 'images'); ?>" url="" modal-container=".modal" @@ -118,22 +121,22 @@ > $url, - 'title' => JText::_('JLIB_FORM_CHANGE_IMAGE'), + 'title' => Text::_('JLIB_FORM_CHANGE_IMAGE'), 'closeButton' => true, 'height' => '100%', 'width' => '100%', 'modalWidth' => '80', 'bodyHeight' => '60', - 'footer' => '' + 'footer' => '' ) ); - JHtml::_('webcomponent', ['joomla-field-media' => 'system/webcomponents/joomla-field-media.min.js'], ['relative' => true, 'version' => 'auto', 'detectBrowser' => false, 'detectDebug' => true]); - JText::script('JLIB_FORM_MEDIA_PREVIEW_EMPTY', true); + HTMLHelper::_('webcomponent', ['joomla-field-media' => 'system/webcomponents/joomla-field-media.min.js'], ['relative' => true, 'version' => 'auto', 'detectBrowser' => false, 'detectDebug' => true]); + Text::script('JLIB_FORM_MEDIA_PREVIEW_EMPTY', true); ?>
@@ -145,8 +148,8 @@ >
- - "> + + ">
diff --git a/layouts/joomla/form/field/moduleorder.php b/layouts/joomla/form/field/moduleorder.php index fef0b2c05c944..11959fa4bd484 100644 --- a/layouts/joomla/form/field/moduleorder.php +++ b/layouts/joomla/form/field/moduleorder.php @@ -9,6 +9,8 @@ defined('JPATH_BASE') or die; +use Joomla\CMS\HTML\HTMLHelper; + extract($displayData); /** @@ -55,7 +57,7 @@ // Initialize JavaScript field attributes. $attr .= !empty($onchange) ? ' onchange="' . $onchange . '"' : ''; -JHtml::_('script', 'system/fields/moduleorder.js', array('version' => 'auto', 'relative' => true)); +HTMLHelper::_('script', 'system/fields/moduleorder.min.js', array('version' => 'auto', 'relative' => true)); ?>
'auto', 'relative' => true)); + HTMLHelper::_('behavior.formvalidator'); + HTMLHelper::_('script', 'system/fields/passwordstrength.min.js', array('version' => 'auto', 'relative' => true)); $class = 'js-password-strength ' . $class; @@ -57,12 +60,12 @@ } } -JHtml::_('script', 'system/fields/passwordview.min.js', array('version' => 'auto', 'relative' => true)); +HTMLHelper::_('script', 'system/fields/passwordview.min.js', array('version' => 'auto', 'relative' => true)); -JText::script('JFIELD_PASSWORD_INDICATE_INCOMPLETE'); -JText::script('JFIELD_PASSWORD_INDICATE_COMPLETE'); -JText::script('JSHOW'); -JText::script('JHIDE'); +Text::script('JFIELD_PASSWORD_INDICATE_INCOMPLETE'); +Text::script('JFIELD_PASSWORD_INDICATE_COMPLETE'); +Text::script('JSHOW'); +Text::script('JHIDE'); $attributes = array( strlen($hint) ? 'placeholder="' . htmlspecialchars($hint, ENT_COMPAT, 'UTF-8') . '"' : '', @@ -93,7 +96,7 @@ > - +
diff --git a/layouts/joomla/form/field/radiobasic.php b/layouts/joomla/form/field/radiobasic.php index 5797f35f35b0a..0a609b9ef3ec6 100644 --- a/layouts/joomla/form/field/radiobasic.php +++ b/layouts/joomla/form/field/radiobasic.php @@ -9,6 +9,8 @@ defined('JPATH_BASE') or die; +use Joomla\CMS\Language\Text; + extract($displayData); /** @@ -40,9 +42,6 @@ * @var array $options Options available for this field. */ -// Including fallback code for HTML5 non supported browsers. -JHtml::_('jquery.framework'); - /** * The format of the input tag to be filled in using sprintf. * %1 - id @@ -79,7 +78,7 @@
diff --git a/layouts/joomla/form/field/subform/repeatable-table.php b/layouts/joomla/form/field/subform/repeatable-table.php index 9be6a2886b186..c118aa0f6d483 100644 --- a/layouts/joomla/form/field/subform/repeatable-table.php +++ b/layouts/joomla/form/field/subform/repeatable-table.php @@ -9,6 +9,10 @@ defined('_JEXEC') or die; +use Joomla\CMS\Factory; +use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Language\Text; + /** * Make thing clear * @@ -29,8 +33,8 @@ // Add script if ($multiple) { - JHtml::_('jquery.ui', array('core', 'sortable')); - JHtml::_('script', 'system/fields/subform-repeatable.min.js', array('version' => 'auto', 'relative' => true)); + HTMLHelper::_('jquery.ui', array('core', 'sortable')); + HTMLHelper::_('script', 'system/fields/subform-repeatable.min.js', array('version' => 'auto', 'relative' => true)); } // Build heading @@ -39,11 +43,11 @@ if (!empty($groupByFieldset)) { foreach ($tmpl->getFieldsets() as $fieldset) { - $table_head .= '' . JText::_($fieldset->label); + $table_head .= '' . Text::_($fieldset->label); if (!empty($fieldset->description)) { - $table_head .= '
' . JText::_($fieldset->description) . ''; + $table_head .= '
' . Text::_($fieldset->description) . ''; } $table_head .= ''; @@ -55,14 +59,14 @@ { foreach ($tmpl->getGroup('') as $field) { $table_head .= '' . strip_tags($field->label); - $table_head .= '
' . JText::_($field->description) . ''; + $table_head .= '
' . Text::_($field->description) . ''; $table_head .= ''; } $sublayout = 'section'; // Label will not be shown for sections layout, so reset the margin left - JFactory::getDocument()->addStyleDeclaration( + Factory::getDocument()->addStyleDeclaration( '.subform-table-sublayout-section .controls { margin-left: 0px }' ); } @@ -83,7 +87,7 @@
- +
diff --git a/layouts/joomla/form/field/subform/repeatable-table/section-byfieldsets.php b/layouts/joomla/form/field/subform/repeatable-table/section-byfieldsets.php index 5e1c840dc10d2..e0e03fe385bab 100644 --- a/layouts/joomla/form/field/subform/repeatable-table/section-byfieldsets.php +++ b/layouts/joomla/form/field/subform/repeatable-table/section-byfieldsets.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\CMS\Language\Text; + /** * Make thing clear * @@ -32,9 +34,9 @@
- - - + + +
diff --git a/layouts/joomla/form/field/subform/repeatable-table/section.php b/layouts/joomla/form/field/subform/repeatable-table/section.php index bfc29a4278b8e..e3fb5ae7a63bd 100644 --- a/layouts/joomla/form/field/subform/repeatable-table/section.php +++ b/layouts/joomla/form/field/subform/repeatable-table/section.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\CMS\Language\Text; + /** * Make thing clear * @@ -30,9 +32,9 @@
- - - + + +
diff --git a/layouts/joomla/form/field/subform/repeatable.php b/layouts/joomla/form/field/subform/repeatable.php index 20c11f7c7e44b..cd6d9cbbfe8c9 100644 --- a/layouts/joomla/form/field/subform/repeatable.php +++ b/layouts/joomla/form/field/subform/repeatable.php @@ -9,6 +9,9 @@ defined('_JEXEC') or die; +use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Language\Text; + /** * Make thing clear * @@ -29,8 +32,8 @@ // Add script if ($multiple) { - JHtml::_('jquery.ui', array('core', 'sortable')); - JHtml::_('script', 'system/fields/subform-repeatable.min.js', array('version' => 'auto', 'relative' => true)); + HTMLHelper::_('jquery.ui', array('core', 'sortable')); + HTMLHelper::_('script', 'system/fields/subform-repeatable.min.js', array('version' => 'auto', 'relative' => true)); } $sublayout = empty($groupByFieldset) ? 'section' : 'section-byfieldsets'; @@ -44,7 +47,7 @@
- +
diff --git a/layouts/joomla/form/field/subform/repeatable/section-byfieldsets.php b/layouts/joomla/form/field/subform/repeatable/section-byfieldsets.php index 0009fa27147b3..93335337de776 100644 --- a/layouts/joomla/form/field/subform/repeatable/section-byfieldsets.php +++ b/layouts/joomla/form/field/subform/repeatable/section-byfieldsets.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\CMS\Language\Text; + /** * Make thing clear * @@ -24,9 +26,9 @@
- - - + + +
@@ -34,7 +36,7 @@ getFieldsets() as $fieldset) : ?>
label)) : ?> - label); ?> + label); ?> getFieldset($fieldset->name) as $field) : ?> renderField(); ?> diff --git a/layouts/joomla/form/field/subform/repeatable/section.php b/layouts/joomla/form/field/subform/repeatable/section.php index e674d93cb5b09..1b4790b910f93 100644 --- a/layouts/joomla/form/field/subform/repeatable/section.php +++ b/layouts/joomla/form/field/subform/repeatable/section.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\CMS\Language\Text; + /** * Make thing clear * @@ -25,9 +27,9 @@
- - - + + +
diff --git a/layouts/joomla/form/field/text.php b/layouts/joomla/form/field/text.php index e906d9c239c4c..786af949ecb6e 100644 --- a/layouts/joomla/form/field/text.php +++ b/layouts/joomla/form/field/text.php @@ -9,6 +9,8 @@ defined('JPATH_BASE') or die; +use Joomla\CMS\Language\Text; + extract($displayData); /** @@ -75,8 +77,8 @@ !empty($validationtext) ? 'data-validation-text="' . $validationtext . '"' : '', ); -$addonBeforeHtml = '' . JText::_($addonBefore) . ''; -$addonAfterHtml = '' . JText::_($addonAfter) . ''; +$addonBeforeHtml = '' . Text::_($addonBefore) . ''; +$addonAfterHtml = '' . Text::_($addonAfter) . ''; ?> diff --git a/layouts/joomla/form/field/url.php b/layouts/joomla/form/field/url.php index 3d64686ebdbae..6ac1bfc01ee8c 100644 --- a/layouts/joomla/form/field/url.php +++ b/layouts/joomla/form/field/url.php @@ -9,6 +9,8 @@ defined('JPATH_BASE') or die; +use Joomla\CMS\String\PunycodeHelper; + extract($displayData); /** @@ -65,5 +67,5 @@ name="" id="" - value="" + value="" > diff --git a/layouts/joomla/form/field/user.php b/layouts/joomla/form/field/user.php index ddc7a1aed1fc3..4d74bdc2b9d40 100644 --- a/layouts/joomla/form/field/user.php +++ b/layouts/joomla/form/field/user.php @@ -9,6 +9,9 @@ defined('JPATH_BASE') or die; +use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Uri\Uri; use Joomla\Utilities\ArrayHelper; extract($displayData); @@ -48,11 +51,11 @@ if (!$readonly) { // @TODO remove jQuery dependency once modal moves to webcomponents - JHtml::_('jquery.framework'); + HTMLHelper::_('jquery.framework'); - JHtml::_('webcomponent', ['joomla-field-user' =>'system/webcomponents/joomla-field-user.min.js'], ['version' => 'auto', 'relative' => true]);} + HTMLHelper::_('webcomponent', ['joomla-field-user' =>'system/webcomponents/joomla-field-user.min.js'], ['version' => 'auto', 'relative' => true]);} -$uri = new JUri('index.php?option=com_users&view=users&layout=modal&tmpl=component&required=0'); +$uri = new Uri('index.php?option=com_users&view=users&layout=modal&tmpl=component&required=0'); $uri->setVar('field', $this->escape($id)); @@ -72,7 +75,7 @@ } // Invalidate the input value if no user selected -if ($this->escape($userName) === JText::_('JLIB_FORM_SELECT_USER')) +if ($this->escape($userName) === Text::_('JLIB_FORM_SELECT_USER')) { $userName = ''; } @@ -94,7 +97,7 @@ } if (!$readonly) { - $inputAttributes['placeholder'] = JText::_('JLIB_FORM_SELECT_USER'); + $inputAttributes['placeholder'] = Text::_('JLIB_FORM_SELECT_USER'); } ?> @@ -110,19 +113,19 @@ readonly> - - "> + $uri, - 'title' => JText::_('JLIB_FORM_CHANGE_USER'), + 'title' => Text::_('JLIB_FORM_CHANGE_USER'), 'closeButton' => true, 'height' => '100%', 'width' => '100%', 'modalWidth' => 80, 'bodyHeight' => 60, - 'footer' => '' . JText::_('JCANCEL') . '' + 'footer' => '' . Text::_('JCANCEL') . '' ) ); ?> diff --git a/layouts/joomla/form/renderfield.php b/layouts/joomla/form/renderfield.php index a605297d93b31..55c018be89425 100644 --- a/layouts/joomla/form/renderfield.php +++ b/layouts/joomla/form/renderfield.php @@ -9,6 +9,8 @@ defined('JPATH_BASE') or die; +use Joomla\CMS\HTML\HTMLHelper; + extract($displayData); /** @@ -22,8 +24,8 @@ if (!empty($options['showonEnabled'])) { - JHtml::_('jquery.framework'); - JHtml::_('script', 'system/cms.min.js', array('version' => 'auto', 'relative' => true)); + HTMLHelper::_('jquery.framework'); + HTMLHelper::_('script', 'system/cms.min.js', array('version' => 'auto', 'relative' => true)); } $class = empty($options['class']) ? '' : ' ' . $options['class']; diff --git a/layouts/joomla/form/renderlabel.php b/layouts/joomla/form/renderlabel.php index 031c79d0917db..6a58d69290be5 100644 --- a/layouts/joomla/form/renderlabel.php +++ b/layouts/joomla/form/renderlabel.php @@ -9,6 +9,9 @@ defined('JPATH_BASE') or die; +use Joomla\CMS\Factory; +use Joomla\CMS\HTML\HTMLHelper; + extract($displayData); /** @@ -24,19 +27,19 @@ $classes = array_filter((array) $classes); -$id = $for . '-lbl'; +$id = $for . '-lbl'; $title = ''; if (!empty($description)) { if ($text && $text !== $description) { - JHtml::_('bootstrap.popover'); + HTMLHelper::_('bootstrap.popover'); $classes[] = 'hasPopover'; $title = ' title="' . htmlspecialchars(trim($text, ':')) . '"' . ' data-content="'. htmlspecialchars($description) . '"'; - if (!$position && JFactory::getLanguage()->isRtl()) + if (!$position && Factory::getLanguage()->isRtl()) { $position = ' data-placement="left" '; } @@ -44,7 +47,7 @@ else { $classes[] = 'hasTooltip'; - $title = ' title="' . JHtml::_('tooltipText', trim($text, ':'), $description, 0) . '"'; + $title = ' title="' . HTMLHelper::_('tooltipText', trim($text, ':'), $description, 0) . '"'; } }