Exemple #1
0
 public static function get_instance()
 {
     if (null == self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Exemple #2
0
 /**
  * Early loading actions.
  * 
  * Initialize the Toolset Common library with the new loader. 
  * Initialize asset manager if we're not doing an AJAX call.
  * 
  * @since 2.0
  */
 public function after_setup_theme()
 {
     Toolset_Common_Bootstrap::getInstance();
     // If an AJAX callback handler needs other assets, they should initialize the asset manager by themselves.
     if (!defined('DOING_AJAX')) {
         Types_Assets::get_instance()->initialize_scripts_and_styles();
     }
 }
 /**
  * Build the context for main poge template.
  *
  * That includes variables for the template as well as data to be passed to JavaScript.
  * 
  * @return array Page context. See the main page template for details.
  * @since 2.0
  */
 private function build_page_context()
 {
     $context = array('strings' => $this->build_strings_for_twig(), 'js_model_data' => base64_encode(wp_json_encode($this->build_js_data())), 'assets' => array('loaderOverlay' => Types_Assets::get_instance()->get_image_url(Types_Assets::IMG_AJAX_LOADER_OVERLAY)));
     return $context;
 }