Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
0ba3870e
Commit
0ba3870e
authored
Nov 29, 2006
by
Nigel McNie
Committed by
Nigel McNie
Nov 29, 2006
Browse files
Added support for differently named submit functions based on the name of
the submit button pressed.
parent
68672660
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/pieforms/pieform.php
View file @
0ba3870e
...
...
@@ -556,7 +556,17 @@ class Pieform {
// Submit the form if things went OK
if
(
$this
->
submit
&&
!
$this
->
has_errors
())
{
if
(
function_exists
(
$this
->
submitfunction
))
{
foreach
(
$this
->
get_elements
()
as
$element
)
{
// @todo Rename 'ajaxmessages' to 'submitelement'
if
(
$element
[
'ajaxmessages'
]
==
true
&&
isset
(
$values
[
$element
[
'name'
]]))
{
$function
=
"
{
$this
->
name
}
_submit_
{
$element
[
'name'
]
}
"
;
if
(
function_exists
(
$function
))
{
$function
(
$values
);
break
;
}
}
}
else
if
(
function_exists
(
$this
->
submitfunction
))
{
$function
=
$this
->
submitfunction
;
// Call the user defined function for processing a submit
// This function should really redirect/exit after it has
...
...
htdocs/lib/pieforms/pieform/elements/submitcancel.php
View file @
0ba3870e
...
...
@@ -42,6 +42,8 @@ function pieform_render_submitcancel($element, Pieform $form) {
}
function
pieform_render_submitcancel_set_attributes
(
$element
)
{
// @todo change to 'submitelement' => true, more generic and can be used
// for working out which submit button was pressed
$element
[
'ajaxmessages'
]
=
true
;
return
$element
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment