Project

General

Profile

« Previous | Next » 

Revision ba2bca28

Added by Andreas Kohlbecker almost 15 years ago

minor changes

View differences:

modules/cdm_dataportal/cdm_api/cdm_api.module
73 73
}
74 74

  
75 75
/**
76
 * Configures the settings forfm for the CDM-API module.
76
 * Configures the settings form for the CDM-API module.
77 77
 *
78 78
 * @return Array Drupal settings form
79 79
 */
......
100 100
    '#options'       => cdm_rankVocabulary_as_option(),
101 101
    '#description'   => t('The rank of the highest displayed taxon in the taxontree.'),
102 102
  );
103
  
104
  /*
105
  $form['cdm_webservice']['cdm_webservice_isStub'] =  array(
106
    '#type' => 'checkbox',
107
    '#title'         => t('Use Web Service Stub'),
108
    '#default_value' => variable_get('cdm_webservice_isStub', 1),
109
    '#description'   => t('Use a static web service stub. Only for development. For further information please refer to the ')
110
  .l('ws_stub/README.txt', 'http://dev.e-taxonomy.eu/svn/trunk/drupal/modules/cdm_dataportal/cdm/ws_stub/README.txt', array('target'=>'_blank')),
111
  );
112
  
113

  
114
  $form['cdm_webservice']['cdm_webservice_type'] =  array(
115
    '#type'          => 'select',
116
    '#title'         => t('Web Service Type'),
117
    '#default_value' => variable_get('cdm_webservice_type', 'json'),
118
    '#options'       => array(
119
            'xml'  => t('XML'),
120
            'json' => t('JSON'),
121
        ),
122
    '#description'   => t('The response data type of the web service.'),
123
  );
124
  */
125 103

  
126 104
  $form['cdm_webservice']['cdm_webservice_cache'] =  array(
127 105
    '#type' => 'checkbox',
......
169 147
    '#type' => 'checkbox',
170 148
    '#title'         => t('Debug CDM Web Service'),
171 149
    '#default_value' => variable_get('cdm_webservice_debug', 1),
172
    '#description'   => t('Enable CDM Web Service debugging messages. Only visible for administrators!')
150
    '#description'   => t('Enable CDM Web Service debugging messages. Only visible for the super administrator or for users having the permission <em>administer cdm_api</em>!')
173 151
  );
174 152
    
175 153
  return $form;
......
184 162
  cache_clear_all(NULL, 'cache_cdm_ws');
185 163
}
186 164

  
165
function cdm_api_perm() {
166
  return array(
167
      'administer cdm_api'
168
  );
169
}
170

  
187 171

  
188 172
// ----------------------------------------------------------- //
189 173

  
......
655 639
    $obj = cdm_load_obj($datastr);
656 640

  
657 641
    $time_parse = microtime(true) - $time_parse_start;
658
    if(variable_get('cdm_webservice_debug', 1) && user_access('administer')){
642
    if(variable_get('cdm_webservice_debug', 1) && ( user_access('administer') || user_access('administer cdm_api'))){
659 643
      $success_msg = $obj || $datastr == "[]" ? 'valid':'invalid'; 
660 644
      _add_debugMessage($uri, $time_get, $time_parse, strlen($datastr), $success_msg);
661 645
    }
......
665 649
    }
666 650
  } else {
667 651
    $obj = unserialize($cache_entry->data);
668
    if(variable_get('cdm_webservice_debug', 1) && user_access('administer')){
652
    if(variable_get('cdm_webservice_debug', 1) && (user_access('administer')|| user_access('administer cdm_api'))){
669 653
      _add_status_message_toggler();
670 654
      drupal_set_message('Using cache for: '.$uri, 'debug');
671 655
    }
modules/cdm_dataportal/cdm_dataportal.module
45 45
function cdm_dataportal_perm() {
46 46
  return array(
47 47
    	'administer cdm_dataportal',
48
        'cdm_dataportal view notes',
48
      'cdm_dataportal view notes',
49 49
  //TODO which else permission are required? -> check the WP6 requirements document
50 50
  );
51 51
}
......
556 556
    '#options' => $taxonomicTreeOptions,
557 557
    '#description'   => t('Select a taxonomic view for this webservice.')
558 558
  );
559
  
560
  $form['cdm_dataportal']['DEBUG']= array(
561
    '#value' => '<pre>'.print_r($taxonomicTreeOptions, true).'</pre>'
562
  );
559 563
  
560 564
    
561 565
  //------------------ FEATURE TREE --------------------//
......
575 579
    '#description'   => t('Select a FeatureTree for this webservice.'
576 580
          //.' If there is no applicable FeatureTree you can create a new one using the <a href="">FeatureTreeManager</a>'
577 581
          )
578
  );
582
  );

579 583
  
580 584
  //------------------ LAYOUT --------------------//
581 585
  

Also available in: Unified diff