path = dirname( __file__ ); // Widget variable settings $this->description = __( 'Tab Builder.', 'spyropress' ); $this->id_base = 'tab'; $this->name = __( 'Tabs', 'spyropress' ); // Templates $this->templates['view-one'] = array( 'view' => 'view-one.php', 'label' =>__( 'Style One','spyropress' ) ); $this->templates['view-two'] = array( 'view' => 'view-two.php', 'label' =>__( 'Style Two','spyropress' ) ); $this->templates['view-three'] = array( 'view' => 'view-three.php', 'label' =>__( 'Style Three','spyropress' ) ); // Fields $this->fields = array( array( 'label' => __( 'Template','spyropress' ), 'id' => 'template', 'class' => 'enable_changer section-full', 'type' => 'select', 'options' => $this->get_option_templates(), 'std' => 'view-one' ), array( 'label' => __( 'Tab Title', 'spyropress' ), 'id' => 'title', 'type' => 'text', ), array( 'label' => __( 'Tab', 'spyropress' ), 'id' => 'tabs', 'type' => 'repeater', 'item_title' => 'title', 'fields' => array( array( 'label' => __( 'Title', 'spyropress' ), 'id' => 'title', 'type' => 'text' ), array( 'label' => __( 'Sub Title', 'spyropress' ), 'id' => 'sub_title', 'class' => 'template view-three', 'type' => 'text' ), array( 'label' => __( 'Icon', 'spyropress' ), 'id' => 'icon', 'type' => 'select', 'desc' => 'Select icons for tab heading.', 'options' => spyropress_get_options_tab_icons() ), array( 'label' => __( 'Tab Bucket', 'spyropress' ), 'id' => 'bucket', 'type' => 'select', 'desc' => 'If you want to use html instead of plain text.', 'options' => spyropress_get_buckets() ), array( 'label' => __( 'Content', 'spyropress' ), 'id' => 'content', 'type' => 'textarea', 'rows' => 7 ) ) ) ); $this->create_widget(); } function widget( $args, $instance ){ // extracting info extract( $args ); extract( $instance ); $template = isset( $instance['template'] ) ? $instance['template'] : ''; if( empty( $template ) )return; // get view to render require( $this->get_view($template) ); } } //register class Spyropress_Module_Tabs spyropress_builder_register_module('Spyropress_Module_Tabs'); ?>