/[drupal]/contributions/modules/chart/contrib/system_charts/system_charts.module
ViewVC logotype

Diff of /contributions/modules/chart/contrib/system_charts/system_charts.module

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

revision 1.10, Tue Jul 14 02:28:58 2009 UTC revision 1.11, Tue Jul 14 02:45:33 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2    // $Id$
3  /**  /**
4  * @file  * @file
5  * Core drupal system charting.  * Provides core Drupal chart implementations.
6    *
7  * @author Tj Holowaychuk <http://www.350designs.com/>  * @author Tj Holowaychuk <http://www.350designs.com/>
8  * @package Chart  * @package Chart
9  */  */
10    
11  /* -----------------------------------------------------------------  /*-----------------------------------------------------------------
12     * Hook Implementations
13    Hook Implementations   *------------------------------------------------------------------*/
   
 ------------------------------------------------------------------ */  
14    
15  /**  /**
16  * Implementation of hook_perm();   * Implementation of hook_perm();
17  */   */
18  function system_charts_perm(){  function system_charts_perm(){
19    return array('administer system charts', 'access system charts');    return array('administer system charts', 'access system charts');
20  }  }
21    
22  /**  /**
23  * Implementation of hook_menu().   * Implementation of hook_menu().
24  */   */
25  function system_charts_menu() {  function system_charts_menu() {
26    $items = array();    $items = array();
27    
# Line 58  function system_charts_menu() { Line 57  function system_charts_menu() {
57  }  }
58    
59  /**  /**
60  * Implementation of hook_chart_color_schemes();   * Implementation of hook_chart_color_schemes();
61  */   */
62  function system_charts_chart_color_schemes(&$colors) {  function system_charts_chart_color_schemes(&$colors) {
63    $colors['watchdog_severity'] = array(    $colors['watchdog_severity'] = array(
64        'Error'   => 'a00000',        'Error'   => 'a00000',
# Line 75  function system_charts_chart_color_schem Line 74  function system_charts_chart_color_schem
74  ------------------------------------------------------------------ */  ------------------------------------------------------------------ */
75    
76  /**  /**
77  * Page callback.   * Page callback.
78  */   */
79  function system_charts($page = 'nodes') {  function system_charts($page = 'nodes') {
80    return '<div id="system-charts">' . system_charts_display($page) . '</div><!-- END #system-charts -->';    return '<div id="system-charts">' . system_charts_display($page) . '</div><!-- END #system-charts -->';
81  }  }
82    
83  /**  /**
84  * Display charts and content in context to the current page.   * Display charts and content in context to the current page.
85  *   *
86  * @return string   * @return string
87  *   markup, chart images.   *   markup, chart images.
88  */   */
89  function system_charts_display($page = 'nodes') {  function system_charts_display($page = 'nodes') {
90    $output = '';    $output = '';
91    
# Line 113  function system_charts_display($page = ' Line 112  function system_charts_display($page = '
112  }  }
113    
114  /**  /**
115  * Gather data and build a chart API structure.   * Gather data and build a chart API structure.
116  *   *
117  * @return array   * @return array
118  *   chart API structure.   *   chart API structure.
119  */   */
120  function system_charts_build($type) {  function system_charts_build($type) {
121    $chart = array();    $chart = array();
122    $now   = (isset($_GET['year']) && isset($_GET['month'])) ? mktime(0, 0, 0, $_GET['month'], 30, $_GET['year']) : time();    $now   = (isset($_GET['year']) && isset($_GET['month'])) ? mktime(0, 0, 0, $_GET['month'], 30, $_GET['year']) : time();
# Line 307  function system_charts_build($type) { Line 306  function system_charts_build($type) {
306  }  }
307    
308  /**  /**
309  * Get available report page information.   * Get available report page information.
310  *   *
311  * @return array   * @return array
312  *   report information.   *   report information.
313  */   */
314  function system_charts_get_page_info() {  function system_charts_get_page_info() {
315    return array(    return array(
316        'nodes' => array(        'nodes' => array(
# Line 332  function system_charts_get_page_info() { Line 331  function system_charts_get_page_info() {
331      );      );
332  }  }
333    
334  /* -----------------------------------------------------------------  /*-----------------------------------------------------------------
335     * Helpers
336    Helpers   *------------------------------------------------------------------*/
   
 ------------------------------------------------------------------ */  
337    
338  /**  /**
339  * Return the watchdog severity label   * Return the watchdog severity label
340  */   */
341  function _system_charts_watchdog_severity_label($severity) {  function _system_charts_watchdog_severity_label($severity) {
342    switch($severity){    switch($severity){
343      case WATCHDOG_NOTICE:      case WATCHDOG_NOTICE:
# Line 358  function _system_charts_watchdog_severit Line 355  function _system_charts_watchdog_severit
355  }  }
356    
357  /**  /**
358  * Return user status label   * Return user status label
359  */   */
360  function _system_charts_user_status_label($status) {  function _system_charts_user_status_label($status) {
361    return $status ? t('Active') : t('Blocked') ;    return $status ? t('Active') : t('Blocked') ;
362  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.2