Exemple #1
0
  case 'buildings':
  case 'names':
    if (isset($_REQUEST['drilldown'])) {
      $title = $categories[$category];
      $drilldown = $_REQUEST['drilldown'];
      $drilldown_title = $_REQUEST['desc'];
      $places = places_sublist($drilldown);
      require "$page->branch/drilldown.html";
    } else {
      require "$page->branch/$category.html";
    }
    break;

  default:
    $title = Buildings::category_title($category);
    $places = Buildings::category_items($category);
    require "$page->branch/places.html";
    break;
  }
} 

$page->output();

function places_sublist($listName) {
  $places = array();

  if($_REQUEST['category'] == 'buildings') {
    $drill = new DrillNumeralAlpha($listName, "key");

    $keys = array_keys(Buildings::$bldg_data);
    natsort($keys);
Exemple #2
0
function get_category($category) {
  if (preg_match('/^[enmw]{1,2}$/', $category)) {
    return generate_building_numbers($category);
  } elseif (preg_match('/^\w_\w+$/', $category)) {
    return generate_building_names($category);
  }

  $places = Buildings::category_items($category);
  $result = array();

  foreach ($places as $title => $building) {
    $bldg_info = Buildings::bldg_info($building);
    $bldg_info['displayName'] = $title;
    $result[] = $bldg_info;
  }
  return $result;
}