Esempio n. 1
0
 /**
  * Constructor
  *
  * @since	1.4
  */
 function __construct($settings, $owner)
 {
     parent::__construct($settings, $owner);
     paradox_add_action_once('admin_enqueue_scripts', array($this, 'enqueueSlider'));
     paradox_add_action_once('customize_controls_enqueue_scripts', array($this, 'enqueueSlider'));
     add_action('admin_head', array(__CLASS__, 'createSliderScript'));
 }
Esempio n. 2
0
 /**
  * Constructor
  *
  * @return	void
  * @since	1.5
  */
 function __construct($settings, $owner)
 {
     parent::__construct($settings, $owner);
     add_filter('tf_generate_css_upload_' . $this->getOptionNamespace(), array($this, 'generateCSS'), 10, 2);
     add_action('tf_livepreview_pre_' . $this->getOptionNamespace(), array($this, 'preLivePreview'), 10, 3);
     add_action('tf_livepreview_post_' . $this->getOptionNamespace(), array($this, 'postLivePreview'), 10, 3);
 }
Esempio n. 3
0
 /**
  * Constructor
  *
  * @since	1.4
  */
 function __construct($settings, $owner)
 {
     parent::__construct($settings, $owner);
     paradox_add_action_once('admin_enqueue_scripts', array($this, 'enqueueDatepicker'));
     paradox_add_action_once('customize_controls_enqueue_scripts', array($this, 'enqueueDatepicker'));
     add_action('admin_head', array(__CLASS__, 'createCalendarScript'));
     if (empty(self::$date_epoch)) {
         self::$date_epoch = date('Y-m-d', 0);
     }
 }
Esempio n. 4
0
 public function createOption($settings)
 {
     if (!apply_filters('paradox_tf_create_option_continue_' . $this->owner->owner->optionNamespace, true, $settings)) {
         return null;
     }
     $obj = ParadoxTitanFrameworkOption::factory($settings, $this);
     $this->options[] = $obj;
     do_action('paradox_tf_create_option_' . $this->owner->owner->optionNamespace, $obj);
     return $obj;
 }
Esempio n. 5
0
 /**
  * Constructor
  *
  * @since	1.3
  */
 function __construct($settings, $owner)
 {
     parent::__construct($settings, $owner);
     add_action('admin_enqueue_scripts', array($this, 'loadAdminScripts'));
     add_action('customize_controls_enqueue_scripts', array($this, 'loadAdminScripts'));
     // CSS generation for CSS code langs
     add_filter('tf_generate_css_code_' . $this->getOptionNamespace(), array($this, 'generateCSSCode'), 10, 2);
     add_filter('wp_head', array($this, 'printCSSForPagesAndPosts'), 100);
     // JS inclusion for Javascript code langs
     add_filter('wp_footer', array($this, 'printJS'), 100);
     add_filter('wp_footer', array($this, 'printJSForPagesAndPosts'), 101);
 }
Esempio n. 6
0
 /**
  * Constructor
  *
  * @return	void
  * @since	1.4
  */
 function __construct($settings, $owner)
 {
     parent::__construct($settings, $owner);
     paradox_add_action_once('admin_enqueue_scripts', array($this, 'loadAdminScripts'));
     paradox_add_action_once('customize_controls_enqueue_scripts', array($this, 'loadAdminScripts'));
     paradox_add_action_once('admin_head', array(__CLASS__, 'createFontScript'));
     paradox_add_action_once('wp_enqueue_scripts', array($this, 'enqueueGooglefonts'));
     add_filter('tf_generate_css_font_' . $this->getOptionNamespace(), array($this, 'generateCSS'), 10, 2);
     if ($this->settings['enqueue']) {
         self::$optionsToEnqueue[] = $this;
     }
 }
Esempio n. 7
0
 function __construct($settings, $owner)
 {
     parent::__construct($settings, $owner);
     paradox_add_action_once('admin_enqueue_scripts', array($this, 'enqueueColorPickerScript'));
     paradox_add_action_once('admin_footer', array($this, 'startColorPicker'));
 }
