24.705
Bearbeitungen
(switch wob.attrText() zu atr.attrText()) Markierung: Manuelle Zurücksetzung |
(+ setBoolAttr()) |
||
| Zeile 215: | Zeile 215: | ||
elseif attr_type == "_tel" then -- Telefon-Attribute Spezialbehandlung | elseif attr_type == "_tel" then -- Telefon-Attribute Spezialbehandlung | ||
t = t .. p.setTelAttr(args.fbdata.attr.list, attr_name, val, args.val_show_only) | t = t .. p.setTelAttr(args.fbdata.attr.list, attr_name, val, args.val_show_only) | ||
elseif attr_type == "_boo" then -- Wahrheitswert-Attribute Spezialbehandlung | |||
t = t .. p.setBoolAttr(args.fbdata.attr.list, attr_name, val, args.val_show_only, args.fbdata.klasse[1]) | |||
else -- Standard-Attribute | else -- Standard-Attribute | ||
t = t .. p.setStandardAttr(args.fbdata.attr.list, attr_name, val, args.exclude_bracket_values, args.val_show_only) | t = t .. p.setStandardAttr(args.fbdata.attr.list, attr_name, val, args.exclude_bracket_values, args.val_show_only) | ||
| Zeile 303: | Zeile 305: | ||
if not val_show_only then | if not val_show_only then | ||
smw.addAttrToList(attrlist, name, tel) | smw.addAttrToList(attrlist, name, tel) | ||
end | |||
return t | |||
end | |||
function p.setBoolAttr(attrlist, name, val, val_show_only, klasse) | |||
local t = "" | |||
if not val_show_only then | |||
smw.addAttrToList(attrlist, name, val) | |||
end | |||
-- Anzeigeformat abfragen | |||
local attr_attr = atr.getAttrAttributes(name, klasse) | |||
local anzeigeformat = attr_attr["Anzeigeformat"] | |||
anzeigeformat = str.splitAndStrip(anzeigeformat, ",") | |||
-- Anzeigeformat Spezialbehandlungen | |||
if anzeigeformat[1] == "tick" then | |||
anzeigeformat = {"✓", "✕"} | |||
elseif anzeigeformat[1] == "x" then | |||
anzeigeformat = {"✕"} | |||
end | |||
-- Anzeige | |||
if com.isTrue(val) then | |||
t = t .. (anzeigeformat[1] or "ja") | |||
else | |||
t = t .. (anzeigeformat[2] or "nein") | |||
end | end | ||
return t | return t | ||