Esempio n. 1
0
 /**
  * Start
  * 
  * Singleton shortcut to run the constructor without returning the instance
  * Includes all the necessary files for the config API
  *
  * @return boolean
  */
 public static function Start()
 {
     $success = OnePanelDebug::Track('Starting Config Engine');
     if (!is_object(self::$instance)) {
         // Load the requirements
         OnePanelLib::RequireFileOnce(ONE_PANEL_DIR . '/theme/behaviouralconfigobject.php');
         OnePanelLib::RequireFileOnce(ONE_PANEL_DIR . '/theme/onepanelskin.php');
         OnePanelLib::RequireFileOnce(ONE_PANEL_DIR . '/theme/onepanelhomepagelayout.php');
         OnePanelLib::RequireFileOnce(ONE_PANEL_DIR . '/theme/onepaneladblock.php');
         OnePanelLib::RequireFileOnce(ONE_PANEL_DIR . '/theme/adsensecolorpalette.php');
         OnePanelLib::RequireFileOnce(ONE_PANEL_DIR . '/theme/onepanelhighlight.php');
         OnePanelLib::RequireFileOnce(ONE_PANEL_DIR . '/theme/onepanelbehaviour.php');
         OnePanelLib::RequireFileOnce(ONE_PANEL_DIR . '/theme/onepaneloutcome.php');
         OnePanelLib::RequireFileOnce(ONE_PANEL_DIR . '/theme/onepanelthumbnailtype.php');
         // Create the object
         self::$instance = new OnePanelConfig();
         /* 
          * Try to load the active thees config file
          * on failiure set the ONE_PANEL_NO_CONFIG flag for later evaluation
          * TODO if this fails add a message asking to upgrade One Panel
          */
         $config_file = ABSPATH . 'wp-content/themes/' . get_option('template') . '/onepanel_config.php';
         if (file_exists($config_file)) {
             $load_config = OnePanelDebug::Track('Loading theme config');
             OnePanelLib::RequireFileOnce($config_file);
             $load_config->Affirm();
         } else {
             OnePanelDebug::Info('No config file found, setting ONE_PANEL_NO_CONFIG');
             define('ONE_PANEL_NO_CONFIG', true);
         }
     }
     $success->Affirm();
     return true;
 }