subtab_init(); $this->form_messages = array( 'success_message' => __( 'Image Title Settings successfully saved.', 'a3-responsive-slider' ), 'error_message' => __( 'Error: Image Title Settings can not save.', 'a3-responsive-slider' ), 'reset_message' => __( 'Image Title Settings successfully reseted.', 'a3-responsive-slider' ), ); add_action( $this->plugin_name . '-' . $this->form_key . '_settings_end', array( $this, 'include_script' ) ); add_action( $this->plugin_name . '_set_default_settings' , array( $this, 'set_default_settings' ) ); add_action( $this->plugin_name . '_get_all_settings' , array( $this, 'get_settings' ) ); } /*-----------------------------------------------------------------------------------*/ /* subtab_init() */ /* Sub Tab Init */ /*-----------------------------------------------------------------------------------*/ public function subtab_init() { add_filter( $this->plugin_name . '-' . $this->parent_tab . '_settings_subtabs_array', array( $this, 'add_subtab' ), $this->position ); } /*-----------------------------------------------------------------------------------*/ /* set_default_settings() /* Set default settings with function called from Admin Interface */ /*-----------------------------------------------------------------------------------*/ public function set_default_settings() { global $a3_responsive_slider_admin_interface; $a3_responsive_slider_admin_interface->reset_settings( $this->form_fields, $this->option_name, false ); } /*-----------------------------------------------------------------------------------*/ /* get_settings() /* Get settings with function called from Admin Interface */ /*-----------------------------------------------------------------------------------*/ public function get_settings() { global $a3_responsive_slider_admin_interface; $a3_responsive_slider_admin_interface->get_settings( $this->form_fields, $this->option_name ); } /** * subtab_data() * Get SubTab Data * ============================================= * array ( * 'name' => 'my_subtab_name' : (required) Enter your subtab name that you want to set for this subtab * 'label' => 'My SubTab Name' : (required) Enter the subtab label * 'callback_function' => 'my_callback_function' : (required) The callback function is called to show content of this subtab * ) * */ public function subtab_data() { $subtab_data = array( 'name' => 'title', 'label' => __( 'Image Title', 'a3-responsive-slider' ), 'callback_function' => 'a3_responsive_sider_template_1_title_settings_form', ); if ( $this->subtab_data ) return $this->subtab_data; return $this->subtab_data = $subtab_data; } /*-----------------------------------------------------------------------------------*/ /* add_subtab() */ /* Add Subtab to Admin Init /*-----------------------------------------------------------------------------------*/ public function add_subtab( $subtabs_array ) { if ( ! is_array( $subtabs_array ) ) $subtabs_array = array(); $subtabs_array[] = $this->subtab_data(); return $subtabs_array; } /*-----------------------------------------------------------------------------------*/ /* settings_form() */ /* Call the form from Admin Interface /*-----------------------------------------------------------------------------------*/ public function settings_form() { global $a3_responsive_slider_admin_interface; $output = ''; $output .= $a3_responsive_slider_admin_interface->admin_forms( $this->form_fields, $this->form_key, $this->option_name, $this->form_messages ); return $output; } /*-----------------------------------------------------------------------------------*/ /* init_form_fields() */ /* Init all fields of this form */ /*-----------------------------------------------------------------------------------*/ public function init_form_fields() { // Define settings $this->form_fields = apply_filters( $this->option_name . '_settings_fields', array( array( 'name' => __( 'Image Title Settings', 'a3-responsive-slider' ), 'type' => 'heading', ), array( 'name' => __( 'Title', 'a3-responsive-slider' ), 'id' => 'enable_slider_title', 'class' => 'enable_slider_title', 'type' => 'onoff_checkbox', 'default' => 1, 'checked_value' => 1, 'unchecked_value' => 0, 'checked_label' => __( 'ON', 'a3-responsive-slider' ), 'unchecked_label' => __( 'OFF', 'a3-responsive-slider' ), ), array( 'type' => 'heading', 'class' => 'slider_title_container' ), array( 'name' => __( 'Title Position', 'a3-responsive-slider' ), 'id' => 'title_position', 'type' => 'select', 'default' => 'top-right', 'options' => array( 'top-left' => __( 'Top Left', 'a3-responsive-slider' ), 'top-right' => __( 'Top Right', 'a3-responsive-slider' ), 'bottom-left' => __( 'Bottom Left', 'a3-responsive-slider' ), 'bottom-right' => __( 'Bottom Right', 'a3-responsive-slider' ), ), 'css' => 'width:160px;', ), array( 'name' => __( 'Title Container Maximum Wide', 'a3-responsive-slider' ), 'desc' => '%.', 'id' => 'title_wide', 'type' => 'slider', 'default' => 60, 'min' => 20, 'max' => 100, 'increment' => 1, ), array( 'name' => __( 'Title Font', 'a3-responsive-slider' ), 'id' => 'title_font', 'type' => 'typography', 'default' => array( 'size' => '18px', 'line_height' => '1.4em', 'face' => 'Arial, sans-serif', 'style' => 'bold', 'color' => '#FFFFFF' ) ), array( 'name' => __( 'Title Hover Colour', 'a3-responsive-slider' ), 'id' => 'title_font_hover_color', 'type' => 'color', 'default' => '#F1F1F1' ), array( 'name' => __( 'Title Container Background Colour', 'a3-responsive-slider' ), 'desc' => __( 'Default', 'a3-responsive-slider' ) . ' [default_value]', 'id' => 'title_background_colour', 'type' => 'color', 'default' => '#000000' ), array( 'name' => __( 'Title Container Background Transparency', 'a3-responsive-slider' ), 'desc' => __( 'Scale - 0 = 100% transparent - 100 = 100% Solid Colour.', 'a3-responsive-slider' ), 'id' => 'title_background_transparency', 'type' => 'slider', 'default' => 60, 'min' => 0, 'max' => 100, 'increment' => 10, ), array( 'name' => __( 'Title Container Border', 'a3-responsive-slider' ), 'id' => 'title_border', 'type' => 'border', 'default' => array( 'width' => '0px', 'style' => 'solid', 'color' => '#000000', 'corner' => 'rounded' , 'rounded_value' =>4 ) ), array( 'name' => __( 'Title Container Shadow', 'a3-responsive-slider' ), 'id' => 'title_shadow', 'type' => 'box_shadow', 'default' => array( 'enable' => 0, 'h_shadow' => '5px' , 'v_shadow' => '5px', 'blur' => '2px' , 'spread' => '2px', 'color' => '#DBDBDB', 'inset' => '' ) ), )); } public function include_script() { ?> settings_form(); } ?>