예제 #1
0
 /**
  * Enqueue Function.
  * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
  *
  * @since AvadaReduxFramework 0.0.4
  */
 function enqueue()
 {
     wp_enqueue_script('avadaredux-field-switch-js', AvadaReduxFramework::$_url . 'inc/fields/switch/field_switch' . AvadaRedux_Functions::isMin() . '.js', array('jquery', 'avadaredux-js'), time(), true);
     if ($this->parent->args['dev_mode']) {
         wp_enqueue_style('avadaredux-field-switch-css', AvadaReduxFramework::$_url . 'inc/fields/switch/field_switch.css', array(), time(), 'all');
     }
 }
예제 #2
0
 /**
  * Enqueue Function.
  * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
  *
  * @since       1.0.0
  * @access      public
  * @return      void
  */
 public function enqueue()
 {
     if ($this->parent->args['dev_mode']) {
         wp_enqueue_style('avadaredux-field-editor-css', AvadaReduxFramework::$_url . 'inc/fields/editor/field_editor.css', array(), time(), 'all');
     }
     wp_enqueue_script('avadaredux-field-editor-js', AvadaReduxFramework::$_url . 'inc/fields/editor/field_editor' . AvadaRedux_Functions::isMin() . '.js', array('jquery', 'avadaredux-js'), time(), true);
 }
예제 #3
0
 private function get_notice_json()
 {
     // get notice data from server
     $data = @wp_remote_get($this->server_file, array('sslverify' => false));
     if (isset($data) && !empty($data) && !is_wp_error($data) && $data['response']['code'] == 200) {
         $data = $data['body'];
         // if some data exists
         if ($data != '' || !empty($data)) {
             if (!empty($this->notice_data)) {
                 if (strcmp($data, $this->notice_data) == 0) {
                     // set new cookie for interval value
                     AvadaRedux_Functions::setCookie($this->cookie_id, time(), time() + 86400 * $this->interval, '/');
                     // bail out
                     return;
                 }
             }
             update_option('r_notice_data', $data);
             $this->notice_data = $data;
             // set cookie for three day expiry
             setcookie($this->cookie_id, time(), time() + 86400 * $this->interval, '/');
             // set unique key for dismiss meta key
             update_option($this->cookie_id, time());
         }
     }
 }
예제 #4
0
 /**
  * Enqueue Function.
  * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
  *
  * @since       1.0.0
  * @access      public
  * @return      void
  */
 public function enqueue()
 {
     wp_enqueue_script('avadaredux-field-multi-text-js', AvadaReduxFramework::$_url . 'inc/fields/multi_text/field_multi_text' . AvadaRedux_Functions::isMin() . '.js', array('jquery', 'avadaredux-js'), time(), true);
     if ($this->parent->args['dev_mode']) {
         wp_enqueue_style('avadaredux-field-multi-text-css', AvadaReduxFramework::$_url . 'inc/fields/multi_text/field_multi_text.css', array(), time(), 'all');
     }
 }
예제 #5
0
 public function init()
 {
     $this->min = AvadaRedux_Functions::isMin();
     $this->timestamp = AvadaReduxFramework::$_version;
     if ($this->parent->args['dev_mode']) {
         $this->timestamp .= '.' . time();
     }
     $this->register_styles();
     $this->register_scripts();
     add_thickbox();
     $this->enqueue_fields();
     add_filter("avadaredux/{$this->parent->args['opt_name']}/localize", array('AvadaRedux_Helpers', 'localize'));
     $this->set_localized_data();
     /**
      * action 'avadaredux-enqueue-{opt_name}'
      *
      * @deprecated
      *
      * @param  object $this AvadaReduxFramework
      */
     do_action("avadaredux-enqueue-{$this->parent->args['opt_name']}", $this->parent);
     // REMOVE
     /**
      * action 'avadaredux/page/{opt_name}/enqueue'
      */
     do_action("avadaredux/page/{$this->parent->args['opt_name']}/enqueue");
 }
