/** * Enqueue style */ public function enqueue_admin_style() { IG_Pb_Helper_Functions::enqueue_styles(); if (!IG_Pb_Helper_Functions::is_preview()) { IG_Init_Assets::load(array('ig-pb-modal-css')); } else { IG_Init_Assets::load(array('ig-pb-frontend-css')); } }
/** * return shortcode content: if shortcode is disable, return empty * * @param array $atts * @param string $content */ public function element_shortcode($atts = null, $content = null) { $this->init_element(); $prefix = IG_Pb_Helper_Functions::is_preview() ? 'pb_admin' : 'wp'; // enqueue custom assets at footer of frontend/backend add_action("{$prefix}_footer", array(&$this, 'custom_assets_frontend')); $arr_params = shortcode_atts($this->config['params'], $atts); if ($arr_params['disabled_el'] == 'yes') { if (IG_Pb_Helper_Functions::is_preview()) { return ''; //_e( 'This element is deactivated. It will be hidden at frontend', IGPBL ); } return ''; } // enqueue script for current element in frontend add_action('wp_footer', array(&$this, 'enqueue_assets_frontend'), 1); // get full shortcode content return $this->element_shortcode_full($atts, $content); }
/** * Load bootstrap 3, replace bootstrap 2 * * @param type $assets * * @return string */ static function load_bootstrap_3(&$assets) { if (!is_admin() || IG_Pb_Helper_Functions::is_preview()) { $assets['ig-pb-bootstrap-css'] = array('src' => IG_Pb_Helper_Functions::path('assets/3rd-party/bootstrap3') . '/css/bootstrap_frontend.min.css', 'ver' => '3.0.2'); $assets['ig-pb-bootstrap-js'] = array('src' => IG_Pb_Helper_Functions::path('assets/3rd-party/bootstrap3') . '/js/bootstrap_frontend.min.js', 'ver' => '3.0.2', 'deps' => array('jquery')); } }
/** * Register custom asset files * * @param type $assets * @return string */ function apply_assets($assets) { $assets['ig-pb-frontend-css'] = array('src' => IG_Pb_Helper_Functions::path('assets/innogears') . '/css/front_end.css', 'ver' => '1.0.0'); IG_Pb_Helper_Functions::load_bootstrap_3($assets); if (!is_admin() || IG_Pb_Helper_Functions::is_preview()) { $options = array('ig_pb_settings_boostrap_js', 'ig_pb_settings_boostrap_css'); // get saved options value foreach ($options as $key) { ${$key} = get_option($key, 'enable'); } if ($ig_pb_settings_boostrap_css != 'enable') { $assets['ig-pb-bootstrap-css'] = array('src' => '', 'ver' => '3.0.2'); } if ($ig_pb_settings_boostrap_js != 'enable') { $assets['ig-pb-bootstrap-js'] = array('src' => '', 'ver' => '3.0.2'); } } $assets['ig-pb-joomlashine-frontend-css'] = array('src' => IG_Pb_Helper_Functions::path('assets/innogears') . '/css/jsn-gui-frontend.css', 'deps' => array('ig-pb-bootstrap-css')); $assets['ig-pb-frontend-responsive-css'] = array('src' => IG_Pb_Helper_Functions::path('assets/innogears') . '/css/front_end_responsive.css', 'ver' => '1.0.0'); $assets['ig-pb-addpanel-js'] = array('src' => IG_Pb_Helper_Functions::path('assets/innogears') . '/js/add_page_builder.js', 'ver' => '1.0.0'); $assets['ig-pb-layout-js'] = array('src' => IG_Pb_Helper_Functions::path('assets/innogears') . '/js/layout.js', 'ver' => '1.0.0'); $assets['ig-pb-widget-js'] = array('src' => IG_Pb_Helper_Functions::path('assets/innogears') . '/js/widget.js', 'ver' => '1.0.0'); $assets['ig-pb-placeholder'] = array('src' => IG_Pb_Helper_Functions::path('assets/innogears') . '/js/placeholder.js', 'ver' => '1.0.0'); $assets['ig-pb-settings-js'] = array('src' => IG_Pb_Helper_Functions::path('assets/innogears') . '/js/product/settings.js', 'ver' => '1.0.0'); $assets['ig-pb-upgrade-js'] = array('src' => IG_Pb_Helper_Functions::path('assets/innogears') . '/js/product/upgrade.js', 'ver' => '1.0.0'); return $assets; }