diff --git a/contao/classes/MetafieldsHelper.php b/contao/classes/MetafieldsHelper.php index fc236d0..91e56ae 100644 --- a/contao/classes/MetafieldsHelper.php +++ b/contao/classes/MetafieldsHelper.php @@ -13,6 +13,9 @@ * @filesource */ + +namespace AdditionalMetafields; + /** * Class MetafieldsHelper * @@ -125,11 +128,13 @@ private function getMultiMetaData($multiSRC) { if (!$objFile->isGdImage) { continue; } + $images[$objFile->path] = $this->getMetaData($objSubfiles->meta, $objPage->language); } } } } // END if($objFiles !== null) + return $images; } diff --git a/contao/config/autoload.php b/contao/config/autoload.php index 9ac782c..86ae1cb 100644 --- a/contao/config/autoload.php +++ b/contao/config/autoload.php @@ -12,11 +12,12 @@ * @license LGPL * @filesource */ +ClassLoader::addNamespace('AdditionalMetafields'); ClassLoader::addClasses(array( - 'MetafieldsHelper' => 'system/modules/additional_metafields/classes/MetafieldsHelper.php', - 'MetaWizardPlus' => 'system/modules/additional_metafields/widgets/MetaWizardPlus.php', - 'MetafieldsModel' => 'system/modules/additional_metafields/models/MetafieldsModel.php', + 'AdditionalMetafields\MetafieldsHelper' => 'system/modules/additional_metafields/classes/MetafieldsHelper.php', + 'AdditionalMetafields\MetaWizardPlus' => 'system/modules/additional_metafields/widgets/MetaWizardPlus.php', + 'AdditionalMetafields\MetafieldsModel' => 'system/modules/additional_metafields/models/MetafieldsModel.php', )); diff --git a/contao/config/config.php b/contao/config/config.php index 1feef20..7bc6a4b 100644 --- a/contao/config/config.php +++ b/contao/config/config.php @@ -13,10 +13,11 @@ * @filesource */ -$GLOBALS['TL_HOOKS']['getContentElement'][] = array('MetafieldsHelper', 'injectMetaData'); -$GLOBALS['TL_HOOKS']['parseArticles'][] = array('MetafieldsHelper', 'injectMetaDataArticleImage'); +$GLOBALS['TL_HOOKS']['getContentElement'][] = array('AdditionalMetafields\MetafieldsHelper', 'injectMetaData'); +$GLOBALS['TL_HOOKS']['parseArticles'][] = array('AdditionalMetafields\MetafieldsHelper', 'injectMetaDataArticleImage'); -$GLOBALS['BE_FFL']['metaWizardPlus'] = 'MetaWizardPlus'; +$GLOBALS['BE_FFL']['metaWizardPlus'] = 'AdditionalMetafields\MetaWizardPlus'; +$GLOBALS['TL_MODELS']['tl_metafields'] = 'AdditionalMetafields\MetafieldsModel'; array_insert($GLOBALS['BE_MOD']['system'], 1, array( 'metafields' => array diff --git a/contao/models/MetafieldsModel.php b/contao/models/MetafieldsModel.php index d7fadba..2a9bb8b 100644 --- a/contao/models/MetafieldsModel.php +++ b/contao/models/MetafieldsModel.php @@ -12,7 +12,7 @@ * @license LGPL * @filesource */ - +namespace AdditionalMetafields; /** * Class MetafieldsModel diff --git a/contao/widgets/MetaWizardPlus.php b/contao/widgets/MetaWizardPlus.php index 154b2a3..6d853c4 100644 --- a/contao/widgets/MetaWizardPlus.php +++ b/contao/widgets/MetaWizardPlus.php @@ -12,6 +12,7 @@ * @license LGPL * @filesource */ +namespace AdditionalMetafields; /** * Class MetaWizardPlus