Esempio n. 8
0
 /**
  * Constructor
  *
  * @return	void
  * @since	1.5
  */
 function __construct($settings, $owner)
 {
     parent::__construct($settings, $owner);
 }
 /**
  * Constructor, fixes the settings to allow for multiple ajax buttons in a single option
  *
  * @param	$settings	Array	Option settings
  * @param	$owner		Object	The container of the option
  * @return	void
  */
 function __construct($settings, $owner)
 {
     parent::__construct($settings, $owner);
     add_action('admin_head', array(__CLASS__, 'createAjaxScript'));
     // Adjust the settings
     foreach ($this->defaultSecondarySettings as $key => $default) {
         if (!is_array($this->settings[$key])) {
             $this->settings[$key] = array($this->settings[$key]);
         }
     }
     while (count($this->settings['label']) < count($this->settings['action'])) {
         $this->settings['label'][] = $this->settings['label'][count($this->settings['label']) - 1];
     }
     while (count($this->settings['class']) < count($this->settings['action'])) {
         $this->settings['class'][] = 'button-secondary';
     }
     while (count($this->settings['wait_label']) < count($this->settings['action'])) {
         $this->settings['wait_label'][] = $this->settings['wait_label'][count($this->settings['wait_label']) - 1];
     }
     while (count($this->settings['error_label']) < count($this->settings['action'])) {
         $this->settings['error_label'][] = $this->settings['error_label'][count($this->settings['error_label']) - 1];
     }
     while (count($this->settings['success_label']) < count($this->settings['action'])) {
         $this->settings['success_label'][] = $this->settings['success_label'][count($this->settings['success_label']) - 1];
     }
     while (count($this->settings['success_callback']) < count($this->settings['action'])) {
         $this->settings['success_callback'][] = '';
     }
     while (count($this->settings['error_callback']) < count($this->settings['action'])) {
         $this->settings['error_callback'][] = __('Something went wrong', PARADOX_TF_I18NDOMAIN);
     }
     foreach ($this->settings['label'] as $i => $label) {
         if (empty($label)) {
             $this->settings['label'][$i] = __('Click me', PARADOX_TF_I18NDOMAIN);
         }
     }
     foreach ($this->settings['wait_label'] as $i => $label) {
         if (empty($label)) {
             $this->settings['wait_label'][$i] = __('Please wait...', PARADOX_TF_I18NDOMAIN);
         }
     }
     foreach ($this->settings['error_label'] as $i => $label) {
         if (empty($label)) {
             $this->settings['error_label'][$i] = $this->settings['label'][$i];
         }
     }
     foreach ($this->settings['success_label'] as $i => $label) {
         if (empty($label)) {
             $this->settings['success_label'][$i] = $this->settings['label'][$i];
         }
     }
     /**
      * Create ajax handlers for security and last resort success returns
      */
     foreach ($this->settings['action'] as $i => $action) {
         if (!empty($action)) {
             add_action('wp_ajax_' . $action, array($this, 'ajaxSecurityChecker'), 1);
             add_action('wp_ajax_' . $action, array($this, 'ajaxLastSuccess'), 99999);
         }
     }
 }
 function __construct($settings, $owner)
 {
     parent::__construct($settings, $owner);
     add_action('tf_livepreview_pre_' . $this->getOptionNamespace(), array($this, 'preLivePreview'), 10, 3);
 }
 /**
  * Constructor
  *
  * @since    1.7.1
  *
  * @param array  $settings Option settings
  * @param string $owner
  */
 function __construct($settings, $owner)
 {
     parent::__construct($settings, $owner);
     add_action('admin_init', array($this, 'checkUpdates'), 10, 0);
     add_action('paradox_tf_create_option_' . $this->getOptionNamespace(), array($this, 'activateLicense'));
 }