diff --git a/include/class_template.inc b/include/class_template.inc index d6acc5d287ea7422645334a88fd64625bd7fd1df..fb0deaea40e07b44986f3db6a486058dcec4fabc 100644 --- a/include/class_template.inc +++ b/include/class_template.inc @@ -176,6 +176,15 @@ class template return $this->tabObject->by_object[$tab]->attributesAccess[$attr]; } + function getAttributeTab($attr) + { + foreach ($this->tabObject->by_object as $tab => $tabObject) { + if (isset($tabObject->attributesAccess[$attr])) { + return $tab; + } + } + } + /*! \brief Serialize this template for webservice */ function serialize() diff --git a/include/simpleplugin/attributes/class_BooleanAttribute.inc b/include/simpleplugin/attributes/class_BooleanAttribute.inc index 770ed6d66ad198e05d5d4d7c83922701db7402db..f6f1aee18a2e317862c66c0d3a2ee61e18a70ade 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();