mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-03 20:09:27 +01:00
Formatting (minor)
This commit is contained in:
parent
cd339aa676
commit
c80c3bbcd9
@ -24,14 +24,13 @@
|
|||||||
|
|
||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parent class for the phpgwAPI
|
* Parent class for the phpgwAPI
|
||||||
* Parent class. Has a few functions but is more importantly used as a parent class for everything else.
|
* Parent class. Has a few functions but is more importantly used as a parent class for everything else.
|
||||||
* @author Dan Kuykendall <dan@kuykendall.org>
|
* @author Dan Kuykendall <dan@kuykendall.org>
|
||||||
* @copyright LGPL
|
* @copyright LGPL
|
||||||
* @package phpgwapi
|
* @package phpgwapi
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class phpgw
|
class phpgw
|
||||||
@ -41,11 +40,11 @@
|
|||||||
var $acl;
|
var $acl;
|
||||||
var $auth;
|
var $auth;
|
||||||
var $db;
|
var $db;
|
||||||
/**
|
/**
|
||||||
* Turn on debug mode. Will output additional data for debugging purposes.
|
* Turn on debug mode. Will output additional data for debugging purposes.
|
||||||
* @var string $debug
|
* @var string $debug
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $debug = 0; // This will turn on debugging information.
|
var $debug = 0; // This will turn on debugging information.
|
||||||
var $crypto;
|
var $crypto;
|
||||||
var $categories;
|
var $categories;
|
||||||
@ -70,89 +69,92 @@
|
|||||||
* Core functions *
|
* Core functions *
|
||||||
\**************************************************************************/
|
\**************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Strips out html chars
|
* Strips out html chars
|
||||||
*
|
*
|
||||||
* Used as a shortcut for stripping out html special chars.
|
* Used as a shortcut for stripping out html special chars.
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param $s string The string to have its html special chars stripped out.
|
* @param $s string The string to have its html special chars stripped out.
|
||||||
* @return string The string with html special characters removed
|
* @return string The string with html special characters removed
|
||||||
* @syntax strip_html($string)
|
* @syntax strip_html($string)
|
||||||
* @example $reg_string = strip_html($urlencode_string);
|
* @example $reg_string = strip_html($urlencode_string);
|
||||||
*/
|
*/
|
||||||
|
function strip_html($s)
|
||||||
|
{
|
||||||
|
return htmlspecialchars(stripslashes($s));
|
||||||
|
}
|
||||||
|
|
||||||
function strip_html($s)
|
/**
|
||||||
{
|
* Link url generator
|
||||||
return htmlspecialchars(stripslashes($s));
|
*
|
||||||
}
|
* Used for backwards compatibility and as a shortcut. If no url is passed, it will use PHP_SELF. Wrapper to session->link()
|
||||||
|
*
|
||||||
/**
|
* @access public
|
||||||
* Link url generator
|
* @param string $string The url the link is for
|
||||||
*
|
* @param string $extravars Extra params to be passed to the url
|
||||||
* Used for backwards compatibility and as a shortcut. If no url is passed, it will use PHP_SELF. Wrapper to session->link()
|
* @return string The full url after processing
|
||||||
*
|
* @see session->link()
|
||||||
* @access public
|
* @syntax link($string, $extravars)
|
||||||
* @param string $string The url the link is for
|
* @example None yet
|
||||||
* @param string $extravars Extra params to be passed to the url
|
*/
|
||||||
* @return string The full url after processing
|
function link($url = '', $extravars = '')
|
||||||
* @see session->link()
|
|
||||||
* @syntax link($string, $extravars)
|
|
||||||
* @example None yet
|
|
||||||
*/
|
|
||||||
function link($url = "", $extravars = "")
|
|
||||||
{
|
{
|
||||||
global $phpgw, $phpgw_info, $usercookie, $kp3, $PHP_SELF;
|
global $phpgw, $phpgw_info, $usercookie, $kp3, $PHP_SELF;
|
||||||
return $this->session->link($url, $extravars);
|
return $this->session->link($url, $extravars);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles redirects under iis and apache
|
* Handles redirects under iis and apache
|
||||||
*
|
*
|
||||||
* This function handles redirects under iis and apache it assumes that $phpgw->link() has already been called
|
* This function handles redirects under iis and apache it assumes that $phpgw->link() has already been called
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param string The url ro redirect to
|
* @param string The url ro redirect to
|
||||||
* @syntax redirect(key as string)
|
* @syntax redirect(key as string)
|
||||||
* @example None yet
|
* @example None yet
|
||||||
*/
|
*/
|
||||||
function redirect($url = "")
|
function redirect($url = '')
|
||||||
{
|
{
|
||||||
global $HTTP_ENV_VARS;
|
global $HTTP_ENV_VARS;
|
||||||
|
|
||||||
$iis = @strpos($HTTP_ENV_VARS["SERVER_SOFTWARE"], "IIS", 0);
|
$iis = @strpos($HTTP_ENV_VARS['SERVER_SOFTWARE'], 'IIS', 0);
|
||||||
|
|
||||||
if ( !$url ) {
|
if ( !$url )
|
||||||
|
{
|
||||||
$url = $PHP_SELF;
|
$url = $PHP_SELF;
|
||||||
}
|
}
|
||||||
if ( $iis ) {
|
if ( $iis )
|
||||||
|
{
|
||||||
echo "\n<HTML>\n<HEAD>\n<TITLE>Redirecting to $url</TITLE>";
|
echo "\n<HTML>\n<HEAD>\n<TITLE>Redirecting to $url</TITLE>";
|
||||||
echo "\n<META HTTP-EQUIV=REFRESH CONTENT=\"0; URL=$url\">";
|
echo "\n<META HTTP-EQUIV=REFRESH CONTENT=\"0; URL=$url\">";
|
||||||
echo "\n</HEAD><BODY>";
|
echo "\n</HEAD><BODY>";
|
||||||
echo "<H3>Please continue to <a href=\"$url\">this page</a></H3>";
|
echo "<H3>Please continue to <a href=\"$url\">this page</a></H3>";
|
||||||
echo "\n</BODY></HTML>";
|
echo "\n</BODY></HTML>";
|
||||||
exit;
|
exit;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
Header("Location: $url");
|
Header("Location: $url");
|
||||||
print("\n\n");
|
print("\n\n");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shortcut to tranlation class
|
* Shortcut to tranlation class
|
||||||
*
|
*
|
||||||
* This function is a basic wrapper to translation->translate()
|
* This function is a basic wrapper to translation->translate()
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param string The key for the phrase
|
* @param string The key for the phrase
|
||||||
* @param string the first additional param
|
* @param string the first additional param
|
||||||
* @param string the second additional param
|
* @param string the second additional param
|
||||||
* @param string the thrid additional param
|
* @param string the thrid additional param
|
||||||
* @param string the fourth additional param
|
* @param string the fourth additional param
|
||||||
* @see translation->translate()
|
* @see translation->translate()
|
||||||
*/
|
*/
|
||||||
function lang($key, $m1 = "", $m2 = "", $m3 = "", $m4 = "")
|
function lang($key, $m1 = '', $m2 = '', $m3 = '', $m4 = '')
|
||||||
{
|
{
|
||||||
global $phpgw;
|
global $phpgw;
|
||||||
return $this->translation->translate($key);
|
return $this->translation->translate($key);
|
||||||
|
Loading…
Reference in New Issue
Block a user