path = dirname( __file__ );
// Widget variable settings
$this->cssclass = 'module-heading';
$this->description = __( 'Add headings into the page layout wherever needed.','spyropress' );
$this->id_base = 'spyropress_heading';
$this->name = __( 'Heading', 'spyropress' );
// Templates
$this->templates['view-one'] = array( 'view' => 'view.php', 'label' =>__( 'Style One', 'spyropress' ) );
$this->templates['view-two'] = array( 'view' => 'view-two.php', 'label' =>__( 'Style Two', 'spyropress' ) );
// Fields
$this->fields = array(
array(
'label' => __( 'Template', 'spyropress' ),
'id' => 'template',
'class' => 'enable_changer section-full',
'type' => 'select',
'options' => $this->get_option_templates()
),
array(
'id' => 'uppercase',
'type' => 'checkbox',
'class' => 'template view-one section-full',
'options' => array(
'1' =>__( 'unable Heading Style Uppercase Letter', 'spyropress' )
)
),
array(
'label' => __( 'Heading Title', 'spyropress' ),
'id' => 'title',
'type' => 'text',
),
array(
'id' => 'align',
'type' => 'checkbox',
'class' => 'template view-two section-full',
'options' => array(
'centered' => __( 'Unable Title Align Center', 'spyropress' )
)
),
array(
'label' => __( 'HTML Tag', 'spyropress' ),
'id' => 'html_tag',
'type' => 'select',
'options' => array(
1 => __( 'H1', 'spyropress' ),
2 => __( 'H2', 'spyropress' ),
3 => __( 'H3', 'spyropress' ),
4 => __( 'H4', 'spyropress' ),
5 => __( 'H5', 'spyropress' ),
6 => __( 'H6', 'spyropress' )
),'std' => 2
),
array(
'label' => __( 'Heading Text', 'spyropress' ),
'id' => 'heading',
'class' => 'template view-one section-full',
'type' => 'text',
),
);
$this->create_widget();
}
function widget( $args, $instance ){
// extracting info
extract( $args ); extract( $instance );
$template = isset( $instance['template'] ) ? $instance['template'] : '';
// get view to render
include $this->get_view( $template );
}
}
//register class Spyropress_Module_Heading
spyropress_builder_register_module('Spyropress_Module_Heading');
?>