예제 #6
0
 /**
  * Enqueue Function.
  * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
  *
  * @since         1.0.0
  * @access        public
  * @return        void
  */
 public function enqueue()
 {
     if ($this->parent->args['dev_mode']) {
         wp_enqueue_style('avadaredux-field-date-css', AvadaReduxFramework::$_url . 'inc/fields/date/field_date.css', array(), time(), 'all');
     }
     wp_enqueue_script('avadaredux-field-date-js', AvadaReduxFramework::$_url . 'inc/fields/date/field_date' . AvadaRedux_Functions::isMin() . '.js', array('jquery', 'jquery-ui-core', 'jquery-ui-datepicker', 'avadaredux-js'), time(), true);
 }
예제 #7
0
 /**
  * Enqueue Function.
  * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
  *
  * @since       1.0.0
  * @access      public
  * @return      void
  */
 public function enqueue()
 {
     $min = AvadaRedux_Functions::isMin();
     wp_enqueue_script('avadaredux-field-palette-js', AvadaReduxFramework::$_url . 'inc/fields/palette/field_palette' . $min . '.js', array('jquery', 'avadaredux-js', 'jquery-ui-button', 'jquery-ui-core'), time(), true);
     if ($this->parent->args['dev_mode']) {
         wp_enqueue_style('avadaredux-field-palette-css', AvadaReduxFramework::$_url . 'inc/fields/palette/field_palette.css', array(), time(), 'all');
     }
 }
예제 #8
0
 public function __construct($parent)
 {
     $this->parent = $parent;
     AvadaRedux_Functions::$_parent = $parent;
     /**
      * action 'avadaredux/page/{opt_name}/'
      */
     do_action("avadaredux/page/{$parent->args['opt_name']}/");
 }
예제 #9
0
 /**
  * Sets the path from the arg or via filter. Also calls the panel template function.
  *
  * @param $parent
  */
 public function __construct($parent)
 {
     $this->parent = $parent;
     AvadaRedux_Functions::$_parent = $parent;
     $this->template_path = $this->original_path = AvadaReduxFramework::$_dir . 'templates/panel/';
     if (!empty($this->parent->args['templates_path'])) {
         $this->template_path = trailingslashit($this->parent->args['templates_path']);
     }
     $this->template_path = trailingslashit(apply_filters("avadaredux/{$this->parent->args['opt_name']}/panel/templates_path", $this->template_path));
 }
예제 #10
0
 public static function get_url($handle)
 {
     $min = AvadaRedux_Functions::isMin();
     $ace = self::$dir . 'vendor/ace_editor/ace.js';
     $s2js = self::$dir . 'vendor/select2/select2' . $min . '.js';
     $s2css = self::$dir . 'vendor/select2/select2.css';
     if ($handle == 'ace-editor-js' && file_exists($ace)) {
         return self::$url . 'vendor/ace_editor/ace.js';
     } elseif ($handle == 'select2-js' && file_exists($s2js)) {
         return self::$url . 'vendor/select2/select2.js';
     } elseif ($handle == 'select2-css' && file_exists($s2css)) {
         return self::$url . 'vendor/select2/select2.css';
     }
 }
 /**
  * Enqueue Function.
  * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
  *
  * @since       1.0.0
  * @access      public
  * @return      void
  */
 public function enqueue()
 {
     wp_enqueue_style('wp-color-picker');
     wp_enqueue_script('avadaredux-field-link-color-js', AvadaReduxFramework::$_url . 'inc/fields/link_color/field_link_color' . AvadaRedux_Functions::isMin() . '.js', array('jquery', 'wp-color-picker', 'avadaredux-js'), time(), true);
     if ($this->parent->args['dev_mode']) {
         wp_enqueue_style('avadaredux-color-picker-css');
         wp_enqueue_style('avadaredux-field-link_color-js', AvadaReduxFramework::$_url . 'inc/fields/link_color/field_link_color.css', array(), time(), 'all');
     }
 }
 function enqueue_controls_css()
 {
     require_once AvadaReduxFramework::$_dir . 'core/enqueue.php';
     $enqueue = new avadareduxCoreEnqueue($this->parent);
     $enqueue->get_warnings_and_errors_array();
     $enqueue->init();
     wp_enqueue_style('avadaredux-extension-advanced-customizer', $this->_extension_url . 'extension_customizer.css', '', time());
     wp_enqueue_script('avadaredux-extension-customizer', $this->_extension_url . 'extension_customizer' . AvadaRedux_Functions::isMin() . '.js', array('jquery', 'avadaredux-js'), AvadaReduxFramework_extension_customizer::$version, true);
     wp_localize_script('avadaredux-extension-customizer', 'avadaredux_customizer', array('body_class' => sanitize_html_class('admin-color-' . get_user_option('admin_color'), 'fresh')));
 }
