summaryrefslogtreecommitdiffstats
path: root/lib/util.php
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-04-18 12:20:09 +0200
committerGeorg Ehrke <dev@georgswebsite.de>2012-04-18 12:20:09 +0200
commiteb29c577c2b2378c1983e55ddaf4955ad9ae7fe2 (patch)
tree4a53459150c6485666e350982ef3ad61ab3936c8 /lib/util.php
parent3e0e6e35f4fa638dd42bd5adc3b26e078bf3d081 (diff)
parent57b8ff890c75169521041b4eb9cdf4582b68e551 (diff)
downloadnextcloud-server-eb29c577c2b2378c1983e55ddaf4955ad9ae7fe2.tar.gz
nextcloud-server-eb29c577c2b2378c1983e55ddaf4955ad9ae7fe2.zip
Merge branch 'master' into movable_apps
Diffstat (limited to 'lib/util.php')
-rw-r--r--lib/util.php40
1 files changed, 23 insertions, 17 deletions
diff --git a/lib/util.php b/lib/util.php
index e3c20ddb858..0b8ea1ec907 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -129,23 +129,23 @@ class OC_Util {
self::$headers[]=array('tag'=>$tag,'attributes'=>$attributes,'text'=>$text);
}
- /**
- * formats a timestamp in the "right" way
- *
- * @param int timestamp $timestamp
- * @param bool dateOnly option to ommit time from the result
- */
- public static function formatDate( $timestamp,$dateOnly=false){
- if(isset($_SESSION['timezone'])){//adjust to clients timezone if we know it
- $systemTimeZone = intval(date('O'));
- $systemTimeZone=(round($systemTimeZone/100,0)*60)+($systemTimeZone%100);
- $clientTimeZone=$_SESSION['timezone']*60;
- $offset=$clientTimeZone-$systemTimeZone;
- $timestamp=$timestamp+$offset*60;
- }
- $timeformat=$dateOnly?'F j, Y':'F j, Y, H:i';
- return date($timeformat,$timestamp);
- }
+ /**
+ * formats a timestamp in the "right" way
+ *
+ * @param int timestamp $timestamp
+ * @param bool dateOnly option to ommit time from the result
+ */
+ public static function formatDate( $timestamp,$dateOnly=false){
+ if(isset($_SESSION['timezone'])){//adjust to clients timezone if we know it
+ $systemTimeZone = intval(date('O'));
+ $systemTimeZone=(round($systemTimeZone/100,0)*60)+($systemTimeZone%100);
+ $clientTimeZone=$_SESSION['timezone']*60;
+ $offset=$clientTimeZone-$systemTimeZone;
+ $timestamp=$timestamp+$offset*60;
+ }
+ $timeformat=$dateOnly?'F j, Y':'F j, Y, H:i';
+ return date($timeformat,$timestamp);
+ }
/**
* Shows a pagenavi widget where you can jump to different pages.
@@ -237,6 +237,12 @@ class OC_Util {
if(!function_exists('ctype_digit')){
$errors[]=array('error'=>'PHP module ctype is not installed.<br/>','hint'=>'Please ask your server administrator to install the module.');
}
+ if(!function_exists('json_encode')){
+ $errors[]=array('error'=>'PHP module JSON is not installed.<br/>','hint'=>'Please ask your server administrator to install the module.');
+ }
+ if(!function_exists('imagepng')){
+ $errors[]=array('error'=>'PHP module GD is not installed.<br/>','hint'=>'Please ask your server administrator to install the module.');
+ }
return $errors;
}