path = dirname( __file__ ); // Widget variable settings $this->cssclass = 'module-icon-teaser'; $this->description = __( 'Display Servivce For Clients', 'spyropress' ); $this->id_base = 'service_list'; $this->name = __( 'Icon Teaser', 'spyropress' ); $this->templates['view-one'] = array( 'view' => 'view-one.php', 'label' =>__( 'Big Icons', 'spyropress' ) ); // Templates $this->templates['view-two'] = array( 'view' => 'view-two.php', 'label' =>__( 'Box Icons', 'spyropress' ) ); $this->templates['view-three'] = array( 'view' => 'view-three.php', 'label' =>__( 'Image Big Icons', 'spyropress' ) ); $this->templates['view-four'] = array( 'view' => 'view-four.php', 'label' =>__( 'Image Box Icons', 'spyropress' ) ); $this->templates['view-five'] = array( 'view' => 'view-five.php', 'label' =>__( 'Image With Button', 'spyropress' ) ); $this->templates['view-six'] = array( 'view' => 'view-six.php', 'label' =>__( 'Image With Button & Link', 'spyropress' ) ); $this->templates['view-seven'] = array( 'view' => 'view-seven.php', 'label' =>__( 'Gallary Style', 'spyropress' ) ); // Fields $this->fields = array( array( 'label' => __( 'Template', 'spyropress' ), 'id' => 'template', 'class' => 'enable_changer section-full', 'type' => 'select', 'options' => $this->get_option_templates() ), array( 'label' => __( 'Number of Columns', 'spyropress' ), 'id' => 'columns', 'type' => 'range_slider', 'std' => 3, 'max' => 4 ), array( 'label' => __( 'Service', 'spyropress' ), 'id' => 'services', 'type' => 'repeater', 'item_title' => 'heading', 'fields' => array( array( 'id' => 'hover', 'type' => 'checkbox', 'class' => 'template view-one', 'options' => array( '1' => 'Disable hover effect' ) ), array( 'label' => __( 'Heading', 'spyropress' ), 'id' => 'heading', 'type' => 'text' ), array( 'label' => __( 'Teaser Link', 'spyropress' ), 'id' => 'teaser_link', 'class' => 'template view-one view-two view-three view-four view-five', 'type' => 'text' ), array( 'label' => __( 'Icon Style', 'spyropress' ), 'id' => 'icon-style', 'class' => 'template view-one', 'type' => 'select', 'options' => array( 'square' => __( 'Square', 'spyropress' ), 'circle' => __( 'Circle', 'spyropress' ), ),'std' => 'circle' ), array( 'label' => __( 'Icon Size', 'spyropress' ), 'id' => 'icon-size', 'class' => 'template view-two', 'type' => 'select', 'options' => array( 'small' => __( 'Small', 'spyropress' ), 'medium' => __( 'Medium', 'spyropress' ), ),'std' => 'small' ), array( 'label' => __( 'Icon', 'spyropress' ), 'id' => 'icon', 'class' => 'template view-one view-two', 'type' => 'select', 'options' => spyropress_get_options_teaser_icons() ), array( 'label' => __( 'Image', 'spyropress' ), 'id' => 'image', 'class' => 'template view-three view-five view-six', 'type' => 'upload', ), array( 'label' => __( 'Image', 'spyropress' ), 'id' => 'images', 'type' => 'repeater', 'class' => 'template view-seven', 'item_title' => 'heading', 'fields' => array( array( 'label' =>__( 'Image', 'spyropress' ), 'id' => 'image', 'type' => 'upload', ) ) ), array( 'label' => __( 'Button', 'spyropress' ), 'id' => 'buttons', 'type' => 'repeater', 'class' => 'template view-seven', 'item_title' => 'heading', 'fields' => array( array( 'id' => 'colored', 'type' => 'checkbox', 'options' => array( '1' => __( 'Colored', 'spyropress' ) ) ), array( 'label' => __( 'Button Text', 'spyropress' ), 'id' => 'btn_text', 'type' => 'text' ), array( 'label' => __( 'Button Link', 'spyropress' ), 'id' => 'btn_link', 'type' => 'text' ) ) ), array( 'label' => __( 'Icon', 'spyropress' ), 'id' => 'box-icon', 'class' => 'template view-four', 'type' => 'select', 'options' => spyropress_get_options_teaser_image_icons() ), array( 'label' => __( 'Icons Color', 'spyropress' ), 'id' => 'color', 'class' => 'template view-one view-two', 'type' => 'select', 'options' => spyropress_get_options_teaser_color(), 'std' => 'colored', ), array( 'label' => __( 'Teaser', 'spyropress' ), 'id' => 'content', 'type' => 'textarea', 'rows' => 4 ), array( 'label' => __( 'Button Setting', 'spyropress' ), 'class' => 'template view-two view-five view-six', 'type' => 'toggle', ), array( 'label' => __( 'Button Text', 'spyropress' ), 'id' => 'btn_text', 'class' => 'template view-two view-five view-six section-full', 'type' => 'text' ), array( 'label' => __( 'Button Link', 'spyropress' ), 'id' => 'btn_link', 'class' => 'template view-two view-five view-six section-full', 'type' => 'text' ), array( 'type' => 'toggle_end' ) ) ) ); $this->create_widget(); } function widget( $args, $instance ){ // extracting info extract($args); $template = isset( $instance['template'] ) ? $instance['template'] : ''; // get view to render include $this->get_view( $template ); } function big_icon_generator( $item, $atts ){ $color = ( $item['icon-style'] == 'square' && !empty( $item['hover'] ) && isset( $item['color'] ) ) ? $item['color'] .'-2' : $item['color']; $square = ( $item['icon-style'] == 'square' ) ? 'm-square' : ''; $icon = ( isset( $item['icon'] ) )? '': ''; $heading = ( isset( $item['heading'] ) )? '
' . $item['content'] . '
' . $item['content'] . '
' . $button . '' . $item['content'] . '
' . $item['content'] . '
' . $item['content'] . '
' . $button . '' . $item['content'] . '
' . $button . '' . $item['content'] . '
' . $button_content . '