Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
30059b1a
Commit
30059b1a
authored
Nov 13, 2005
by
Dries Buytaert
Browse files
- Patch
#34514
by darius: fixed forms API glitches.
parent
c8f6a242
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/profile.module
View file @
30059b1a
...
...
@@ -349,12 +349,12 @@ function profile_form_profile($edit, $user, $category) {
$result
=
db_query
(
"SELECT * FROM
{
profile_fields
}
WHERE LOWER(category) = LOWER('%s') ORDER BY weight"
,
$category
);
// We use LOWER('%s') instead of PHP's strtolower() to avoid UTF-8 conversion issues.
}
// Only add form group if items exist
if
(
db_num_rows
(
$result
))
{
$fields
[
$category
]
=
array
(
'#type'
=>
'fieldset'
,
'#title'
=>
$category
);
}
while
(
$field
=
db_fetch_object
(
$result
))
{
$category
=
$field
->
category
;
if
(
!
isset
(
$fields
[
$category
]))
{
$fields
[
$category
]
=
array
(
'#type'
=>
'fieldset'
,
'#title'
=>
$category
,
'#weight'
=>
$w
++
);
}
switch
(
$field
->
type
)
{
case
'textfield'
:
case
'url'
:
...
...
@@ -380,7 +380,7 @@ function profile_form_profile($edit, $user, $category) {
$fields
[
$category
][
$field
->
name
]
=
array
(
'#type'
=>
'select'
,
'#title'
=>
check_plain
(
$field
->
title
),
'#default_value'
=>
$edit
[
$field
->
name
],
'#options'
=>
$options
,
'#description'
=>
_profile_form_explanation
(
$field
),
'#required'
=>
$field
->
required
);
break
;
case
'date'
:
$fields
[
$category
][
$field
->
name
]
=
array
(
'#type'
=>
'date'
,
'#title'
=>
check_plain
(
$field
->
title
),
'#default_value'
=>
$edit
[
$field
->
name
],
description
,
'#description'
=>
_profile_form_explanation
(
$field
),
'#required'
=>
$field
->
required
);
$fields
[
$category
][
$field
->
name
]
=
array
(
'#type'
=>
'date'
,
'#title'
=>
check_plain
(
$field
->
title
),
'#default_value'
=>
$edit
[
$field
->
name
],
'#description'
=>
_profile_form_explanation
(
$field
),
'#required'
=>
$field
->
required
);
break
;
}
}
...
...
modules/profile/profile.module
View file @
30059b1a
...
...
@@ -349,12 +349,12 @@ function profile_form_profile($edit, $user, $category) {
$result
=
db_query
(
"SELECT * FROM
{
profile_fields
}
WHERE LOWER(category) = LOWER('%s') ORDER BY weight"
,
$category
);
// We use LOWER('%s') instead of PHP's strtolower() to avoid UTF-8 conversion issues.
}
// Only add form group if items exist
if
(
db_num_rows
(
$result
))
{
$fields
[
$category
]
=
array
(
'#type'
=>
'fieldset'
,
'#title'
=>
$category
);
}
while
(
$field
=
db_fetch_object
(
$result
))
{
$category
=
$field
->
category
;
if
(
!
isset
(
$fields
[
$category
]))
{
$fields
[
$category
]
=
array
(
'#type'
=>
'fieldset'
,
'#title'
=>
$category
,
'#weight'
=>
$w
++
);
}
switch
(
$field
->
type
)
{
case
'textfield'
:
case
'url'
:
...
...
@@ -380,7 +380,7 @@ function profile_form_profile($edit, $user, $category) {
$fields
[
$category
][
$field
->
name
]
=
array
(
'#type'
=>
'select'
,
'#title'
=>
check_plain
(
$field
->
title
),
'#default_value'
=>
$edit
[
$field
->
name
],
'#options'
=>
$options
,
'#description'
=>
_profile_form_explanation
(
$field
),
'#required'
=>
$field
->
required
);
break
;
case
'date'
:
$fields
[
$category
][
$field
->
name
]
=
array
(
'#type'
=>
'date'
,
'#title'
=>
check_plain
(
$field
->
title
),
'#default_value'
=>
$edit
[
$field
->
name
],
description
,
'#description'
=>
_profile_form_explanation
(
$field
),
'#required'
=>
$field
->
required
);
$fields
[
$category
][
$field
->
name
]
=
array
(
'#type'
=>
'date'
,
'#title'
=>
check_plain
(
$field
->
title
),
'#default_value'
=>
$edit
[
$field
->
name
],
'#description'
=>
_profile_form_explanation
(
$field
),
'#required'
=>
$field
->
required
);
break
;
}
}
...
...
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!
Cancel
Please
register
or
sign in
to comment