Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
fusiondirectory
fusiondirectory
Commits
13ddb1b3
Commit
13ddb1b3
authored
8 years ago
by
Côme Chilliet
Browse files
Options
Download
Patches
Plain Diff
Added some documentation in SelectAttribute
parent
e6fdc18d
dev
6342-update-the-locales-for-1-5
6344-template-issue-when-creating-a-template-with-empty-password-error-message-should-not-be-seen
6365-core-locking-mechanism-is-not-changing-the-mail-ressource-it-does-lock-the-mail-account
6365-core-when-lock-mechanism-is-trigger-the-user-should-not-be-editable-if-not-unlock
6378-orcid-test-method-is-wrong-and-break-orcid-saving
core-php8
master
fusiondirectory-1.5
fusiondirectory-1.4
fusiondirectory-1.3.1
fusiondirectory-1.3
fusiondirectory-1.2.3
fusiondirectory-1.2.2
fusiondirectory-1.2.1
fusiondirectory-1.2
fusiondirectory-1.1.1
fusiondirectory-1.1
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/class_management.inc
+1
-4
include/class_management.inc
include/simpleplugin/attributes/class_SelectAttribute.inc
+26
-9
include/simpleplugin/attributes/class_SelectAttribute.inc
with
27 additions
and
13 deletions
+27
-13
include/class_management.inc
+
1
−
4
View file @
13ddb1b3
...
...
@@ -401,9 +401,7 @@ class management
}
/*!
* \brief Save object modifications and keep dialogs opened.
* - Calls 'ldap::check' to validate the given input.
* - Calls 'ldap::save' to save back object modifications (e.g. to ldap).
* \brief Save object modifications and keep dialogs opened
*/
protected
function
applyChanges
()
{
...
...
@@ -412,7 +410,6 @@ class management
$msgs
=
$this
->
tabObject
->
save
();
if
(
count
(
$msgs
))
{
msg_dialog
::
displayChecks
(
$msgs
);
return
""
;
}
else
{
@
DEBUG
(
DEBUG_TRACE
,
__LINE__
,
__FUNCTION__
,
__FILE__
,
$this
->
dns
,
'Modifications applied!'
);
$this
->
tabObject
->
re_init
();
...
...
This diff is collapsed.
Click to expand it.
include/simpleplugin/attributes/class_SelectAttribute.inc
+
26
−
9
View file @
13ddb1b3
...
...
@@ -18,6 +18,11 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/*!
* \file class_SelectAttribute.inc
* Source code for the Select attributes
*/
/*! \brief This class allow to handle easily a Select LDAP attribute with a set of choices
*
*/
...
...
@@ -35,7 +40,7 @@ class SelectAttribute extends Attribute
* \param boolean $required Is this attribute mandatory or not
* \param array $choices The choices this select should offer. Pass array("") if you're gonna fill it later with setChoices
* \param mixed $defaultValue The default value for this attribute
* \param array $outputs The label corresponding to the choices, leave to NULL if you want to display the choices themselves
* \param array $outputs The label
s
corresponding to the choices, leave to NULL if you want to display the choices themselves
* \param string $acl The 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)
*/
function
__construct
(
$label
,
$description
,
$ldapName
,
$required
=
FALSE
,
$choices
=
array
(),
$defaultValue
=
""
,
$outputs
=
NULL
,
$acl
=
""
)
...
...
@@ -47,13 +52,18 @@ class SelectAttribute extends Attribute
$this
->
setChoices
(
$choices
,
$outputs
);
}
/*! \brief Set the options of the select attribute
*
* \param array $choices The choices this select should offer
* \param array $outputs The labels corresponding to the choices, leave to NULL if you want to display the choices themselves
*/
function
setChoices
(
$choices
,
$outputs
=
NULL
)
{
$this
->
outputs
=
NULL
;
if
(
!
$this
->
isRequired
()
&&
!
in_array
(
""
,
$choices
,
TRUE
))
{
array_unshift
(
$choices
,
""
);
if
(
!
$this
->
isRequired
()
&&
!
in_array
(
''
,
$choices
,
TRUE
))
{
array_unshift
(
$choices
,
''
);
if
(
is_array
(
$outputs
))
{
array_unshift
(
$outputs
,
_
(
"
None
"
));
array_unshift
(
$outputs
,
_
(
'
None
'
));
}
}
$this
->
choices
=
$choices
;
...
...
@@ -68,6 +78,10 @@ class SelectAttribute extends Attribute
}
}
/*! \brief Set the display options of the select attribute
*
* \param array $outputs The labels corresponding to the choices, in the same order as the choices
*/
function
setDisplayChoices
(
$values
)
{
$this
->
outputs
=
array
();
...
...
@@ -77,6 +91,13 @@ class SelectAttribute extends Attribute
}
}
/*! \brief Get the choices
*/
function
getChoices
()
{
return
$this
->
choices
;
}
function
setRequired
(
$bool
)
{
parent
::
setRequired
(
$bool
);
...
...
@@ -154,11 +175,6 @@ class SelectAttribute extends Attribute
return
$this
->
renderAcl
(
$display
);
}
function
getChoices
()
{
return
$this
->
choices
;
}
function
serializeAttribute
(
&
$attributes
,
$form
=
TRUE
)
{
if
(
!
$form
||
$this
->
visible
)
{
...
...
@@ -173,6 +189,7 @@ class SelectAttribute extends Attribute
}
}
/*! \brief Set the size of the HTML input tag, useful to display several options on the screen instead of just one */
function
setSize
(
$size
)
{
$this
->
size
=
$size
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets