Commit e7074b11 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Merge branch '5896-add-a-generic-objectlinkattribute' into '1.4-dev'

Resolve "Add a generic ObjectLinkAttribute"

See merge request fusiondirectory/fd!406
Showing with 22 additions and 1 deletion
+22 -1
......@@ -894,4 +894,25 @@ class DisplayAttribute extends DisplayLDAPAttribute
$this->setInLdap(FALSE);
}
}
?>
/*! \brief This class allow to display a link to an object which dn is stored in the attribute
*/
class ObjectLinkAttribute extends DisplayLDAPAttribute
{
protected $type;
function __construct ($label, $description, $ldapName, $required, $type, $defaultValue = "", $acl = "")
{
parent::__construct ($label, $description, $ldapName, $required, $defaultValue, $acl);
$this->type = $type;
}
function renderFormInput ()
{
try {
return objects::link($this->value, $this->type);
} catch (NonExistingLdapNodeException $e) {
return '<a><img src="geticon.php?context=status&amp;icon=dialog-warning&amp;size=16" alt="warning" class="center"/>&nbsp;'.sprintf(_('Invalid: %s'), $this->value).'</a>';
}
}
}
  • bmortier @bmortier

    mentioned in commit 24dad20f

    By Côme Chilliet on 2019-01-16T11:12:25 (imported from GitLab)

    ·

    mentioned in commit 24dad20f

    By Côme Chilliet on 2019-01-16T11:12:25 (imported from GitLab)

    Toggle commit list
  • bmortier @bmortier

    mentioned in merge request !490

    By Côme Chilliet on 2019-01-16T11:13:19 (imported from GitLab)

    ·

    mentioned in merge request !490

    By Côme Chilliet on 2019-01-16T11:13:19 (imported from GitLab)

    Toggle commit list
  • bmortier @bmortier

    mentioned in commit e92f79b2

    By Côme Chilliet on 2019-01-16T12:09:35 (imported from GitLab)

    ·

    mentioned in commit e92f79b2

    By Côme Chilliet on 2019-01-16T12:09:35 (imported from GitLab)

    Toggle commit list
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment