summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-25 12:46:13 +0300
committerAndrew Dolgov <[email protected]>2021-02-25 12:46:13 +0300
commitbd2314170dc183c154c2af05686ddb0224b5d133 (patch)
tree762e6563377f4baeadd7a4f995cec57dbeacac90 /include
parente858e979e9e6daf1888b007d509cc4afe5443811 (diff)
implement prefs UI based on new prefs class and a few more things
Diffstat (limited to 'include')
-rw-r--r--include/functions.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/functions.php b/include/functions.php
index 7b07a31f7..3ed024d11 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -42,12 +42,14 @@
define('SUBSTRING_FOR_DATE', 'SUBSTRING');
}
- function get_pref($pref_name, $user_id = false, $die_on_error = false) {
- return Db_Prefs::get()->read($pref_name, $user_id, $die_on_error);
+ function get_pref(string $pref_name, int $owner_uid = null) {
+ return Prefs::get($pref_name, $owner_uid ? $owner_uid : $_SESSION["uid"]);
+ //return Db_Prefs::get()->read($pref_name, $user_id, $die_on_error);
}
- function set_pref($pref_name, $value, $user_id = false, $strip_tags = true) {
- return Db_Prefs::get()->write($pref_name, $value, $user_id, $strip_tags);
+ function set_pref(string $pref_name, $value, int $owner_uid = null, bool $strip_tags = true) {
+ return Prefs::set($pref_name, $value, $owner_uid ? $owner_uid : $_SESSION["uid"], $_SESSION["profile"] ?? null, $strip_tags);
+ //return Db_Prefs::get()->write($pref_name, $value, $user_id, $strip_tags);
}
function get_translations() {