function getThemesOfType($xmlDoc, &$rootNode, $paramsNode) { $theme_type = $paramsNode->getElementsByTagName('theme_type')->item(0)->nodeValue; $themes = getThemesByType($theme_type); if($themes === false) { setError($xmlDoc, $rootNode, "Error fetching information."); } else { setNoError($xmlDoc, $rootNode); $thmsNode = addXMLChildNode($xmlDoc, $rootNode, "themes", null, array('theme_type' => $theme_type)); foreach($themes as $theme) { addXMLChildNode($xmlDoc, $thmsNode, "theme", null, array('theme_id' => $theme['theme_id'], 'theme_name' => $theme['theme_name'], 'icon' => getThemeIconUrl($theme['icon']), 'geolocation' => $theme['geolocation'])); } } }
function getCategoricalLayersList($xmlDoc, &$rootNode, $paramsNode) { $theme_type = $paramsNode->getElementsByTagName('theme_type')->item(0)->nodeValue; if($theme_type == null || $theme_type == '') { setError($xmlDoc, $rootNode, "Required parameters not set."); return; } else { $themes = getThemesByType($theme_type); if($themes === false) { setError($xmlDoc, $rootNode, "Error fetching information."); } else { $layers = getLayersByThemeType($theme_type); if($layers === false) { setError($xmlDoc, $rootNode, "Error fetching information."); } else { setNoError($xmlDoc, $rootNode); $thmsNode = addXMLChildNode($xmlDoc, $rootNode, "themes", null, array('theme_type' => $theme_type)); foreach($themes as $theme) { $chldcnt = sizeof($layers[$theme['theme_id']]); $theme['icon'] = getThemeIconUrl($theme['icon']); $thmNode = addXMLChildNode($xmlDoc, $thmsNode, "theme", null, $theme); foreach($layers[$theme['theme_id']] as $lyr) { formLayersListXML($xmlDoc, $thmNode, $lyr['layer_tablename'], $lyr['layer_name'], $lyr['access'], $lyr['p_nid'], $lyr['participation_type']); } } } } } }