mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 09:04:53 +01:00
Formatting
This commit is contained in:
parent
375750ea7e
commit
a2c0d12173
@ -23,19 +23,22 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
class graphics
|
||||
{
|
||||
// put a valid font here
|
||||
class graphics
|
||||
{
|
||||
/* put a valid font here */
|
||||
var $font="/opt/future-project/src/management-server/ttf/arial.ttf";
|
||||
|
||||
function createImage($_text, $_fontsize=11)
|
||||
{
|
||||
// create filename
|
||||
$filename="button_".md5($_text).".png";
|
||||
$filename=strtolower($filename);
|
||||
/* create filename */
|
||||
$filename = 'button_' . md5($_text) . '.png';
|
||||
$filename = strtolower($filename);
|
||||
|
||||
// see if file exists already, we cache it
|
||||
if (file_exists(PHPGW_IMAGES_FILEDIR.'/'.$filename)) return $filename;
|
||||
/* see if file exists already, we cache it */
|
||||
if (file_exists(PHPGW_IMAGES_FILEDIR.'/'.$filename))
|
||||
{
|
||||
return $filename;
|
||||
}
|
||||
|
||||
$size = imagettfbbox($_fontsize,0,$this->font,$_text);
|
||||
$dx = abs($size[2]-$size[0]);
|
||||
@ -58,7 +61,7 @@ class graphics
|
||||
|
||||
function createInputButton($_text, $_name, $_mode='graphic')
|
||||
{
|
||||
if ($_mode == 'graphic' && extension_loaded("gd"))
|
||||
if ($_mode == 'graphic' && extension_loaded('gd'))
|
||||
{
|
||||
return '<input type="image" src="/phpgroupware/phpgwapi/templates/default/images/'.$this->createImage($_text).'" border="0" name="'.$_name.'">';
|
||||
}
|
||||
@ -73,7 +76,10 @@ class graphics
|
||||
function parseHTTPPostVars()
|
||||
{
|
||||
// execute only if libgd support is enabled
|
||||
if (!extension_loaded("gd")) return;
|
||||
if (!extension_loaded('gd'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
global $HTTP_POST_VARS;
|
||||
|
||||
@ -87,12 +93,7 @@ class graphics
|
||||
global $$name;
|
||||
$$name = "content generated by parseHTTPPostVars()";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user