partial implementation of new fieldified preferences system
[brisk.git] / web / Obj / brisk.phh
index 6395d70..a903589 100644 (file)
@@ -1417,18 +1417,12 @@ class Brisk
     $ret = sprintf('gst.st = %d; ',  $user_step);
 
     if ($user->is_auth()) {
-        $ret .= sprintf('/* g_prefsn.load(\'%s\'); */', json_encode($user->prefsn_get()));
-    }
-    if(false) {
-        if ($user->flags & USER_FLAG_ISOLAUTH) {
-            $ret .= 'list_set(\'isolation\', false, \''.$mlang_brisk['tit_onisol'][$G_lang].'\' ); ';
-        }
-        else if ($user->flags & USER_FLAG_LISTAUTH) {
-            $ret .= 'list_set(\'auth\', false, \''.$mlang_brisk['tit_onauth'][$G_lang].'\' ); ';
-        }
-        else {
-            $ret .= 'list_set(\'all\', false, \'\' ); ';
-        }
+        $model = '{ "listen": { "__type": "radio" } }';
+        $content = '{ "listen": {"val": "' . ($user->flags & USER_FLAG_ISOLAUTH ? "2" :
+                                              ($user->flags & USER_FLAG_LISTAUTH ? "1" : "0")) .
+            '" } }';
+        $ret .= sprintf('g_prefsf.fields_descr_set(JSON.parse(\'%s\'));', $model);
+        $ret .= sprintf('g_prefsf.json2dom(JSON.parse(\'%s\'));', $content);
     }
 
     if ($user->subst == 'standup')