. * * @package ReduxFramework * @subpackage Field_slides * @author Luciano "WebCaos" Ubertini * @author Daniel J Griffiths (Ghost1227) * @author Dovy Paukstys * @version 3.0.0 */ // Exit if accessed directly if (!defined('ABSPATH')) exit; // Don't duplicate me! if (!class_exists('ReduxFramework_slides_html')) { /** * Main ReduxFramework_slides_html class * * @since 1.0.0 */ class ReduxFramework_slides_html extends widget_handler{ var $titles = array(); var $field_id = ""; /** * Field Constructor. * * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function * * @since 1.0.0 * @access public * @param array $field * @param string $value * @param $parent * @return \ReduxFramework_slides_html */ function __construct( $field = array(), $value ='', $parent ) { parent::__construct($field,$value,$parent); $this->field_id = $this->field['id']; $default_titles = array( "add_slider" => "Add Slider", "add_slide" => "Add Slide", "remove_slider" => "Delete Slider", "remove_slide" => "Delete Slide", "new_slide" => "New item", ); if(!isset($this->field['titles']) || !is_array($this->field['titles'])) $this->field['titles'] = array(); $this->titles = wp_parse_args($this->field['titles'],$default_titles); include_once(ReduxFramework::$_dir. "inc/fields/editor/field_editor.php"); $this->editor_args = array( 'id' => $this->field['id'], 'name' => $this->field['id'], 'name_suffix' => '', 'class' => '', 'type' => 'editor', 'title' => __('HTML', 'redux-framework-demo'), 'subtitle' => __('', 'redux-framework-demo'), 'default' => 'Enter html code here', 'args' => array( 'teeny' => true, 'textarea_rows' => 10 ) ); $this->enqueue(); } public function blank_slider(){ } /** * Field Render Function. * * Takes the vars and outputs the HTML for the field in the settings * * @since 1.0.0 * @access public * @param bool $hidden * @return void */ public function render($hidden = false) { $this->blank_slider(); $x = 0; if(!isset($this->value['items']) || empty($this->value['items'])){ $this->value['items'] = array('1'=>array()); }else if(isset($this->value['items']['_blank'])) unset($this->value['items']['_blank']); $filed_name = $this->field['name']; echo '
' . __($this->titles['add_slider'], 'redux-framework') . '