Fixed bug #13310: PHP Warning "array_merge(): Argument #2 is not an array" in class...
[Packages/TYPO3.CMS.git] / typo3 / sysext / em / classes / settings / class.tx_em_settings.php
index 66616a8..0af1221 100644 (file)
@@ -42,12 +42,13 @@ class tx_em_Settings implements t3lib_Singleton {
 
 
        /**
 
 
        /**
-        * Develop commands
+        * Settings array
         *
         *
-        * @var string
+        * @var array
         */
        protected $settings;
 
         */
        protected $settings;
 
+
        /**
         * Constructor
         *
        /**
         * Constructor
         *
@@ -97,6 +98,14 @@ class tx_em_Settings implements t3lib_Singleton {
         * @return void
         */
        protected function readSettings() {
         * @return void
         */
        protected function readSettings() {
+               $globalSettings = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['em']);
+               if (!is_array($globalSettings)) {
+                       $globalSettings = array(
+                               'displayMyExtensions' => 0,
+                               'selectedLanguages' => array(),
+                               'inlineToWindow' => 1,
+                       );
+               }
                $this->MOD_MENU = array(
                        'function' => array(
                                'loaded_list' => $GLOBALS['LANG']->getLL('menu_loaded_extensions'),
                $this->MOD_MENU = array(
                        'function' => array(
                                'loaded_list' => $GLOBALS['LANG']->getLL('menu_loaded_extensions'),
@@ -156,6 +165,7 @@ class tx_em_Settings implements t3lib_Singleton {
                        'mainTab' => '0',
                );
                $this->settings = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), 'tools_em');
                        'mainTab' => '0',
                );
                $this->settings = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), 'tools_em');
+               $this->settings = array_merge($this->settings, $globalSettings);
        }
 
        /**
        }
 
        /**