示例#1
0
 /**
  * Return singleton instance
  *
  * @return ICE_Enqueue
  */
 public static function instance()
 {
     if (!self::$instance instanceof self) {
         self::$instance = new self();
     }
     return self::$instance;
 }
 /**
  * Set UI environment
  */
 private function setup_ui()
 {
     // get custom ui stylesheet directive
     $ui_stylesheet = $this->scheme->directives()->get(ICE_Scheme::DIRECTIVE_UI_STYLESHEET);
     // custom ui stylesheet set?
     if ($ui_stylesheet instanceof ICE_Init_Directive) {
         ICE_Enqueue::instance()->ui_stylesheet(ICE_Files::theme_file_url($ui_stylesheet->get_theme(), $ui_stylesheet->get_value()));
     }
 }
示例#3
0
 /**
  * Refresh export files if necessary
  */
 public function exports_refresh($force = false)
 {
     // hard refresh toggle
     static $hard_refresh = false;
     // export instance depends on which filter is being run
     switch (current_filter()) {
         // enqueue styles action
         case 'ice_enqueue_styles':
             // grab the styles exporter
             $export = $this->exports()->get('styles');
             break;
             // enqueue scripts action
         // enqueue scripts action
         case 'ice_enqueue_scripts':
             // grab the scripts exporter
             $export = $this->exports()->get('scripts');
             break;
             // no matching filter... might be a hard refresh
         // no matching filter... might be a hard refresh
         default:
             // force toggled on?
             if (true === $force) {
                 // toggle hard refresh ON
                 $hard_refresh = true;
                 // manually call style enqueuer
                 ICE_Enqueue::instance()->do_enqueue_styles();
                 // manually call script enqueuer
                 ICE_Enqueue::instance()->do_enqueue_scripts();
                 // toggle hard refresh OFF
                 $hard_refresh = false;
             }
             // return either way
             return;
     }
     // are we using the cache?
     if (true == ICE_CACHE_EXPORTS && false == $hard_refresh) {
         // yes, loop all config files
         foreach ($this->config_files_loaded as $file) {
             // get file last mod time
             $mtime = @filemtime($file);
             // check if stale
             if ($export->stale($mtime)) {
                 // call export refresher
                 return $this->export_refresh($export);
             }
         }
         // cache is up to date, did NOT refresh
         return false;
     }
     // update the export
     return $this->export_refresh($export);
 }
示例#4
0
if (!defined('ICE_ERROR_REPORTING')) {
    define('ICE_ERROR_REPORTING', INFINITY_ERROR_REPORTING);
}
/**
 * Load the ICE lib loader
 */
require_once INFINITY_ICE_PATH . '/loader.php';
// initialize ICE
ICE_Loader::init(INFINITY_ICE_URL);
// setup translation
load_theme_textdomain(INFINITY_TEXT_DOMAIN, WP_LANG_DIR . '/' . INFINITY_SLUG);
// initialize enqueuer and configure actions
if (is_admin()) {
    ICE_Enqueue::instance()->styles_on_action('load-appearance_page_' . INFINITY_ADMIN_PAGE)->scripts_on_action('load-appearance_page_' . INFINITY_ADMIN_PAGE);
} else {
    ICE_Enqueue::instance()->styles_on_action('wp_enqueue_scripts')->scripts_on_action('wp_enqueue_scripts');
}
// load Infinity API
require_once INFINITY_API_PATH . '/scheme.php';
require_once INFINITY_API_PATH . '/sections.php';
require_once INFINITY_API_PATH . '/options.php';
require_once INFINITY_API_PATH . '/features.php';
require_once INFINITY_API_PATH . '/widgets.php';
require_once INFINITY_API_PATH . '/screens.php';
require_once INFINITY_API_PATH . '/shortcodes.php';
// initialize scheme
infinity_scheme_init();
// initialize components
infinity_sections_init();
infinity_options_init();
infinity_screens_init();