/** * This simply sets up any qtips that have been defined in the page config * * @access protected * @return void */ protected function _add_qtips() { if (isset($this->_route_config['qtips'])) { $qtips = (array) $this->_route_config['qtips']; //load qtip loader EE_Registry::instance()->load_helper('Qtip_Loader', array(), TRUE); $path = array($this->_get_dir() . '/qtips/', EE_ADMIN_PAGES . basename($this->_get_dir()) . '/qtips/'); EEH_Qtip_Loader::instance()->register($qtips, $path); } }
/** * enqueue all admin scripts that need loaded for admin pages * * @access public * @return void */ public function enqueue_admin_scripts() { // this javascript is loaded on every admin page to catch any injections ee needs to add to wp run js. // Note: the intention of this script is to only do TARGETED injections. I.E, only injecting on certain script calls. wp_enqueue_script('ee-inject-wp', EE_ADMIN_URL . 'assets/ee-cpt-wp-injects.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE); // register cookie script for future dependencies wp_register_script('jquery-cookie', EE_THIRD_PARTY_URL . 'joyride/jquery.cookie.js', array('jquery'), '2.1', TRUE); // jquery_validate loading is turned OFF by default, but prior to the admin_enqueue_scripts hook, can be turned back on again via: add_filter( 'FHEE_load_jquery_validate', '__return_true' ); if (apply_filters('FHEE_load_jquery_validate', FALSE)) { // register jQuery Validate wp_register_script('jquery-validate', EE_GLOBAL_ASSETS_URL . 'scripts/jquery.validate.min.js', array('jquery'), '1.11.1', TRUE); } //joyride is turned OFF by default, but prior to the admin_enqueue_scripts hook, can be turned back on again vai: add_filter('FHEE_load_joyride', '__return_true' ); if (apply_filters('FHEE_load_joyride', FALSE)) { //joyride style wp_register_style('joyride-css', EE_THIRD_PARTY_URL . 'joyride/joyride-2.1.css', array(), '2.1'); wp_register_style('ee-joyride-css', EE_GLOBAL_ASSETS_URL . 'css/ee-joyride-styles.css', array('joyride-css'), EVENT_ESPRESSO_VERSION); wp_register_script('joyride-modernizr', EE_THIRD_PARTY_URL . 'joyride/modernizr.mq.js', array(), '2.1', TRUE); //joyride JS wp_register_script('jquery-joyride', EE_THIRD_PARTY_URL . 'joyride/jquery.joyride-2.1.js', array('jquery-cookie', 'joyride-modernizr'), '2.1', TRUE); // wanna go for a joyride? wp_enqueue_style('ee-joyride-css'); wp_enqueue_script('jquery-joyride'); } //qtip is turned OFF by default, but prior to the admin_enqueue_scripts hook, can be turned back on again via: add_filter('FHEE_load_qtips', '__return_true' ); if (apply_filters('FHEE_load_qtip', FALSE)) { EE_Registry::instance()->load_helper('Qtip_Loader'); EEH_Qtip_Loader::instance()->register_and_enqueue(); } //accounting.js library // @link http://josscrowcroft.github.io/accounting.js/ if (apply_filters('FHEE_load_accounting_js', FALSE)) { wp_register_script('ee-accounting', EE_GLOBAL_ASSETS_URL . 'scripts/ee-accounting-config.js', array('ee-accounting-core'), EVENT_ESPRESSO_VERSION, TRUE); wp_register_script('ee-accounting-core', EE_THIRD_PARTY_URL . 'accounting/accounting.js', array('underscore'), '0.3.2', TRUE); wp_enqueue_script('ee-accounting'); // array of settings to get converted to JSON array via wp_localize_script $currency_config = array('currency' => array('symbol' => EE_Registry::instance()->CFG->currency->sign, 'format' => array('pos' => EE_Registry::instance()->CFG->currency->sign_b4 ? '%s%v' : '%v%s', 'neg' => EE_Registry::instance()->CFG->currency->sign_b4 ? '- %s%v' : '- %v%s', 'zero' => EE_Registry::instance()->CFG->currency->sign_b4 ? '%s--' : '--%s'), 'decimal' => EE_Registry::instance()->CFG->currency->dec_mrk, 'thousand' => EE_Registry::instance()->CFG->currency->thsnds, 'precision' => EE_Registry::instance()->CFG->currency->dec_plc), 'number' => array('precision' => EE_Registry::instance()->CFG->currency->dec_plc, 'thousand' => EE_Registry::instance()->CFG->currency->thsnds, 'decimal' => EE_Registry::instance()->CFG->currency->dec_mrk)); wp_localize_script('ee-accounting', 'EE_ACCOUNTING_CFG', $currency_config); } }
/** * wp_enqueue_scripts * * @access public * @return void */ public function wp_enqueue_scripts() { // css is turned ON by default, but prior to the wp_enqueue_scripts hook, can be turned OFF via: add_filter( 'FHEE_load_css', '__return_false' ); if (apply_filters('FHEE_load_css', TRUE)) { $this->Registry->CFG->template_settings->enable_default_style = TRUE; //Load the ThemeRoller styles if enabled if (isset($this->Registry->CFG->template_settings->enable_default_style) && $this->Registry->CFG->template_settings->enable_default_style) { //Load custom style sheet if available if (isset($this->Registry->CFG->template_settings->custom_style_sheet)) { wp_register_style('espresso_custom_css', EVENT_ESPRESSO_UPLOAD_URL . 'css/' . $this->Registry->CFG->template_settings->custom_style_sheet, EVENT_ESPRESSO_VERSION); wp_enqueue_style('espresso_custom_css'); } if (is_readable(EVENT_ESPRESSO_UPLOAD_DIR . 'css/style.css')) { wp_register_style('espresso_default', EVENT_ESPRESSO_UPLOAD_DIR . 'css/espresso_default.css', array('dashicons'), EVENT_ESPRESSO_VERSION); } else { wp_register_style('espresso_default', EE_GLOBAL_ASSETS_URL . 'css/espresso_default.css', array('dashicons'), EVENT_ESPRESSO_VERSION); } wp_enqueue_style('espresso_default'); if (is_readable(get_stylesheet_directory() . EE_Config::get_current_theme() . DS . 'style.css')) { wp_register_style('espresso_style', get_stylesheet_directory_uri() . EE_Config::get_current_theme() . DS . 'style.css', array('dashicons', 'espresso_default')); } else { wp_register_style('espresso_style', EE_TEMPLATES_URL . EE_Config::get_current_theme() . DS . 'style.css', array('dashicons', 'espresso_default')); } } } // js is turned ON by default, but prior to the wp_enqueue_scripts hook, can be turned OFF via: add_filter( 'FHEE_load_js', '__return_false' ); if (apply_filters('FHEE_load_js', TRUE)) { wp_enqueue_script('jquery'); //let's make sure that all required scripts have been setup if (function_exists('wp_script_is') && !wp_script_is('jquery')) { $msg = sprintf(__('%sJquery is not loaded!%sEvent Espresso is unable to load Jquery due to a conflict with your theme or another plugin.', 'event_espresso'), '<em><br />', '</em>'); EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); } // load core js wp_register_script('espresso_core', EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE); wp_enqueue_script('espresso_core'); wp_localize_script('espresso_core', 'eei18n', EE_Registry::$i18n_js_strings); } //qtip is turned OFF by default, but prior to the wp_enqueue_scripts hook, can be turned back on again via: add_filter('FHEE_load_qtip', '__return_true' ); if (apply_filters('FHEE_load_qtip', FALSE)) { EEH_Qtip_Loader::instance()->register_and_enqueue(); } //accounting.js library // @link http://josscrowcroft.github.io/accounting.js/ if (apply_filters('FHEE_load_accounting_js', FALSE)) { $acct_js = EE_THIRD_PARTY_URL . 'accounting/accounting.js'; wp_register_script('ee-accounting', EE_GLOBAL_ASSETS_URL . 'scripts/ee-accounting-config.js', array('ee-accounting-core'), EVENT_ESPRESSO_VERSION, TRUE); wp_register_script('ee-accounting-core', $acct_js, array('underscore'), '0.3.2', TRUE); wp_enqueue_script('ee-accounting'); $currency_config = array('currency' => array('symbol' => $this->Registry->CFG->currency->sign, 'format' => array('pos' => $this->Registry->CFG->currency->sign_b4 ? '%s%v' : '%v%s', 'neg' => $this->Registry->CFG->currency->sign_b4 ? '- %s%v' : '- %v%s', 'zero' => $this->Registry->CFG->currency->sign_b4 ? '%s--' : '--%s'), 'decimal' => $this->Registry->CFG->currency->dec_mrk, 'thousand' => $this->Registry->CFG->currency->thsnds, 'precision' => $this->Registry->CFG->currency->dec_plc), 'number' => array('precision' => 0, 'thousand' => $this->Registry->CFG->currency->thsnds, 'decimal' => $this->Registry->CFG->currency->dec_mrk)); wp_localize_script('ee-accounting', 'EE_ACCOUNTING_CFG', $currency_config); } if (!function_exists('wp_head')) { $msg = sprintf(__('%sMissing wp_head() function.%sThe WordPress function wp_head() seems to be missing in your theme. Please contact the theme developer to make sure this is fixed before using Event Espresso.', 'event_espresso'), '<em><br />', '</em>'); EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); } if (!function_exists('wp_footer')) { $msg = sprintf(__('%sMissing wp_footer() function.%sThe WordPress function wp_footer() seems to be missing in your theme. Please contact the theme developer to make sure this is fixed before using Event Espresso.', 'event_espresso'), '<em><br />', '</em>'); EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); } }