phpgw->egw

This commit is contained in:
Miles Lott 2005-11-26 14:25:39 +00:00
parent a828b3cf85
commit bcacc1ef46
8 changed files with 163 additions and 165 deletions

View File

@ -38,7 +38,7 @@ class html
*/ */
var $prefered_img_title; var $prefered_img_title;
/** /**
* charset used by the page, as returned by $GLOBALS['phpgw']->translation->charset() * charset used by the page, as returned by $GLOBALS['egw']->translation->charset()
* @var string * @var string
*/ */
var $charset; var $charset;
@ -53,7 +53,6 @@ class html
*/ */
var $wz_tooltip_included = False; var $wz_tooltip_included = False;
/** /**
* Constructor: initialised the class-vars * Constructor: initialised the class-vars
*/ */
@ -72,11 +71,11 @@ class html
$this->prefered_img_title = $this->netscape4 ? 'alt' : 'title'; $this->prefered_img_title = $this->netscape4 ? 'alt' : 'title';
//echo "<p>HTTP_USER_AGENT='$_SERVER[HTTP_USER_AGENT]', UserAgent: '$this->user_agent', Version: '$this->ua_version', img_title: '$this->prefered_img_title'</p>\n"; //echo "<p>HTTP_USER_AGENT='$_SERVER[HTTP_USER_AGENT]', UserAgent: '$this->user_agent', Version: '$this->ua_version', img_title: '$this->prefered_img_title'</p>\n";
if ($GLOBALS['phpgw']->translation) if ($GLOBALS['egw']->translation)
{ {
$this->charset = $GLOBALS['phpgw']->translation->charset(); $this->charset = $GLOBALS['egw']->translation->charset();
} }
$this->phpgwapi_js_url = $GLOBALS['phpgw_info']['server']['webserver_url'].'/phpgwapi/js'; $this->phpgwapi_js_url = $GLOBALS['egw_info']['server']['webserver_url'].'/phpgwapi/js';
} }
/** /**
@ -115,9 +114,9 @@ class html
{ {
if (!$this->wz_tooltip_included) if (!$this->wz_tooltip_included)
{ {
if (!strstr('wz_tooltip',$GLOBALS['phpgw_info']['flags']['need_footer'])) if (!strstr('wz_tooltip',$GLOBALS['egw_info']['flags']['need_footer']))
{ {
$GLOBALS['phpgw_info']['flags']['need_footer'] .= '<script language="JavaScript" type="text/javascript" src="'.$this->phpgwapi_js_url.'/wz_tooltip/wz_tooltip.js"></script>'."\n"; $GLOBALS['egw_info']['flags']['need_footer'] .= '<script language="JavaScript" type="text/javascript" src="'.$this->phpgwapi_js_url.'/wz_tooltip/wz_tooltip.js"></script>'."\n";
} }
$this->wz_tooltip_included = True; $this->wz_tooltip_included = True;
} }
@ -450,14 +449,14 @@ class html
function init_tinymce() function init_tinymce()
{ {
/* do stuff once */ /* do stuff once */
if (!is_object($GLOBALS['phpgw']->js)) if (!is_object($GLOBALS['egw']->js))
{ {
$GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript'); $GLOBALS['egw']->js = CreateObject('phpgwapi.javascript');
} }
if (!strstr($GLOBALS['phpgw_info']['flags']['java_script'],'tinyMCE')) if (!strstr($GLOBALS['egw_info']['flags']['java_script'],'tinyMCE'))
{ {
$GLOBALS['phpgw']->js->validate_file('tinymce','jscripts/tiny_mce/tiny_mce'); $GLOBALS['egw']->js->validate_file('tinymce','jscripts/tiny_mce/tiny_mce');
} }
} }
@ -601,7 +600,7 @@ class html
{ {
$image = str_replace(array('.gif','.GIF','.png','.PNG'),'',$image); $image = str_replace(array('.gif','.GIF','.png','.PNG'),'',$image);
if (!($path = $GLOBALS['phpgw']->common->image($app,$image))) if (!($path = $GLOBALS['egw']->common->image($app,$image)))
{ {
$path = $image; // name may already contain absolut path $path = $image; // name may already contain absolut path
} }
@ -657,7 +656,7 @@ class html
parse_str($v,$v); parse_str($v,$v);
$vars += $v; $vars += $v;
} }
return $GLOBALS['phpgw']->link($url,$vars); return $GLOBALS['egw']->link($url,$vars);
} }
/** /**
@ -854,7 +853,7 @@ class html
} }
if (is_array($name)) // menuaction and other get-vars if (is_array($name)) // menuaction and other get-vars
{ {
$name = $GLOBALS['phpgw']->link('/index.php',$name); $name = $GLOBALS['egw']->link('/index.php',$name);
} }
if ($name[0] == '/' || substr($name,0,7) == 'http://' || substr($name,0,8) == 'https://') if ($name[0] == '/' || substr($name,0,7) == 'http://' || substr($name,0,8) == 'https://')
{ {
@ -864,15 +863,15 @@ class html
{ {
$name = str_replace(array('.gif','.GIF','.png','.PNG'),'',$name); $name = str_replace(array('.gif','.GIF','.png','.PNG'),'',$name);
if (!($url = $GLOBALS['phpgw']->common->image($app,$name))) if (!($url = $GLOBALS['egw']->common->image($app,$name)))
{ {
$url = $name; // name may already contain absolut path $url = $name; // name may already contain absolut path
} }
if(!$GLOBALS['phpgw_info']['server']['webserver_url']) if(!$GLOBALS['egw_info']['server']['webserver_url'])
{ {
$base_path = "./"; $base_path = "./";
} }
if (!@is_readable($base_path . str_replace($GLOBALS['phpgw_info']['server']['webserver_url'],PHPGW_SERVER_ROOT,$url))) if (!@is_readable($base_path . str_replace($GLOBALS['egw_info']['server']['webserver_url'],PHPGW_SERVER_ROOT,$url)))
{ {
// if the image-name is a percentage, use a progressbar // if the image-name is a percentage, use a progressbar
if (substr($name,-1) == '%' && is_numeric($percent = substr($name,0,-1))) if (substr($name,-1) == '%' && is_numeric($percent = substr($name,0,-1)))
@ -992,9 +991,9 @@ class html
*/ */
function theme2css() function theme2css()
{ {
return ".th { background: ".$GLOBALS['phpgw_info']['theme']['th_bg']."; }\n". return ".th { background: ".$GLOBALS['egw_info']['theme']['th_bg']."; }\n".
".row_on,.th_bright { background: ".$GLOBALS['phpgw_info']['theme']['row_on']."; }\n". ".row_on,.th_bright { background: ".$GLOBALS['egw_info']['theme']['row_on']."; }\n".
".row_off { background: ".$GLOBALS['phpgw_info']['theme']['row_off']."; }\n"; ".row_off { background: ".$GLOBALS['egw_info']['theme']['row_off']."; }\n";
} }
/** /**

View File

@ -29,15 +29,15 @@
*/ */
function jscalendar($do_header=True,$path='jscalendar') function jscalendar($do_header=True,$path='jscalendar')
{ {
$this->jscalendar_url = $GLOBALS['phpgw_info']['server']['webserver_url'].'/phpgwapi/js/'.$path; $this->jscalendar_url = $GLOBALS['egw_info']['server']['webserver_url'].'/phpgwapi/js/'.$path;
$this->dateformat = $GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']; $this->dateformat = $GLOBALS['egw_info']['user']['preferences']['common']['dateformat'];
if ($do_header && !strstr($GLOBALS['phpgw_info']['flags']['java_script'],'jscalendar')) if ($do_header && !strstr($GLOBALS['egw_info']['flags']['java_script'],'jscalendar'))
{ {
$GLOBALS['phpgw_info']['flags']['java_script'] .= $GLOBALS['egw_info']['flags']['java_script'] .=
'<link rel="stylesheet" type="text/css" media="all" href="'.$this->jscalendar_url.'/calendar-blue.css" title="blue" /> '<link rel="stylesheet" type="text/css" media="all" href="'.$this->jscalendar_url.'/calendar-blue.css" title="blue" />
<script type="text/javascript" src="'.$this->jscalendar_url.'/calendar.js"></script> <script type="text/javascript" src="'.$this->jscalendar_url.'/calendar.js"></script>
<script type="text/javascript" src="'.ereg_replace('[?&]*click_history=[0-9a-f]*','',$GLOBALS['phpgw']->link('/phpgwapi/inc/jscalendar-setup.php')).'"></script> <script type="text/javascript" src="'.ereg_replace('[?&]*click_history=[0-9a-f]*','',$GLOBALS['egw']->link('/phpgwapi/inc/jscalendar-setup.php')).'"></script>
'; ';
} }
} }
@ -85,17 +85,16 @@
if ($jsreturn) if ($jsreturn)
{ {
$return_array = array( $return_array = array(
'html' => '<input type="text" id="'.$name.'" name="'.$name.'" size="10" value="'.$date.'"'.$options.'/><img id="'.$name.'-trigger" src="'.$GLOBALS['phpgw']->common->find_image('phpgwpai','datepopup').'" title="'.lang('Select date').'" style="cursor:pointer; cursor:hand;"/>', 'html' => '<input type="text" id="'.$name.'" name="'.$name.'" size="10" value="'.$date.'"'.$options.'/><img id="'.$name.'-trigger" src="'.$GLOBALS['egw']->common->find_image('phpgwpai','datepopup').'" title="'.lang('Select date').'" style="cursor:pointer; cursor:hand;"/>',
'js' => 'Calendar.setup({inputField : "'.$name.'",button: "'.$name.'-trigger" });' 'js' => 'Calendar.setup({inputField : "'.$name.'",button: "'.$name.'-trigger" });'
); );
return $return_array; return $return_array;
} }
return return
'<input type="text" id="'.$name.'" name="'.$name.'" size="10" value="'.$date.'"'.$options.'/> '<input type="text" id="'.$name.'" name="'.$name.'" size="10" value="'.$date.'"'.$options.'/>
<script type="text/javascript"> <script type="text/javascript">
document.writeln(\'<img id="'.$name.'-trigger" src="'.$GLOBALS['phpgw']->common->find_image('phpgwpai','datepopup').'" title="'.lang('Select date').'" style="cursor:pointer; cursor:hand;"/>\'); document.writeln(\'<img id="'.$name.'-trigger" src="'.$GLOBALS['egw']->common->find_image('phpgwpai','datepopup').'" title="'.lang('Select date').'" style="cursor:pointer; cursor:hand;"/>\');
Calendar.setup( Calendar.setup(
{ {
inputField : "'.$name.'", inputField : "'.$name.'",

View File

@ -30,7 +30,7 @@
var $mime_magic_file; var $mime_magic_file;
/** /**
* Wrapper to PHP5 Compatiable Constructor * Wrapper to PHP5 Compatible Constructor
* *
* @author skwashd * @author skwashd
@ -198,14 +198,14 @@
*/ */
function analyze_data($data) function analyze_data($data)
{ {
if(!is_writeable(@$GLOBALS['phpgw_info']['server']['temp_dir'])) if(!is_writeable(@$GLOBALS['egw_info']['server']['temp_dir']))
{ {
//nothing we can do but bail out //nothing we can do but bail out
return false; return false;
} }
mt_srand(time()); mt_srand(time());
$filename = $GLOBALS['phpgw_info']['server']['temp_dir'] . SEP $filename = $GLOBALS['egw_info']['server']['temp_dir'] . SEP
. md5( time() + mt_rand() ) . '.tmp'; . md5( time() + mt_rand() ) . '.tmp';
$fp = @fopen($filename, 'ab'); $fp = @fopen($filename, 'ab');

View File

@ -54,8 +54,8 @@
function pdf() function pdf()
{ {
parent::FPDF(); parent::FPDF();
$this->SetCreator('eGroupWare '.$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']); $this->SetCreator('eGroupWare '.$GLOBALS['egw_info']['server']['versions']['phpgwapi']);
$this->SetAuthor($GLOBALS['phpgw']->common->display_fullname()); $this->SetAuthor($GLOBALS['egw']->common->display_fullname());
} }
//Page footer //Page footer

View File

@ -26,7 +26,7 @@
{ {
function service_contacts() function service_contacts()
{ {
$this->provider = $GLOBALS['phpgw_info']['contact_service'] ? $GLOBALS['phpgw_info']['contact_service'] : 'addressbook'; $this->provider = $GLOBALS['egw_info']['contact_service'] ? $GLOBALS['egw_info']['contact_service'] : 'addressbook';
$this->svc = $this->provider . '.bo' . $this->provider; $this->svc = $this->provider . '.bo' . $this->provider;
$type = $this->type ? $this->type : 'xmlrpc'; $type = $this->type ? $this->type : 'xmlrpc';
$this->function_map = ExecMethod($this->svc . '.list_methods',$type); $this->function_map = ExecMethod($this->svc . '.list_methods',$type);

View File

@ -26,7 +26,7 @@
{ {
function service_schedule() function service_schedule()
{ {
$this->provider = $GLOBALS['phpgw_info']['schedule_service'] ? $GLOBALS['phpgw_info']['schedule_service'] : 'calendar'; $this->provider = $GLOBALS['egw_info']['schedule_service'] ? $GLOBALS['egw_info']['schedule_service'] : 'calendar';
$this->svc = $this->provider . '.bo' . $this->provider; $this->svc = $this->provider . '.bo' . $this->provider;
$type = $this->type ? $this->type : 'xmlrpc'; $type = $this->type ? $this->type : 'xmlrpc';
$this->function_map = ExecMethod($this->svc . '.list_methods',$type); $this->function_map = ExecMethod($this->svc . '.list_methods',$type);

View File

@ -140,7 +140,7 @@
. " HTTP/1.0\r\n" . " HTTP/1.0\r\n"
. 'User-Agent: eGroupware/' . $cliversion . '(PHP) ' . "\r\n" . 'User-Agent: eGroupware/' . $cliversion . '(PHP) ' . "\r\n"
. 'X-EGW-Server: ' . $this->server . "\r\n" . 'X-EGW-Server: ' . $this->server . "\r\n"
. 'X-EGW-Version: ' . $GLOBALS['phpgw_info']['server']['versions']['phpgwapi'] . "\r\n" . 'X-EGW-Version: ' . $GLOBALS['egw_info']['server']['versions']['phpgwapi'] . "\r\n"
. 'Host: '.$this->server . "\r\n" . 'Host: '.$this->server . "\r\n"
. $credentials . $credentials
. "Content-Type: text/xml\r\nContent-Length: " . strlen($soap_data) . "\r\n" . "Content-Type: text/xml\r\nContent-Length: " . strlen($soap_data) . "\r\n"
@ -191,7 +191,7 @@
. " HTTP/1.0\r\n" . " HTTP/1.0\r\n"
. 'User-Agent: eGroupware/' . $cliversion . '(PHP) ' . "\r\n" . 'User-Agent: eGroupware/' . $cliversion . '(PHP) ' . "\r\n"
. 'X-EGW-Server: ' . $this->server . "\r\n" . 'X-EGW-Server: ' . $this->server . "\r\n"
. 'X-EGW-Version: ' . $GLOBALS['phpgw_info']['server']['versions']['phpgwapi'] . "\r\n" . 'X-EGW-Version: ' . $GLOBALS['egw_info']['server']['versions']['phpgwapi'] . "\r\n"
. 'Host: ' . $this->server . "\r\n" . 'Host: ' . $this->server . "\r\n"
. $credentials . $credentials
. "Content-Type: text/xml\r\nContent-Length: " . strlen($soap_data) . "\r\n" . "Content-Type: text/xml\r\nContent-Length: " . strlen($soap_data) . "\r\n"

View File

@ -3,7 +3,7 @@
* eGroupWare API - SOAP functions * * eGroupWare API - SOAP functions *
* This file written by dietrich@ganx4.com * * This file written by dietrich@ganx4.com *
* shared functions and vars for use with soap client/server * * shared functions and vars for use with soap client/server *
* -------------------------------------------------------------------------* * ------------------------------------------------------------------------ *
* This library is free software; you can redistribute it and/or modify it * * This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by * * under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 2.1 of the License, * * the Free Software Foundation; either version 2.1 of the License, *
@ -26,7 +26,7 @@
); );
function hello($serverid) function hello($serverid)
{ {
return CreateObject('soap.soapval','return','string',$GLOBALS['phpgw_info']['server']['site_title']); return CreateObject('soap.soapval','return','string',$GLOBALS['egw_info']['server']['site_title']);
} }
$GLOBALS['server']->add_to_map( $GLOBALS['server']->add_to_map(