diff --git a/data/php/building_aliases.inc.php b/data/php/building_aliases.inc.php new file mode 100644 index 0000000000000000000000000000000000000000..e705a8881ac1d40a85e4e10a82bfd26b742a7393 --- /dev/null +++ b/data/php/building_aliases.inc.php @@ -0,0 +1,24 @@ +<?php +return array( + + // EAST CAMPUS + + // CITY CAMPUS + + 'HEPP' => 'NRC', + 'PIPH' => 'NRC', + 'RAYH' => 'NRC', + 'LOVH' => 'NRC', + 'SELD' => 'SELQ', + 'SELE' => 'SELQ', + 'SELF' => 'SELQ', + 'SELG' => 'SELQ', + 'SELH' => 'SELQ', + 'SELJ' => 'SELQ', + 'SELK' => 'SELQ', + 'SELL' => 'SELQ', + 'STE' => 'MEMS', + 'STNO' => 'MEMS', + 'STSO' => 'MEMS', + 'STW' => 'MEMS', +); diff --git a/data/php/hidden_buildings.inc.php b/data/php/hidden_buildings.inc.php index 52294dfd17c65d29611dc47dc6a6cb6a3ccd62c7..7af66dd96559c534c9f38087ebeb0aff1796e679 100644 --- a/data/php/hidden_buildings.inc.php +++ b/data/php/hidden_buildings.inc.php @@ -46,7 +46,6 @@ return array( 'SVC', 'UTPE', 'W1', - 'W2', 'WAST', 'WEED', @@ -55,6 +54,7 @@ return array( '2', '1631', '1740', + '1820', // Demo'd 'ARCL', 'ARCW', 'BOAT', @@ -66,22 +66,35 @@ return array( 'FMF', 'GE', 'HAY', + 'HEPP', // Aliased to unofficial 'HZM', 'HZMC', + 'LOVH', // Aliased to unofficial 'LSMB', 'LSS', 'LSCS', 'MAIN', 'MSTO', + 'PIPH', // Aliased to unofficial + 'RAYH', // Aliased to unofficial 'REUN', + 'SELD', // Aliased to unofficial + 'SELE', // Aliased to unofficial + 'SELF', // Aliased to unofficial + 'SELG', // Aliased to unofficial + 'SELH', // Aliased to unofficial + 'SELJ', // Aliased to unofficial + 'SELK', // Aliased to unofficial + 'SELL', 'SPCW', 'STSB', 'STS', 'STSC', - 'STNO', - 'STSO', + 'STE', // Aliased to unofficial + 'STNO', // Aliased to unofficial + 'STSO', // Aliased to unofficial 'SSTD', - 'STW', + 'STW', // Aliased to unofficial 'STNC', 'STN', 'SYF', diff --git a/src/UNL/TourMap/BuildingData.php b/src/UNL/TourMap/BuildingData.php index fed7f5ad0dd539e941f294ce3714338fa0238056..bf39dc01201734803413db71a92eb04084c93b83 100644 --- a/src/UNL/TourMap/BuildingData.php +++ b/src/UNL/TourMap/BuildingData.php @@ -11,10 +11,13 @@ class UNL_TourMap_BuildingData { protected $db; + protected $codeAliases; + public function __construct(Adapter $db) { $this->db = $db; $this->checkDb(); + $this->codeAliases = require UNL_TourMap::getDataDir() . '/php/building_aliases.inc.php'; } public function checkDb() @@ -140,9 +143,18 @@ class UNL_TourMap_BuildingData public function getByCode($code) { + if (isset($this->codeAliases[$code])) { + $code = $this->codeAliases[$code]; + } + return $this->executeSelect(array('code' => $code)); } + public function getAliases() + { + return $this->codeAliases; + } + public function getAllBuildings() { return $this->executeSelect(array('location' => array( diff --git a/src/UNL/TourMap/MarkerList/Buildings.php b/src/UNL/TourMap/MarkerList/Buildings.php index 58572acf616e20b61a70e0aef32081851ea872ee..dc0ea764f8ecee49d9a8f89867b87ee3186d8ce0 100644 --- a/src/UNL/TourMap/MarkerList/Buildings.php +++ b/src/UNL/TourMap/MarkerList/Buildings.php @@ -48,4 +48,9 @@ class UNL_TourMap_MarkerList_Buildings extends FilterIterator implements UNL_Tou { return new UNL_TourMap_Marker_Building(parent::current()); } + + public function getAliases() + { + return $this->buildingDriver->getAliases(); + } } \ No newline at end of file diff --git a/www/templates/html/UNL/TourMap/GoogleMap.tpl.php b/www/templates/html/UNL/TourMap/GoogleMap.tpl.php index d6164fd57b761bf6c8a2b15d90a63c29c9bcb2dc..85859657d22d3249f49daa2f3b43410b61ffb63b 100644 --- a/www/templates/html/UNL/TourMap/GoogleMap.tpl.php +++ b/www/templates/html/UNL/TourMap/GoogleMap.tpl.php @@ -85,6 +85,15 @@ WDN.loadCSS('<?php echo UNL_TourMap::getURL(); ?>css/map.css'); UNLTourMap.initialize(); <?php endif; ?> + <?php + if ($context->getRaw('markers') instanceof UNL_TourMap_MarkerList_Buildings) { + $buildings = $context->getRaw('markers'); + } else { + $buildings = new UNL_TourMap_MarkerList_Buildings(); + } + ?> + UNLTourMap.setBuildingAliases(<?php echo json_encode($buildings->getAliases()) ?>); + <?php if ($context->getRawObject() instanceof UNL_TourMap_GoogleMap_DynamicCenter) : ?> UNLTourMap.openBuildingInfo("<?php echo $context->getRawObject()->options['code']; ?>", true); <?php endif; ?>