From 29ada58b4ac06178c908869e0bb078949e1cb465 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 22 Feb 2021 23:25:14 +0300 Subject: move db-prefs shortcut functions to functions.php --- include/db-prefs.php | 8 -------- include/functions.php | 9 ++++++++- 2 files changed, 8 insertions(+), 9 deletions(-) delete mode 100644 include/db-prefs.php (limited to 'include') diff --git a/include/db-prefs.php b/include/db-prefs.php deleted file mode 100644 index ce5753638..000000000 --- a/include/db-prefs.php +++ /dev/null @@ -1,8 +0,0 @@ -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); - } \ No newline at end of file diff --git a/include/functions.php b/include/functions.php index 172ba169d..a698fa79d 100644 --- a/include/functions.php +++ b/include/functions.php @@ -42,6 +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 set_pref($pref_name, $value, $user_id = false, $strip_tags = true) { + return Db_Prefs::get()->write($pref_name, $value, $user_id, $strip_tags); + } + function get_translations() { $t = array( "auto" => __("Detect automatically"), @@ -152,7 +160,6 @@ } } - require_once 'db-prefs.php'; require_once 'controls.php'; require_once 'controls_compat.php'; -- cgit v1.2.3-54-g00ecf