Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
cck
Commits
94fc583a
Commit
94fc583a
authored
Jan 28, 2010
by
yched
Browse files
[
#658150
] followup by Pasqualle - fix coding style, error in hook name, and template suggestions
parent
938de050
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/node_reference/node_reference.module
View file @
94fc583a
...
...
@@ -396,7 +396,7 @@ function node_reference_autocomplete_value($element, $input = FALSE, $form_state
$result
=
$q
->
execute
();
// @todo If no result (node doesn't exist or no access).
$value
=
$result
->
fetchField
();
$value
.
=
' [nid:'
.
$nid
.
']'
;
$value
.
=
' [nid:'
.
$nid
.
']'
;
return
$value
;
}
}
...
...
@@ -451,7 +451,7 @@ function node_reference_autocomplete_validate($element, &$form_state, $form) {
/**
* Implements hook_field_widget_error().
*/
function
nodereference_field_widget_error
(
$element
,
$error
)
{
function
node
_
reference_field_widget_error
(
$element
,
$error
)
{
form_error
(
$element
[
'nid'
],
$error
[
'message'
]);
}
...
...
@@ -493,7 +493,7 @@ function nodereference_field_widget_error($element, $error) {
* mode is ported.
*/
function
_node_reference_potential_references
(
$field
,
$string
=
''
,
$match
=
'contains'
,
$ids
=
array
(),
$limit
=
NULL
)
{
static
$results
=
array
();
$results
=
&
drupal_static
(
__FUNCTION__
,
array
()
)
;
// Create unique id for static cache.
$cid
=
$field
[
'field_name'
]
.
':'
.
$match
.
':'
...
...
@@ -586,7 +586,7 @@ function node_reference_autocomplete($field_name, $string = '') {
$references
=
_node_reference_potential_references
(
$field
,
$string
,
$match
,
array
(),
10
);
foreach
(
$references
as
$id
=>
$row
)
{
// Add a class wrapper for a few required CSS overrides.
$matches
[
$row
[
'title'
]
.
" [nid:
$id
]"
]
=
'<div class="reference-autocomplete">'
.
$row
[
'rendered'
]
.
'</div>'
;
$matches
[
$row
[
'title'
]
.
" [nid:
$id
]"
]
=
'<div class="reference-autocomplete">'
.
$row
[
'rendered'
]
.
'</div>'
;
}
drupal_json_output
(
$matches
);
}
...
...
@@ -624,10 +624,10 @@ function node_reference_preprocess_node(&$vars) {
if
(
!
empty
(
$vars
[
'node'
]
->
referencing_field
))
{
$node
=
$vars
[
'node'
];
$field
=
$node
->
referencing_field
;
$vars
[
'tem
plate_file
s'
][]
=
'node-
node_
reference'
;
$vars
[
'tem
plate_file
s'
][]
=
'node-
node_
reference
-
'
.
$field
[
'field_name'
];
$vars
[
'tem
plate_file
s'
][]
=
'node-
node_
reference
-
'
.
$node
->
type
;
$vars
[
'tem
plate_file
s'
][]
=
'node-
node_
reference
-
'
.
$field
[
'field_name'
]
.
'-'
.
$node
->
type
;
$vars
[
't
h
em
e_hook_suggestion
s'
][]
=
'node-reference'
;
$vars
[
't
h
em
e_hook_suggestion
s'
][]
=
'node-reference
__
'
.
$field
[
'field_name'
];
$vars
[
't
h
em
e_hook_suggestion
s'
][]
=
'node-reference
__
'
.
$node
->
type
;
$vars
[
't
h
em
e_hook_suggestion
s'
][]
=
'node-reference
__
'
.
$field
[
'field_name'
]
.
'__'
.
$node
->
type
;
}
}
...
...
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