Beispiel #1
0
 public function __construct()
 {
     $this->type = 'layout';
     $this->config['el_type'] = 'element';
     $this->element_config();
     $this->element_items();
     $this->shortcode_data();
     /* add shortcode */
     add_shortcode($this->config['shortcode'], array(&$this, 'element_shortcode'));
     // enqueue custom script for current element
     if (IG_Pb_Helper_Functions::is_modal_of_element($this->config['shortcode'])) {
         IG_Pb_Helper_Functions::shortcode_enqueue_assets($this, 'admin_assets', '');
     }
     parent::__construct();
 }
Beispiel #2
0
 /**
  * Method to call neccessary functions for initialyzing the backend
  */
 public function init_element()
 {
     $this->element_items();
     $this->element_items_extra();
     $this->shortcode_data();
     do_action('ig_pb_element_init');
     parent::__construct();
     // enqueue assets for current element in backend (modal setting iframe)
     if (IG_Pb_Helper_Functions::is_modal_of_element($this->config['shortcode'])) {
         add_action('pb_admin_enqueue_scripts', array(&$this, 'enqueue_assets_modal'));
     }
     // enqueue assets for current element in backend (preview iframe)
     if (IG_Pb_Helper_Functions::is_preview()) {
         add_action('pb_admin_enqueue_scripts', array(&$this, 'enqueue_assets_frontend'));
     }
 }