Handle some debugs properly.

This commit is contained in:
stronk7 2006-04-25 23:52:42 +00:00
parent d9f9d943b5
commit d860c55c84

View file

@ -277,14 +277,14 @@
/// Get the default organization
$default_organization = $data['@']['default'];
if ($CFG->debug) print_object('default_organization: '.$default_organization);
if ($CFG->debug > 7) print_object('default_organization: '.$default_organization);
/// Iterate (reverse) over organizations until we find the default one
if (empty($data['#']['organization'])) { /// Verify <organization> exists
return false;
}
$count_organizations = count($data['#']['organization']);
if ($CFG->debug) print_object('count_organizations: '.$count_organizations);
if ($CFG->debug > 7) print_object('count_organizations: '.$count_organizations);
$current_organization = $count_organizations - 1;
while ($current_organization >= 0) {
@ -297,7 +297,7 @@
}
/// At this point we MUST have the final organization
if ($CFG->debug) print_object('final organization: '.$organization['#']['title'][0]['#']);
if ($CFG->debug > 7) print_object('final organization: '.$organization['#']['title'][0]['#']);
if (empty($organization)) {
return false; //Error, no organization found
}
@ -323,7 +323,7 @@
/// Iterate over items from start to end
$count_items = count($items);
if ($CFG->debug) print_object('level '.$level.'-count_items: '.$count_items);
if ($CFG->debug > 7) print_object('level '.$level.'-count_items: '.$count_items);
$current_item = 0;
while ($current_item < $count_items) {
@ -341,7 +341,7 @@
!empty($obj_item->identifier)) {
/// Add to itemmap
$itemmap[$id] = $obj_item;
if ($CFG->debug) print_object('level '.$level.'-id '.$id.'-parent '.$parent.'-'.$obj_item->title);
if ($CFG->debug > 7) print_object('level '.$level.'-id '.$id.'-parent '.$parent.'-'.$obj_item->title);
/// Counters go up
$id++;
/// Check for subitems recursively
@ -377,7 +377,7 @@
return false;
}
$count_resources = count($data);
if ($CFG->debug) print_object('count_resources: '.$count_resources);
if ($CFG->debug > 7) print_object('count_resources: '.$count_resources);
$current_resource = 0;
while ($current_resource < $count_resources) {
@ -423,4 +423,4 @@
return $resources;
}
?>
?>