diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-10-18 23:24:28 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-10-18 23:24:28 +0200 |
commit | 9712a785594f57b210d7b399c7ffd8904a8d1c18 (patch) | |
tree | 4e25f6dbf0a71dd5c7730aed4f8383b39eeaa83e /lib | |
parent | 77cef5f5142d340117add03fd95e1430a3868eb7 (diff) | |
parent | 59c2414439f3824bd35504077f64a0221fefeb05 (diff) | |
download | nextcloud-server-9712a785594f57b210d7b399c7ffd8904a8d1c18.tar.gz nextcloud-server-9712a785594f57b210d7b399c7ffd8904a8d1c18.zip |
merge master into filesystem
Diffstat (limited to 'lib')
-rw-r--r-- | lib/l10n.php | 11 | ||||
-rwxr-xr-x | lib/util.php | 35 |
2 files changed, 32 insertions, 14 deletions
diff --git a/lib/l10n.php b/lib/l10n.php index 4eb4c323d88..26611537175 100644 --- a/lib/l10n.php +++ b/lib/l10n.php @@ -58,9 +58,9 @@ class OC_L10N{ * Localization */ private $localizations = array( - 'date' => 'd.m.Y', - 'datetime' => 'd.m.Y H:i:s', - 'time' => 'H:i:s'); + 'date' => '%d.%m.%Y', + 'datetime' => '%d.%m.%Y %H:%M:%S', + 'time' => '%H:%M:%S'); /** * get an L10N instance @@ -216,7 +216,10 @@ class OC_L10N{ case 'time': if($data instanceof DateTime) return $data->format($this->localizations[$type]); elseif(is_string($data)) $data = strtotime($data); - return date($this->localizations[$type], $data); + $locales = array(self::findLanguage()); + if (strlen($locales[0]) == 2) $locales[] = $language.'_'.strtoupper($language); + setlocale(LC_TIME, $locales); + return strftime($this->localizations[$type], $data); break; default: return false; diff --git a/lib/util.php b/lib/util.php index 62a0580070b..5335efb11c7 100755 --- a/lib/util.php +++ b/lib/util.php @@ -53,14 +53,8 @@ class OC_Util { OC_FileProxy::register($quotaProxy); OC_FileProxy::register($fileOperationProxy); // Load personal mount config - if (is_file($user_root.'/mount.php')) { - $mountConfig = include($user_root.'/mount.php'); - if (isset($mountConfig['user'][$user])) { - foreach ($mountConfig['user'][$user] as $mountPoint => $options) { - \OC\Files\Filesystem::mount($options['class'], $options['options'], $mountPoint); - } - } - } + self::loadUserMountPoints($user); + OC_Hook::emit('OC_Filesystem', 'setup', array('user' => $user, 'user_dir' => $user_dir)); } } @@ -69,6 +63,27 @@ class OC_Util { \OC\Files\Filesystem::tearDown(); self::$fsSetup=false; } + + public static function loadUserMountPoints($user) { + $user_dir = '/'.$user.'/files'; + $user_root = OC_User::getHome($user); + $userdirectory = $user_root . '/files'; + if (is_file($user_root.'/mount.php')) { + $mountConfig = include($user_root.'/mount.php'); + if (isset($mountConfig['user'][$user])) { + foreach ($mountConfig['user'][$user] as $mountPoint => $options) { + OC_Filesystem::mount($options['class'], $options['options'], $mountPoint); + } + } + + $mtime=filemtime($user_root.'/mount.php'); + $previousMTime=OC_Preferences::getValue($user,'files','mountconfigmtime',0); + if($mtime>$previousMTime) {//mount config has changed, filecache needs to be updated + OC_FileCache::triggerUpdate($user); + OC_Preferences::setValue($user,'files','mountconfigmtime',$mtime); + } + } + } /** * get the current installed version of ownCloud @@ -155,8 +170,8 @@ class OC_Util { $offset=$clientTimeZone-$systemTimeZone; $timestamp=$timestamp+$offset*60; } - $timeformat=$dateOnly?'F j, Y':'F j, Y, H:i'; - return date($timeformat,$timestamp); + $l=OC_L10N::get('lib'); + return $l->l($dateOnly ? 'date' : 'datetime', $timestamp); } /** |