Example #1
0
 /**
  *  Init 
  */
 public function init()
 {
     if (is_admin()) {
         wp_enqueue_script('otw_form_colorpicker_admin', $this->component_url . 'js/colorpicker.js', array('jquery'), $this->js_version);
         wp_enqueue_script('otw_form_admin', $this->component_url . 'js/otw_form_admin.js', array('jquery'), $this->js_version);
         wp_enqueue_style('otw_form_colorpicker_admin', $this->component_url . 'css/colorpicker.css', array(), $this->css_version);
         wp_enqueue_style('otw_form_admin', $this->component_url . 'css/otw_form_admin.css', array(), $this->css_version);
     } elseif ($this->init_in_front) {
         wp_enqueue_script('otw_form_colorpicker', $this->component_url . 'js/colorpicker.js', array('jquery'), $this->js_version);
         wp_enqueue_script('otw_form', $this->component_url . 'js/otw_form_admin.js', array('jquery'), $this->js_version);
         wp_enqueue_style('otw_form_colorpicker', $this->component_url . 'css/colorpicker.css', array(), $this->css_version);
         wp_enqueue_style('otw_form', $this->component_url . 'css/otw_form_admin.css', array(), $this->css_version);
     }
     parent::init();
 }
 /**
  *  Init 
  */
 public function init()
 {
     $this->include_shortcodes();
     $this->apply_shortcode_settings();
     $this->register_shortcodes();
     if (is_admin()) {
         wp_enqueue_script('otw_shortcode_admin', $this->component_url . 'js/otw_shortcode_admin.js', array('jquery'), $this->js_version);
         wp_enqueue_style('otw_shortcode_admin', $this->component_url . 'css/otw_shortcode_admin.css', array(), $this->css_version);
         add_action('admin_footer', array(&$this, 'load_admin_js'));
         add_action('wp_ajax_otw_shortcode_editor_dialog', array(&$this, 'build_shortcode_editor_dialog'));
         add_action('wp_ajax_otw_shortcode_get_code', array(&$this, 'get_code'));
         add_action('wp_ajax_otw_shortcode_live_preview', array(&$this, 'live_preview'));
         add_action('wp_ajax_otw_shortcode_live_reload', array(&$this, 'live_reload'));
         add_action('wp_ajax_otw_shortcode_preview_shortcodes', array(&$this, 'preview_shortcodes'));
         add_action('wp_ajax_otw_shortcode_preview_front_shortcodes', array(&$this, 'preview_front_shortcodes'));
         if (get_user_option('rich_editing')) {
             add_filter('mce_external_plugins', array(&$this, 'add_tinymce_plugin'));
             add_filter('mce_buttons', array(&$this, 'register_tinymce_button'));
         }
     } else {
         if ($this->init_in_front) {
             wp_enqueue_script('otw_shortcode_front', $this->component_url . 'js/otw_shortcode_admin.js', array('jquery'), $this->js_version);
             wp_enqueue_style('otw_shortcode_front', $this->component_url . 'css/otw_shortcode_admin.css', array(), $this->css_version);
             wp_enqueue_style('thickbox', false);
             wp_enqueue_script('thickbox');
             add_action('wp_footer', array(&$this, 'load_front_js'));
         }
     }
     parent::init();
 }