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
c9e82a3b
Commit
c9e82a3b
authored
Aug 27, 2009
by
Dries Buytaert
Browse files
- Patch
#503782
by Davy Van Den Brempt: not able to select region at block creation.
parent
14919600
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/block/block.admin.inc
View file @
c9e82a3b
...
...
@@ -221,7 +221,7 @@ function block_admin_configure(&$form_state, $module = NULL, $delta = 0) {
$theme_default
=
variable_get
(
'theme_default'
,
'garland'
);
// Create a select list for each theme
foreach
(
system_ge
t_theme
_data
()
as
$theme_key
=>
$theme
)
{
foreach
(
lis
t_theme
s
()
as
$theme_key
=>
$theme
)
{
// Only display enabled themes
if
(
$theme
->
status
)
{
$region
=
db_query
(
"SELECT region FROM
{
block
}
WHERE module = :module AND delta = :delta AND theme = :theme"
,
array
(
...
...
@@ -492,6 +492,18 @@ function block_add_block_form_submit($form, &$form_state) {
));
}
$query
->
execute
();
// Store regions per theme for this block
foreach
(
$form_state
[
'values'
][
'regions'
]
as
$theme
=>
$region
)
{
db_merge
(
'block'
)
->
key
(
array
(
'theme'
=>
$theme
,
'delta'
=>
$delta
,
'module'
=>
$form_state
[
'values'
][
'module'
]))
->
fields
(
array
(
'region'
=>
$region
,
'pages'
=>
trim
(
$form_state
[
'values'
][
'pages'
]),
'status'
=>
(
int
)
(
$region
!=
BLOCK_REGION_NONE
),
))
->
execute
();
}
drupal_set_message
(
t
(
'The block has been created.'
));
cache_clear_all
();
...
...
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