diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-08-27 19:40:36 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-08-27 19:40:36 +0000 |
commit | c9e82a3b7f81833878433b07cee19a527536133d (patch) | |
tree | 149e0af4cc4f16458264c34b6aa927d219cd51c9 /modules/block/block.admin.inc | |
parent | 149196005dd7aa5169608d624bf81038b9051405 (diff) | |
download | brdo-c9e82a3b7f81833878433b07cee19a527536133d.tar.gz brdo-c9e82a3b7f81833878433b07cee19a527536133d.tar.bz2 |
- Patch #503782 by Davy Van Den Brempt: not able to select region at block creation.
Diffstat (limited to 'modules/block/block.admin.inc')
-rw-r--r-- | modules/block/block.admin.inc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/modules/block/block.admin.inc b/modules/block/block.admin.inc index 5ab230a85..975ba3ec5 100644 --- a/modules/block/block.admin.inc +++ b/modules/block/block.admin.inc @@ -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(); |