private function PopulateLanguageData() { if (!isset(self::$operational_data[2])) { $config_data = OnePanelLanguage::GetConfigData(); // TODO what should we do if it is missing? if (empty($config_data)) { if (defined('ONE_PANEL_RUNNING')) { trigger_error('One Panel Error: No language data found in config file', E_USER_ERROR); } } else { if (is_array($config_data)) { self::$operational_data[2] = $config_data; return true; } else { if (defined('ONE_PANEL_RUNNING')) { trigger_error('One Panel Error: No language data found in config file', E_USER_ERROR); } } } } else { return true; } }
/** * PopulateLanguageData * * * @todo One Panel should include some default language sets that are * external to the theme config files, if data exists in the config it * should override the default set. Otherwise the default set should be * used. * @return boolean */ private function PopulateLanguageData() { // Debug $success = OnePanelDebug::Track('Populating language data.'); $return_value = false; // Check to see if the data is there if (!isset(self::$operational_data[2])) { $language_data =& self::$operational_data[2]; // Reference for easier reading $config_data = OnePanelLanguage::GetConfigData(); // Run a check for the config data. if (empty($config_data)) { OnePanelDebug::Error('No language data found in the theme config.'); $return_value = false; } else { // Ensure that the data contains an array if (is_array($config_data)) { $language_data = $config_data; // TEST THIS OnePanelLanguage::CleanupData($language_data); $return_value = true; } else { OnePanelDebug::Error('Corrupt language data found in the theme config.'); $return_value = false; } } } else { OnePanelLanguage::CleanupData(self::$operational_data[2]); $return_value = true; } // Check to see if we need to throw an error if (defined('ONE_PANEL_RUNNING') && $return_value == false) { $success->Fail(); trigger_error('One Panel Error: No language data found in config file', E_USER_ERROR); } elseif ($return_value == true) { $success->Affirm(); } return $return_value; }