From 2222b135efb87b67cadd3b3d0df58d1b3174a242 Mon Sep 17 00:00:00 2001 From: Lars Kneschke Date: Wed, 14 Feb 2001 20:55:10 +0000 Subject: [PATCH] more exetensions to my graphics class --- admin/testbutton.php | 5 +++-- phpgwapi/inc/class.graphics.inc.php | 27 ++++++++++++++++++++++++++ phpgwapi/inc/class.preferences.inc.php | 2 +- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/admin/testbutton.php b/admin/testbutton.php index 59c574df04..78f3b4f624 100755 --- a/admin/testbutton.php +++ b/admin/testbutton.php @@ -18,11 +18,12 @@ $button = CreateObject('phpgwapi.graphics'); + $button->parseHTTPPostVars(); $button->createInputButton(lang('save'), 'save'); - if (isset($submit)) print "it workied
"; + if (isset($submit)) print "is worked $submit
"; - print "
"; + print ""; print $button->createInputButton("Lars is the best ;)",'submit'); print "
the same as ascii
"; print $button->createInputButton("Lars is the best ;)",'submit','ascii'); diff --git a/phpgwapi/inc/class.graphics.inc.php b/phpgwapi/inc/class.graphics.inc.php index 450457e793..f74a1aaf0a 100644 --- a/phpgwapi/inc/class.graphics.inc.php +++ b/phpgwapi/inc/class.graphics.inc.php @@ -67,5 +67,32 @@ class graphics return ''; } } + + // this function checks, if there is a variable $aaa_x and $aaa_y + // if so, it will create a new variable $aaa + function parseHTTPPostVars() + { + // execute only if libgd support is enabled + if (!extension_loaded("gd")) return; + + global $HTTP_POST_VARS; + + if (is_array($HTTP_POST_VARS)) + { + while( list($key, $val) = each($HTTP_POST_VARS)) + { + if (ereg("(.*)_x",$key,$varName) && $HTTP_POST_VARS[$varName[1]."_y"]) + { + $name = $varName[1]; + global $$name; + $$name = "content generated by parseHTTPPostVars()"; + } + + } + } + + + + } } diff --git a/phpgwapi/inc/class.preferences.inc.php b/phpgwapi/inc/class.preferences.inc.php index bff9d3763b..bab1aef5d3 100644 --- a/phpgwapi/inc/class.preferences.inc.php +++ b/phpgwapi/inc/class.preferences.inc.php @@ -178,4 +178,4 @@ } } } //end of preferences class -?> \ No newline at end of file +?>