J3.x

Report Extension Capabilities in Privacy Component

From Joomla! Documentation

Other languages:
English • ‎français
Privacy Component Capabilities-en.png

As part of the Privacy Tool Suite introduced to Joomla! 3.9, a capabilities screen is present to allow extensions to report the functionality of their extensions that may require consideration when adding new features to a site or preparing documentation such as a privacy policy or terms of use.

IMPORTANT - The capabilities reported on this screen are based on the actively installed and enabled extensions on a site, and that the extensions support reporting their capabilities. As such, this should not be considered a complete list and it is recommended you consult the documentation of each installed extension for full details.

Implementation Guide For Developers

In order to report extension capabilities, a plugin must be subscribed to the onPrivacyCollectAdminCapabilities event. Unlike other plugins which are typically intended for use with a single plugin group, the following plugin groups are imported for potential use with this event:

  • Authentication
  • Captcha
  • Installer
  • Privacy
  • System
  • User

A plugin should return an associative array where the key is the text to be displayed as the section title and the value is an array of capabilities to be displayed as a bullet list within the section. All messages should be translated by the plugin. Below is an example of the array structure for the Captcha - Recaptcha plugin.

public function onPrivacyCollectAdminCapabilities()
{
	// If a plugin does not have its language files autoloaded, ensure you manually load the language files now otherwise the below may not be translated
	$this->loadLanguage();

	return array(
		JText::_('PLG_CAPTCHA_RECAPTCHA') => array(
			JText::_('PLG_RECAPTCHA_PRIVACY_CAPABILITY_IP_ADDRESS'),
		),
	);
}