From ff58181d5b4ddd10b34062a0ad2204435e698cae Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Wed, 10 Oct 2007 07:30:15 +0000 Subject: fixed acls, fixed transcoding issues --- lib/class/ajax.class.php | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'lib/class/ajax.class.php') diff --git a/lib/class/ajax.class.php b/lib/class/ajax.class.php index d0bf4eee..2c0c9aff 100644 --- a/lib/class/ajax.class.php +++ b/lib/class/ajax.class.php @@ -40,7 +40,7 @@ class Ajax { * observe * This returns a string with the correct and full ajax 'observe' stuff from prototype */ - public static function observe($source,$method,$action) { + public static function observe($source,$method,$action,$post='') { $non_quoted = array('document','window'); @@ -51,8 +51,13 @@ class Ajax { $source_txt = "'$source'"; } + // If it's a post then we need to stop events + if ($post) { + $action = 'Event.stop(e); ' . $action; + } + $observe = ""; return $observe; @@ -98,7 +103,7 @@ class Ajax { // Get the correct action $ajax_string = self::action($action,$source,$post); - // If they passed a span class + // If they passed a span class if ($class) { $class_txt = ' class="' . $class . '"'; } @@ -106,13 +111,13 @@ class Ajax { $string = get_user_icon($icon,$alt); - // Generate a so that it's more compliant with older browsers - // (ie :hover actions) and also to unify linkbuttons (w/o ajax) display - $string = "".$string."\n"; + // Generate a so that it's more compliant with older browsers + // (ie :hover actions) and also to unify linkbuttons (w/o ajax) display + $string = "".$string."\n"; $string .= self::observe($source,'click',$ajax_string); - return $string; + return $string; } // button @@ -126,17 +131,13 @@ class Ajax { // Format the string we wanna use $ajax_string = self::action($action,$source,$post); - //$class.= ($class?' ':'') . 'link'; - // If they passed a span class if ($class) { $class_txt = ' class="' . $class . '"'; } // If we pass a source put it in the ID - //$string = "
$text
\n"; - - $string = "$text\n"; + $string = "$text\n"; $string .= self::observe($source,'click',$ajax_string); -- cgit