From 585426c1263587f79cc539e315992c60281e7594 Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Sat, 13 Apr 2019 17:06:51 -0500 Subject: [PATCH] Namespace PrivacyHelper --- .../privacy.php => Helper/PrivacyHelper.php} | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) rename administrator/components/com_privacy/{helpers/privacy.php => Helper/PrivacyHelper.php} (69%) diff --git a/administrator/components/com_privacy/helpers/privacy.php b/administrator/components/com_privacy/Helper/PrivacyHelper.php similarity index 69% rename from administrator/components/com_privacy/helpers/privacy.php rename to administrator/components/com_privacy/Helper/PrivacyHelper.php index 806f9b4c318f3..2265bac27af43 100644 --- a/administrator/components/com_privacy/helpers/privacy.php +++ b/administrator/components/com_privacy/Helper/PrivacyHelper.php @@ -7,14 +7,20 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ +namespace Joomla\Component\Privacy\Administrator\Helper; + defined('_JEXEC') or die; +use Joomla\CMS\Helper\ContentHelper; +use Joomla\CMS\Language\Text; +use Joomla\Component\Privacy\Administrator\Export\Domain; + /** * Privacy component helper. * * @since 3.9.0 */ -class PrivacyHelper extends JHelperContent +class PrivacyHelper extends ContentHelper { /** * Configure the Linkbar. @@ -27,26 +33,26 @@ class PrivacyHelper extends JHelperContent */ public static function addSubmenu($vName) { - JHtmlSidebar::addEntry( - JText::_('COM_PRIVACY_SUBMENU_DASHBOARD'), + \JHtmlSidebar::addEntry( + Text::_('COM_PRIVACY_SUBMENU_DASHBOARD'), 'index.php?option=com_privacy&view=dashboard', $vName === 'dashboard' ); - JHtmlSidebar::addEntry( - JText::_('COM_PRIVACY_SUBMENU_REQUESTS'), + \JHtmlSidebar::addEntry( + Text::_('COM_PRIVACY_SUBMENU_REQUESTS'), 'index.php?option=com_privacy&view=requests', $vName === 'requests' ); - JHtmlSidebar::addEntry( - JText::_('COM_PRIVACY_SUBMENU_CAPABILITIES'), + \JHtmlSidebar::addEntry( + Text::_('COM_PRIVACY_SUBMENU_CAPABILITIES'), 'index.php?option=com_privacy&view=capabilities', $vName === 'capabilities' ); - JHtmlSidebar::addEntry( - JText::_('COM_PRIVACY_SUBMENU_CONSENTS'), + \JHtmlSidebar::addEntry( + Text::_('COM_PRIVACY_SUBMENU_CONSENTS'), 'index.php?option=com_privacy&view=consents', $vName === 'consents' ); @@ -55,7 +61,7 @@ public static function addSubmenu($vName) /** * Render the data request as a XML document. * - * @param PrivacyExportDomain[] $exportData The data to be exported. + * @param Domain[] $exportData The data to be exported. * * @return string * @@ -63,7 +69,7 @@ public static function addSubmenu($vName) */ public static function renderDataAsXml(array $exportData) { - $export = new SimpleXMLElement(''); + $export = new \SimpleXMLElement(''); foreach ($exportData as $domain) { @@ -87,7 +93,7 @@ public static function renderDataAsXml(array $exportData) } } - $dom = new DOMDocument; + $dom = new \DOMDocument; $dom->loadXML($export->asXML()); $dom->formatOutput = true;