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
bcf1c300
Commit
bcf1c300
authored
10 years ago
by
Côme Bernigaud
Committed by
Benoit Mortier
10 years ago
Browse files
Options
Download
Patches
Plain Diff
Moved some code from FAI (see #3451)
parent
48938803
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
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/simpleplugin/class_dialogAttributes.inc
+67
-0
include/simpleplugin/class_dialogAttributes.inc
with
67 additions
and
0 deletions
+67
-0
include/simpleplugin/class_dialogAttributes.inc
+
67
−
0
View file @
bcf1c300
...
@@ -663,4 +663,71 @@ class UserAttribute extends DialogButtonAttribute
...
@@ -663,4 +663,71 @@ class UserAttribute extends DialogButtonAttribute
return
$ids
;
return
$ids
;
}
}
}
}
class
GenericSimplePluginDialog
extends
GenericDialog
{
protected
$initialDialogValue
=
NULL
;
function
__construct
(
$simplePlugin
,
&
$attribute
,
$value
=
array
())
{
$this
->
attribute
=
$attribute
;
$this
->
dialog
=
new
$this
->
dialogClass
(
$simplePlugin
->
config
,
'new'
);
$base
=
$simplePlugin
->
dn
;
if
(
$base
==
'new'
)
{
$base
=
$simplePlugin
->
base
;
}
$this
->
dialog
->
set_acl_base
(
$base
);
$this
->
dialog
->
set_acl_category
(
$simplePlugin
->
acl_category
);
if
(
!
empty
(
$value
))
{
$this
->
initialDialogValue
=
$value
;
foreach
(
$this
->
dialog
->
attributes
as
$attr
)
{
if
(
isset
(
$value
[
$attr
]))
{
$this
->
dialog
->
$attr
=
$value
[
$attr
];
}
}
}
}
function
buttons
()
{
return
'<div style="width:100%; text-align:right; clear:both; float:none;">'
.
' <input type="submit" name="'
.
$this
->
post_finish
.
'" value="'
.
msgPool
::
saveButton
()
.
'"/> '
.
' <input type="submit" name="'
.
$this
->
post_cancel
.
'" value="'
.
msgPool
::
cancelButton
()
.
'"/>'
.
'</div>'
;
}
function
dialog_execute
()
{
$this
->
dialog
->
save_object
();
return
$this
->
dialog
->
execute
()
.
$this
->
buttons
();
}
function
handle_finish
()
{
$this
->
dialog
->
save_object
();
if
(
count
(
$this
->
dialog
->
check
()))
{
foreach
(
$this
->
dialog
->
check
()
as
$msg
)
{
msg_dialog
::
display
(
_
(
'Error'
),
$msg
,
ERROR_DIALOG
);
}
return
$this
->
dialog
->
execute
()
.
$this
->
buttons
();
}
$value
=
array
();
foreach
(
$this
->
dialog
->
attributes
as
$attr
)
{
$value
[
$attr
]
=
$this
->
dialog
->
$attr
;
}
$this
->
attribute
->
addValue
(
$value
);
return
FALSE
;
}
function
handle_cancel
()
{
if
(
$this
->
initialDialogValue
!==
NULL
)
{
$this
->
attribute
->
addValue
(
$this
->
initialDialogValue
);
}
return
FALSE
;
}
}
?>
?>
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