28 function __construct ($label, $description, $ldapName, $required = FALSE, $defaultValue = [], $acl =
'')
31 $this->edit_enabled = FALSE;
33 $this->attribute = FALSE;
34 $this->setInLdap(FALSE);
37 function setParent (&$plugin)
39 parent::setParent($plugin);
40 if (is_object($this->plugin)) {
41 if ($this->plugin->global) {
58 function loadPostValue ()
60 if ($this->isVisible()) {
61 parent::loadPostValue();
62 parent::applyPostValue();
66 protected function handleEdit ($key)
70 function applyPostValue ()
74 function addValue (
string $dn, $entry = NULL)
76 if ($entry !== NULL) {
77 $this->value[] = $entry;
78 $this->reIndexValues();
82 function renderButtons ()
87 protected function getAttributeArrayValue ($key, $value)
90 date(_(
'Y-m-d, H:i:s'), preg_replace(
'/\-.*$/',
'', $value[
'gosaSnapshotTimestamp'][0])),
91 $value[
'description'][0]
93 if ($this->plugin->global) {
94 array_unshift($values, $value[
'gosaSnapshotDN'][0]);
99 protected function genRowIcons ($key, $value)
101 $id = $this->getHtmlId();
102 list ($img, $nbicons) = parent::genRowIcons($key, $value);
103 $img = $this->renderInputField(
104 'image', $id.
'_restore_'.$key,
106 'src' =>
'geticon.php?context=actions&icon=document-restore&size=16',
107 'title' => _(
'Restore'),
108 'alt' => _(
'Restore'),
115 return [$img, $nbicons];
118 protected function handlePostValueActions ($id, $postValue)
120 if (parent::handlePostValueActions($id, $postValue)) {
123 if (preg_match(
'/^'.$id.
'_restore_/', $postValue)) {
124 $key = preg_replace(
'/^'.$id.
'_restore_/',
'', $postValue);
125 $key = preg_replace(
'/_[xy]$/',
'', $key);
127 $this->plugin->triggerRestore($this->value[$key][
'dn']);
133 function delPostValue ($key)
135 $this->plugin->triggerDelete($this->value[$key][
'dn']);
Attribute which list the snapshots.
Multivalued attribute displayed as a columned table. May allow ordering and/or editing.
__construct(string $label, string $description, string $ldapName, bool $required=FALSE, $defaultValue='', string $acl='')
The constructor of Attribute.