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
drupal
Commits
36f6cdc7
Commit
36f6cdc7
authored
Jul 30, 2005
by
Steven Wittens
Browse files
-
#23310
: Gray out picture theme settings if pictures are disabled.
parent
897aae3e
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/system.module
View file @
36f6cdc7
...
...
@@ -721,20 +721,32 @@ function system_theme_settings($key = '') {
$group
=
''
;
// Toggle settings
$toggles
=
array
(
'toggle_name'
=>
t
(
'Site name'
),
'toggle_slogan'
=>
t
(
'Site slogan'
),
'toggle_mission'
=>
t
(
'Mission statement'
),
'toggle_primary_links'
=>
t
(
'Primary links'
),
'toggle_secondary_links'
=>
t
(
'Secondary links'
),
'toggle_node_user_picture'
=>
t
(
'User pictures in posts'
),
'toggle_comment_user_picture'
=>
t
(
'User pictures in comments'
),
'toggle_search'
=>
t
(
'Search box'
),
'toggle_favicon'
=>
t
(
'Shortcut icon'
));
$toggles
=
array
(
'toggle_name'
=>
t
(
'Site name'
),
'toggle_slogan'
=>
t
(
'Site slogan'
),
'toggle_mission'
=>
t
(
'Mission statement'
),
'toggle_primary_links'
=>
t
(
'Primary links'
),
'toggle_secondary_links'
=>
t
(
'Secondary links'
),
'toggle_node_user_picture'
=>
t
(
'User pictures in posts'
),
'toggle_comment_user_picture'
=>
t
(
'User pictures in comments'
),
'toggle_search'
=>
t
(
'Search box'
),
'toggle_favicon'
=>
t
(
'Shortcut icon'
)
);
// Some features are not always available
$disabled
=
array
();
if
(
!
variable_get
(
'user_pictures'
,
0
))
{
$disabled
[
'toggle_node_user_picture'
]
=
true
;
$disabled
[
'toggle_comment_user_picture'
]
=
true
;
}
if
(
!
module_exist
(
'search'
))
{
$disabled
[
'toggle_search'
]
=
true
;
}
foreach
(
$toggles
as
$name
=>
$title
)
{
if
((
!
$key
)
||
in_array
(
$name
,
$features
))
{
// disable search box if search.module is disabled
$group
.
=
form_checkbox
(
$title
,
"
$var
][
$name
"
,
1
,
$settings
[
$name
],
NULL
,
(
!
module_exist
(
'search'
)
&&
$name
==
'toggle_search'
)
?
array
(
'disabled'
=>
'disabled'
)
:
NULL
);
$group
.
=
form_checkbox
(
$title
,
"
$var
][
$name
"
,
1
,
$settings
[
$name
],
NULL
,
isset
(
$disabled
[
$name
]
)
?
array
(
'disabled'
=>
'disabled'
)
:
NULL
);
}
}
if
(
$group
)
{
...
...
modules/system/system.module
View file @
36f6cdc7
...
...
@@ -721,20 +721,32 @@ function system_theme_settings($key = '') {
$group
=
''
;
// Toggle settings
$toggles
=
array
(
'toggle_name'
=>
t
(
'Site name'
),
'toggle_slogan'
=>
t
(
'Site slogan'
),
'toggle_mission'
=>
t
(
'Mission statement'
),
'toggle_primary_links'
=>
t
(
'Primary links'
),
'toggle_secondary_links'
=>
t
(
'Secondary links'
),
'toggle_node_user_picture'
=>
t
(
'User pictures in posts'
),
'toggle_comment_user_picture'
=>
t
(
'User pictures in comments'
),
'toggle_search'
=>
t
(
'Search box'
),
'toggle_favicon'
=>
t
(
'Shortcut icon'
));
$toggles
=
array
(
'toggle_name'
=>
t
(
'Site name'
),
'toggle_slogan'
=>
t
(
'Site slogan'
),
'toggle_mission'
=>
t
(
'Mission statement'
),
'toggle_primary_links'
=>
t
(
'Primary links'
),
'toggle_secondary_links'
=>
t
(
'Secondary links'
),
'toggle_node_user_picture'
=>
t
(
'User pictures in posts'
),
'toggle_comment_user_picture'
=>
t
(
'User pictures in comments'
),
'toggle_search'
=>
t
(
'Search box'
),
'toggle_favicon'
=>
t
(
'Shortcut icon'
)
);
// Some features are not always available
$disabled
=
array
();
if
(
!
variable_get
(
'user_pictures'
,
0
))
{
$disabled
[
'toggle_node_user_picture'
]
=
true
;
$disabled
[
'toggle_comment_user_picture'
]
=
true
;
}
if
(
!
module_exist
(
'search'
))
{
$disabled
[
'toggle_search'
]
=
true
;
}
foreach
(
$toggles
as
$name
=>
$title
)
{
if
((
!
$key
)
||
in_array
(
$name
,
$features
))
{
// disable search box if search.module is disabled
$group
.
=
form_checkbox
(
$title
,
"
$var
][
$name
"
,
1
,
$settings
[
$name
],
NULL
,
(
!
module_exist
(
'search'
)
&&
$name
==
'toggle_search'
)
?
array
(
'disabled'
=>
'disabled'
)
:
NULL
);
$group
.
=
form_checkbox
(
$title
,
"
$var
][
$name
"
,
1
,
$settings
[
$name
],
NULL
,
isset
(
$disabled
[
$name
]
)
?
array
(
'disabled'
=>
'disabled'
)
:
NULL
);
}
}
if
(
$group
)
{
...
...
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