__( 'Show Ad or Group of Ads on website via Widget and Sidebar', 'adfoxly' ), )
);
}
/**
* display widget ad
*/
public function widget( $args, $instance ) {
$id = $instance[ 'adfoxly_adzone' ];
$data = explode("_", $id);
echo $args[ 'before_widget' ];
if ( $data[ 0 ] === 'group' ) {
$id = $data[ 1 ];
$display = new GroupController();
echo $display->renderGroup( $id );
// } else if ( $data[ 0 ] === 'ad' ) {
// todo: temporary removed option in widget showing single ad. only groups
// $id = $data[ 1 ];
// $display = new PlacesController();
// echo $display->renderPlace( $id );
}
echo $args[ 'after_widget' ];
}
/**
* widget form
*/
public function form( $instance ) {
if ( isset( $instance[ 'adfoxly_adzone' ] ) ) {
$widgetAdzone = $instance[ 'adfoxly_adzone' ];
} else {
$widgetAdzone = __( 'Select Ad or Group of Ads', 'adfoxly' );
}
?>