From: Matteo Nastasi (mop) Date: Fri, 13 Nov 2015 17:44:38 +0000 (+0100) Subject: info reset action added X-Git-Tag: v5.3.0~54 X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=commitdiff_plain;h=ad5edae885f629dc478dfeda167f6fa0db0e1830;p=brisk.git info reset action added --- diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index ce5d106..a8220f8 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -1643,6 +1643,12 @@ class Brisk } } + /* + function info_show($user, $user_login, $dt) + + if success return assoc. array with "ret" => 0 and other fields + else return an assoc. array with "ret: != 0 and "mesg" with an error description + */ function info_show($user, $user_login, $dt) { GLOBAL $G_lang, $mlang_brisk, $G_base; diff --git a/web/info.js b/web/info.js index c7f473f..8e30988 100644 --- a/web/info.js +++ b/web/info.js @@ -65,29 +65,10 @@ function info_show_cb(e) } } -function info_save() -{ - var ret; - - info = info_fld($('info')); - ret = info.dom2json(); - - console.log(ret); - - if (0 == 1) { - if (typeof(g_prefs) == 'undefined') - return false; - - ret = server_request('mesg', 'info|save','__POST__', 'prefs', JSON.stringify(g_prefs)); - - if (ret == 1) - $('preferences').style.visibility = 'hidden'; - } -} - function info_reset() { - var ret; + var ret, target; - ret = server_request('mesg', 'prefs|reset'); + target = $('info').getElementsByClassName('login_id')[0].innerHTML; + return info_show(target); }