/[drupal]/contributions/modules/dashboard/dashboard.module
ViewVC logotype

Diff of /contributions/modules/dashboard/dashboard.module

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

revision 1.35, Fri Sep 4 11:19:46 2009 UTC revision 1.36, Thu Sep 10 06:39:56 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: dashboard.module,v 1.34 2009/09/04 09:10:38 drumm Exp $  // $Id: dashboard.module,v 1.35 2009/09/04 11:19:46 drumm Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 12  Line 12 
12   * Implement hook_menu().   * Implement hook_menu().
13   */   */
14  function dashboard_menu() {  function dashboard_menu() {
   // Rebuild the widget registry.  
   db_query("DELETE FROM {dashboard_widget_registry}");  
   foreach (module_implements('dashboard_widget') as $module) {  
     foreach (module_invoke($module, 'dashboard_widget') as $widget) {  
       $widget['module'] = $module;  
       drupal_write_record('dashboard_widget_registry', $widget);  
     }  
   }  
   
15    $items = array(    $items = array(
16      'admin/settings/dashboard' => array(      'admin/settings/dashboard' => array(
17        'title' => 'Dashboard',        'title' => 'Dashboard',
# Line 291  function dashboard_user_tabs() { Line 282  function dashboard_user_tabs() {
282  }  }
283    
284  /**  /**
  * Unknown.  
  */  
 function dashboard_drupalorg_crosssite_page_tools() {  
   // Find widgets for the current path.  
   $item = menu_get_item();  
   $result = db_query("SELECT path, module, name, title FROM {dashboard_widget_registry} WHERE path = '%s' ORDER BY title", $item['path']);  
   $widgets = array();  
   while ($widget = db_fetch_object($result)) {  
     $widgets[] = $widget;  
   }  
   
   if (count($widgets) > 0) {  
     if (user_access('access user dashboard')) {  
       return array(  
         'dashboard-add-widget profile' => array(  
           'href' => 'dashboard',  
           'title' => t('Add to Dashboard'),  
           'attributes' => array('class' => 'add'),  
         ),  
       );  
     }  
     else {  
       return array(  
         'dashboard-add profile' => array(  
           'href' => 'user',  
           'title' => t('Log in to Add to Dashboard'),  
           'attributes' => array('class' => 'add'),  
         ),  
       );  
     }  
   }  
 }  
   
 /**  
285   * Add dashboard.js for user profile page.   * Add dashboard.js for user profile page.
286   */   */
287  function dashboard_user($op, &$edit, &$account, $category = NULL) {  function dashboard_user($op, &$edit, &$account, $category = NULL) {

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.36

  ViewVC Help
Powered by ViewVC 1.1.2