Project

General

Profile

Download (3.57 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
// $Id: cdm_dataportal.module $
3

    
4
//TODO if required  outsource all theme functions and uncomment next line
5
//require_once('cdm_dataportal.theme.php');
6

    
7
/* ====================== hook implementations ====================== */ 
8

    
9
/**
10
 * Implementation of hook_help
11
 * Display help and module information
12
 * @param section which section of the site we're displaying help
13
 * @return help text for section
14
 */
15
function cdm_dataportal_help($section='') {
16

    
17
    $out = '';
18
    switch ($section) {
19
        case "admin/modules#description":
20
            $out = t("The dataportal publishes CDM data hosted in a CommunityStore on the web.");
21
            break;
22
    }
23
    return $out;
24
}
25

    
26

    
27
/**
28
 * Implementation of hook_perm
29
 * Valid permissions for this module
30
 * @return array An array of valid permissions for the portfolio module
31
 */
32
function cdm_dataportal_perm() {
33
    return array(
34
    	'administer cdm_dataportal',
35
        'cdm_dataportal view notes',
36
        //TODO which else permission are required? -> check the WP6 requirements document
37
	);
38
}
39

    
40

    
41
/**
42
 * Implementation of hook_menu
43
 */
44
function cdm_dataportal_menu($may_cache) {
45
  $items = array();
46
  if ($may_cache) {
47
    
48
    $items[] = array(
49
      'path' => 'admin/settings/cdm_dataportal',
50
      'title' => t('CDM Dataportal'),
51
      'description' => t('Setting for the CDM Dataportal'),
52
      'access' => user_access('administer cdm_dataportal'),
53
      'callback' => 'drupal_get_form',
54
      'callback arguments' => 'cdm_dataportal_settings',
55
      'type' => MENU_NORMAL_ITEM,
56
    );
57
    
58
    $items[] = array(
59
	    'path' => 'cdm_dataportal/names',
60
	    'callback' => 'cdm_dataportal_view_names',
61
	    'access' => true,
62
	    'type' => MENU_CALLBACK, 
63
	    );
64
	    // optional callback arguments: page 
65
	    
66
	$items[] = array(
67
	    'path' => 'cdm_dataportal/taxon',
68
	    'callback' => 'cdm_dataportal_view_taxon',
69
	    'access' => true,
70
	    'type' => MENU_CALLBACK, 
71
	    // expected callback arguments: name_uuid
72
	    );
73
	    
74
  }
75
  return $items;
76
}
77

    
78

    
79
/* ====================== menu callback functions ====================== */
80

    
81
/**
82
 * Generate main administration form.
83
 *
84
 * @return
85
 *   An array containing form items to place on the module settings page.
86
 */
87
function cdm_dataportal_settings(){
88

    
89
   //TODO: settings are still incomplete, compare with trunk/dataportal/inc/config_default.php.inc
90
   
91
   $form['cdm_webservice_url'] =  array(
92
    '#type' => 'textfield',
93
    '#title'         => t('CDM Store Webservice'),
94
    '#default_value' => variable_get('cdm_webservice_url', 'none'),
95
    '#description'   => t('The URL to Webservice of the CDM Store which is to be published.'),
96
    );
97
    
98
   return $form;
99
}
100

    
101
/**
102
 * Displays a list of the known taxonomic names. Long lists are split up into multiple pages
103
 *
104
 * @param String $page page number to diplay defaults to page 1
105
 * @param boolean $hide_unaccepted whether to hide nams which are not accepted by the current view
106
 */
107
function cdm_dataportal_view_names($page = 1, $hide_unaccepted = false ){
108
  
109

    
110
}
111

    
112
/**
113
 * The taxon page gives detailed information on a taxon, it shows:
114
 *  - Taxon name
115
 *  - Full list of synonyms homotypic synonyms on top, followed by the heterotypic and finally followed by misapplied names. The list is historically ordered.
116
 *  - All facts associated with the very taxon concept and taxon name. 
117
 *
118
 * @param $name_uuid the $name_uuid of the taxon name 
119
 */
120
function cdm_dataportal_view_taxon($name_uuid){
121
  
122
}
123
 
124

    
125
/* ====================== theme functions ====================== */
(2-2/2)