- declare $dms global

This commit is contained in:
steinm 2010-12-16 09:29:49 +00:00
parent d4507695b0
commit 457b805f2c

View File

@ -18,13 +18,12 @@
// along with this program; if not, write to the Free Software // along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
function formatted_size($size_bytes) function formatted_size($size_bytes) { /* {{{ */
{
if ($size_bytes>1000000000) return number_format($size_bytes/1000000000,1,".","")." GBytes"; if ($size_bytes>1000000000) return number_format($size_bytes/1000000000,1,".","")." GBytes";
else if ($size_bytes>1000000) return number_format($size_bytes/1000000,1,".","")." MBytes"; else if ($size_bytes>1000000) return number_format($size_bytes/1000000,1,".","")." MBytes";
else if ($size_bytes>1000) return number_format($size_bytes/1000,1,".","")." KBytes"; else if ($size_bytes>1000) return number_format($size_bytes/1000,1,".","")." KBytes";
return number_format($size_bytes,0,"","")." Bytes"; return number_format($size_bytes,0,"","")." Bytes";
} } /* }}} */
function getReadableDate($timestamp) { function getReadableDate($timestamp) {
return date("d.m.Y", $timestamp); return date("d.m.Y", $timestamp);
@ -48,7 +47,7 @@ function getLongReadableDate($timestamp) {
// return $string; // return $string;
//} //}
function sanitizeString($string) { function sanitizeString($string) { /* {{{ */
$string = (string) $string; $string = (string) $string;
if (get_magic_quotes_gpc()) { if (get_magic_quotes_gpc()) {
@ -75,9 +74,9 @@ function sanitizeString($string) {
$string = str_replace("+", "+", $string); $string = str_replace("+", "+", $string);
return trim($string); return trim($string);
} } /* }}} */
function mydmsDecodeString($string) { function mydmsDecodeString($string) { /* {{{ */
$string = (string)$string; $string = (string)$string;
@ -95,11 +94,10 @@ function mydmsDecodeString($string) {
$string = str_replace("+", "+", $string); $string = str_replace("+", "+", $string);
return $string; return $string;
} } /* }}} */
function createVersionigFile($document) function createVersionigFile($document) { /* {{{ */
{ global $settings, $dms;
global $settings;
// if directory has been removed recreate it // if directory has been removed recreate it
if (!file_exists($settings->_contentDir . $document->getDir())) if (!file_exists($settings->_contentDir . $document->getDir()))
@ -229,10 +227,9 @@ function createVersionigFile($document)
fclose($handle); fclose($handle);
return true; return true;
} } /* }}} */
function add_log_line($msg="") function add_log_line($msg="") { /* {{{ */
{
global $settings,$user; global $settings,$user;
if ($settings->_logFileEnable!=TRUE) return; if ($settings->_logFileEnable!=TRUE) return;
@ -245,16 +242,15 @@ function add_log_line($msg="")
fwrite($h,date("Y/m/d H:i", time())." ".$user->getLogin()." (".$_SERVER['REMOTE_ADDR'].") ".basename($_SERVER["REQUEST_URI"], ".php").$msg."\n"); fwrite($h,date("Y/m/d H:i", time())." ".$user->getLogin()." (".$_SERVER['REMOTE_ADDR'].") ".basename($_SERVER["REQUEST_URI"], ".php").$msg."\n");
fclose($h); fclose($h);
} }
} } /* }}} */
function showtree() function showtree() { /* {{{ */
{
global $settings; global $settings;
if (isset($_GET["showtree"])) return $_GET["showtree"]; if (isset($_GET["showtree"])) return $_GET["showtree"];
else if ($settings->_enableFolderTree==0) return 0; else if ($settings->_enableFolderTree==0) return 0;
return 1; return 1;
} } /* }}} */
?> ?>