Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
drupal.org
search_config
Commits
4663a33c
Commit
4663a33c
authored
Feb 12, 2007
by
Nesta Campbell
Browse files
Fixed minor bug where taxonomy form was showing up even when no categories
had been created.
parent
d467fe90
Changes
1
Hide whitespace changes
Inline
Side-by-side
search_config.module
View file @
4663a33c
...
...
@@ -95,34 +95,35 @@ function search_config_form_alter($form_id, &$form) {
}
}
// T
axonomy
if
(
variable_get
(
'search_config_disable_category_all'
,
0
)
||
!
user_access
(
'search by category'
))
{
unset
(
$form
[
'advanced'
][
'
category'
]);
}
else
{
$terms
=
variable_get
(
'search_config_disable_category'
,
array
());
$taxonomy
=
module_invoke
(
'taxonomy'
,
'form_all'
,
1
);
if
(
$t
axonomy
=
module_invoke
(
'taxonomy'
,
'form_all'
,
1
))
{
// Taxonomy
if
(
variable_get
(
'search_config_disable_category_all'
,
0
)
||
!
user_access
(
'search by
category'
))
{
unset
(
$form
[
'advanced'
][
'category'
]);
}
else
{
$terms
=
variable_get
(
'search_config_disable_category'
,
array
()
);
// FIXME: What about multiple hierarchy categories?
foreach
(
$taxonomy
as
$vocab
=>
$term
)
{
foreach
(
$term
as
$k
=>
$v
)
{
if
(
in_array
(
$k
,
$terms
))
{
unset
(
$taxonomy
[
$vocab
][
$k
]);
// FIXME: What about multiple hierarchy categories?
foreach
(
$taxonomy
as
$vocab
=>
$term
)
{
foreach
(
$term
as
$k
=>
$v
)
{
if
(
in_array
(
$k
,
$terms
))
{
unset
(
$taxonomy
[
$vocab
][
$k
]);
}
}
}
}
// Taxonomy box:
$form
[
'advanced'
][
'category'
]
=
array
(
'#type'
=>
'select'
,
'#title'
=>
t
(
'Only in the category(s)'
),
'#prefix'
=>
'<div class="criterion">'
,
'#size'
=>
10
,
'#suffix'
=>
'</div>'
,
'#options'
=>
$taxonomy
,
'#multiple'
=>
TRUE
,
);
// Taxonomy box:
$form
[
'advanced'
][
'category'
]
=
array
(
'#type'
=>
'select'
,
'#title'
=>
t
(
'Only in the category(s)'
),
'#prefix'
=>
'<div class="criterion">'
,
'#size'
=>
10
,
'#suffix'
=>
'</div>'
,
'#options'
=>
$taxonomy
,
'#multiple'
=>
TRUE
,
);
}
}
}
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