From 929b0a88af1f3467efb2ca6e7adca44d84d0795b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= <come@opensides.be> Date: Mon, 29 Oct 2018 17:25:22 +0100 Subject: [PATCH] :sparkles: feat(BooleanAttribute) Display Boolean as yes/no in OrderedAttribute issue #5903 --- .../simpleplugin/attributes/class_BooleanAttribute.inc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/simpleplugin/attributes/class_BooleanAttribute.inc b/include/simpleplugin/attributes/class_BooleanAttribute.inc index 770ed6d66..f6f1aee18 100644 --- a/include/simpleplugin/attributes/class_BooleanAttribute.inc +++ b/include/simpleplugin/attributes/class_BooleanAttribute.inc @@ -90,6 +90,15 @@ class BooleanAttribute extends Attribute } } + function displayValue($value) + { + if ($this->isTemplate() && $this->isTemplatable() && ($value === '%askme%')) { + return $value; + } else { + return ($value ? _('yes') : _('no')); + } + } + function renderFormInput () { $id = $this->getHtmlId(); -- GitLab