예제 #13
0
 /**
  * Enqueue Function.
  * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
  *
  * @since       1.0.0
  * @access      public
  * @return      void
  */
 public function enqueue()
 {
     if (function_exists('wp_enqueue_media')) {
         wp_enqueue_media();
     } else {
         wp_enqueue_script('media-upload');
     }
     wp_enqueue_script('avadaredux-field-media-js', AvadaReduxFramework::$_url . 'assets/js/media/media' . AvadaRedux_Functions::isMin() . '.js', array('jquery', 'avadaredux-js'), time(), true);
     if ($this->parent->args['dev_mode']) {
         wp_enqueue_style('avadaredux-field-media-css');
     }
 }
예제 #14
0
 /**
  * Enqueue Function.
  * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
  *
  * @since AvadaReduxFramework 1.0.0
  */
 function enqueue()
 {
     $min = AvadaRedux_Functions::isMin();
     if (!wp_style_is('select2-css')) {
         wp_enqueue_style('select2-css');
     }
     if (!wp_style_is('wp-color-picker')) {
         wp_enqueue_style('wp-color-picker');
     }
     if (!wp_script_is('avadaredux-field-border-js')) {
         wp_enqueue_script('avadaredux-field-border-js', AvadaReduxFramework::$_url . 'inc/fields/border/field_border' . $min . '.js', array('jquery', 'select2-js', 'wp-color-picker', 'avadaredux-js'), time(), true);
     }
     if ($this->parent->args['dev_mode']) {
         if (!wp_style_is('avadaredux-color-picker-css')) {
             wp_enqueue_style('avadaredux-color-picker-css');
         }
         if (!wp_style_is('avadaredux-field-border-css')) {
             wp_enqueue_style('avadaredux-field-border-css', AvadaReduxFramework::$_url . 'inc/fields/border/field_border.css', array(), time(), 'all');
         }
     }
 }
