From fe077220bf08ac7ad466e6fdfe88197c6d4ed56e Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Mon, 6 Aug 2007 04:22:19 +0000 Subject: broke a ton of stuff, but added some hotness... yes that is an excuse --- lib/class/ajax.class.php | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) (limited to 'lib/class/ajax.class.php') diff --git a/lib/class/ajax.class.php b/lib/class/ajax.class.php index 441d9a47..5185538a 100644 --- a/lib/class/ajax.class.php +++ b/lib/class/ajax.class.php @@ -42,8 +42,17 @@ class Ajax { */ public static function observe($source,$method,$action) { + $non_quoted = array('document','window'); + + if (in_array($source,$non_quoted)) { + $source_txt = $source; + } + else { + $source_txt = "'$source'"; + } + $observe = "\n"; return $observe; @@ -59,11 +68,20 @@ class Ajax { $url = Config::get('ajax_url') . $action; + $non_quoted = array('document','window'); + + if (in_array($source,$non_quoted)) { + $source_txt = $source; + } + else { + $source_txt = "'$source'"; + } + if ($post) { - $ajax_string = "ajaxPost('$url','$post','$source')"; + $ajax_string = "ajaxPost('$url','$post',$source_txt)"; } else { - $ajax_string = "ajaxPut('$url','$source')"; + $ajax_string = "ajaxPut('$url',$source_txt)"; } return $ajax_string; @@ -112,5 +130,17 @@ class Ajax { } // text + /** + * run + * This runs the specified action no questions asked + */ + public static function run($action) { + + echo ""; + + } // run + } // end Ajax class ?> -- cgit