FusionDirectory
Public Member Functions | Protected Member Functions
Attribute Class Reference

This class allow to handle easily any kind of LDAP attribute. More...

Inheritance diagram for Attribute:
Inheritance graph
[legend]

Public Member Functions

 __construct (string $label, string $description, string $ldapName, bool $required=FALSE, $defaultValue='', string $acl='')
 The constructor of Attribute. More...
 
 setParent (&$plugin)
 Set the parent plugin for this attribute. More...
 
 getParent ()
 Get parent plugin instance, if any. More...
 
 getExample ()
 Get an example value. More...
 
 setPostValue ($value)
 Set the postValue.
 
 fixPostValue ($value)
 In case a treatment is needed on POST content.
 
 resetToDefault ()
 Reset this attribute to its default value.
 
 loadValue (array $attrs)
 If in LDAP, loads this attribute value from the attrs array.
 
 inputValue ($ldapValue)
 Return the ldap value in the correct intern format value. More...
 
 setManagedAttributes (array $mAttributes)
 Set a list of attributes that are managed by this attributes. See FusionDirectory wiki for detailed documentation.
 
 loadPostValue ()
 Update this attributes postValue depending of the $_POST values.
 
 applyPostValue ()
 Apply this attribute postValue in value if this attribute is enabled.
 
 computeLdapValue ()
 Computes LDAP value.
 
 fillLdapValue (array &$attrs)
 Fill LDAP value in the attrs array.
 
 fillLdapValueHook (array &$attrs)
 Post-modify the attrs array if needed (used for erasing managed attributes)
 
 check ()
 Check the correctness of this attribute.
 
 renderAttribute (array &$attributes, bool $readOnly, bool $readable, bool $writable)
 Render this attribute form input(s) More...
 
 serializeAttribute (array &$attributes, bool $form=TRUE)
 Serialize this attribute for RPC requests. More...
 
 deserializeValue ($value)
 Apply value from RPC requests. More...
 
 serializeValue ($value=NULL)
 Serialize value for RPC requests. More...
 
 renderAcl (string $display)
 Add ACL information around display. More...
 
 getAclInfo ()
 Get ACL information about the ACL we need to create.
 

Protected Member Functions

 loadAttrValue (array $attrs)
 Loads this attribute value from the attrs array if present. More...
 

Detailed Description

This class allow to handle easily any kind of LDAP attribute.

Definition at line 32 of file class_Attribute.inc.

Constructor & Destructor Documentation

◆ __construct()

__construct ( string  $label,
string  $description,
string  $ldapName,
bool  $required = FALSE,
  $defaultValue = '',
string  $acl = '' 
)

The constructor of Attribute.

Parameters
string$labelThe label to show for this attribute
string$descriptionA more detailed description for the attribute
string$ldapNameThe name of the attribute in the LDAP (If it's not in the ldap, still provide a unique name)
boolean$requiredIs this attribute mandatory or not
mixed$defaultValueThe default value for this attribute
string$aclThe name of the acl for this attribute if he does not use its own. (Leave empty if he should use its own like most attributes do)

Definition at line 103 of file class_Attribute.inc.

Referenced by DialogAttribute\__construct().

Member Function Documentation

◆ deserializeValue()

deserializeValue (   $value)

Apply value from RPC requests.

Parameters
mixed$valuethe value

Definition at line 696 of file class_Attribute.inc.

References htmlescape().

◆ getExample()

getExample ( )

Get an example value.

Returns
string|null

Definition at line 185 of file class_Attribute.inc.

◆ getParent()

getParent ( )

Get parent plugin instance, if any.

Returns
SimpleTab|null

Definition at line 130 of file class_Attribute.inc.

◆ inputValue()

inputValue (   $ldapValue)

Return the ldap value in the correct intern format value.

Parameters
$ldapValueThe value as found in LDAP

Definition at line 373 of file class_Attribute.inc.

Referenced by ImageAttribute\deserializeValue(), ImageAttribute\fillLdapValue(), and Attribute\loadAttrValue().

◆ loadAttrValue()

loadAttrValue ( array  $attrs)
protected

Loads this attribute value from the attrs array if present.

If the attribute is not present in $attrs, does not change value

Parameters
array$attrsThe attributes array as fetch from the LDAP

Definition at line 342 of file class_Attribute.inc.

References Attribute\inputValue().

Referenced by Attribute\loadValue().

◆ renderAcl()

renderAcl ( string  $display)

Add ACL information around display.

Parameters
string$displaythe display information to pass through ACL

Definition at line 723 of file class_Attribute.inc.

Referenced by SetAttribute\__construct(), BooleanAttribute\__construct(), IntAttribute\__construct(), DateAttribute\__construct(), StringAttribute\__construct(), ImageAttribute\deserializeValue(), FileTextAreaAttribute\loadPostValue(), and FileAttribute\readFile().

◆ renderAttribute()

renderAttribute ( array &  $attributes,
bool  $readOnly,
bool  $readable,
bool  $writable 
)

Render this attribute form input(s)

Parameters
array&$attributesthe attributes array
bool$readOnlyshould we show text or input
bool$readableACL read
bool$writableACL write

Definition at line 631 of file class_Attribute.inc.

◆ serializeAttribute()

serializeAttribute ( array &  $attributes,
bool  $form = TRUE 
)

Serialize this attribute for RPC requests.

Parameters
array&$attributesthe attributes array
boolean$form

Definition at line 664 of file class_Attribute.inc.

References Attribute\serializeValue().

◆ serializeValue()

serializeValue (   $value = NULL)

Serialize value for RPC requests.

Parameters
mixed$valuethe value

Definition at line 711 of file class_Attribute.inc.

Referenced by Attribute\serializeAttribute().

◆ setParent()

setParent ( $plugin)

Set the parent plugin for this attribute.

Parameters
SimpleTab&$pluginThe parent plugin

Definition at line 120 of file class_Attribute.inc.


The documentation for this class was generated from the following file: