path = dirname( __file__ ); $this->description = __( 'Add google map markers work with google map row only.','spyropress' ); $this->id_base = 'gmap_markers'; $this->name = __( 'Google Map Markers', 'spyropress' ); // Fields $this->fields = array( array( 'labels' => __( 'Layout', 'spyropress' ), 'id' => 'layout', 'type' => 'select', 'options' => array( 'full' => __( 'Full Width', 'spyropress' ), 'page' => __( 'page Width', 'spyropress' ) ),'std' => 'page' ), array( 'labels' => __( 'Address', 'spyropress' ), 'id' => 'address', 'type' => 'text', ) ); $this->create_widget(); } function widget( $args, $instance ){ // extracting info extract( $args ); extract( $instance ); if ( empty( $address ) )return; // enqueue javascript file wp_enqueue_script( 'gmap-api' ); wp_enqueue_script( 'jquery-gmap' ); $take_out = ( $layout == 'full' ) ? 'take-out' : ''; $shadow_class = ( $layout == 'full' ) ? 'top-shadow' : 'full-shadow'; $style = ( $layout == 'full' ) ? 'width: 100%; height: 400px;' :'width: 100%; padding-top: 40%; margin-bottom: 40px;'; echo $before_widget; ?>