'); $instance['show_title'] = (boolean) strip_tags($new_instance['show_title']); $overflow = strip_tags($new_instance['overflow']); if (empty($overflow)) { $instance['overflow'] = 'auto'; } else { $instance['overflow'] = $overflow; } $instance['powered_by'] = (boolean) strip_tags($new_instance['powered_by']); $theme = strip_tags($new_instance['theme']); if (empty($theme)) { $instance['theme'] = 'full'; } else { $instance['theme'] = $theme; } $max_height = (int) trim(strip_tags($new_instance['max_height'])); if ($max_height < 1) { $instance['max_height'] = '10000px'; } else { $instance['max_height'] = $max_height . "px"; } $instance['before_text'] = strip_tags($new_instance['before_text'], '
'); $instance['after_text'] = strip_tags($new_instance['after_text'], '
'); $instance['report_id'] = strip_tags($new_instance['report_id']); return $instance; } /** @see WP_Widget::form -- do not rename this */ function form($instance) { $title = esc_attr($instance['title'] === null ? __("SEO Report") : $instance['title']); $show_title = esc_attr($instance['show_title'] === null ? 1 : $instance['show_title']); $report_id = esc_attr($instance['report_id']); $overflow = esc_attr($instance['overflow']); $powered_by = esc_attr($instance['powered_by'] === null ? 1 : $instance['powered_by']); $theme = esc_attr($instance['theme']); $after_text = esc_attr($instance['after_text']); $before_text = esc_attr($instance['before_text']); $max_height = esc_attr($instance['max_height'] === null ? "10000px" : $instance['max_height']); ?>


- Ajax load Report details here -

/>

/>

'; echo $before_widget; if (($title && $show_title)) { echo $before_title . $title . $after_title; } echo '
' . $before_text . '
'; echo '
'; //Call the Report viewer global $sat_action, $sat_subaction, $sat_theme; $sat_action = SAT_ACT_REPORT; $sat_subaction = $report_id; $sat_theme = $theme; sat_act_report(); //End of the viewer echo '
'; echo '
' . $after_text . '
'; if ($powered_by) { echo '
Powered by  
'; } echo $after_widget; echo ''; $out = ob_get_contents(); ob_end_clean(); return $out; } function sat_view_report_shortcode($atts, $content = null) { $empty_data = array('after_widget' => '', 'before_widget' => $content, 'before_title' => '

', 'after_title' => '

'); return sat_view_report_generic($empty_data, $atts); } function sat_register_shortcode_view_report() { add_shortcode('view-report', 'sat_view_report_shortcode'); } // Add the widget and shortcode to WP add_action('widgets_init', create_function('', 'return register_widget("sat_view_report_widget");')); add_action('init', 'sat_register_shortcode_view_report');