29 protected $allowHTML = FALSE;
30 protected $allowSmarty = FALSE;
32 function renderFormInput ():
string 34 if ($this->allowHTML) {
35 $value = $this->getValue();
39 if ($this->allowSmarty) {
42 return '{literal}'.$value.
'{/literal}';
46 function setAllowHTML (
bool $allowHTML)
48 $this->allowHTML = $allowHTML;
51 function setAllowSmarty (
bool $allowSmarty)
53 $this->allowSmarty = $allowSmarty;
76 if (isset($attrs[$this->getLdapName()][
'count'])) {
78 for ($i = 0; $i < $attrs[$this->getLdapName()][
'count']; $i++) {
79 $this->value[] = $attrs[$this->getLdapName()][$i];
84 function renderFormInput ():
string 86 $value = $this->getValue();
87 if (is_array($value)) {
88 $value = join(
', ', $value);
90 return '{literal}'.htmlescape($value).
'{/literal}';
100 function __construct (
string $label,
string $description,
string $ldapName,
bool $required = FALSE, $defaultValue =
'',
string $acl =
'')
102 parent::__construct($label, $description, $ldapName, $required, $defaultValue, $acl);
103 $this->setInLdap(FALSE);
113 function __construct (
string $label,
string $description,
string $ldapName,
bool $required,
string $type, $defaultValue =
'',
string $acl =
'')
115 parent::__construct($label, $description, $ldapName, $required, $defaultValue, $acl);
119 function renderFormInput ():
string 121 if (empty($this->value)) {
128 return '<a><img src="geticon.php?context=status&icon=dialog-warning&size=16" alt="warning" class="center"/> '.sprintf(_(
'Invalid: %s'), $this->value).
'</a>';
htmlescape(string $str)
Escape string for HTML output.
fillLdapValue(array &$attrs)
Fill LDAP value in the attrs array.
This class allow to display an attribute.
loadAttrValue(array $attrs)
Loads this attribute value from the attrs array if present.
This class allow to display an attribute.
This class allow to display a link to an object which dn is stored in the attribute.
This class allow to display a text in front of an attribute.
This class allow to display an attribute.
static link(string $dn, string $type, string $subaction='', $text=NULL, bool $icon=TRUE, bool $link=TRUE)
This class allow to handle easily any kind of LDAP attribute.
__construct(string $label, string $description, string $ldapName, bool $required=FALSE, $defaultValue='', string $acl='')
The constructor of Attribute.