private function __construct() { // Include Panel Class Definitions $this->IncludeClasses(); // Retrieve the operational data from the db $this->UnpackData(); // Set up the language $this->PopulateLanguageData(); OnePanelLanguage::CleanupData(self::$operational_data[2]); // Check for valid installation and define ONE_PANEL_RUNNING constant if (isset(self::$operational_data[0]) && self::$operational_data[0]['installed'] == true) { define('ONE_PANEL_RUNNING', true); } else { // Failsafe self::$operational_data[0]['installed'] = false; } // Is this a fresh install? if (is_null(self::$operational_data)) { define('ONE_PANEL_FRESH_INSTALL', true); } // Register Modules to make use of the defaults. $this->RegisterModules(); // Add the action for the FeedBurner Redirect add_action('template_redirect', array(self::$operational_data[1]['FeedBurner']->features['FeedBurnerToggle'], 'FeedburnerFilter')); }
/** * 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; }