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
1b4698b4
Commit
1b4698b4
authored
Feb 24, 2009
by
Richard Mansfield
Browse files
Pieforms: Check needsmultipart after running the element's set_attributes()
parent
ab79429a
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/pieforms/pieform.php
View file @
1b4698b4
...
...
@@ -322,15 +322,6 @@ class Pieform {/*{{{*/
$element
[
'title'
]
=
''
;
}
// Force the form method to post if there is a file to upload
if
(
!
empty
(
$element
[
'needsmultipart'
]))
{
$this
->
fileupload
=
true
;
if
(
$this
->
data
[
'method'
]
==
'get'
)
{
$this
->
data
[
'method'
]
=
'post'
;
self
::
info
(
"Your form '
$this->name
' had the method 'get' and also a file element - it has been converted to 'post'"
);
}
}
// This function can be defined by the application using Pieforms,
// and applies to all elements of this type
$function
=
'pieform_element_'
.
$element
[
'type'
]
.
'_configure'
;
...
...
@@ -350,6 +341,15 @@ class Pieform {/*{{{*/
$element
=
$function
(
$element
);
}
// Force the form method to post if there is a file to upload
if
(
!
empty
(
$element
[
'needsmultipart'
]))
{
$this
->
fileupload
=
true
;
if
(
$this
->
data
[
'method'
]
==
'get'
)
{
$this
->
data
[
'method'
]
=
'post'
;
self
::
info
(
"Your form '
$this->name
' had the method 'get' and also a file element - it has been converted to 'post'"
);
}
}
// Add the autofocus flag to the element if required
if
(
!
$autofocusadded
&&
$this
->
data
[
'autofocus'
]
===
true
&&
empty
(
$element
[
'nofocus'
]))
{
$element
[
'autofocus'
]
=
true
;
...
...
Write
Preview
Markdown
is supported
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