diff --git a/administrator/components/com_config/forms/application.xml b/administrator/components/com_config/forms/application.xml index c7971a1440dad..9eeb2f60978c1 100644 --- a/administrator/components/com_config/forms/application.xml +++ b/administrator/components/com_config/forms/application.xml @@ -175,6 +175,7 @@ name="dbtype" type="databaseconnection" label="COM_CONFIG_FIELD_DATABASE_TYPE_LABEL" + description="COM_CONFIG_FIELD_DATABASE_TYPE_DESC" supported="mysql,mysqli,pgsql,postgresql" filter="string" /> @@ -293,6 +294,7 @@ name="debug" type="radio" label="COM_CONFIG_FIELD_DEBUG_SYSTEM_LABEL" + description="COM_CONFIG_FIELD_DEBUG_SYSTEM_DESC" layout="joomla.form.field.radio.switcher" default="0" filter="boolean" @@ -305,6 +307,7 @@ name="debug_lang" type="radio" label="COM_CONFIG_FIELD_DEBUG_LANG_LABEL" + description="COM_CONFIG_FIELD_DEBUG_LANG_DESC" layout="joomla.form.field.radio.switcher" default="0" filter="boolean" @@ -394,6 +397,7 @@ name="proxy_enable" type="radio" label="COM_CONFIG_FIELD_PROXY_ENABLE_LABEL" + description="COM_CONFIG_FIELD_PROXY_ENABLE_DESC" layout="joomla.form.field.radio.switcher" default="0" filter="boolean" @@ -406,6 +410,7 @@ name="proxy_host" type="text" label="COM_CONFIG_FIELD_PROXY_HOST_LABEL" + description="COM_CONFIG_FIELD_PROXY_HOST_DESC" filter="string" showon="proxy_enable:1" size="14" @@ -427,6 +432,7 @@ name="proxy_user" type="text" label="COM_CONFIG_FIELD_PROXY_USERNAME_LABEL" + description="COM_CONFIG_FIELD_PROXY_USERNAME_DESC" filter="string" showon="proxy_enable:1" autocomplete="off" @@ -454,6 +460,7 @@ name="offset" type="timezone" label="COM_CONFIG_FIELD_SERVER_TIMEZONE_LABEL" + description="COM_CONFIG_FIELD_SERVER_TIMEZONE_DESC" default="UTC" > @@ -481,6 +488,7 @@ name="massmailoff" type="radio" label="COM_CONFIG_FIELD_MAIL_MASSMAILOFF_LABEL" + description="COM_CONFIG_FIELD_MAIL_MASSMAILOFF_DESC" layout="joomla.form.field.radio.switcher" default="0" filter="boolean" @@ -657,6 +665,7 @@ name="MetaRights" type="textarea" label="JFIELD_META_RIGHTS_LABEL" + description="JFIELD_META_RIGHTS_DESC" filter="string" cols="60" rows="2" @@ -678,6 +687,7 @@ name="MetaVersion" type="radio" label="COM_CONFIG_FIELD_METAVERSION_LABEL" + description="COM_CONFIG_FIELD_METAVERSION_DESC" layout="joomla.form.field.radio.switcher" default="0" filter="boolean" @@ -696,6 +706,7 @@ name="sef" type="radio" label="COM_CONFIG_FIELD_SEF_URL_LABEL" + description="COM_CONFIG_FIELD_SEF_URL_DESC" layout="joomla.form.field.radio.switcher" default="1" filter="boolean" @@ -708,6 +719,7 @@ name="sef_rewrite" type="radio" label="COM_CONFIG_FIELD_SEF_REWRITE_LABEL" + description="COM_CONFIG_FIELD_SEF_REWRITE_DESC" layout="joomla.form.field.radio.switcher" default="0" filter="boolean" @@ -720,7 +732,7 @@ @@ -783,6 +798,7 @@ name="gzip" type="radio" label="COM_CONFIG_FIELD_GZIP_COMPRESSION_LABEL" + description="COM_CONFIG_FIELD_GZIP_COMPRESSION_DESC" layout="joomla.form.field.radio.switcher" default="0" filter="boolean" @@ -795,6 +811,7 @@ name="error_reporting" type="list" label="COM_CONFIG_FIELD_ERROR_REPORTING_LABEL" + description="COM_CONFIG_FIELD_ERROR_REPORTING_DESC" default="default" filter="cmd" validate="options" @@ -1020,6 +1037,7 @@ name="frontediting" type="list" label="COM_CONFIG_FRONTEDITING_LABEL" + description="COM_CONFIG_FRONTEDITING_DESC" default="1" filter="integer" validate="options" @@ -1033,6 +1051,7 @@ name="editor" type="plugins" label="COM_CONFIG_FIELD_DEFAULT_EDITOR_LABEL" + description="COM_CONFIG_FIELD_DEFAULT_EDITOR_DESC" folder="editors" default="tinymce" filter="cmd" @@ -1042,6 +1061,7 @@ name="captcha" type="plugins" label="COM_CONFIG_FIELD_DEFAULT_CAPTCHA_LABEL" + description="COM_CONFIG_FIELD_DEFAULT_CAPTCHA_DESC" folder="captcha" default="0" filter="cmd" @@ -1053,6 +1073,7 @@ name="access" type="accesslevel" label="COM_CONFIG_FIELD_DEFAULT_ACCESS_LEVEL_LABEL" + description="COM_CONFIG_FIELD_DEFAULT_ACCESS_LEVEL_DESC" default="1" filter="UINT" validate="options" @@ -1082,6 +1103,7 @@ name="feed_limit" type="list" label="COM_CONFIG_FIELD_DEFAULT_FEED_LIMIT_LABEL" + description="COM_CONFIG_FIELD_DEFAULT_FEED_LIMIT_DESC" default="10" filter="integer" validate="options" diff --git a/administrator/components/com_config/src/View/Application/HtmlView.php b/administrator/components/com_config/src/View/Application/HtmlView.php index b2304bc7d6b60..23486c2b0c36e 100644 --- a/administrator/components/com_config/src/View/Application/HtmlView.php +++ b/administrator/components/com_config/src/View/Application/HtmlView.php @@ -120,6 +120,7 @@ protected function addToolbar() ToolbarHelper::divider(); ToolbarHelper::cancel('application.cancel', 'JTOOLBAR_CLOSE'); ToolbarHelper::divider(); + ToolbarHelper::inlinehelp(); ToolbarHelper::help('Site_Global_Configuration'); } } diff --git a/administrator/language/en-GB/com_config.ini b/administrator/language/en-GB/com_config.ini index bfe2c9f93d73b..f63f6739dc5b4 100644 --- a/administrator/language/en-GB/com_config.ini +++ b/administrator/language/en-GB/com_config.ini @@ -42,7 +42,7 @@ COM_CONFIG_FIELD_CACHE_LABEL="System Cache" COM_CONFIG_FIELD_CACHE_PATH_LABEL="Path to Cache Folder" COM_CONFIG_FIELD_CACHE_PLATFORMPREFIX_LABEL="Platform Specific Caching" COM_CONFIG_FIELD_CACHE_TIME_LABEL="Cache Time (minutes)" -COM_CONFIG_FIELD_COOKIE_DOMAIN_DESC="Precede domain with '.' if cookie should be valid for all subdomains." +COM_CONFIG_FIELD_COOKIE_DOMAIN_DESC="Precede domain with '.' if cookie should be valid for all subdomains. On most servers you do not need to set this or Cookie Path below." COM_CONFIG_FIELD_COOKIE_DOMAIN_LABEL="Cookie Domain" COM_CONFIG_FIELD_COOKIE_PATH_LABEL="Cookie Path" COM_CONFIG_FIELD_DATABASE_ENCRYPTION_CA_LABEL="Path to CA File" @@ -60,19 +60,27 @@ COM_CONFIG_FIELD_DATABASE_PASSWORD_DESC="Do not edit this field unless absolutel COM_CONFIG_FIELD_DATABASE_PASSWORD_LABEL="Database Password" COM_CONFIG_FIELD_DATABASE_PREFIX_LABEL="Database Tables Prefix" COM_CONFIG_FIELD_DATABASE_TYPE_LABEL="Database Type" +COM_CONFIG_FIELD_DATABASE_TYPE_DESC="Do not change this to a different database technology e.g. from MySQLi (MySQL database technology) to PostgreSQL (Postgres database technology); it will break your site." COM_CONFIG_FIELD_DATABASE_USERNAME_LABEL="Database Username" COM_CONFIG_FIELD_DEBUG_CONST="Constant" COM_CONFIG_FIELD_DEBUG_CONST_LANG_DESC="Select if you should display the language constant or the language value when debugging the language strings." COM_CONFIG_FIELD_DEBUG_CONST_LANG_LABEL="Language Display" COM_CONFIG_FIELD_DEBUG_LANG_LABEL="Debug Language" +COM_CONFIG_FIELD_DEBUG_LANG_DESC="Displays ?? around a language string constant when the string is not present in the currently loaded language files or ** around the string value when the string is present. If none of the above is displayed, it could mean the text is hardcoded and needs a language string." COM_CONFIG_FIELD_DEBUG_SYSTEM_LABEL="Debug System" +COM_CONFIG_FIELD_DEBUG_SYSTEM_DESC="Use it only for troubleshooting, ideally on private copies of your site. The more technical information displayed in this mode can be a security risk if left enabled on live sites. Remember to publish the “System - Debug” plugin to get detailed information on each page being loaded." COM_CONFIG_FIELD_DEBUG_VALUE="Value" COM_CONFIG_FIELD_DEFAULT_ACCESS_LEVEL_LABEL="Default Access Level" +COM_CONFIG_FIELD_DEFAULT_ACCESS_LEVEL_DESC="Set the Access Level which will be assigned by default to newly created items." COM_CONFIG_FIELD_DEFAULT_CAPTCHA_LABEL="Default Captcha" +COM_CONFIG_FIELD_DEFAULT_CAPTCHA_DESC="Joomla and third party extensions can use a CAPTCHA to prevent abuse (spam) on public forms. Each extension can choose to use a different CAPTCHA, if more than one are available. If no selection is made this will be used by default. You can enable additional CAPTCHA methods in System, Manage, Plugins." COM_CONFIG_FIELD_DEFAULT_EDITOR_LABEL="Default Editor" +COM_CONFIG_FIELD_DEFAULT_EDITOR_DESC="This editor will be used for editing content and other rich text areas in third party extensions unless a user has chosen a different one in their user profile . This will also be the only editor available and used for users who are not already logged in (the Guest user group)." COM_CONFIG_FIELD_DEFAULT_FEED_LIMIT_LABEL="Default Feed Limit" +COM_CONFIG_FIELD_DEFAULT_FEED_LIMIT_DESC="How many items will be published by default in RSS and Atom feeds." COM_CONFIG_FIELD_DEFAULT_LIST_LIMIT_LABEL="Default List Limit" COM_CONFIG_FIELD_ERROR_REPORTING_LABEL="Error Reporting" +COM_CONFIG_FIELD_ERROR_REPORTING_DESC="Control whether PHP error messages should be displayed at all and how verbose they will be. On live sites use None for security reasons. Only use Maximum while troubleshooting — remember to set that back to None when you're done!" COM_CONFIG_FIELD_FEED_EMAIL_LABEL="Feed Email Address" COM_CONFIG_FIELD_FILESYSTEM_PATH_DESC="The filesystem path where session data will be stored.
If empty, the system's temporary directory will be used." COM_CONFIG_FIELD_FILESYSTEM_PATH_LABEL="Session Save Path" @@ -86,6 +94,7 @@ COM_CONFIG_FIELD_FLOC_BLOCKER_LABEL="Block FLoC" COM_CONFIG_FIELD_FORCE_SSL_LABEL="Force HTTPS" COM_CONFIG_FIELD_FORCE_SSL_DESC="HTTPS must be enabled on your server or load balancer to utilise this option. Enable 'Behind Load Balancer' if your SSL terminates on your load balancer but your site is served on http on its webserver." COM_CONFIG_FIELD_GZIP_COMPRESSION_LABEL="Gzip Page Compression" +COM_CONFIG_FIELD_GZIP_COMPRESSION_DESC="Joomla can automatically compress the generated HTML pages with GZip, making them smaller and increasing your site's speed score. Disable it if your server is already doing that for you or if it conflicts with third party extensions." COM_CONFIG_FIELD_HTMLBODY_LABEL="HTML Body" COM_CONFIG_FIELD_LOADBALANCER_ENABLE_DESC="If your site is behind a load balancer or reverse proxy, enable this setting so that IP addresses and other configurations within Joomla automatically take this into account." COM_CONFIG_FIELD_LOADBALANCER_ENABLE_LABEL="Behind Load Balancer" @@ -98,6 +107,7 @@ COM_CONFIG_FIELD_LOG_DEPRECATED_LABEL="Log Deprecated API" COM_CONFIG_FIELD_LOG_EVERYTHING_LABEL="Log Almost Everything" COM_CONFIG_FIELD_LOG_EVERYTHING_DESC="Logs everything, except deprecated APIs." COM_CONFIG_FIELD_LOG_PATH_LABEL="Path to Log Folder" +COM_CONFIG_FIELD_LOG_PATH_DESC="Joomla can optionally keep a log file of its own and third party extensions' operations. Provide the absolute path to a folder that is writeable by PHP; if it's missing or is not writeable Joomla will not load at all. For security reasons you must not use a folder with system–wide access such as /tmp." COM_CONFIG_FIELD_LOG_PRIORITIES_ALERT="Alert" COM_CONFIG_FIELD_LOG_PRIORITIES_ALL="All" COM_CONFIG_FIELD_LOG_PRIORITIES_CRITICAL="Critical" @@ -113,6 +123,7 @@ COM_CONFIG_FIELD_MAIL_FROM_NAME_LABEL="From Name" COM_CONFIG_FIELD_MAIL_MAILER_LABEL="Mailer" COM_CONFIG_FIELD_MAIL_MAILONLINE_LABEL="Send Mail" COM_CONFIG_FIELD_MAIL_MASSMAILOFF_LABEL="Disable Mass Mail" +COM_CONFIG_FIELD_MAIL_MASSMAILOFF_DESC="Joomla offers a Mass Mail feature which allows a user with administrator access to send an email to all users of the site. On sites with more than a few dozen users this can be problematic or time out." COM_CONFIG_FIELD_MAIL_REPLY_TO_EMAIL_LABEL="Reply To Email" COM_CONFIG_FIELD_MAIL_REPLY_TO_NAME_LABEL="Reply To Name" COM_CONFIG_FIELD_MAIL_SENDMAIL_PATH_LABEL="Sendmail Path" @@ -129,24 +140,32 @@ COM_CONFIG_FIELD_MEMCACHE_PORT_LABEL="Memcache(d) Server Port" COM_CONFIG_FIELD_METAAUTHOR_LABEL="Author Meta Tag" COM_CONFIG_FIELD_METADESC_LABEL="Site Meta Description" COM_CONFIG_FIELD_METAVERSION_LABEL="Joomla Version" +COM_CONFIG_FIELD_METAVERSION_DESC="Controls whether the generator meta tag in the HTML document's header in the front-end and in Atom feeds includes the exact version of your Joomla site. It is recommended to hide it for security reasons." COM_CONFIG_FIELD_OFFLINE_IMAGE_LABEL="Offline Image" COM_CONFIG_FIELD_OFFLINE_MESSAGE_LABEL="Custom Message" COM_CONFIG_FIELD_PROXY_ENABLE_LABEL="Enable Outbound Proxy" +COM_CONFIG_FIELD_PROXY_ENABLE_DESC="Some hosts do not allow any network access from your site to the outside world by default and require you to manually configure an outbound proxy." COM_CONFIG_FIELD_PROXY_HOST_LABEL="Outbound Proxy Host" +COM_CONFIG_FIELD_PROXY_HOST_DESC="Host (domain) name or IP address." COM_CONFIG_FIELD_PROXY_PASSWORD_LABEL="Outbound Proxy Password" COM_CONFIG_FIELD_PROXY_PORT_LABEL="Outbound Proxy Port" COM_CONFIG_FIELD_PROXY_USERNAME_LABEL="Outbound Proxy Username" +COM_CONFIG_FIELD_PROXY_USERNAME_DESC="Leave blank if your outbound proxy does not require authentication." COM_CONFIG_FIELD_REDIS_AUTH_LABEL="Redis Server Authentication" COM_CONFIG_FIELD_REDIS_DB_LABEL="Redis Database" COM_CONFIG_FIELD_REDIS_HOST_LABEL="Redis Server Host/Sock" COM_CONFIG_FIELD_REDIS_PERSISTENT_LABEL="Persistent Redis" COM_CONFIG_FIELD_REDIS_PORT_DESC="Port discarded if connecting to Redis server over Unix sockets." COM_CONFIG_FIELD_REDIS_PORT_LABEL="Redis Server Port" -COM_CONFIG_FIELD_SEF_REWRITE_DESC="Apache: Rename htaccess.txt to .htaccess
IIS: Rename web.config.txt to web.config" +COM_CONFIG_FIELD_SEF_REWRITE_NOTE="Apache and Litespeed: Rename htaccess.txt to .htaccess
IIS: Rename web.config.txt to web.config
NginX: you must configure your server.
Other servers or if unsure: please consult your hosting company." COM_CONFIG_FIELD_SEF_REWRITE_LABEL="Use URL Rewriting" +COM_CONFIG_FIELD_SEF_REWRITE_DESC="Removes the index.php/ part from the URLs." COM_CONFIG_FIELD_SEF_SUFFIX_LABEL="Add Suffix to URL" +COM_CONFIG_FIELD_SEF_SUFFIX_DESC="By default, Joomla URLs are “bare”, without an extension. This options tells Joomla to add an extension such as .html, .feed etc based on the type of content being displayed by the URL." COM_CONFIG_FIELD_SEF_URL_LABEL="Search Engine Friendly URLs" +COM_CONFIG_FIELD_SEF_URL_DESC="Joomla URLs normally 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." COM_CONFIG_FIELD_SERVER_TIMEZONE_LABEL="Website Time Zone" +COM_CONFIG_FIELD_SERVER_TIMEZONE_DESC="Used by default to display dates and times (Joomla stores them internally as UTC). This can be different than the time zone of your server. Users can override their preferred time zone in their user profile." COM_CONFIG_FIELD_SESSION_HANDLER_LABEL="Session Handler" COM_CONFIG_FIELD_SESSION_METADATA_DESC="If enabled, additional metadata about a user's session (including their username, user ID, and which application they are logged into) will be logged to the session database table.
If disabled, features dependent on this data will be unavailable." COM_CONFIG_FIELD_SESSION_METADATA_LABEL="Track Session Metadata" @@ -159,7 +178,9 @@ COM_CONFIG_FIELD_SITE_OFFLINE_LABEL="Site Offline" COM_CONFIG_FIELD_SITENAME_PAGETITLES_LABEL="Site Name in Page Titles" COM_CONFIG_FIELD_SUBJECT_LABEL="Subject" COM_CONFIG_FIELD_TEMP_PATH_LABEL="Path to Temp Folder" +COM_CONFIG_FIELD_TEMP_PATH_DESC="Joomla needs to temporarily store some files to perform actions such as installing / updating extensions or uploading files. Enter the absolute path of a directory that is writeable be PHP. Do not use the system–wide temporary folder (e.g. /tmp) for security reasons." COM_CONFIG_FIELD_UNICODESLUGS_LABEL="Unicode Aliases" +COM_CONFIG_FIELD_UNICODESLUGS_DESC="No: Joomla transliterates aliases which contain non–latin-1 characters using the transliteration engine provided by the Joomla language pack for the content's selected language, e.g. über becomes ueber for en-GB (English, Great Britain). Yes: Joomla does not transliterate aliases; the alias is used as is, e.g. über remains as–is." COM_CONFIG_FIELD_VALUE_ADMINISTRATOR_ONLY="Administrator Only" COM_CONFIG_FIELD_VALUE_AFTER="After" COM_CONFIG_FIELD_VALUE_AUTHOR_EMAIL="Author Email" @@ -189,6 +210,7 @@ COM_CONFIG_FIELD_WEBSERVICES_CORS_ALLOW_ORIGIN_DESC="Specifies the origin allowe COM_CONFIG_FIELDSET_TAGS_LABEL="Tags" COM_CONFIG_FILTER_OPTION_SELECT_EXTENSION="- Select Extension -" COM_CONFIG_FRONTEDITING_LABEL="Frontend Editing" +COM_CONFIG_FRONTEDITING_DESC="Joomla can show an overlay in the public front–end, visible only to users with edit privileges, to directly modify the configuration of each module and/or menu displayed on the site. Set to “None” to disable this feature." COM_CONFIG_FRONTEDITING_MENUSANDMODULES="Modules & Menus" COM_CONFIG_FRONTEDITING_MODULES="Modules" COM_CONFIG_GLOBAL_CONFIGURATION="Global Configuration" diff --git a/administrator/language/en-GB/joomla.ini b/administrator/language/en-GB/joomla.ini index 36b9f884ece03..a72c84eb2f32d 100644 --- a/administrator/language/en-GB/joomla.ini +++ b/administrator/language/en-GB/joomla.ini @@ -86,6 +86,7 @@ JFEATURED="Featured" JFEATURED_ASC="Featured ascending" JFEATURED_DESC="Featured descending" JHELP="Help" +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." @@ -260,7 +261,7 @@ JFIELD_META_DESCRIPTION_DESC="An optional paragraph to be used as the descriptio JFIELD_META_DESCRIPTION_LABEL="Meta Description" JFIELD_META_KEYWORDS_DESC="An optional comma-separated list of keywords and/or phrases to be used in the HTML output." JFIELD_META_KEYWORDS_LABEL="Keywords" -JFIELD_META_RIGHTS_DESC="Describe what rights others have to use this content." +JFIELD_META_RIGHTS_DESC="Describe what rights others have to use this content. This is conveyed to search engines using the rights meta tag in the HTML head." JFIELD_META_RIGHTS_LABEL="Content Rights" JFIELD_METADATA_AUTHOR_DESC="The author of this content." JFIELD_METADATA_RIGHTS_DESC="Publication rights for the content." diff --git a/build/media_source/legacy/js/toolbar.es5.js b/build/media_source/legacy/js/toolbar.es5.js index af94114682896..04026ff9b76e4 100644 --- a/build/media_source/legacy/js/toolbar.es5.js +++ b/build/media_source/legacy/js/toolbar.es5.js @@ -5,48 +5,49 @@ Joomla = window.Joomla || {}; -(function(Joomla, document) { - 'use strict'; - - /** - * USED IN: libraries/joomla/html/toolbar/button/help.php - * - * Pops up a new window in the middle of the screen - * - * @param {string} mypage The URL for the redirect - * @param {string} myname The name of the page - * @param {int} w The width of the new window - * @param {int} h The height of the new window - * @param {string} scroll The vertical/horizontal scroll bars - * - * @since 4.0.0 - */ - Joomla.popupWindow = function(mypage, myname, w, h, scroll) { - var winl = (screen.width - w) / 2, - wint = (screen.height - h) / 2, - winprops = 'height=' + h + - ',width=' + w + - ',top=' + wint + - ',left=' + winl + - ',scrollbars=' + scroll + - ',resizable'; - - window.open(mypage, myname, winprops).window.focus(); - }; - - document.addEventListener('DOMContentLoaded', function() { - /** - * Fix the alignment of the Options and Help toolbar buttons - */ - var toolbarOptions = document.getElementById('toolbar-options'), - toolbarHelp = document.getElementById('toolbar-help'); - - if (toolbarHelp && !toolbarOptions) { - toolbarHelp.classList.add('ms-auto'); - } - if (toolbarOptions && !toolbarHelp) { - toolbarOptions.classList.add('ms-auto'); - } - - }); -})(Joomla, document); +(function (Joomla, document) { + 'use strict'; + + /** + * USED IN: libraries/joomla/html/toolbar/button/help.php + * + * Pops up a new window in the middle of the screen + * + * @param {string} mypage The URL for the redirect + * @param {string} myname The name of the page + * @param {int} w The width of the new window + * @param {int} h The height of the new window + * @param {string} scroll The vertical/horizontal scroll bars + * + * @since 4.0.0 + */ + Joomla.popupWindow = function (mypage, myname, w, h, scroll) { + const winl = (screen.width - w) / 2; + const wint = (screen.height - h) / 2; + const winprops = `height=${h},width=${w},top=${wint},left=${winl},scrollbars=${scroll},resizable`; + + window.open(mypage, myname, winprops).window.focus(); + }; + + document.addEventListener('DOMContentLoaded', () => { + /** + * Fix the alignment of the Options and Help toolbar buttons + */ + const toolbarOptions = document.getElementById('toolbar-options'); + const toolbarHelp = document.getElementById('toolbar-help'); + const toolbarInlineHelp = document.getElementById('toolbar-inlinehelp'); + + if (toolbarInlineHelp) { + toolbarInlineHelp.classList.add('ms-auto'); + return; + } + + if (toolbarHelp && !toolbarOptions) { + toolbarHelp.classList.add('ms-auto'); + } + + if (toolbarOptions && !toolbarHelp) { + toolbarOptions.classList.add('ms-auto'); + } + }); +}(Joomla, document)); diff --git a/build/media_source/system/joomla.asset.json b/build/media_source/system/joomla.asset.json index 9ae7a6c230155..e4d8a65543529 100644 --- a/build/media_source/system/joomla.asset.json +++ b/build/media_source/system/joomla.asset.json @@ -59,6 +59,29 @@ "messages-legacy" ] }, + { + "name": "inlinehelp-legacy", + "type": "script", + "uri": "system/inlinehelp-es5.min.js", + "attributes": { + "nomodule": true, + "defer": true + }, + "dependencies": [ + "core" + ] + }, + { + "name": "inlinehelp", + "type": "script", + "uri": "system/inlinehelp.min.js", + "attributes": { + "type": "module" + }, + "dependencies": [ + "inlinehelp-legacy" + ] + }, { "name": "template.active", "type": "style", diff --git a/build/media_source/system/js/inlinehelp.es6.js b/build/media_source/system/js/inlinehelp.es6.js new file mode 100644 index 0000000000000..c3a7b11570237 --- /dev/null +++ b/build/media_source/system/js/inlinehelp.es6.js @@ -0,0 +1,51 @@ +/** + * @copyright (C) 2021 Open Source Matters, Inc. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +/** + * Toggles the display of inline help DIVs + * + * @param {String} toggleClass The class name of the DIVs to toggle display for + */ +Joomla.toggleInlineHelp = (toggleClass) => { + [].slice.call(document.querySelectorAll(`div.${toggleClass}`)) + .forEach((elDiv) => { + // Toggle the visibility of the node by toggling the 'd-none' Bootstrap class. + elDiv.classList.toggle('d-none'); + // The ID of the description whose visibility is toggled. + const myId = elDiv.id; + // The ID of the control described by this node (same ID, minus the '-desc' suffix). + const controlId = myId ? myId.substr(0, myId.length - 5) : null; + // Get the control described by this node. + const elControl = controlId ? document.getElementById(controlId) : null; + // Is this node hidden? + const isHidden = elDiv.classList.contains('d-none'); + + // If we do not have a control we will exit early + if (!controlId || !elControl) { + return; + } + + // Unset the aria-describedby attribute in the control when the description is hidden and vice–versa. + if (isHidden && elControl.hasAttribute('aria-describedby')) { + elControl.removeAttribute('aria-describedby'); + } else if (!isHidden) { + elControl.setAttribute('aria-describedby', myId); + } + }); +}; + +// Initialisation. Clicking on anything with the button-inlinehelp class will toggle the inline help. +[].slice.call(document.querySelectorAll('.button-inlinehelp')) + .forEach((elToggler) => { + // The class of the DIVs to toggle visibility on is defined by the data-class attribute of the click target. + const toggleClass = elToggler.dataset.class ?? 'hide-aware-inline-help'; + // Toggle the visibility of the inline help (meaning: hide by default) on initialisation. + Joomla.toggleInlineHelp(toggleClass); + // Add the click handler. + elToggler.addEventListener('click', (event) => { + event.preventDefault(); + Joomla.toggleInlineHelp(toggleClass); + }); + }); diff --git a/components/com_config/forms/config.xml b/components/com_config/forms/config.xml index d3df27c5b9eda..86c1f36718c0e 100644 --- a/components/com_config/forms/config.xml +++ b/components/com_config/forms/config.xml @@ -18,6 +18,7 @@ name="MetaRights" type="textarea" label="JFIELD_META_RIGHTS_LABEL" + description="JFIELD_META_RIGHTS_DESC" filter="string" cols="60" rows="2" @@ -32,6 +33,7 @@ name="sef" type="radio" label="COM_CONFIG_FIELD_SEF_URL_LABEL" + description="COM_CONFIG_FIELD_SEF_URL_DESC" default="1" layout="joomla.form.field.radio.switcher" filter="integer" @@ -84,6 +86,7 @@ name="access" type="accesslevel" label="COM_CONFIG_FIELD_DEFAULT_ACCESS_LEVEL_LABEL" + description="COM_CONFIG_FIELD_DEFAULT_ACCESS_LEVEL_DESC" default="1" filter="UINT" validate="options" diff --git a/components/com_config/src/View/Config/HtmlView.php b/components/com_config/src/View/Config/HtmlView.php index d5e4e386f0445..e37032112a2f4 100644 --- a/components/com_config/src/View/Config/HtmlView.php +++ b/components/com_config/src/View/Config/HtmlView.php @@ -94,6 +94,8 @@ public function display($tpl = null) $this->_prepareDocument(); + Factory::getApplication()->getDocument()->getWebAssetManager()->useScript('inlinehelp'); + parent::display($tpl); } diff --git a/components/com_config/tmpl/config/default.php b/components/com_config/tmpl/config/default.php index a2b77c0880f4e..c04ae3f383dfa 100644 --- a/components/com_config/tmpl/config/default.php +++ b/components/com_config/tmpl/config/default.php @@ -33,6 +33,13 @@
+
+ +
+ loadTemplate('site'); ?> loadTemplate('seo'); ?> loadTemplate('metadata'); ?> diff --git a/components/com_config/tmpl/config/default_metadata.php b/components/com_config/tmpl/config/default_metadata.php index 381b687c54409..c6f58c1e8d1cb 100644 --- a/components/com_config/tmpl/config/default_metadata.php +++ b/components/com_config/tmpl/config/default_metadata.php @@ -17,9 +17,14 @@ form->getFieldset('metadata') as $field) : ?> -
-
label; ?>
-
input; ?>
+
+ label; ?> + input; ?> + description): ?> +
+ description) ?> +
+
diff --git a/components/com_config/tmpl/config/default_seo.php b/components/com_config/tmpl/config/default_seo.php index 618ad1d3e7e12..c7bef39b5c754 100644 --- a/components/com_config/tmpl/config/default_seo.php +++ b/components/com_config/tmpl/config/default_seo.php @@ -17,9 +17,14 @@ form->getFieldset('seo') as $field) : ?> -
-
label; ?>
-
input; ?>
+
+ label; ?> + input; ?> + description): ?> +
+ description) ?> +
+
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 @@ form->getFieldset('site') as $field) : ?> -
-
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.