more exetensions to my graphics class

This commit is contained in:
Lars Kneschke 2001-02-14 20:55:10 +00:00
parent a5c016a725
commit 2222b135ef
3 changed files with 31 additions and 3 deletions

View File

@ -18,11 +18,12 @@
$button = CreateObject('phpgwapi.graphics');
$button->parseHTTPPostVars();
$button->createInputButton(lang('save'), 'save');
if (isset($submit)) print "it workied<br>";
if (isset($submit)) print "is worked $submit<br>";
print "<form>";
print "<form method=post>";
print $button->createInputButton("Lars is the best ;)",'submit');
print "<br>the same as ascii<br>";
print $button->createInputButton("Lars is the best ;)",'submit','ascii');

View File

@ -67,5 +67,32 @@ class graphics
return '<input type="submit" value="'.$_text.'" name="'.$_name.'">';
}
}
// 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()";
}
}
}
}
}

View File

@ -178,4 +178,4 @@
}
}
} //end of preferences class
?>
?>