diff --git a/components/com_config/tmpl/config/default_site.php b/components/com_config/tmpl/config/default_site.php
index 31fe3a817df43..fb0cdb5848745 100644
--- a/components/com_config/tmpl/config/default_site.php
+++ b/components/com_config/tmpl/config/default_site.php
@@ -17,9 +17,14 @@
-
label; ?>
-
input; ?>
+
+ label; ?>
+ input; ?>
+ description): ?>
+
+ description) ?>
+
+
diff --git a/language/en-GB/com_config.ini b/language/en-GB/com_config.ini
index 41892c1805567..a61c1776f06ec 100644
--- a/language/en-GB/com_config.ini
+++ b/language/en-GB/com_config.ini
@@ -7,9 +7,11 @@ COM_CONFIG="Administrator Services"
COM_CONFIG_CONFIGURATION="Administrator Services Configuration"
COM_CONFIG_ERROR_CONTROLLER_NOT_FOUND="Controller Not found!"
COM_CONFIG_FIELD_DEFAULT_ACCESS_LEVEL_LABEL="Default Access Level"
+COM_CONFIG_FIELD_DEFAULT_ACCESS_LEVEL_DESC="Set the default Access Level for newly created items."
COM_CONFIG_FIELD_DEFAULT_LIST_LIMIT_LABEL="Default List Limit"
COM_CONFIG_FIELD_METADESC_LABEL="Site Meta Description"
COM_CONFIG_FIELD_SEF_URL_LABEL="Search Engine Friendly URLs"
+COM_CONFIG_FIELD_SEF_URL_DESC="If this option is disabled, Joomla URLs will not contain any keywords and instead look like
index.php?option=com_example&task=item.display&id=1
which isn't easy to convey verbally or in writing. Search Engine Friendly (SEF) URLs are more human–readable, e.g.
index.php/example/display/something
. Despite the setting's name, kept for historical reasons, the URL format no longer has any bearing to how search engines rank your site's pages."
COM_CONFIG_FIELD_SITE_NAME_LABEL="Site Name"
COM_CONFIG_FIELD_SITE_OFFLINE_LABEL="Site Offline"
COM_CONFIG_FIELD_SITENAME_PAGETITLES_LABEL="Site Name in Page Titles"
diff --git a/language/en-GB/joomla.ini b/language/en-GB/joomla.ini
index a955d077a38c1..4cc0f69242a54 100644
--- a/language/en-GB/joomla.ini
+++ b/language/en-GB/joomla.ini
@@ -80,6 +80,7 @@ JFALSE="False"
JFEATURED="Featured"
JFEATURED_ASC="Featured ascending"
JFEATURED_DESC="Featured descending"
+JINLINEHELP="Toggle Inline Help"
JHIDE="Hide"
JHIDEPASSWORD="Hide Password"
JINVALID_TOKEN="The most recent request was denied because it had an invalid security token. Please refresh the page and try again."
diff --git a/layouts/joomla/form/field/calendar.php b/layouts/joomla/form/field/calendar.php
index e13a0d6215504..a977ef175d687 100644
--- a/layouts/joomla/form/field/calendar.php
+++ b/layouts/joomla/form/field/calendar.php
@@ -167,7 +167,7 @@
id=""
name=""
value=""
-
+
diff --git a/layouts/joomla/form/field/combo.php b/layouts/joomla/form/field/combo.php
index 408e71432c740..04dbe8bac182a 100644
--- a/layouts/joomla/form/field/combo.php
+++ b/layouts/joomla/form/field/combo.php
@@ -54,7 +54,7 @@
$attr .= !empty($readonly) ? ' readonly' : '';
$attr .= !empty($disabled) ? ' disabled' : '';
$attr .= !empty($required) ? ' required' : '';
-$attr .= !empty($description) ? ' aria-describedby="' . $name . '-desc"' : '';
+$attr .= !empty($description) ? ' aria-describedby="' . ($id ?: $name) . '-desc"' : '';
// Initialize JavaScript field attributes.
$attr .= !empty($onchange) ? ' onchange="' . $onchange . '"' : '';
diff --git a/layouts/joomla/form/field/email.php b/layouts/joomla/form/field/email.php
index fa37a86fa0bc0..254489393c144 100644
--- a/layouts/joomla/form/field/email.php
+++ b/layouts/joomla/form/field/email.php
@@ -57,7 +57,7 @@
'value="' . htmlspecialchars(PunycodeHelper::emailToUTF8($value), ENT_COMPAT, 'UTF-8') . '"',
$spellcheck ? '' : 'spellcheck="false"',
!empty($size) ? 'size="' . $size . '"' : '',
- !empty($description) ? 'aria-describedby="' . $name . '-desc"' : '',
+ !empty($description) ? 'aria-describedby="' . ($id ?: $name) . '-desc"' : '',
$disabled ? 'disabled' : '',
$readonly ? 'readonly' : '',
$onchange ? 'onchange="' . $onchange . '"' : '',
diff --git a/layouts/joomla/form/field/list.php b/layouts/joomla/form/field/list.php
index 6726107acf13f..c827e314a99ac 100644
--- a/layouts/joomla/form/field/list.php
+++ b/layouts/joomla/form/field/list.php
@@ -54,7 +54,7 @@
$attr .= $required ? ' required' : '';
$attr .= $autofocus ? ' autofocus' : '';
$attr .= $onchange ? ' onchange="' . $onchange . '"' : '';
-$attr .= !empty($description) ? ' aria-describedby="' . $name . '-desc"' : '';
+$attr .= !empty($description) ? ' aria-describedby="' . ($id ?: $name) . '-desc"' : '';
$attr .= $dataAttribute;
// To avoid user's confusion, readonly="readonly" should imply disabled="disabled".
diff --git a/layouts/joomla/form/field/number.php b/layouts/joomla/form/field/number.php
index 747da215b4d49..d10d61f3d12ba 100644
--- a/layouts/joomla/form/field/number.php
+++ b/layouts/joomla/form/field/number.php
@@ -47,7 +47,7 @@
$attributes = array(
!empty($class) ? 'class="form-control ' . $class . '"' : 'class="form-control"',
- !empty($description) ? 'aria-describedby="' . $name . '-desc"' : '',
+ !empty($description) ? 'aria-describedby="' . ($id ?: $name) . '-desc"' : '',
$disabled ? 'disabled' : '',
$readonly ? 'readonly' : '',
strlen($hint) ? 'placeholder="' . htmlspecialchars($hint, ENT_COMPAT, 'UTF-8') . '"' : '',
diff --git a/layouts/joomla/form/field/password.php b/layouts/joomla/form/field/password.php
index df07acb569fa4..a1bc52cd460b3 100644
--- a/layouts/joomla/form/field/password.php
+++ b/layouts/joomla/form/field/password.php
@@ -86,7 +86,7 @@
}
$ariaDescribedBy = $rules ? $name . '-rules ' : '';
-$ariaDescribedBy .= !empty($description) ? $name . '-desc' : '';
+$ariaDescribedBy .= !empty($description) ? (($id ?: $name) . '-desc') : '';
$attributes = array(
strlen($hint) ? 'placeholder="' . htmlspecialchars($hint, ENT_COMPAT, 'UTF-8') . '"' : '',
diff --git a/layouts/joomla/form/field/range.php b/layouts/joomla/form/field/range.php
index a7e71c7d57c23..3e07863d863c3 100644
--- a/layouts/joomla/form/field/range.php
+++ b/layouts/joomla/form/field/range.php
@@ -49,7 +49,7 @@
// Initialize some field attributes.
$attributes = array(
$class ? 'class="form-range ' . $class . '"' : 'class="form-range"',
- !empty($description) ? 'aria-describedby="' . $name . '-desc"' : '',
+ !empty($description) ? 'aria-describedby="' . ($id ?: $name) . '-desc"' : '',
$disabled ? 'disabled' : '',
$readonly ? 'readonly' : '',
!empty($onchange) ? 'onchange="' . $onchange . '"' : '',
diff --git a/layouts/joomla/form/field/tel.php b/layouts/joomla/form/field/tel.php
index c2838323f8e78..ddf0735ed522b 100644
--- a/layouts/joomla/form/field/tel.php
+++ b/layouts/joomla/form/field/tel.php
@@ -49,7 +49,7 @@
$attributes = array(
!empty($size) ? 'size="' . $size . '"' : '',
- !empty($description) ? 'aria-describedby="' . $name . '-desc"' : '',
+ !empty($description) ? 'aria-describedby="' . ($id ?: $name) . '-desc"' : '',
$disabled ? 'disabled' : '',
$readonly ? 'readonly' : '',
strlen($hint) ? 'placeholder="' . htmlspecialchars($hint, ENT_COMPAT, 'UTF-8') . '"' : '',
diff --git a/layouts/joomla/form/field/text.php b/layouts/joomla/form/field/text.php
index 8ebd1d4c4ac42..300f2789ec8d5 100644
--- a/layouts/joomla/form/field/text.php
+++ b/layouts/joomla/form/field/text.php
@@ -61,7 +61,7 @@
$attributes = array(
!empty($class) ? 'class="form-control ' . $class . '"' : 'class="form-control"',
!empty($size) ? 'size="' . $size . '"' : '',
- !empty($description) ? 'aria-describedby="' . $name . '-desc"' : '',
+ !empty($description) ? 'aria-describedby="' . ($id ?: $name) . '-desc"' : '',
$disabled ? 'disabled' : '',
$readonly ? 'readonly' : '',
$dataAttribute,
diff --git a/layouts/joomla/form/field/textarea.php b/layouts/joomla/form/field/textarea.php
index 177ae193753b1..dcbd3f994fd70 100644
--- a/layouts/joomla/form/field/textarea.php
+++ b/layouts/joomla/form/field/textarea.php
@@ -68,7 +68,7 @@
$columns ?: '',
$rows ?: '',
!empty($class) ? 'class="form-control ' . $class . $charcounter . '"' : 'class="form-control' . $charcounter . '"',
- !empty($description) ? 'aria-describedby="' . $name . '-desc"' : '',
+ !empty($description) ? 'aria-describedby="' . ($id ?: $name) . '-desc"' : '',
strlen($hint) ? 'placeholder="' . htmlspecialchars($hint, ENT_COMPAT, 'UTF-8') . '"' : '',
$disabled ? 'disabled' : '',
$readonly ? 'readonly' : '',
diff --git a/layouts/joomla/form/field/time.php b/layouts/joomla/form/field/time.php
index 8e53c7054af6c..ef7b2f9e9cd03 100644
--- a/layouts/joomla/form/field/time.php
+++ b/layouts/joomla/form/field/time.php
@@ -49,7 +49,7 @@
$attributes = [
!empty($class) ? 'class="form-control ' . $class . '"' : 'class="form-control"',
- !empty($description) ? 'aria-describedby="' . $name . '-desc"' : '',
+ !empty($description) ? 'aria-describedby="' . ($id ?: $name) . '-desc"' : '',
$disabled ? 'disabled' : '',
$readonly ? 'readonly' : '',
strlen($hint) ? 'placeholder="' . htmlspecialchars($hint, ENT_COMPAT, 'UTF-8') . '"' : '',
diff --git a/layouts/joomla/form/field/url.php b/layouts/joomla/form/field/url.php
index 0ce18a9723bc3..d27a259b53eda 100644
--- a/layouts/joomla/form/field/url.php
+++ b/layouts/joomla/form/field/url.php
@@ -50,7 +50,7 @@
$attributes = array(
!empty($size) ? ' size="' . $size . '"' : '',
- !empty($description) ? ' aria-describedby="' . $name . '-desc"' : '',
+ !empty($description) ? ' aria-describedby="' . ($id ?: $name) . '-desc"' : '',
$disabled ? ' disabled' : '',
$readonly ? ' readonly' : '',
strlen($hint) ? ' placeholder="' . htmlspecialchars($hint, ENT_COMPAT, 'UTF-8') . '"' : '',
diff --git a/layouts/joomla/form/renderfield.php b/layouts/joomla/form/renderfield.php
index 036953e3a7654..4695d97a11f92 100644
--- a/layouts/joomla/form/renderfield.php
+++ b/layouts/joomla/form/renderfield.php
@@ -17,10 +17,12 @@
* Layout variables
* -----------------
* @var array $options Optional parameters
- * @var string $name The id of the input this label is for
+ * @var string $id The id of the input this label is for
+ * @var string $name The name of the input this label is for
* @var string $label The html code for the label
* @var string $input The input field html code
- * @var string $description An optional description to use in a tooltip
+ * @var string $description An optional description to use as in–line help text
+ * @var string $descClass The class name ot use for the description
*/
if (!empty($options['showonEnabled']))
@@ -32,9 +34,10 @@
$class = empty($options['class']) ? '' : ' ' . $options['class'];
$rel = empty($options['rel']) ? '' : ' ' . $options['rel'];
-$id = $name . '-desc';
+$id = ($id ?: $name) . '-desc';
$hideLabel = !empty($options['hiddenLabel']);
$hideDescription = empty($options['hiddenDescription']) ? false : $options['hiddenDescription'];
+$descClass = ($options['descClass'] ?? '') ?: 'hide-aware-inline-help';
if (!empty($parentclass))
{
@@ -51,7 +54,7 @@
-
+
diff --git a/libraries/src/Toolbar/Button/InlinehelpButton.php b/libraries/src/Toolbar/Button/InlinehelpButton.php
new file mode 100644
index 0000000000000..a934b2ab039ef
--- /dev/null
+++ b/libraries/src/Toolbar/Button/InlinehelpButton.php
@@ -0,0 +1,93 @@
+
+ * @license GNU General Public License version 2 or later; see LICENSE.txt
+ */
+
+namespace Joomla\CMS\Toolbar\Button;
+
+\defined('JPATH_PLATFORM') or die;
+
+/**
+ * Renders a button to show / hide the inline help text
+ *
+ * @method self targetclass(string $value)
+ * @method string getTargetclass()
+ *
+ * @since __DEPLOY_VERSION__
+ */
+class InlinehelpButton extends BasicButton
+{
+ /**
+ * Prepare options for this button.
+ *
+ * @param array $options The options for this button.
+ *
+ * @return void
+ *
+ * @since __DEPLOY_VERSION__
+ */
+ protected function prepareOptions(array &$options)
+ {
+ $options['text'] = $options['text'] ?: 'JINLINEHELP';
+ $options['icon'] = $options['icon'] ?? 'fa-question-circle';
+ $options['button_class'] = $options['button_class'] ?? 'btn btn-info';
+ $options['attributes'] = array_merge($options['attributes'] ?? [],
+ [
+ 'data-class' => $options['targetclass'] ?? 'hide-aware-inline-help'
+ ]
+ );
+
+ parent::prepareOptions($options);
+ }
+
+ /**
+ * Fetches the button HTML code.
+ *
+ * @param string $type Unused string.
+ * @param string $targetClass The class of the DIVs holding the descriptions to toggle.
+ * @param string $text Button label
+ * @param string $icon Button icon
+ * @param string $buttonClass Button class
+ *
+ * @return string
+ *
+ * @since __DEPLOY_VERSION__
+ *
+ * @deprecated 5.0 Use render() instead.
+ */
+ public function fetchButton(
+ $type = 'Inlinehelp',
+ string $targetClass = 'hide-aware-inline-help',
+ string $text = 'JINLINEHELP', string $icon = 'fa fa-question-circle',
+ string $buttonClass = 'btn btn-info'
+ )
+ {
+ $this->name('inlinehelp')
+ ->targetclass($targetClass)
+ ->text($text)
+ ->icon($icon)
+ ->buttonClass($buttonClass);
+
+ return $this->renderButton($this->options);
+ }
+
+ /**
+ * Method to configure available option accessors.
+ *
+ * @return array
+ *
+ * @since __DEPLOY_VERSION__
+ */
+ protected static function getAccessors(): array
+ {
+ return array_merge(
+ parent::getAccessors(),
+ [
+ 'targetclass',
+ ]
+ );
+ }
+}
diff --git a/libraries/src/Toolbar/Toolbar.php b/libraries/src/Toolbar/Toolbar.php
index 048a64ecc9815..17f3ca2561094 100644
--- a/libraries/src/Toolbar/Toolbar.php
+++ b/libraries/src/Toolbar/Toolbar.php
@@ -19,6 +19,7 @@
use Joomla\CMS\Toolbar\Button\CustomButton;
use Joomla\CMS\Toolbar\Button\DropdownButton;
use Joomla\CMS\Toolbar\Button\HelpButton;
+use Joomla\CMS\Toolbar\Button\InlinehelpButton;
use Joomla\CMS\Toolbar\Button\LinkButton;
use Joomla\CMS\Toolbar\Button\PopupButton;
use Joomla\CMS\Toolbar\Button\SeparatorButton;
@@ -32,6 +33,7 @@
* @method PopupButton popupButton(string $name = '', string $text = '', string $task = '')
* @method LinkButton linkButton(string $name = '', string $text = '', string $task = '')
* @method HelpButton helpButton(string $name = '', string $text = '', string $task = '')
+ * @method InlinehelpButton inlinehelpButton(string $name = '', string $text = '', string $task = '')
* @method CustomButton customButton(string $name = '', string $text = '', string $task = '')
* @method ConfirmButton confirmButton(string $name = '', string $text = '', string $task = '')
* @method BasicButton basicButton(string $name = '', string $text = '', string $task = '')
diff --git a/libraries/src/Toolbar/ToolbarHelper.php b/libraries/src/Toolbar/ToolbarHelper.php
index 288926cb0cf76..8d5c3254fe020 100644
--- a/libraries/src/Toolbar/ToolbarHelper.php
+++ b/libraries/src/Toolbar/ToolbarHelper.php
@@ -10,11 +10,13 @@
\defined('_JEXEC') or die;
+use Joomla\CMS\Document\HtmlDocument;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\FileLayout;
use Joomla\CMS\Table\Table;
use Joomla\CMS\Uri\Uri;
+use Throwable;
/**
* Utility class for the button bar.
@@ -157,6 +159,42 @@ public static function help($ref, $com = false, $override = null, $component = n
$bar->appendButton('Help', $ref, $com, $override, $component);
}
+ /**
+ * Writes a help button for showing/hiding the inline help of a form
+ *
+ * @param string $class The class used by the inline help items.
+ *
+ * @return void
+ *
+ * @since __DEPLOY_VERSION__
+ */
+ public static function inlinehelp(string $class = "hide-aware-inline-help")
+ {
+ /** @var HtmlDocument $doc */
+ try
+ {
+ $doc = Factory::getApplication()->getDocument();
+
+ if (!($doc instanceof HtmlDocument))
+ {
+ return;
+ }
+
+ $doc->getWebAssetManager()->useScript('inlinehelp');
+ }
+ catch (Throwable $e)
+ {
+ return;
+ }
+
+ $bar = Toolbar::getInstance('toolbar');
+
+ // Add a help button.
+ $bar->inlinehelpButton('inlinehelp')
+ ->targetclass($class)
+ ->icon('fa fa-question-circle');
+ }
+
/**
* Writes a cancel button that will go back to the previous page without doing
* any other operation.