Chartbeat_Widget::widget PHP Method

widget() public method

public widget ( $args, $instance )
    function widget($args, $instance)
    {
        extract($args);
        echo $before_widget;
        $api_key = get_option('chartbeat_apikey');
        $widget_config = get_option('chartbeat_widgetconfig');
        if ($api_key) {
            ?>
			<div id="cb_top_pages"></div>
			<script type="text/javascript">
				var options = { };
				new CBTopPagesWidget( <?php 
            echo json_encode(json_decode(get_option('chartbeat_widgetconfig')));
            ?>
 );
			</script>
			<?php 
        }
        echo $after_widget;
    }
Chartbeat_Widget