+ switch($input) {
+ case 'image':
+ case 'checkbox':
+ case 'date':
+ case 'textarea':
+ case 'html':
+ $display_type = $input;
+ break;
+ default:
+ $display_type = 'short';
+ }
+ if($format != 'n/a') {
+ $display_fields[] = array($display_type => array(
+ 'name' => $name, 'caption' => format_caption($name)));
+ }
+
+ if(show_in_listing($type, $input, $format, $sql)) {
+ $listing_headers[] = array('caption' => format_caption($name));
+ $listing_field = array('name' => $name);
+ if($format == 'bool' || $format == 'yesno') {
+ $listing_field['enc'] = 'yesno';
+ } elseif($input == 'date') {
+ $listing_field['enc'] = 'mmddyyyy';
+ } elseif($type == 'thumb') {
+ $listing_field['thumb'] = true;
+ } else {
+ $listing_field['enc'] = 'html';
+ }
+ $listing_fields[] = $listing_field;
+ }