Skip to content
Snippets Groups Projects
Commit c9e82a3b authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #503782 by Davy Van Den Brempt: not able to select region at block creation.

parent 14919600
No related branches found
No related tags found
No related merge requests found
......@@ -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_get_theme_data() as $theme_key => $theme) {
foreach (list_themes() 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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment