"altos-widgets-charts-widget", "description" => "Altos Charts");
$control_ops = array ("width" => 300, "id_base" => "altos_widgets_charts_widget");
$this->WP_Widget ($control_ops["id_base"], "Altos Charts", $widget_ops, $control_ops);
/**/
return;
}
/*
Widget display function. This is where the widget actually does something.
*/
function widget ($args = FALSE, $instance = FALSE)
{
extract ($args);
/**/
global $Altos_Widgets;
/**/
$widget_options = (is_array ($instance) && !empty ($instance)) ? $instance : array();
/**/
if ($Altos_Widgets->is_authenticated () && is_array ($widget_options["charturls"]))
{
echo $before_widget . $before_title . $widget_options["title"] . $after_title;
/**/
echo ($widget_options["url"]) ? '' : '';
/**/
echo '';
/**/
echo ($widget_options["url"]) ? '' : '';
/**/
echo $after_widget;
}
}
/*
Widget form control function. This is where options are made configurable.
*/
function form ($instance = FALSE)
{
global $Altos_Widgets;
/**/
$widget_options = (is_array ($instance) && !empty ($instance)) ? $instance : array();
/**/
if ($Altos_Widgets->is_authenticated ())
{
echo '
'; echo ''; echo '
'; /**/ echo ''; echo ' [?]'; echo '
'; echo ''; echo '
'; /**/ echo ''; echo ''; echo '
'; /**/ echo ''; echo ''; echo '
'; /**/ echo ''; echo ''; echo '
'; /**/ echo ''; echo ''; echo '
'; /**/ echo ''; echo ''; echo '
'; /**/ echo ''; echo ''; echo '
'; } else { $Altos_Widgets->login_form (); } } /* Widget update function. This is where an updated instance is configured/stored. */ function update ($instance = FALSE, $old = FALSE) { global $Altos_Widgets; /**/ $widget_options = stripslashes_deep ($instance); /**/ $widget_options["charturls"] = array (); /* Reset array. */ /**/ foreach ((array)$widget_options["st,cid,zid"] as $st_cid_zid) { list ($widget_options["st"], $widget_options["cid"], $widget_options["zid"]) = explode (",", $st_cid_zid); /**/ $charturl = $Altos_Widgets->get_state_city_zip_chart_url ($widget_options["st"], $widget_options["cid"], $widget_options["zid"], $widget_options["s"], $widget_options["sz"], $widget_options["rt"], $widget_options["ra"], $widget_options["q"], $widget_options["ts"]); /**/ if ($Altos_Widgets->has_error ($charturl)) { $Altos_Widgets->print_error_message ($charturl); return $old; /* Revert to previous options. */ } /**/ $widget_options["charturls"][] = $charturl->response->url; } /**/ return $widget_options; } } ?>