/** * Class Constructor. Defines the args for the extions class * * @since 1.0.0 * @access public * @param array $parent Parent settings. * @return void */ public function __construct($parent) { $redux_ver = ReduxFramework::$_version; // Set parent object $this->parent = $parent; // Set extension dir if (empty($this->extension_dir)) { $this->extension_dir = trailingslashit(str_replace('\\', '/', dirname(__FILE__))); $this->extension_url = site_url(str_replace(trailingslashit(str_replace('\\', '/', ABSPATH)), '', $this->extension_dir)); self::$ext_url = $this->extension_url; } // Set field name $this->field_name = 'multi_media'; // Set instance self::$theInstance = $this; // Uncomment when customizer works - kp //include_once($this->extension_dir . 'multi-media/inc/class.customizer.php'); //new ReduxColorSchemeCustomizer($parent, $this->extension_dir); // Adds the local field add_filter('redux/' . $this->parent->args['opt_name'] . '/field/class/' . $this->field_name, array(&$this, 'overload_field_path')); }
/** * 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 = ReduxFramework_extension_multi_media::getInstance(); // Get labels for localization $upload_file = isset($this->field['labels']['upload_file']) ? $this->field['labels']['upload_file'] : __('Select File(s)', 'redux-framework'); $remove_image = isset($this->field['labels']['remove_image']) ? $this->field['labels']['remove_image'] : __('Remove Image', 'redux-framework'); $remove_file = isset($this->field['labels']['remove_file']) ? $this->field['labels']['remove_file'] : __('Remove', 'redux-framework'); $file_label = isset($this->field['labels']['file']) ? $this->field['labels']['file'] : __('File: ', 'redux-framework'); $download_label = isset($this->field['labels']['download']) ? $this->field['labels']['download'] : __('Download', 'redux-framework'); $media_title = isset($this->field['labels']['title']) ? $this->field['labels']['title'] : $this->field['title']; $dup_warn = isset($this->field['labels']['duplicate']) ? $this->field['labels']['duplicate'] : __('%s already exists in your file queue.', 'redux-framework'); $max_warn = isset($this->field['labels']['max_limit']) ? $this->field['labels']['max_limit'] : __('Maximum upload limit of %s reached/exceeded.', 'redux-framework'); // Set up min files for dev_mode = false. $min = Redux_Functions::isMin(); // Field dependent JS wp_enqueue_script('redux-field-multi-media-js', $this->extension_url . 'field_multi_media' . $min . '.js', array('jquery'), time(), true); // Field CSS wp_enqueue_style('redux-field-multi-media-css', $this->extension_url . 'field_multi_media.css', time(), true); // Localization wp_localize_script('redux-field-multi-media-js', 'redux_multi_media_l10', apply_filters('redux_multi_media_localized_data', array('upload_file' => $upload_file, 'remove_image' => $remove_image, 'remove_file' => $remove_file, 'file' => $file_label, 'download' => $download_label, 'title' => $media_title, 'dup_warn' => $dup_warn, 'max_warn' => $max_warn))); }