/[drupal]/contributions/modules/dashboard/dashboard.page.inc
ViewVC logotype

Diff of /contributions/modules/dashboard/dashboard.page.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.9, Tue Sep 1 16:59:55 2009 UTC revision 1.10, Wed Sep 9 06:09:08 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: dashboard.page.inc,v 1.8 2009/08/26 07:31:39 drumm Exp $  // $Id: dashboard.page.inc,v 1.9 2009/09/01 16:59:55 drumm Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 42  function dashboard_page($page = NULL) { Line 42  function dashboard_page($page = NULL) {
42    dashboard_add_ui($page);    dashboard_add_ui($page);
43    
44    $widgets = array_fill(0, 3, '');    $widgets = array_fill(0, 3, '');
45    $result = db_query('SELECT widget_id, module, name, col FROM {dashboard_widget} WHERE page_id = %d ORDER BY weight', $page->page_id);    $result = db_query('SELECT widget_id, type, subtype, col FROM {dashboard_widget} WHERE page_id = %d ORDER BY weight', $page->page_id);
46    while ($widget = db_fetch_object($result)) {    while ($widget = db_fetch_object($result)) {
47      $function = $widget->module . '_' . $widget->name .'_dashboard_widget';      $content = ctools_content_render($widget->type, $widget->subtype, array());
48      $info = $function($widget->widget_id);      $content->widget_id = $widget->widget_id;
49      $info['widget_id'] = $widget->widget_id;      $widgets[$widget->col] .= theme('dashboard_widget', $content);
     if (isset($info['link'])) {  
       $info['title'] = l($info['title'], $info['link']);  
     }  
     else {  
       $info['title'] = check_plain($info['title']);  
     }  
   
     $widgets[$widget->col] .= theme('dashboard_widget', $info);  
50    }    }
51    
52    return theme('dashboard_page', dashboard_user_tabs(), $widgets);    return theme('dashboard_page', dashboard_user_tabs(), $widgets);

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.2