diff --git a/administrator/modules/mod_login/tmpl/default.php b/administrator/modules/mod_login/tmpl/default.php
index c67bc2fac2..e53c9c096c 100644
--- a/administrator/modules/mod_login/tmpl/default.php
+++ b/administrator/modules/mod_login/tmpl/default.php
@@ -32,7 +32,7 @@
diff --git a/libraries/src/Document/Document.php b/libraries/src/Document/Document.php
index c6074ab101..fa4c72358c 100644
--- a/libraries/src/Document/Document.php
+++ b/libraries/src/Document/Document.php
@@ -242,6 +242,14 @@ class Document
*/
protected $preloadTypes = ['preload', 'dns-prefetch', 'preconnect', 'prefetch', 'prerender'];
+ /**
+ * Array of icons
+ *
+ * @var array
+ * @since 4.0.0
+ */
+ public $icons = array();
+
/**
* Class constructor.
*
@@ -308,6 +316,11 @@ public function __construct($options = array())
{
$this->setPreloadManager(new PreloadManager);
}
+
+ if (array_key_exists('icons', $options))
+ {
+ $this->setIcons($options['icons']);
+ }
}
/**
@@ -482,6 +495,41 @@ public function setMetaData($name, $content, $attribute = 'name')
return $this;
}
+ /**
+ * Returns the icon names
+ *
+ * @return array
+ *
+ * @since 4.0.0
+ */
+ public function getIcons()
+ {
+ return $this->icons;
+ }
+
+ /**
+ * Setter for an icon
+ *
+ * @param string $icon Name of the meta HTML tag
+ * @return string
+ *
+ * @since 11.1
+ */
+ public function setIcons($icon, $classes = null)
+ {
+ if (!empty($icon))
+ {
+ // Setup options object
+ if (!in_array($icon, $this->getIcons())) {
+ $this->icons[] = $icon;
+ }
+
+ return '';
+ }
+
+ return '';
+ }
+
/**
* Adds a linked script to the page
*
diff --git a/libraries/src/Document/HtmlDocument.php b/libraries/src/Document/HtmlDocument.php
index 0d8ff3c9d0..b82168b6d3 100644
--- a/libraries/src/Document/HtmlDocument.php
+++ b/libraries/src/Document/HtmlDocument.php
@@ -12,6 +12,7 @@
use Joomla\CMS\Cache\Cache;
use Joomla\CMS\Helper\ModuleHelper;
+use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Log\Log;
use Joomla\CMS\Uri\Uri;
use Joomla\Registry\Registry;
@@ -151,6 +152,7 @@ public function getHeadData()
$data['scripts'] = $this->_scripts;
$data['script'] = $this->_script;
$data['custom'] = $this->_custom;
+ $data['icons'] = $this->icons;
$data['scriptText'] = \JText::getScriptStrings();
return $data;
@@ -179,6 +181,7 @@ public function resetHeadData($types = null)
$this->_scripts = array();
$this->_script = array();
$this->_custom = array();
+ $this->icons = array();
}
if (is_array($types))
@@ -255,6 +258,7 @@ public function setHeadData($data)
$this->_scripts = $data['scripts'] ?? $this->_scripts;
$this->_script = $data['script'] ?? $this->_script;
$this->_custom = $data['custom'] ?? $this->_custom;
+ $this->icons = $data['custom'] ?? $this->icons;
if (isset($data['scriptText']) && !empty($data['scriptText']))
{
@@ -794,6 +798,39 @@ protected function _renderTemplate()
$with[] = $this->getBuffer($args['type'], $args['name'], $args['attribs']);
}
+ $this->_template = str_replace('', self::renderIcons() . '