use of app.hongs.CoreLocale in project HongsCORE by ihongs.
the class DeptAction method doDelete.
@Action("delete")
@CommitSuccess
public void doDelete(ActionHelper helper) throws HongsException {
Map rd = helper.getRequestData();
int rn = model.delete(rd);
CoreLocale ln = CoreLocale.getInstance().clone();
ln.load("master");
String ms = ln.translate("core.delete.dept.success", Integer.toString(rn));
helper.reply(ms, rn);
}
use of app.hongs.CoreLocale in project HongsCORE by ihongs.
the class UserAction method doSave.
@Action("save")
@Verify(conf = "master", form = "user")
@CommitSuccess
public void doSave(ActionHelper helper) throws HongsException {
Map rd = helper.getRequestData();
// Ignore empty password in update
if ("".equals(rd.get("password"))) {
rd.remove("password");
rd.remove("passcode");
}
String id = model.set(rd);
Map sd = new HashMap();
sd.put("id", id);
sd.put("name", rd.get("name"));
sd.put("head", rd.get("head"));
CoreLocale ln = CoreLocale.getInstance().clone();
ln.load("master");
String ms = ln.translate("core.save.user.success");
helper.reply(ms, sd);
}
use of app.hongs.CoreLocale in project HongsCORE by ihongs.
the class FormAction method doDelete.
@Action("delete")
@CommitSuccess
public void doDelete(ActionHelper helper) throws HongsException {
Map data = helper.getRequestData();
int rows = model.delete(data);
CoreLocale lang = CoreLocale.getInstance().clone();
lang.load("matrix");
String ms = lang.translate("core.delete.form.success", Integer.toString(rows));
helper.reply(ms, rows);
}
use of app.hongs.CoreLocale in project HongsCORE by ihongs.
the class FormSet method getFormTranslated.
public Map getFormTranslated(String namc) throws HongsException {
Map items = getForm(namc);
Map itemz = new LinkedHashMap();
if (items == null)
return itemz;
CoreLocale lang = getCurrTranslator();
for (Object o : items.entrySet()) {
Map.Entry e = (Map.Entry) o;
Map m = (Map) e.getValue();
String k = (String) e.getKey();
String n = (String) m.get("__text__");
String h = (String) m.get("__hint__");
Map u = new LinkedHashMap();
u.putAll(m);
if (n == null || "".equals(n)) {
n = "fore.form." + name + "." + namc + "." + k;
}
u.put("__text__", lang.translate(n));
if (h != null && !"".equals(n)) {
u.put("__hint__", lang.translate(h));
}
itemz.put(k, u);
}
return itemz;
}
use of app.hongs.CoreLocale in project HongsCORE by ihongs.
the class NaviMap method getMenuTranslated.
public List<Map> getMenuTranslated(String name, int d, Set<String> rolez) {
CoreLocale lang = getCurrTranslator();
Map menu = (Map) getMenu(name).get("menus");
return getMenuTranslated(menu, rolez, lang, d, 0);
}
Aggregations