Project

General

Profile

« Previous | Next » 

Revision bc8a4f7c

Added by Alex Theys almost 12 years ago

AT: committing latest changes to the dataportal code during first round of Code review

View differences:

5.x/modules/cdm_dataportal/cdm_dataportal.module
606 606
        $block['subject'] = t('Identification Keys');
607 607
        $block['content'] = theme('cdm_block_IdentificationKeys');
608 608
        return $block;
609
      //Creating a block specific for the Use Interface.
609 610
      case "uses":
610 611
      	$block['subject'] = t('Uses');
611 612
        $block['content'] = theme('cdm_block_uses');
5.x/modules/cdm_dataportal/theme/cdm_dataportal.descriptions.theme
1219 1219
  return $out;
1220 1220
}
1221 1221

  
1222
//this theming function formats the use description and use record list for these descriptions 
1222 1223
function theme_cdm_format_Uses ($descriptions = null, $pageSize, $pageNumber) {
1223 1224
	$out = '<div id="content"><ul id="Description" class ="description">';
1224 1225
	if ($descriptions == null) {
......
1235 1236
			$out .= '<li class="use_record_list">- ' . $useRecordTags[0] . '[' . $useRecordTags[1] . ']' . ' - ' . $useRecordTags[2] . ' - ' . $useRecordTags[3]. '[' .$useRecordTags[4]. ']' . ' - ' .   $useRecordTags[5] . '</li>';
1236 1237
		}
1237 1238
		$out .= '</ul>';
1238
		
1239
		//$out .= "<BR />Use Records: ";
1240
		//$out .='<div><ul id="Desciption">';
1241
		//foreach ($description->elements as $descriptionElement) {
1242
		//	$out .= '<span><li class="descriptionText">';
1243
			/*foreach ($descriptionElement->states as $stateData) {
1244
				$out .= '<div class="useTag">' . $stateData->state->representation_L10n . '</div>';
1245
			}
1246
			
1247
			foreach ($descriptionElement->modifiers as $modifier) {
1248
				$out .= '<div class="useTag">' . $modifier->representation_L10n . '</div>' ;
1249
			}*/
1250
			//$out .= '<div>' . $descriptionElement->modifyingText->English->text;
1251
			//$out .= '</span><div class="clear"></div>';
1252
		
1253
		
1239

  
1254 1240
		$out .= "</li>";
1255 1241
		
1256 1242
	}
......
1258 1244
	return $out;
1259 1245
}
1260 1246

  
1247
//The Use theming function here will handle the display of the Use Descriptions 
1261 1248
function theme_cdm_block_Uses ($taxonUuid = null, $pageSize = null) {
1262 1249
	RenderHints::pushToRenderStack('block_Uses');
1263 1250
	
......
1268 1255
	$markerTypes = array();
1269 1256
	$markerTypes['markerTypes'] = '2e6e42d9-e92a-41f4-899b-03c0ac64f039';
1270 1257
	$useDescriptions = cdm_ws_get(CDM_WS_PORTAL_TAXON_DESCRIPTIONS, $taxonUuid, queryString($markerTypes));
1271
  	$out .= '<div id="block-cdm_dataportal-feature-description" class="clear-block block block-cdm_dataportal-feature"><H2> Uses </H2>';
1272
  	//$out .= '<div id="block-cdm_dataportal-feature-discussion">';
1273
	$formatUseDescriptions = theme('cdm_format_Uses', $useDescriptions, $pageSize, $pageNumber);
1274
	//$out .= '<pre>' . print_r($useDescriptions) . '</pre>';
1275
	$out .= $formatUseDescriptions;
1276
	$out .="</div>";
1258
  	if(!empty($useDescriptions)) {
1259
		$out .= '<div id="block-cdm_dataportal-feature-description" class="clear-block block block-cdm_dataportal-feature"><a name="userecords"> </a><H2> Uses </H2>';
1260
  		$formatUseDescriptions = theme('cdm_format_Uses', $useDescriptions, $pageSize, $pageNumber);
1261
		$out .= $formatUseDescriptions;
1262
		$out .="</div>";
1263
  	}
1277 1264
	
1278 1265
	return $out;
1279 1266
}
5.x/modules/cdm_dataportal/theme/cdm_dataportal.page.theme
124 124
        $markerTypesEmpty = array();
125 125
  $markerTypesEmpty['markerTypes'] = '';
126 126
    $taxonDescriptions = cdm_ws_get(CDM_WS_PORTAL_TAXON_DESCRIPTIONS, $taxon->uuid, queryString($markerTypesEmpty)); //retrieve all description for the taxon
127
	//$out .=print_r($taxonDescriptions);
128
    $nonStructuredDescriptions = array();
127
	$nonStructuredDescriptions = array();
129 128
    if($taxonDescriptions != null){
130 129
      foreach ($taxonDescriptions as $taxonDescription) {
131 130
        // check if structured description
......
134 133
        if($hasStructuredData){
135 134
          $structured_description_featuretree_uuid = variable_get(CDM_DATAPORTAL_STRUCTURED_DESCRIPTION_FEATURETREE_UUID, false);
136 135
          $naturallanguage_textData = cdm_ws_get(CDM_WS_DESCRIPTION_NATURALLANGUAGE_DESCRIPTION, array($taxonDescription->uuid, $structured_description_featuretree_uuid));
137
          //$out .=print_r($naturallanguage_textData);
138 136
          if(!$naturallanguage_textData){
139 137
            drupal_set_message('The \'FeatureTree\' for the generation of natural language representations is not configured correctly, please select a \'FeatureTree\' in the '.l('CDM Dataportal Settings', 'admin/settings/cdm_dataportal/layout/taxon'), 'warning');
140 138
          }

Also available in: Unified diff