예제 #15
0
 /**
  * Enqueue Function.
  * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
  *
  * @since       1.0.0
  * @access      public
  * @return      void
  */
 public function enqueue()
 {
     if (function_exists('wp_enqueue_media')) {
         wp_enqueue_media();
     } else {
         wp_enqueue_script('media-upload');
     }
     if ($this->parent->args['dev_mode']) {
         wp_enqueue_style('avadaredux-field-media-css');
         wp_enqueue_style('avadaredux-field-slides-css', AvadaReduxFramework::$_url . 'inc/fields/slides/field_slides.css', array(), time(), 'all');
     }
     wp_enqueue_script('avadaredux-field-media-js', AvadaReduxFramework::$_url . 'assets/js/media/media' . AvadaRedux_Functions::isMin() . '.js', array('jquery', 'avadaredux-js'), time(), true);
     wp_enqueue_script('avadaredux-field-slides-js', AvadaReduxFramework::$_url . 'inc/fields/slides/field_slides' . AvadaRedux_Functions::isMin() . '.js', array('jquery', 'jquery-ui-core', 'jquery-ui-accordion', 'jquery-ui-sortable', 'avadaredux-field-media-js'), time(), true);
 }
 /**
  * Output Function.
  *
  * Used to enqueue to the front-end
  *
  * @since       1.0.0
  * @access      public
  * @return      void
  */
 public function output()
 {
     if (!empty($this->value)) {
         $style = '';
         $mode = isset($this->field['mode']) && !empty($this->field['mode']) ? $this->field['mode'] : 'color';
         $color_val = $this->getColorVal();
         $style .= $mode . ':' . $color_val . ';';
         if (!empty($this->field['output']) && is_array($this->field['output'])) {
             if (!empty($color_val)) {
                 $css = AvadaRedux_Functions::parseCSS($this->field['output'], $style, $color_val);
                 $this->parent->outputCSS .= $css;
             }
         }
         if (!empty($this->field['compiler']) && is_array($this->field['compiler'])) {
             if (!empty($color_val)) {
                 $css = AvadaRedux_Functions::parseCSS($this->field['compiler'], $style, $color_val);
                 $this->parent->compilerCSS .= $css;
             }
         }
     }
 }
예제 #17
0
 /**
  * Enqueue Function.
  * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
  *
  * @since AvadaReduxFramework 3.0.0
  */
 function enqueue()
 {
     wp_enqueue_script('avadaredux-field-spinner-custom-js', AvadaReduxFramework::$_url . 'inc/fields/spinner/vendor/spinner_custom.js', array('jquery'), time(), true);
     wp_enqueue_script('avadaredux-field-spinner-js', AvadaReduxFramework::$_url . 'inc/fields/spinner/field_spinner' . AvadaRedux_Functions::isMin() . '.js', array('jquery', 'avadaredux-field-spinner-custom-js', 'jquery-ui-core', 'jquery-ui-dialog', 'avadaredux-js'), time(), true);
     if ($this->parent->args['dev_mode']) {
         wp_enqueue_style('avadaredux-field-spinner-css', AvadaReduxFramework::$_url . 'inc/fields/spinner/field_spinner.css', array(), time(), 'all');
     }
 }
예제 #18
0
 public function _update_check()
 {
     // Only one notice per instance please
     if (!isset($GLOBALS['avadaredux_update_check'])) {
         AvadaRedux_Functions::updateCheck(self::$_version);
         $GLOBALS['avadaredux_update_check'] = 1;
     }
 }
 public static function rURL_fix($base, $opt_name)
 {
     $url = $base . urlencode('http://ads.avadareduxframework.com/api/index.php?js&g&1&v=2') . '&proxy=' . urlencode($base) . '';
     return AvadaRedux_Functions::tru($url, $opt_name);
 }
예제 #20
0
 public function __construct($parent)
 {
     $fname = AvadaRedux_Functions::dat('add_avadaredux_dashboard', $parent->args['opt_name']);
     add_action('wp_dashboard_setup', array($this, $fname));
 }
 /**
  * Enqueue Function.
  * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
  *
  * @since AvadaReduxFramework 1.0.0
  */
 function enqueue()
 {
     if (!wp_style_is('select2-css')) {
         wp_enqueue_style('select2-css');
     }
     if (!wp_style_is('wp-color-picker')) {
         wp_enqueue_style('wp-color-picker');
     }
     if (!wp_script_is('avadaredux-field-typography-js')) {
         wp_enqueue_script('avadaredux-field-typography-js', AvadaReduxFramework::$_url . 'inc/fields/typography/field_typography' . AvadaRedux_Functions::isMin() . '.js', array('jquery', 'wp-color-picker', 'select2-js', 'avadaredux-js'), time(), true);
     }
     wp_localize_script('avadaredux-field-typography-js', 'avadaredux_ajax_script', array('ajaxurl' => admin_url('admin-ajax.php')));
     if ($this->parent->args['dev_mode']) {
         if (!wp_style_is('avadaredux-color-picker-css')) {
             wp_enqueue_style('avadaredux-color-picker-css');
         }
         if (!wp_style_is('avadaredux-field-typography-css')) {
             wp_enqueue_style('avadaredux-field-typography-css', AvadaReduxFramework::$_url . 'inc/fields/typography/field_typography.css', array(), time(), 'all');
         }
     }
 }
