/[drupal]/contributions/modules/reports/reports_definitions.inc
ViewVC logotype

Contents of /contributions/modules/reports/reports_definitions.inc

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


Revision 1.3 - (show annotations) (download) (as text)
Thu Dec 14 07:00:19 2006 UTC (2 years, 11 months ago) by hlslaughter
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +17 -9 lines
File MIME type: text/x-php
tweaks - still just a crude prototype
1 <?php
2 // $Id: reports_definitions.inc,v 1.2 2006/12/04 08:48:11 hlslaughter Exp $
3
4 /**
5 * @file
6 * Configure individual reports
7 *
8 * TODO:
9 *
10 */
11
12 global $reports_config;
13 $reports_config = array();
14
15 $reports_config['test'] = array(
16 '#title' => 'Very handy list of Node titles and their IDs',
17 '#description' => '<b>By utilizing this complex report, the user can identify the precise
18 ID of all nodes. This is a painstaking report, please enjoy.</b>',
19 '#weight' => 0,
20 '#graph' => FALSE,
21 '#sql' => "
22 SELECT n.type ntype, count(1) cnt
23 FROM {node} n
24 GROUP BY n.type
25 ",
26 '#results_per_page' => 10,
27 '#table_header' => array(
28 array('data' => t('Type'), 'field' => 'n.type'),
29 array('data' => t('Count'), 'field' => 'cnt')
30 ),
31 // TODO: configureable processing of row data ???
32 /*
33 '#row_config' => array(
34 array('field_name' => 'ntype'),
35 array('field_name' => 'cnt')
36 ),
37 '#graph' => array(
38 'one' => TRUE,
39 'two' => FALSE
40 )
41 */
42 );
43
44 $reports_config['publishing_volume_by_day'] = array(
45 '#title' => 'Publishing Volume by Day',
46 '#description' => '<b>Nodes published per day.</b>',
47 '#weight' => -5,
48 '#graph' => TRUE,
49 '#sql' => "
50 SELECT DATE_FORMAT(from_unixtime(created),'%Y-%m-%%d') daystamp, count(1) cnt
51 FROM {node} n
52 GROUP BY daystamp
53 ",
54 '#results_per_page' => 10,
55 '#table_header' => array(
56 array('data' => t('Day'), 'field' => 'daystamp'),
57 array('data' => t('Nodes Published'), 'field' => 'cnt')
58 ),
59 );
60 $reports_config['test2'] = array(
61 '#title' => 'test pager',
62 '#description' => 'test to make sure paging works',
63 '#weight' => -1,
64 '#graph' => TRUE,
65 '#sql' => "
66 SELECT n.title, n.nid
67 FROM node n
68 ",
69 '#results_per_page' => 10,
70 '#table_header' => array(
71 array('data' => t('Title'), 'field' => 'n.title'),
72 array('data' => t('Node ID'), 'field' => 'n.nid')
73 ),
74 );
75

  ViewVC Help
Powered by ViewVC 1.1.2