FusionDirectory
Public Member Functions | Protected Attributes
SelectAttribute Class Reference

This class allow to handle easily a Select LDAP attribute with a set of choices. More...

Inheritance diagram for SelectAttribute:
Inheritance graph
[legend]

Public Member Functions

 __construct ($label, $description, $ldapName, $required=FALSE, $choices=[], $defaultValue="", $outputs=NULL, $acl="")
 The constructor of SelectAttribute. More...
 
 setChoices (array $choices, array $outputs=NULL)
 Set the options of the select attribute. More...
 
 setDisplayChoices (array $values)
 Set the display options of the select attribute. More...
 
 getChoices ()
 Get the choices.
 
 getDisplayChoices ()
 Get the displayed choices (keys are choices)
 
 setSize ($size)
 Set the size of the HTML input tag, useful to display several options on the screen instead of just one.
 
- Public Member Functions inherited from Attribute
 __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 Attributes

 $hiddenChoices = []
 Valid values which should be hidden from rendered input. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Attribute
 loadAttrValue (array $attrs)
 Loads this attribute value from the attrs array if present. More...
 

Detailed Description

This class allow to handle easily a Select LDAP attribute with a set of choices.

Definition at line 30 of file class_SelectAttribute.inc.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $label,
  $description,
  $ldapName,
  $required = FALSE,
  $choices = [],
  $defaultValue = "",
  $outputs = NULL,
  $acl = "" 
)

The constructor of SelectAttribute.

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
array$choicesThe choices this select should offer. Pass array("") if you're gonna fill it later with setChoices
mixed$defaultValueThe default value for this attribute
array$outputsThe labels corresponding to the choices, leave to NULL if you want to display the choices themselves
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 52 of file class_SelectAttribute.inc.

References setChoices().

Member Function Documentation

◆ setChoices()

setChoices ( array  $choices,
array  $outputs = NULL 
)

Set the options of the select attribute.

Parameters
array$choicesThe choices this select should offer
array$outputsThe labels corresponding to the choices, leave to NULL if you want to display the choices themselves

Definition at line 63 of file class_SelectAttribute.inc.

References Attribute\resetToDefault(), and setDisplayChoices().

Referenced by __construct().

◆ setDisplayChoices()

setDisplayChoices ( array  $values)

Set the display options of the select attribute.

Parameters
array$valuesThe labels corresponding to the choices, in the same order as the choices

Definition at line 102 of file class_SelectAttribute.inc.

Referenced by setChoices().

Field Documentation

◆ $hiddenChoices

$hiddenChoices = []
protected

Valid values which should be hidden from rendered input.

Used by SetAttribute to hide used values

Definition at line 39 of file class_SelectAttribute.inc.


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