| 1 |
<?php
|
| 2 |
// $Id:$
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* Provides a site wide report for the invite module.
|
| 7 |
*
|
| 8 |
* The invite module provides invitations to a site/node. This module provides a site
|
| 9 |
* wide report for those invitations.
|
| 10 |
*/
|
| 11 |
|
| 12 |
/**
|
| 13 |
* Implementation of hook_menu().
|
| 14 |
*/
|
| 15 |
function invite_site_report_menu($may_cache) {
|
| 16 |
$items = array();
|
| 17 |
|
| 18 |
if ($may_cache) {
|
| 19 |
$items[] = array(
|
| 20 |
'path' => 'admin/logs/invite-site-report',
|
| 21 |
'title' => t('Invite Site Report'),
|
| 22 |
'description' => t('A site wide report of invitations sent, accepted, etc.'),
|
| 23 |
'callback' => 'invite_site_report_report',
|
| 24 |
'access' => user_access('view Invite site report'),
|
| 25 |
);
|
| 26 |
|
| 27 |
$items[] = array(
|
| 28 |
'path' => 'admin/logs/invite-site-report/accepted',
|
| 29 |
'title' => t('Accepted'),
|
| 30 |
'callback' => 'invite_site_report_report',
|
| 31 |
'callback arguments' => array('accepted'),
|
| 32 |
'access' => user_access('view Invite site report'),
|
| 33 |
'type' => MENU_DEFAULT_LOCAL_TASK,
|
| 34 |
);
|
| 35 |
|
| 36 |
$items[] = array(
|
| 37 |
'path' => 'admin/logs/invite-site-report/pending',
|
| 38 |
'title' => t('Pending'),
|
| 39 |
'callback' => 'invite_site_report_report',
|
| 40 |
'callback arguments' => array('pending'),
|
| 41 |
'access' => user_access('view Invite site report'),
|
| 42 |
'type' => MENU_LOCAL_TASK,
|
| 43 |
);
|
| 44 |
|
| 45 |
$items[] = array(
|
| 46 |
'path' => 'admin/logs/invite-site-report/expired',
|
| 47 |
'title' => t('Expired'),
|
| 48 |
'callback' => 'invite_site_report_report',
|
| 49 |
'callback arguments' => array('expired'),
|
| 50 |
'access' => user_access('view Invite site report'),
|
| 51 |
'type' => MENU_LOCAL_TASK,
|
| 52 |
);
|
| 53 |
}
|
| 54 |
return $items;
|
| 55 |
}
|
| 56 |
|
| 57 |
/**
|
| 58 |
* Implementation of hook_perm().
|
| 59 |
*/
|
| 60 |
function invite_site_report_perm() {
|
| 61 |
return array('view Invite site report');
|
| 62 |
}
|
| 63 |
|
| 64 |
/**
|
| 65 |
* Menu callback; presents the report
|
| 66 |
*/
|
| 67 |
function invite_site_report_report($page = 'accepted') {
|
| 68 |
|
| 69 |
// Load report and report presentation from include file
|
| 70 |
require_once('./'. drupal_get_path('module', 'invite_site_report') .'/invite_site_report.report.inc');
|
| 71 |
|
| 72 |
if (function_exists('invite_site_report_report_overview')) {
|
| 73 |
return invite_site_report_report_overview($page);
|
| 74 |
}
|
| 75 |
|
| 76 |
else {
|
| 77 |
drupal_set_message(t('The report could not be loaded.'), 'error');
|
| 78 |
return t('The report could not be loaded. The file invite_site_report.report.inc is missing.');
|
| 79 |
}
|
| 80 |
}
|