diff --git a/config/config.php b/config/config.php index 90d321c..397b2e3 100644 --- a/config/config.php +++ b/config/config.php @@ -12,6 +12,11 @@ * @author Martin Auswöger */ +// Backwards compatibility for Contao < 3.5.1 +if (!class_exists('StringUtil') && class_exists('String')) { + class_alias('String', 'StringUtil'); +} + $GLOBALS['TL_HOOKS']['executePostActions'][] = array('MadeYourDay\\Contao\\ThemeAssistant', 'executePostActionsHook'); $GLOBALS['BE_MOD']['design']['rocksolid_theme_assistant'] = array( diff --git a/src/MadeYourDay/Contao/ThemeAssistant.php b/src/MadeYourDay/Contao/ThemeAssistant.php index cca5cfa..b53d17e 100644 --- a/src/MadeYourDay/Contao/ThemeAssistant.php +++ b/src/MadeYourDay/Contao/ThemeAssistant.php @@ -546,7 +546,7 @@ public function onsubmitCallback(\DataContainer $dc) $file = \FilesModel::findByPk($value); } else { - $file = \FilesModel::findByUuid(\String::uuidToBin($value)); + $file = \FilesModel::findByUuid(\StringUtil::uuidToBin($value)); } } if ($file) { @@ -563,7 +563,7 @@ public function onsubmitCallback(\DataContainer $dc) $file = \FilesModel::findByPk($value); } else { - $file = \FilesModel::findByUuid(\String::uuidToBin($value)); + $file = \FilesModel::findByUuid(\StringUtil::uuidToBin($value)); } } if ($file) { diff --git a/src/MadeYourDay/Contao/ThemeAssistantDataContainer.php b/src/MadeYourDay/Contao/ThemeAssistantDataContainer.php index 91aba3f..88a652c 100644 --- a/src/MadeYourDay/Contao/ThemeAssistantDataContainer.php +++ b/src/MadeYourDay/Contao/ThemeAssistantDataContainer.php @@ -46,7 +46,7 @@ public function __construct($strTable, $arrModule = array()) foreach ($GLOBALS['TL_DCA'][$this->strTable]['config']['onload_callback'] as $callback) { if (is_array($callback)) { $this->import($callback[0]); - $this->$callback[0]->$callback[1]($this); + $this->{$callback[0]}->{$callback[1]}($this); } } } @@ -315,7 +315,7 @@ public function edit() foreach ($GLOBALS['TL_DCA'][$this->strTable]['fields'][$this->strField]['load_callback'] as $callback) { if (is_array($callback)) { $this->import($callback[0]); - $this->varValue = $this->$callback[0]->$callback[1]($this->varValue, $this); + $this->varValue = $this->{$callback[0]}->{$callback[1]}($this->varValue, $this); } } } @@ -372,7 +372,7 @@ public function edit() if (is_array($GLOBALS['TL_DCA'][$this->strTable]['config']['onsubmit_callback'])) { foreach ($GLOBALS['TL_DCA'][$this->strTable]['config']['onsubmit_callback'] as $callback) { $this->import($callback[0]); - $this->$callback[0]->$callback[1]($this); + $this->{$callback[0]}->{$callback[1]}($this); } }