? dashboard-blocks.patch ? dashboard.patch ? modules/dashboard ? sites/default/files ? sites/default/private ? sites/default/settings.php Index: install.php =================================================================== RCS file: /cvs/drupal/drupal/install.php,v retrieving revision 1.202 diff -u -p -r1.202 install.php --- install.php 25 Aug 2009 21:53:46 -0000 1.202 +++ install.php 3 Sep 2009 10:21:51 -0000 @@ -1423,6 +1423,14 @@ function install_finished(&$install_stat $output .= '

' . st('For more information on configuring Drupal, please refer to the help section.', array('@help' => url('admin/help'))) . '

'; } + // Rebuild the module and theme data, in case any newly-installed modules + // need to modify it via hook_system_info_alter(). We need to clear the + // theme static cache first, to make sure that the theme data is actually + // rebuilt. + drupal_static_reset('_system_get_theme_data'); + system_get_module_data(); + system_get_theme_data(); + // Rebuild menu and registry to get content type links registered by the // profile, and possibly any other menu items created through the tasks. menu_rebuild(); Index: modules/block/block.module =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block.module,v retrieving revision 1.373 diff -u -p -r1.373 block.module --- modules/block/block.module 31 Aug 2009 17:06:08 -0000 1.373 +++ modules/block/block.module 3 Sep 2009 10:21:51 -0000 @@ -224,20 +224,34 @@ function block_page_build(&$page) { * The requested region. */ function block_get_blocks_by_region($region) { - $weight = 0; $build = array(); if ($list = block_list($region)) { - foreach ($list as $key => $block) { - $build[$key] = $block->content; - unset($block->content); - $build[$key] += array( - '#block' => $block, - '#weight' => ++$weight, - ); - $build[$key]['#theme_wrappers'][] ='block'; - } - $build['#sorted'] = TRUE; + $build = _block_get_renderable_array($list); + } + return $build; +} + +/** + * Get an array of blocks suitable for drupal_render(). + * + * @param $list + * A list of blocks such as that returned by block_list(). + * @return + * A renderable array. + */ +function _block_get_renderable_array($list = array()) { + $weight = 0; + $build = array(); + foreach ($list as $key => $block) { + $build[$key] = $block->content; + unset($block->content); + $build[$key] += array( + '#block' => $block, + '#weight' => ++$weight, + ); + $build[$key]['#theme_wrappers'][] ='block'; } + $build['#sorted'] = TRUE; return $build; } Index: modules/simpletest/tests/system_test.module =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/system_test.module,v retrieving revision 1.15 diff -u -p -r1.15 system_test.module --- modules/simpletest/tests/system_test.module 17 Aug 2009 20:32:30 -0000 1.15 +++ modules/simpletest/tests/system_test.module 3 Sep 2009 10:21:51 -0000 @@ -182,7 +182,7 @@ function system_test_exit() { /** * Implement hook_system_info_alter(). */ -function system_test_system_info_alter(&$info, $file) { +function system_test_system_info_alter(&$info, $file, $type) { // We need a static otherwise the last test will fail to alter common_test. static $test; if (($dependencies = variable_get('dependencies', array())) || $test) { Index: modules/system/system.api.php =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.api.php,v retrieving revision 1.71 diff -u -p -r1.71 system.api.php --- modules/system/system.api.php 1 Sep 2009 17:40:27 -0000 1.71 +++ modules/system/system.api.php 3 Sep 2009 10:21:51 -0000 @@ -713,8 +713,11 @@ function hook_mail_alter(&$message) { * @param $file * Full information about the module or theme, including $file->name, and * $file->filename + * @param $type + * Either 'module' or 'theme', depending on the type of .info file that was + * passed. */ -function hook_system_info_alter(&$info, $file) { +function hook_system_info_alter(&$info, $file, $type) { // Only fill this in if the .info file does not define a 'datestamp'. if (empty($info['datestamp'])) { $info['datestamp'] = filemtime($file->filename); Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.784 diff -u -p -r1.784 system.module --- modules/system/system.module 1 Sep 2009 16:50:12 -0000 1.784 +++ modules/system/system.module 3 Sep 2009 10:21:52 -0000 @@ -1906,7 +1906,7 @@ function _system_get_module_data() { // Invoke hook_system_info_alter() to give installed modules a chance to // modify the data in the .info files if necessary. - drupal_alter('system_info', $modules[$key]->info, $modules[$key]); + drupal_alter('system_info', $modules[$key]->info, $modules[$key], 'module'); } // The install profile is required. @@ -1999,7 +1999,7 @@ function _system_get_theme_data() { // Invoke hook_system_info_alter() to give installed modules a chance to // modify the data in the .info files if necessary. - drupal_alter('system_info', $themes[$key]->info, $themes[$key]); + drupal_alter('system_info', $themes[$key]->info, $themes[$key], 'theme'); if (!empty($themes[$key]->info['base theme'])) { $sub_themes[] = $key; @@ -2161,11 +2161,13 @@ function system_region_list($theme_key, /** * Implement hook_system_info_alter(). */ -function system_system_info_alter(&$info, $file) { +function system_system_info_alter(&$info, $file, $type) { // Remove page-top from the blocks UI since it is reserved for modules to // populate from outside the blocks system. - $info['regions_hidden'][] = 'page_top'; - $info['regions_hidden'][] = 'page_bottom'; + if ($type == 'theme') { + $info['regions_hidden'][] = 'page_top'; + $info['regions_hidden'][] = 'page_bottom'; + } } /** Index: modules/toolbar/toolbar.install =================================================================== RCS file: /cvs/drupal/drupal/modules/toolbar/toolbar.install,v retrieving revision 1.4 diff -u -p -r1.4 toolbar.install --- modules/toolbar/toolbar.install 31 Aug 2009 17:09:01 -0000 1.4 +++ modules/toolbar/toolbar.install 3 Sep 2009 10:21:52 -0000 @@ -27,7 +27,7 @@ function toolbar_install() { $items = array( 'node/add' => 'Add content', 'admin/content' => 'Find content', - 'admin' => 'Dashboard', + 'admin/dashboard' => 'Dashboard', ); $weight = -20; foreach ($items as $path => $title) { Index: profiles/default/default.info =================================================================== RCS file: /cvs/drupal/drupal/profiles/default/default.info,v retrieving revision 1.4 diff -u -p -r1.4 default.info --- profiles/default/default.info 30 Aug 2009 06:02:08 -0000 1.4 +++ profiles/default/default.info 3 Sep 2009 10:21:52 -0000 @@ -6,6 +6,7 @@ core = 7.x dependencies[] = block dependencies[] = color dependencies[] = comment +dependencies[] = dashboard dependencies[] = help dependencies[] = image dependencies[] = menu Index: profiles/default/default.install =================================================================== RCS file: /cvs/drupal/drupal/profiles/default/default.install,v retrieving revision 1.2 diff -u -p -r1.2 default.install --- profiles/default/default.install 27 Aug 2009 20:25:29 -0000 1.2 +++ profiles/default/default.install 3 Sep 2009 10:21:52 -0000 @@ -100,6 +100,26 @@ function default_install() { 'pages' => '', 'cache' => -1, ), + array( + 'module' => 'system', + 'delta' => 'management', + 'theme' => 'seven', + 'status' => 1, + 'weight' => 0, + 'region' => 'dashboard_main', + 'pages' => '', + 'cache' => -1, + ), + array( + 'module' => 'user', + 'delta' => 'new', + 'theme' => 'seven', + 'status' => 1, + 'weight' => 0, + 'region' => 'dashboard_sidebar', + 'pages' => '', + 'cache' => -1, + ), ); $query = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache')); foreach ($values as $record) {