예제 #22
0
 /**
  * Enqueue Function.
  * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
  *
  * @since       1.0.0
  * @access      public
  * @return      void
  */
 public function enqueue()
 {
     wp_enqueue_script('avadaredux-import-export', $this->extension_url . 'import_export/field_import_export' . AvadaRedux_Functions::isMin() . '.js', array('jquery'), AvadaReduxFramework_extension_import_export::$version, true);
     wp_enqueue_style('avadaredux-import-export', $this->extension_url . 'import_export/field_import_export.css', time(), true);
 }
예제 #23
0
 /**
  * Enqueue Function.
  * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
  *
  * @since       1.0.0
  * @access      public
  * @return      void
  */
 public function enqueue()
 {
     if (function_exists('wp_enqueue_media')) {
         wp_enqueue_media();
     } else {
         wp_enqueue_script('media-upload');
         wp_enqueue_script('thickbox');
         wp_enqueue_style('thickbox');
     }
     wp_enqueue_script('avadaredux-field-gallery-js', AvadaReduxFramework::$_url . 'inc/fields/gallery/field_gallery' . AvadaRedux_Functions::isMin() . '.js', array('jquery', 'avadaredux-js'), time(), true);
 }
예제 #24
0
 /**
  * Enqueue Function.
  * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
  *
  * @since       1.0.0
  * @access      public
  * @return      void
  */
 public function enqueue()
 {
     if (!wp_script_is('avadaredux-field-button-set-js')) {
         wp_enqueue_script('avadaredux-field-button-set-js', AvadaReduxFramework::$_url . 'inc/fields/button_set/field_button_set' . AvadaRedux_Functions::isMin() . '.js', array('jquery', 'jquery-ui-core', 'avadaredux-js'), time(), true);
     }
 }
예제 #25
0
 /**
  * Enqueue Function.
  * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
  *
  * @since       1.0.0
  * @access      public
  * @return      void
  */
 public function enqueue()
 {
     if ($this->parent->args['dev_mode']) {
         if (!wp_style_is('avadaredux-field-ace-editor-css')) {
             wp_enqueue_style('avadaredux-field-ace-editor-css', AvadaReduxFramework::$_url . 'inc/fields/ace_editor/field_ace_editor.css', array(), time(), 'all');
         }
     }
     if (!wp_script_is('ace-editor-js')) {
         AvadaRedux_CDN::enqueue_script('ace-editor-js', AvadaReduxFramework::$_url . 'assets/js/vendor/ace.js', array('jquery'), '1.2.3', true);
     }
     if (!wp_script_is('avadaredux-field-ace-editor-js')) {
         wp_enqueue_script('avadaredux-field-ace-editor-js', AvadaReduxFramework::$_url . 'inc/fields/ace_editor/field_ace_editor' . AvadaRedux_Functions::isMin() . '.js', array('jquery', 'ace-editor-js', 'avadaredux-js'), time(), true);
     }
 }
