26 private $baseSelector = NULL;
27 private $orig_dn = NULL;
38 if ($label === NULL) {
42 $desc = _(
'Object base');
44 parent::__construct($label, $desc,
'base', FALSE,
'',
'base');
45 $this->setInLdap(FALSE);
49 function setManagedAttributes (array $dontcare)
51 trigger_error(
'method setManagedAttributes is not supported for BaseSelectorAttribute');
54 function setParent (&$plugin)
56 parent::setParent($plugin);
57 if (is_object($this->plugin)) {
59 if ($this->plugin->is_template) {
60 $this->ou =
'ou=templates,'.$this->ou;
62 if ($this->plugin->dn ==
'new') {
64 $this->setValue($ui->getCurrentBase());
66 $this->setValue(
dn2base($this->plugin->dn, $this->ou));
68 $this->orig_dn = $this->plugin->dn;
70 $this->initialValue = $this->value;
78 function loadPostValue ()
82 function applyPostValue ()
84 if (!$this->disabled && $this->isVisible()
85 && ($this->plugin->acl_is_moveable($this->value) || ($this->plugin->dn ==
'new'))) {
88 if ($this->plugin->dn ==
'new') {
103 $error = parent::check();
104 if (!empty($error)) {
108 if (($this->orig_dn ==
'new') && !$this->plugin->acl_is_createable($this->value)) {
111 ($this->orig_dn !=
'new') &&
112 ($this->plugin->dn != $this->orig_dn) &&
113 !$this->plugin->acl_is_moveable($this->value)) {
123 function checkValue ($value)
125 if (!is_string($value) && (!is_object($value) || !method_exists($value,
'__toString'))) {
130 function setValue ($value)
132 parent::setValue($value);
133 if (is_object($this->plugin) &&
146 function renderFormInput ():
string 149 $smarty->assign(
'usePrototype',
'true');
150 if ($this->disabled) {
151 $display = $this->renderInputField(
154 'value' => $this->getValue()
158 $display =
'{literal}'.$this->baseSelector->render().
'{/literal}';
163 function getHtmlId ():
string 172 function serializeAttribute (array &$attributes,
bool $form = TRUE)
174 if (!$form || $this->visible) {
175 parent::serializeAttribute($attributes, $form);
setSubmitButton($flag)
Set a new flag to the submit button.
Exception class which can be thrown if an attribute is set to a value with a non-compatible type...
__construct($ou, $label=NULL, $desc=NULL)
The constructor of BaseSelectorAttribute.
update(bool $force=FALSE)
Update the base.
& get_userinfo()
Return the current userinfo object.
static permCreate($name='')
Display that we have no permission to create an object.
checkLastBaseUpdate()
Check the last base value updated.
& get_smarty()
Get global smarty object.
Error returned by check method of SimplePlugin.
static check_base()
Display error when checking the base.
dn2base($dn, $ou=NULL)
Return the base of a given DN.
setHeight($value)
Set a new value of the member height.
getBase()
Accessor of the base.
This class allow to handle easily an Base selector attribute.
static permMove($name='')
Display that we have no permission to move an object.
renderAcl(string $display)
Add ACL information around display.
getInputHtmlId()
Returns id of the html field.
getBases()
Accessor of the bases.
This class allow to handle easily any kind of LDAP attribute.
setBase(string $base)
Set a new value of the member base.