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
8e0a22e4
Commit
8e0a22e4
authored
Nov 22, 2008
by
Dries Buytaert
Browse files
- Patch
#305345
by catch: making all terminology consistent.
parent
6e0b06ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/node/node.admin.inc
View file @
8e0a22e4
...
...
@@ -152,7 +152,7 @@ function node_filters() {
// The taxonomy filter
if
(
$taxonomy
=
module_invoke
(
'taxonomy'
,
'form_all'
,
1
))
{
$filters
[
'
category
'
]
=
array
(
'title'
=>
t
(
'
category
'
),
'options'
=>
$taxonomy
);
$filters
[
'
term
'
]
=
array
(
'title'
=>
t
(
'
term
'
),
'options'
=>
$taxonomy
);
}
// Language filter if there is a list of languages
if
(
$languages
=
module_invoke
(
'locale'
,
'language_list'
))
{
...
...
@@ -179,7 +179,7 @@ function node_build_filter_query() {
list
(
$key
,
$value
)
=
explode
(
'-'
,
$value
,
2
);
$where
[]
=
'n.'
.
$key
.
' = %d'
;
break
;
case
'
category
'
:
case
'
term
'
:
$table
=
"tn
$index
"
;
$where
[]
=
"
$table
.tid = %d"
;
$join
.
=
"INNER JOIN
{
term_node
}
$table
ON n.nid =
$table
.nid "
;
...
...
@@ -215,7 +215,7 @@ function node_filter_form() {
$form
[
'#submit'
][]
=
'node_filter_form_submit'
;
foreach
(
$session
as
$filter
)
{
list
(
$type
,
$value
)
=
$filter
;
if
(
$type
==
'
category
'
)
{
if
(
$type
==
'
term
'
)
{
// Load term name from DB rather than search and parse options array.
$value
=
module_invoke
(
'taxonomy'
,
'get_term'
,
$value
);
$value
=
$value
->
name
;
...
...
modules/node/node.module
View file @
8e0a22e4
...
...
@@ -1303,24 +1303,24 @@ function node_search($op = 'search', $keys = NULL) {
$keys
=
search_query_insert
(
$keys
,
'type'
);
}
if
(
$
category
=
search_query_extract
(
$keys
,
'
category
'
))
{
$
categorie
s
=
array
();
foreach
(
explode
(
','
,
$
category
)
as
$c
)
{
$
categorie
s
[]
=
"tn.tid = %d"
;
if
(
$
term
=
search_query_extract
(
$keys
,
'
term
'
))
{
$
term
s
=
array
();
foreach
(
explode
(
','
,
$
term
)
as
$c
)
{
$
term
s
[]
=
"tn.tid = %d"
;
$arguments1
[]
=
$c
;
}
$conditions1
.
=
' AND ('
.
implode
(
' OR '
,
$
categorie
s
)
.
')'
;
$conditions1
.
=
' AND ('
.
implode
(
' OR '
,
$
term
s
)
.
')'
;
$join1
.
=
' INNER JOIN {term_node} tn ON n.vid = tn.vid'
;
$keys
=
search_query_insert
(
$keys
,
'
category
'
);
$keys
=
search_query_insert
(
$keys
,
'
term
'
);
}
if
(
$languages
=
search_query_extract
(
$keys
,
'language'
))
{
$
categorie
s
=
array
();
$
term
s
=
array
();
foreach
(
explode
(
','
,
$languages
)
as
$l
)
{
$
categorie
s
[]
=
"n.language = '%s'"
;
$
term
s
[]
=
"n.language = '%s'"
;
$arguments1
[]
=
$l
;
}
$conditions1
.
=
' AND ('
.
implode
(
' OR '
,
$
categorie
s
)
.
')'
;
$conditions1
.
=
' AND ('
.
implode
(
' OR '
,
$
term
s
)
.
')'
;
$keys
=
search_query_insert
(
$keys
,
'language'
);
}
...
...
@@ -1947,9 +1947,9 @@ function node_form_alter(&$form, $form_state, $form_id) {
// Taxonomy box:
if
(
$taxonomy
=
module_invoke
(
'taxonomy'
,
'form_all'
,
1
))
{
$form
[
'advanced'
][
'
category
'
]
=
array
(
$form
[
'advanced'
][
'
term
'
]
=
array
(
'#type'
=>
'select'
,
'#title'
=>
t
(
'Only in the
category
(s)'
),
'#title'
=>
t
(
'Only in the
term
(s)'
),
'#prefix'
=>
'<div class="criterion">'
,
'#size'
=>
10
,
'#suffix'
=>
'</div>'
,
...
...
@@ -2010,8 +2010,8 @@ function node_search_validate($form, &$form_state) {
}
}
if
(
isset
(
$form_state
[
'values'
][
'
category
'
])
&&
is_array
(
$form_state
[
'values'
][
'
category
'
]))
{
$keys
=
search_query_insert
(
$keys
,
'
category
'
,
implode
(
','
,
$form_state
[
'values'
][
'
category
'
]));
if
(
isset
(
$form_state
[
'values'
][
'
term
'
])
&&
is_array
(
$form_state
[
'values'
][
'
term
'
]))
{
$keys
=
search_query_insert
(
$keys
,
'
term
'
,
implode
(
','
,
$form_state
[
'values'
][
'
term
'
]));
}
if
(
isset
(
$form_state
[
'values'
][
'language'
])
&&
is_array
(
$form_state
[
'values'
][
'language'
]))
{
$keys
=
search_query_insert
(
$keys
,
'language'
,
implode
(
','
,
array_filter
(
$form_state
[
'values'
][
'language'
])));
...
...
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