mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
Section_edit: Show section when section_key is passed
This commit is contained in:
@@ -20,12 +20,12 @@ import gplx.dbs.*; import gplx.xowa.addons.apps.cfgs.mgrs.*;
|
||||
public class Xocfg_mgr {
|
||||
private final Xocfg_cache_mgr cache_mgr = new Xocfg_cache_mgr();
|
||||
public void Init_by_app(Db_conn conn) {
|
||||
// cache_mgr.Init_by_app(conn); // COMMENT:section_edit DATE:2016-12-04
|
||||
cache_mgr.Init_by_app(conn); // SECTION_EDIT
|
||||
}
|
||||
public void Clear() {
|
||||
cache_mgr.Clear();
|
||||
}
|
||||
public boolean Bind_bool(Xow_wiki wiki, String key, Gfo_invk sub) {return Bool_.Parse_or(Bind_str(wiki, key, sub), false);}
|
||||
public boolean Bind_bool(Xow_wiki wiki, String key, Gfo_invk sub) {return Yn.parse_or(Bind_str(wiki, key, sub), false);}
|
||||
public String Bind_str(Xow_wiki wiki, String key, Gfo_invk sub) {
|
||||
String ctx = wiki.Domain_itm().Abrv_xo_str();
|
||||
cache_mgr.Sub(sub, ctx, key, key);
|
||||
|
||||
@@ -21,7 +21,7 @@ public class Xogui_itm_html {
|
||||
public void Build_html(Bry_bfr bfr, String key, String name, int gui_type, String gui_args, String data) {
|
||||
switch (gui_type) {
|
||||
case Xoitm_gui_tid.Tid__checkbox:
|
||||
bfr.Add_str_u8_fmt("<input id='{0}' data-xocfg='0' type='checkbox' accesskey='d' class='xocfg_checkbox'{1}></input>", key, String_.Eq(data, "true") ? " checked='checked'" : "");
|
||||
bfr.Add_str_u8_fmt("<input id='{0}' data-xocfg='0' type='checkbox' accesskey='d' class='xocfg_checkbox'{1}></input>", key, String_.Eq(data, "y") ? " checked='checked'" : "");
|
||||
break;
|
||||
case Xoitm_gui_tid.Tid__numeric:
|
||||
bfr.Add_str_u8_fmt("<input id='{0}' data-xocfg='0' type='text' accesskey='d' class='xocfg_numeric' value='{1}'></input>", key, data);
|
||||
|
||||
@@ -34,6 +34,7 @@ public class Xocfg_cache_mgr {
|
||||
public void Set(String ctx, String key, String val) {
|
||||
Xocfg_cache_grp grp = Grps__get_or_load(key);
|
||||
grp.Set(ctx, val);
|
||||
db_mgr.Set_str(ctx, key, val);
|
||||
grp.Pub(ctx, val);
|
||||
}
|
||||
public void Sub(Gfo_invk sub, String ctx, String key, String evt) {
|
||||
|
||||
Reference in New Issue
Block a user