Index: modules/dashboard/dashboard.info =================================================================== RCS file: modules/dashboard/dashboard.info diff -N modules/dashboard/dashboard.info --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/dashboard/dashboard.info 27 Aug 2009 20:43:40 -0000 @@ -0,0 +1,9 @@ +; $Id$ +name = Dashboard +description = A module that provides a dashboard interface for organizing and tracking various information within your site. +core = 7.x +package = Core +version = VERSION +files[] = dashboard.info +files[] = dashboard.module +dependencies[] = block Index: modules/dashboard/dashboard.js =================================================================== RCS file: modules/dashboard/dashboard.js diff -N modules/dashboard/dashboard.js --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/dashboard/dashboard.js 27 Aug 2009 20:43:40 -0000 @@ -0,0 +1,26 @@ +// $Id: toolbar.js,v 1.1 2009/07/04 05:37:30 dries Exp $ +(function ($) { + +/** + * Implementation of Drupal.behaviors for dashboard. + */ +Drupal.behaviors.dashboard = { + attach: function() { + $('#content').append('
'); + $('#content .customize input').click(Drupal.behaviors.dashboard.showDisabledBlocks); + }, + + showDisabledBlocks: function() { + $('#content').load(Drupal.settings.dashboard.customize); + + var regions = $('div.region'); + regions.sortable({ + items: '>div.block', + connectWith: regions, + opacity: 0.8, + cursor: 'move' + }); + } +}; + +})(jQuery); Index: modules/dashboard/dashboard.module =================================================================== RCS file: modules/dashboard/dashboard.module diff -N modules/dashboard/dashboard.module --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/dashboard/dashboard.module 27 Aug 2009 20:43:40 -0000 @@ -0,0 +1,67 @@ + 'Dashboard', + 'page callback' => 'dashboard_admin', + 'access arguments' => array('access toolbar'), + 'type' => MENU_CALLBACK, + ); + $items['admin/dashboard/customize'] = array( + 'page callback' => 'dashboard_show_disabled', + 'access arguments' => array('access toolbar'), + 'type' => MENU_CALLBACK, + ); + return $items; +} + +/** + * Dashboard page callback + */ +function dashboard_admin() { + drupal_add_js(drupal_get_path('module', 'dashboard') . '/dashboard.js'); + drupal_add_js(array('dashboard' => array('customize' => url('admin/dashboard/customize'))), array('type' => 'setting')); + drupal_add_library('system', 'ui.sortable'); + return ''; +} + +/** + * Implement hook_block_list_alter(). + * + * Skip rendering dashboard blocks when not on the dashboard page itself. + */ +function dashboard_block_list_alter(&$blocks) { + if ($_GET['q'] != 'admin/dashboard') { + foreach ($blocks as $key => $block) { + if (strpos($block->region, 'dashboard') === 0) { + unset($blocks[$key]); + } + } + } +} + +function dashboard_show_disabled() { + global $theme_key; + + // Theme system not initialized at this point. + drupal_theme_initialize(); + + // Blocks are not necessarily initialized either. + _block_rehash(); + + $output = '
'; + $output .= '

' . t('Drag and drop blocks to their place') . '

'; + $result = db_query("SELECT * FROM {block} WHERE theme = :theme AND status = 0", array(':theme' => $theme_key)); + foreach ($result as $block) { + $output .= '
' . $block->module . '-' . $block->delta . '
'; + } + $output .= '
'; + + print $output; + exit(); + +} Index: modules/toolbar/toolbar.install =================================================================== RCS file: /cvs/drupal/drupal/modules/toolbar/toolbar.install,v retrieving revision 1.3 diff -u -p -r1.3 toolbar.install --- modules/toolbar/toolbar.install 30 Jul 2009 19:24:21 -0000 1.3 +++ modules/toolbar/toolbar.install 27 Aug 2009 20:43:40 -0000 @@ -27,7 +27,7 @@ function toolbar_install() { $items = array( 'node/add' => 'Add', '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.3 diff -u -p -r1.3 default.info --- profiles/default/default.info 21 Aug 2009 07:50:08 -0000 1.3 +++ profiles/default/default.info 27 Aug 2009 20:43:40 -0000 @@ -6,6 +6,7 @@ core = 7.x dependencies[] = block dependencies[] = color dependencies[] = comment +dependencies[] = dashboard dependencies[] = help dependencies[] = image dependencies[] = menu Index: themes/seven/page-admin-dashboard.tpl.php =================================================================== RCS file: themes/seven/page-admin-dashboard.tpl.php diff -N themes/seven/page-admin-dashboard.tpl.php --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ themes/seven/page-admin-dashboard.tpl.php 27 Aug 2009 20:43:40 -0000 @@ -0,0 +1,62 @@ + +> + + <?php print $head_title; ?> + + + + + + + + + +
+ +

+ +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+ +
+
+ + +
+
+ +
+
+ + + + +
+ + + + + \ No newline at end of file Index: themes/seven/seven.info =================================================================== RCS file: /cvs/drupal/drupal/themes/seven/seven.info,v retrieving revision 1.1 diff -u -p -r1.1 seven.info --- themes/seven/seven.info 31 Jul 2009 19:35:57 -0000 1.1 +++ themes/seven/seven.info 27 Aug 2009 20:43:40 -0000 @@ -11,3 +11,7 @@ regions[content] = Content regions[help] = Help regions[page_top] = Page top regions[page_bottom] = Page bottom +regions[dashboard_thick] = Dashboard thick +regions[dashboard_thin] = Dashboard thin +;hidden_regions[] = dashboard_thick +;hidden_regions[] = dashboard_thin Index: themes/seven/style.css =================================================================== RCS file: /cvs/drupal/drupal/themes/seven/style.css,v retrieving revision 1.15 diff -u -p -r1.15 style.css --- themes/seven/style.css 27 Aug 2009 20:33:05 -0000 1.15 +++ themes/seven/style.css 27 Aug 2009 20:43:40 -0000 @@ -728,3 +728,57 @@ body.overlay #page { body.overlay #block-system-main { padding: 20px; } + +/* Dashboard */ + +body.page-admin-dashboard div#page { + padding-top:20px; +} + +body.page-admin-dashboard div#dashboard-thick { + width: 65%; + float: left; + min-height: 1px; + margin: 5px; +} + +body.page-admin-dashboard div#dashboard-thin { + width: 30%; + float: left; + min-height: 1px; + margin: 5px; +} + +body.page-admin-dashboard div.block { + border: 1px solid #e2e1dc; + margin-bottom: 20px; +} + +body.page-admin-dashboard div.block h2 { + background-color:#e2e1dc; + padding: 3px 5px; +} + +body.page-admin-dashboard div.block div.content { + padding: 10px 5px 5px 5px; +} + +body.page-admin-dashboard div.block div.content ul.menu { + margin-left:20px; +} + +body.page-admin-dashboard.one-sidebar div#content div.block { + margin-right:20px; +} + +body.page-admin-dashboard #disabled-blocks { + margin: 5px; + padding: 10px; +} +body.page-admin-dashboard #disabled-blocks .disabled-block { + background: #e2e1dc; + padding: 4px; + margin: 3px; + float: left; + -moz-border-radius: 4px; +}