Permalink
Browse files

added support for optional refresh on widgets

  • Loading branch information...
1 parent c924372 commit f6ef1a419092dca0e5e1ed231d8a8dd83b5a3a36 @rodneyshupe rodneyshupe committed Nov 11, 2010
Showing with 4 additions and 2 deletions.
  1. +4 −2 widgets.php
View
@@ -41,10 +41,12 @@ function renderWidgetHeaders($widget, $params = "") {
switch ($widget["type"]) {
case "ajax":
echo "\t\t<script type=\"text/javascript\" language=\"javascript\">\n";
+
+ $loader = (!empty($widget["loader"])) ? $widget["loader"] : "ajaxPageLoad('".$widget["call"]."', '".$widget["block"]."');";
if((int)$widget["interval"] > 0) {
- echo "\t\t\tsetInterval(\"ajaxPageLoad('".$widget["call"]."', '".$widget["block"]."')\", ".$widget["interval"].");\n";
+ echo "\t\t\tvar ".$widget["block"]."_interval = setInterval(\"".$loader."\", ".$widget["interval"].");\n";
}
- echo "\t\t\tajaxPageLoad('".$widget["call"]."', '".$widget["block"]."');\n";
+ echo "\t\t\t".$loader."\n";
echo "\t\t</script>\n";
break;
case "mixed":

0 comments on commit f6ef1a4

Please sign in to comment.