From 993e41f17aeecedb0e163d66b126e69adb71712f Mon Sep 17 00:00:00 2001 From: kozi Date: Mon, 18 Aug 2014 15:55:38 +0200 Subject: [PATCH] Changed namespace to AdditionalMetafields --- composer.json | 2 ++ contao/classes/MetaFieldsHelper.php | 4 ++-- contao/config/autoload.php | 7 +++++-- contao/config/config.php | 4 ++-- contao/widgets/MetaWizardPlus.php | 4 ++-- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 628fca6..a78d0b8 100644 --- a/composer.json +++ b/composer.json @@ -32,3 +32,5 @@ } } } + + diff --git a/contao/classes/MetaFieldsHelper.php b/contao/classes/MetaFieldsHelper.php index 75c810a..112ebab 100644 --- a/contao/classes/MetaFieldsHelper.php +++ b/contao/classes/MetaFieldsHelper.php @@ -17,7 +17,7 @@ /** * Run in a custom namespace, so the class can be replaced */ -namespace Contao; +namespace AdditionalMetafields; /** * Class MetaFieldsHelper @@ -27,7 +27,7 @@ * @author Martin Kozianka * @package additional_metafields */ -class MetaFieldsHelper extends Frontend { +class MetaFieldsHelper extends \Frontend { public static function getFileExtensions() { $exts = array(); diff --git a/contao/config/autoload.php b/contao/config/autoload.php index 7d52eb3..2baf21d 100644 --- a/contao/config/autoload.php +++ b/contao/config/autoload.php @@ -14,7 +14,10 @@ */ + +ClassLoader::addNamespace('AdditionalMetafields'); + ClassLoader::addClasses(array( - 'Contao\MetaFieldsHelper' => 'system/modules/additional_metafields/classes/MetaFieldsHelper.php', - 'Contao\MetaWizardPlus' => 'system/modules/additional_metafields/widgets/MetaWizardPlus.php' + 'AdditionalMetafields\MetaFieldsHelper' => 'system/modules/additional_metafields/classes/MetaFieldsHelper.php', + 'AdditionalMetafields\MetaWizardPlus' => 'system/modules/additional_metafields/widgets/MetaWizardPlus.php' )); diff --git a/contao/config/config.php b/contao/config/config.php index a99d68d..a4b4150 100644 --- a/contao/config/config.php +++ b/contao/config/config.php @@ -13,8 +13,8 @@ * @filesource */ -$GLOBALS['TL_HOOKS']['getContentElement'][] = array('MetaFieldsHelper', 'injectMetaData'); -$GLOBALS['BE_FFL']['metaWizardPlus'] = 'MetaWizardPlus'; +$GLOBALS['TL_HOOKS']['getContentElement'][] = array('AdditionalMetafields\MetaFieldsHelper', 'injectMetaData'); +$GLOBALS['BE_FFL']['metaWizardPlus'] = 'AdditionalMetafields\MetaWizardPlus'; if (TL_MODE == 'BE') { $GLOBALS['TL_CSS'][] = "/system/modules/additional_metafields/assets/style.css|screen"; diff --git a/contao/widgets/MetaWizardPlus.php b/contao/widgets/MetaWizardPlus.php index fe5172b..2d63815 100644 --- a/contao/widgets/MetaWizardPlus.php +++ b/contao/widgets/MetaWizardPlus.php @@ -17,7 +17,7 @@ /** * Run in a custom namespace, so the class can be replaced */ -namespace Contao; +namespace AdditionalMetafields; /** @@ -49,7 +49,7 @@ public function generate() { // Make sure there is at least an empty array if (!is_array($this->varValue) || empty($this->varValue)) { - $this->import('BackendUser', 'User'); + $this->import('Contao\BackendUser', 'User'); $this->varValue = array($this->User->language=>array()); // see #4188 }