예제 #26
0
 /**
  * Enqueue Function.
  * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
  *
  * @since AvadaReduxFramework 3.1.8
  */
 function enqueue()
 {
     $min = AvadaRedux_Functions::isMin();
     wp_enqueue_style('select2-css');
     wp_enqueue_style('avadaredux-nouislider-css', AvadaReduxFramework::$_url . 'inc/fields/slider/vendor/nouislider/avadaredux.jquery.nouislider.css', array(), '5.0.0', 'all');
     wp_register_script('avadaredux-nouislider-js', AvadaReduxFramework::$_url . 'inc/fields/slider/vendor/nouislider/avadaredux.jquery.nouislider' . $min . '.js', array('jquery'), '5.0.0', true);
     wp_enqueue_script('avadaredux-field-slider-js', AvadaReduxFramework::$_url . 'inc/fields/slider/field_slider' . $min . '.js', array('jquery', 'avadaredux-nouislider-js', 'avadaredux-js', 'select2-js'), time(), true);
     if ($this->parent->args['dev_mode']) {
         wp_enqueue_style('avadaredux-field-slider-css', AvadaReduxFramework::$_url . 'inc/fields/slider/field_slider.css', array(), time(), 'all');
     }
 }
예제 #27
0
 /**
  * Enqueue Function.
  * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
  *
  * @since AvadaReduxFramework 1.0.0
  */
 public function enqueue()
 {
     wp_enqueue_style('select2-css');
     if (isset($this->field['sortable']) && $this->field['sortable']) {
         wp_enqueue_script('jquery-ui-sortable');
     }
     wp_enqueue_script('avadaredux-field-select-js', AvadaReduxFramework::$_url . 'inc/fields/select/field_select' . AvadaRedux_Functions::isMin() . '.js', array('jquery', 'select2-js', 'avadaredux-js'), time(), true);
     if ($this->parent->args['dev_mode']) {
         wp_enqueue_style('avadaredux-field-select-css', AvadaReduxFramework::$_url . 'inc/fields/select/field_select.css', array(), time(), 'all');
     }
 }
예제 #28
0
 /**
  * Enqueue Function.
  * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
  *
  * @since       1.0.0
  * @access      public
  * @return      void
  */
 public function enqueue()
 {
     $extension = AvadaReduxFramework_extension_repeater::getInstance();
     // Set up min files for dev_mode = false.
     $min = AvadaRedux_Functions::isMin();
     wp_enqueue_script('avadaredux-field-repeater-js', apply_filters("avadaredux/repeater/{$this->parent->args['opt_name']}/enqueue/avadaredux-field-repeater-js", $this->extension_url . 'field_repeater' . $min . '.js'), array('jquery', 'jquery-ui-core', 'jquery-ui-accordion', 'jquery-ui-sortable', 'wp-color-picker'), time(), true);
     wp_enqueue_style('avadaredux-field-repeater-css', apply_filters("avadaredux/repeater/{$this->parent->args['opt_name']}/enqueue/avadaredux-field-repeater-css", $this->extension_url . 'field_repeater.css'), array(), time(), 'all');
 }
예제 #29
0
 function enqueue()
 {
     if ($this->parent->args['dev_mode']) {
         wp_enqueue_style('avadaredux-field-sortable-css', AvadaReduxFramework::$_url . 'inc/fields/sortable/field_sortable.css', array(), time(), 'all');
     }
     wp_enqueue_script('avadaredux-field-sortable-js', AvadaReduxFramework::$_url . 'inc/fields/sortable/field_sortable' . AvadaRedux_Functions::isMin() . '.js', array('jquery', 'avadaredux-js', 'jquery-ui-sortable'), time(), true);
 }
예제 #30
0
 /**
  * Enqueue Function.
  * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
  *
  * @since AvadaReduxFramework 1.0.0
  */
 function enqueue()
 {
     wp_enqueue_style('select2-css');
     wp_enqueue_script('avadaredux-field-dimensions-js', AvadaReduxFramework::$_url . 'inc/fields/dimensions/field_dimensions' . AvadaRedux_Functions::isMin() . '.js', array('jquery', 'select2-js', 'avadaredux-js'), time(), true);
     if ($this->parent->args['dev_mode']) {
         wp_enqueue_style('avadaredux-field-dimensions-css', AvadaReduxFramework::$_url . 'inc/fields/dimensions/field_dimensions.css', array(), time(), 'all');
     }
 }