summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartek Przybylski <bart.p.pl@gmail.com>2012-02-04 20:15:55 +0100
committerBartek Przybylski <bart.p.pl@gmail.com>2012-02-04 20:15:55 +0100
commitcfc710e7683a3e16e80fd0f2b6e8bef047e8502c (patch)
tree765b1c40a43654de306b735b96ff833b3ff5d179
parentf6a27dfa2898ab23527d4efe8063ff32895b52e8 (diff)
downloadnextcloud-server-cfc710e7683a3e16e80fd0f2b6e8bef047e8502c.tar.gz
nextcloud-server-cfc710e7683a3e16e80fd0f2b6e8bef047e8502c.zip
preferences store fix
-rw-r--r--apps/gallery/ajax/galleryOp.php8
-rw-r--r--apps/gallery/lib/album.php2
-rw-r--r--apps/gallery/lib/hooks_handlers.php2
-rw-r--r--apps/gallery/lib/scanner.php2
-rw-r--r--apps/gallery/templates/index.php2
5 files changed, 8 insertions, 8 deletions
diff --git a/apps/gallery/ajax/galleryOp.php b/apps/gallery/ajax/galleryOp.php
index 1233b49052f..f819d87f666 100644
--- a/apps/gallery/ajax/galleryOp.php
+++ b/apps/gallery/ajax/galleryOp.php
@@ -57,7 +57,7 @@ function handleGalleryScanning() {
function handleFilescan($cleanup) {
OC_JSON::checkLoggedIn();
if ($cleanup) OC_Gallery_Album::cleanup();
- $root = OC_Appconfig::getValue('gallery', 'root', '').'/';
+ $root = OC_Preferences::getValue(OC_User::getUser(), 'gallery', 'root', '').'/';
$pathlist = OC_Gallery_Scanner::find_paths($root);
sort($pathlist);
OC_JSON::success(array('paths' => $pathlist));
@@ -85,11 +85,11 @@ function handleStoreSettings($root, $order) {
return;
}
- $current_root = OC_Appconfig::getValue('gallery', 'root', '/');
+ $current_root = OC_Preferences::getValue(OC_User::getUser(),'gallery', 'root', '/');
$root = trim(rtrim($root, '/'));
$rescan = $current_root==$root?'no':'yes';
- OC_Appconfig::setValue('gallery', 'root', $root);
- OC_Appconfig::setValue('gallery', 'order', $order);
+ OC_Preferences::setValue(OC_User::getUser(), 'gallery', 'root', $root);
+ OC_Preferences::setValue(OC_User::getUser(), 'gallery', 'order', $order);
OC_JSON::success(array('rescan' => $rescan));
}
diff --git a/apps/gallery/lib/album.php b/apps/gallery/lib/album.php
index 502237481a9..d1405333ac7 100644
--- a/apps/gallery/lib/album.php
+++ b/apps/gallery/lib/album.php
@@ -77,7 +77,7 @@ class OC_Gallery_Album {
$sql .= ' AND album_path = ?';
$args[] = $path;
}
- $order = OC_Appconfig::getValue('gallery', 'order', 'ASC');
+ $order = OC_Preferences::getValue(OC_User::getUser(), 'gallery', 'order', 'ASC');
$sql .= ' ORDER BY album_name ' . $order;
$stmt = OC_DB::prepare($sql);
diff --git a/apps/gallery/lib/hooks_handlers.php b/apps/gallery/lib/hooks_handlers.php
index 605cb0d0037..046866e5c5d 100644
--- a/apps/gallery/lib/hooks_handlers.php
+++ b/apps/gallery/lib/hooks_handlers.php
@@ -59,7 +59,7 @@ class OC_Gallery_Hooks_Handlers {
}
public static function pathInRoot($path) {
- $root = OC_Appconfig::getValue('gallery', 'root', '/');
+ $root = OC_Preferences::getValue(OC_User::getUser(), 'gallery', 'root', '/');
return substr($path, 0, strlen($path)>strlen($root)?strlen($root):strlen($path)) == $root;
}
diff --git a/apps/gallery/lib/scanner.php b/apps/gallery/lib/scanner.php
index 13800f48e69..3aae94d1a4f 100644
--- a/apps/gallery/lib/scanner.php
+++ b/apps/gallery/lib/scanner.php
@@ -40,7 +40,7 @@ class OC_Gallery_Scanner {
}
public static function createName($name) {
- $root = OC_Appconfig::getValue('gallery', 'root', '/');
+ $root = OC_Preferences::getValue(OC_User::getUser(), 'gallery', 'root', '/');
$name = str_replace('/', '.', str_replace(OC::$CONFIG_DATADIRECTORY, '', $name));
if (substr($name, 0, strlen($root)) == str_replace('/','.',$root)) {
$name = substr($name, strlen($root));
diff --git a/apps/gallery/templates/index.php b/apps/gallery/templates/index.php
index 4e74be4c64e..7cc7dad3ac6 100644
--- a/apps/gallery/templates/index.php
+++ b/apps/gallery/templates/index.php
@@ -33,7 +33,7 @@ $l = new OC_L10N('gallery');
<div id="g-dialog-settings" title="<?php echo $l->t('Settings');?>" style="display:none">
<form>
- <fieldset><?php $root = OC_Appconfig::getValue('gallery', 'root', '/'); $order = OC_Appconfig::getValue('gallery', 'order', 'ASC');?>
+ <fieldset><?php $root = OC_Preferences::getValue(OC_User::getUser(), 'gallery', 'root', '/'); $order = OC_Preferences::getValue(OC_User::getUser(), 'gallery', 'order', 'ASC');?>
<label for="name"><?php echo $l->t('Scanning root');?></label>
<input type="text" name="g-scanning-root" id="g-scanning-root" class="text ui-widget-content ui-corner-all" value="<?php echo $root;?>" /><br/>