Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
drupal.org
link
Commits
e2426818
Commit
e2426818
authored
Apr 20, 2008
by
Nathan Haug
Browse files
Cleanup of link field labels when not displaying the title field.
parent
996d0f9e
Changes
1
Hide whitespace changes
Inline
Side-by-side
link.module
View file @
e2426818
...
...
@@ -439,17 +439,22 @@ function theme_link($element) {
drupal_add_css
(
drupal_get_path
(
'module'
,
'link'
)
.
'/link.css'
);
// Prefix single value link fields with the name of the field.
if
(
!
$element
[
'#field'
][
'multiple'
]
&&
isset
(
$element
[
'url'
])
&&
isset
(
$element
[
'title'
]))
{
$element
[
'url'
][
'#title'
]
=
$element
[
'#title'
]
.
' '
.
$element
[
'url'
][
'#title'
];
$element
[
'title'
][
'#title'
]
=
$element
[
'#title'
]
.
' '
.
$element
[
'title'
][
'#title'
];
if
(
empty
(
$element
[
'#field'
][
'multiple'
]))
{
if
(
isset
(
$element
[
'url'
])
&&
isset
(
$element
[
'title'
]))
{
$element
[
'url'
][
'#title'
]
=
$element
[
'#title'
]
.
' '
.
$element
[
'url'
][
'#title'
];
$element
[
'title'
][
'#title'
]
=
$element
[
'#title'
]
.
' '
.
$element
[
'title'
][
'#title'
];
}
elseif
(
$element
[
'url'
])
{
$element
[
'url'
][
'#title'
]
=
$element
[
'#title'
];
}
}
$output
=
''
;
$output
.
=
'<div class="link-field-subrow clear-block">'
;
if
(
$element
[
'title'
])
{
if
(
isset
(
$element
[
'title'
])
)
{
$output
.
=
'<div class="link-field-title link-field-column">'
.
theme
(
'textfield'
,
$element
[
'title'
])
.
'</div>'
;
}
$output
.
=
'<div class="link-field-url'
.
(
$element
[
'title'
]
?
' link-field-column'
:
''
)
.
'">'
.
theme
(
'textfield'
,
$element
[
'url'
])
.
'</div>'
;
$output
.
=
'<div class="link-field-url'
.
(
isset
(
$element
[
'title'
]
)
?
' link-field-column'
:
''
)
.
'">'
.
theme
(
'textfield'
,
$element
[
'url'
])
.
'</div>'
;
$output
.
=
'</div>'
;
if
(
!
empty
(
$element
[
'attributes'
]))
{
$output
.
=
'<div class="link-attributes">'
.
theme
(
'form_element'
,
$element
[
'attributes'
],
$element
[
'attributes'
][
'#value'
])
.
'</div>'
;
...
...
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