From: Matteo Nastasi (mop) Date: Thu, 29 Sep 2016 05:19:38 +0000 (+0200) Subject: partial implementation of new fieldified preferences system X-Git-Url: https://mop.ddnsfree.com/gitweb/?p=brisk.git;a=commitdiff_plain;h=5a0aa4a98df035d451b1e7b427ef16cc3580b932 partial implementation of new fieldified preferences system --- diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index 6395d70..a903589 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -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') diff --git a/web/index.php b/web/index.php index 9a1459f..878c2a5 100644 --- a/web/index.php +++ b/web/index.php @@ -2,7 +2,7 @@ /* * brisk - index.php * - * Copyright (C) 2006-2015 Matteo Nastasi + * Copyright (C) 2006-2016 Matteo Nastasi * mailto: nastasi@alternativeoutput.it * matteo.nastasi@milug.org * web: http://www.alternativeoutput.it @@ -1013,7 +1013,6 @@ supported by:
- @@ -1040,7 +1039,6 @@ var g_tables_auth_n = ; var g_tables_cert_n = ; var g_prefs, g_prefs_new = null; var g_prefsn = null, g_prefsn_old = null; -var g_prefsf = null; var g_listen; var g_withflash = false; var g_is_spawn = 0; @@ -1210,7 +1208,6 @@ cookie_law(null); var g_tables_cert_n = ; var g_prefs, g_prefs_new = null; var g_prefsn = null, g_prefsn_old = null; - var g_prefsf = null; var g_listen; var g_is_spawn = 0; var g_withflash = false; @@ -1226,20 +1223,18 @@ cookie_law(null); // var nonunload = false; var spo_slide, sup_slide; - function status_cb() - { - console.log("status_cb"); - } - + /* room case */ window.onload = function() { g_brow = get_browser_agent(); g_prefs = new client_prefs(null); /* g_prefsn = new Prefsn($('prefsn')); */ - g_prefsf = new Fieldify(null, null, null, {}, "prefsf", [$("prefsf")], status_cb); + prefsf_initialize(); + // console.log(g_prefsf); spo_slide = new sideslide($('spon_caro'), 80, 20); sup_slide = new sideslide($('supp_caro'), 80, 20); + g_prefsf.page_set('index_wr.php?mesg=prefsf'); @@ -1607,7 +1602,7 @@ type="submit" class="button" onclick="this.form.elements['realsub'].value = 'chi