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

@ -1,16 +1,16 @@
<?php
/**************************************************************************\
* eGroupWare - HTML creation class *
* http://www.eGroupWare.org *
* Written and (c) by Ralf Becker <RalfBecker@outdoor-training.de> *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/**************************************************************************\
* eGroupWare - HTML creation class *
* http://www.eGroupWare.org *
* Written and (c) by Ralf Becker <RalfBecker@outdoor-training.de> *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
/* $Id$ */
/**
* generates html with methods representing html-tags or higher widgets
@ -38,7 +38,7 @@ class html
*/
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 $charset;
@ -53,7 +53,6 @@ class html
*/
var $wz_tooltip_included = False;
/**
* Constructor: initialised the class-vars
*/
@ -72,11 +71,11 @@ class html
$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";
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 (!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;
}
@ -450,14 +449,14 @@ class html
function init_tinymce()
{
/* 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);
if (!($path = $GLOBALS['phpgw']->common->image($app,$image)))
if (!($path = $GLOBALS['egw']->common->image($app,$image)))
{
$path = $image; // name may already contain absolut path
}
@ -657,7 +656,7 @@ class html
parse_str($v,$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
{
$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://')
{
@ -864,15 +863,15 @@ class html
{
$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
}
if(!$GLOBALS['phpgw_info']['server']['webserver_url'])
if(!$GLOBALS['egw_info']['server']['webserver_url'])
{
$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 (substr($name,-1) == '%' && is_numeric($percent = substr($name,0,-1)))
@ -992,9 +991,9 @@ class html
*/
function theme2css()
{
return ".th { background: ".$GLOBALS['phpgw_info']['theme']['th_bg']."; }\n".
".row_on,.th_bright { background: ".$GLOBALS['phpgw_info']['theme']['row_on']."; }\n".
".row_off { background: ".$GLOBALS['phpgw_info']['theme']['row_off']."; }\n";
return ".th { background: ".$GLOBALS['egw_info']['theme']['th_bg']."; }\n".
".row_on,.th_bright { background: ".$GLOBALS['egw_info']['theme']['row_on']."; }\n".
".row_off { background: ".$GLOBALS['egw_info']['theme']['row_off']."; }\n";
}
/**

View File

@ -29,15 +29,15 @@
*/
function jscalendar($do_header=True,$path='jscalendar')
{
$this->jscalendar_url = $GLOBALS['phpgw_info']['server']['webserver_url'].'/phpgwapi/js/'.$path;
$this->dateformat = $GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
$this->jscalendar_url = $GLOBALS['egw_info']['server']['webserver_url'].'/phpgwapi/js/'.$path;
$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" />
<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)
{
$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" });'
);
return $return_array;
}
return
'<input type="text" id="'.$name.'" name="'.$name.'" size="10" value="'.$date.'"'.$options.'/>
<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(
{
inputField : "'.$name.'",

View File

@ -30,7 +30,7 @@
var $mime_magic_file;
/**
* Wrapper to PHP5 Compatiable Constructor
* Wrapper to PHP5 Compatible Constructor
*
* @author skwashd
@ -198,14 +198,14 @@
*/
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
return false;
}
mt_srand(time());
$filename = $GLOBALS['phpgw_info']['server']['temp_dir'] . SEP
$filename = $GLOBALS['egw_info']['server']['temp_dir'] . SEP
. md5( time() + mt_rand() ) . '.tmp';
$fp = @fopen($filename, 'ab');

View File

@ -6,33 +6,33 @@
* http://www.egroupware.org *
* Written by : Lars Kneschke [lkneschke@linux-at-work.de] *
* ------------------------------------------------- *
* Copyright (c) 2004, Lars Kneschke *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without *
* Copyright (c) 2004, Lars Kneschke *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions are *
* met: *
* *
* * Redistributions of source code must retain the above copyright *
* notice, this list of conditions and the following disclaimer. *
* * Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution.*
* * Neither the name of the FeLaMiMail organization nor the names of *
* its contributors may be used to endorse or promote products derived *
* from this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* met: *
* *
* * Redistributions of source code must retain the above copyright *
* notice, this list of conditions and the following disclaimer. *
* * Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* * Neither the name of the FeLaMiMail organization nor the names of *
* its contributors may be used to endorse or promote products derived *
* from this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR*
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR *
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR *
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
\***************************************************************************/
/* $Id$ */
@ -40,22 +40,22 @@
define('FPDF_FONTPATH',PHPGW_SERVER_ROOT.'/phpgwapi/inc/fpdf/font/');
require(PHPGW_SERVER_ROOT.'/phpgwapi/inc/fpdf/fpdf.php');
/**
* wrapper class for FPDF
*
* @package phpgwapi
* @author Lars Kneschke
* @version 1.35
* @copyright Lars Kneschke 2004
* @license http://www.opensource.org/licenses/bsd-license.php BSD
*/
/**
* wrapper class for FPDF
*
* @package phpgwapi
* @author Lars Kneschke
* @version 1.35
* @copyright Lars Kneschke 2004
* @license http://www.opensource.org/licenses/bsd-license.php BSD
*/
class pdf extends FPDF
{
function pdf()
{
parent::FPDF();
$this->SetCreator('eGroupWare '.$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']);
$this->SetAuthor($GLOBALS['phpgw']->common->display_fullname());
$this->SetCreator('eGroupWare '.$GLOBALS['egw_info']['server']['versions']['phpgwapi']);
$this->SetAuthor($GLOBALS['egw']->common->display_fullname());
}
//Page footer

View File

@ -26,7 +26,7 @@
{
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;
$type = $this->type ? $this->type : 'xmlrpc';
$this->function_map = ExecMethod($this->svc . '.list_methods',$type);

View File

@ -26,7 +26,7 @@
{
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;
$type = $this->type ? $this->type : 'xmlrpc';
$this->function_map = ExecMethod($this->svc . '.list_methods',$type);

View File

@ -140,7 +140,7 @@
. " HTTP/1.0\r\n"
. 'User-Agent: eGroupware/' . $cliversion . '(PHP) ' . "\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"
. $credentials
. "Content-Type: text/xml\r\nContent-Length: " . strlen($soap_data) . "\r\n"
@ -191,7 +191,7 @@
. " HTTP/1.0\r\n"
. 'User-Agent: eGroupware/' . $cliversion . '(PHP) ' . "\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"
. $credentials
. "Content-Type: text/xml\r\nContent-Length: " . strlen($soap_data) . "\r\n"

View File

@ -3,7 +3,7 @@
* eGroupWare API - SOAP functions *
* This file written by dietrich@ganx4.com *
* shared functions and vars for use with soap client/server *
* -------------------------------------------------------------------------*
* ------------------------------------------------------------------------ *
* 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 *
* the Free Software Foundation; either version 2.1 of the License, *
@ -26,7 +26,7 @@
);
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(