[MERGE] Branch 'master' of https://phabricator.glanzstueck.agency/source/typo3-template_aide
This commit is contained in:
@@ -22,7 +22,11 @@ class ArrayUtility
|
||||
*/
|
||||
public static function toObject($array) {
|
||||
if (is_array($array)) {
|
||||
return (object) array_map([__CLASS__, __METHOD__], $array);
|
||||
if (self::isAssoc($array)) {
|
||||
return (object) array_map([__CLASS__, __METHOD__], $array);
|
||||
} else {
|
||||
return array_map([__CLASS__, __METHOD__], $array);
|
||||
}
|
||||
} else {
|
||||
return $array;
|
||||
}
|
||||
@@ -46,4 +50,15 @@ class ArrayUtility
|
||||
return $array;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static function isAssoc(array $arr) {
|
||||
if (array() === $arr) {
|
||||
return false;
|
||||
}
|
||||
return array_keys($arr) !== range(0, count($arr) - 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -280,6 +280,13 @@ class MailUtility
|
||||
$bodydataText[] = $textRow;
|
||||
$bodydataHtml[] = $htmlRow;
|
||||
break;
|
||||
case 'attachment':
|
||||
$mail->attach(new \Swift_Attachment(
|
||||
$row['data'][0],
|
||||
$row['data'][1],
|
||||
$row['data'][2]
|
||||
));
|
||||
break;
|
||||
case 'attachmentBase64':
|
||||
$attachmentdata = explode(',', $row['data']);
|
||||
preg_match('/\w*:(.*);\w*/', $attachmentdata[0], $matches);
|
||||
|
||||
@@ -27,8 +27,10 @@ class SiteConfigUtility
|
||||
* @var string $path
|
||||
* @return string
|
||||
*/
|
||||
public static function getByPath($path)
|
||||
{
|
||||
public static function getByPath(
|
||||
$path,
|
||||
$limitToSiteConfig = true
|
||||
) {
|
||||
$pathParts = explode('.', $path);
|
||||
$objectManager = GeneralUtility::makeInstance(
|
||||
ObjectManager::class
|
||||
@@ -40,7 +42,10 @@ class SiteConfigUtility
|
||||
ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT
|
||||
);
|
||||
$typoscript = GeneralUtility::removeDotsFromTS($typoscript);
|
||||
$siteConfig = $typoscript['config']['site'];
|
||||
$siteConfig = $typoscript;
|
||||
if ($limitToSiteConfig) {
|
||||
$siteConfig = $typoscript['config']['site'];
|
||||
}
|
||||
$current = &$siteConfig;
|
||||
foreach ($pathParts as $key) {
|
||||
$current = &$current[$key];
|
||||
|
||||
Reference in New Issue
Block a user