| 1 |
<?php
|
| 2 |
/* $Id$ */
|
| 3 |
|
| 4 |
// if we include this here will the dependant modules still need it??
|
| 5 |
include_once('includes/ermcommon.inc.php');
|
| 6 |
|
| 7 |
/**
|
| 8 |
* Display help and module information
|
| 9 |
* @param section which section of the site we're displaying help
|
| 10 |
* @return help text for section
|
| 11 |
*/
|
| 12 |
function erm_help($section='') {
|
| 13 |
|
| 14 |
$output = '';
|
| 15 |
|
| 16 |
switch ($section) {
|
| 17 |
case "admin/help#erm":
|
| 18 |
$output = '<p>'. t("Equipment & Resource Management Tool"). '</p>';
|
| 19 |
break;
|
| 20 |
}
|
| 21 |
|
| 22 |
return $output;
|
| 23 |
} // function erm_help
|
| 24 |
|
| 25 |
|
| 26 |
function erm_perm() {
|
| 27 |
|
| 28 |
return array('access erm', 'update erm', 'administer erm');
|
| 29 |
|
| 30 |
} // function erm_perm
|
| 31 |
|
| 32 |
|
| 33 |
function erm_block($op='list', $delta=0) {
|
| 34 |
// listing of blocks, such as on the admin/block page
|
| 35 |
if ($op == "list") {
|
| 36 |
$block[0]["info"] = t("ERM");
|
| 37 |
return $block;
|
| 38 |
} else if ($op == 'view') {
|
| 39 |
// our block content
|
| 40 |
// content variable that will be returned for display
|
| 41 |
$block_content = '';
|
| 42 |
$block_content .=
|
| 43 |
"<div class=\"more-link\">".
|
| 44 |
l(
|
| 45 |
t("more"),
|
| 46 |
"erm",
|
| 47 |
array(
|
| 48 |
"title" => t("More ERM information.")
|
| 49 |
)
|
| 50 |
)."</div>";
|
| 51 |
|
| 52 |
// set up the block
|
| 53 |
$block['subject'] = 'ERM';
|
| 54 |
$block['content'] = $block_content;
|
| 55 |
return $block;
|
| 56 |
}
|
| 57 |
} // function erm_block
|
| 58 |
|
| 59 |
|
| 60 |
function erm_menu() {
|
| 61 |
|
| 62 |
$items = array();
|
| 63 |
|
| 64 |
// Administration Options
|
| 65 |
$items[] = array(
|
| 66 |
'path' => 'admin/settings/erm',
|
| 67 |
'title' => t('ERM settings'),
|
| 68 |
'callback' => 'drupal_get_form',
|
| 69 |
'callback arguments' => 'erm_admin',
|
| 70 |
'access' => user_access('administer erm'),
|
| 71 |
'description' => ('Configure the Equipment & Resource Management tool'),
|
| 72 |
'type' => MENU_NORMAL_ITEM,
|
| 73 |
);
|
| 74 |
|
| 75 |
// User-level Menus
|
| 76 |
$items[] = array(
|
| 77 |
'path' => 'erm',
|
| 78 |
'title' => t('Resource manager'),
|
| 79 |
'callback' => 'erm_all',
|
| 80 |
'access' => user_access('access content'),
|
| 81 |
'type' => MENU_NORMAL_ITEM
|
| 82 |
);
|
| 83 |
|
| 84 |
return $items;
|
| 85 |
} // function erm_menu
|
| 86 |
|
| 87 |
|
| 88 |
function erm_admin() {
|
| 89 |
|
| 90 |
$form ['erm_main'] = array(
|
| 91 |
'#type' => 'fieldset',
|
| 92 |
'#title' => 'Display configuration',
|
| 93 |
'#collapsible' => TRUE,
|
| 94 |
'#collapsed' => FALSE
|
| 95 |
);
|
| 96 |
$form['erm_main']['erm_view_split'] = array(
|
| 97 |
'#type' => 'checkbox',
|
| 98 |
'#title' => t('Display by group'),
|
| 99 |
'#default_value' => variable_get('erm_view_split', FALSE),
|
| 100 |
'#description' => t("Tick this option to split the icon view into groups.")
|
| 101 |
);
|
| 102 |
|
| 103 |
return system_settings_form($form);
|
| 104 |
} //function erm_admin
|
| 105 |
|
| 106 |
|
| 107 |
function erm_all() {
|
| 108 |
|
| 109 |
$page_content = '';
|
| 110 |
|
| 111 |
$page_content = drupal_get_form(erm_form);
|
| 112 |
|
| 113 |
$splitview = variable_get('erm_view_split', FALSE);
|
| 114 |
$page_content .= dapi_loadicons($module = NULL, $splitview);
|
| 115 |
|
| 116 |
print theme("page", $page_content);
|
| 117 |
} // function erm_all
|
| 118 |
|
| 119 |
|
| 120 |
function erm_form() {
|
| 121 |
$form['erm'] = array(
|
| 122 |
'#type' => 'fieldset',
|
| 123 |
//'#title' => 'Electronic Resource Manager',
|
| 124 |
'#collapsible' => FALSE,
|
| 125 |
'#collapsed' => FALSE
|
| 126 |
);
|
| 127 |
|
| 128 |
$form['erm']['welcome-note'] = array(
|
| 129 |
'#value' => '<p>Welcome to the Electronic Resource Management tool.</p>'
|
| 130 |
);
|
| 131 |
|
| 132 |
return $form;
|
| 133 |
} // function erm_form;
|