/**
  * Widget.
  */
 function widget($args = array())
 {
     if (is_array($args)) {
         extract($args, EXTR_SKIP);
     }
     echo $before_widget . $before_title . $widget_name . $after_title;
     $form = new WPSDAdminConfigForm();
     if ($form->getWpsdWidgetTrends()) {
         $dao = new WPSDTrendsDao();
         $factory = new WPSDStatsFactory();
         $trends_type = $form->getWpsdTrendsType();
         if (null == $trends_type) {
             $trends_type = $factory->pagerank;
         }
         $rows = $dao->getStats($trends_type);
         $data = array();
         if (is_array($rows)) {
             foreach ($rows as $row) {
                 $data[$row->wpsd_trends_date] = $row->wpsd_trends_stats;
             }
         }
         // Default is pagerank.
         $this->render_admin('admin_trend', array('set' => $data, 'label' => 'days', 'form' => $form));
     } else {
         _e('Widget disabled check', 'wpsd');
         echo ' <a href="' . wpsd_get_settings_url() . '" title="wp-stats-dashboard settings" target="_self">' . __('settings', 'wpsd') . '</a>';
     }
     echo $after_widget;
 }
 * 
 * (default value: new WPSDAdminConfigForm())
 * 
 * @var mixed
 * @access public
 */
$form = new WPSDAdminConfigForm();
/**
 * wpsd_trends_type
 * 
 * (default value: $form->getWpsdTrendsType())
 * 
 * @var mixed
 * @access public
 */
$wpsd_trends_type = $form->getWpsdTrendsType();
/**
 * loading_img
 * 
 * (default value: '<img src="'. WPSD_PLUGIN_URL .'/resources/images/ajax-loader.gif" alt="'.__('loading', 'wpsd').'" width="24" height="24" />')
 * 
 * @var string
 * @access public
 */
$loading_img = '<img src="' . WPSD_PLUGIN_URL . '/resources/images/ajax-loader.gif" alt="' . __('loading', 'wpsd') . '" width="24" height="24" />';
?>
<style type="text/css">
.postbox .inside{ padding:5px; }
.postbox .inside a { text-decoration:none; }
</style>