function places_sublist($listName) { $places = array(); if ($_REQUEST['category'] == 'buildings') { $drill = new DrillNumeralAlpha($listName, "key"); $keys = array_keys(Buildings::$bldg_data); natsort($keys); $places = array_combine($keys, $keys); } else { $drill = new DrillAlphabeta($listName, "key"); foreach (Buildings::$bldg_data as $id => $info) { $places[$info['name']] = $id; } uksort($places, 'strnatcasecmp'); } return $drill->get_list($places); }
function places_sublist($listName) { if ($_REQUEST['category'] == 'buildings') { $drill = new DrillNumeralAlpha($listName, "key"); } else { $drill = new DrillAlphabeta($listName, "key"); } return $drill->get_list(places()); }