Ejemplo n.º 1
0
 public function linkForItem(KurogoObject $mapItem, $options = null)
 {
     $result = array('title' => $mapItem->getTitle(), 'subtitle' => $mapItem->getSubtitle());
     if ($mapItem instanceof Placemark) {
         $result['class'] = 'placemark';
         if ($mapItem instanceof BasePlacemark && ($url = $mapItem->getURL())) {
             // if url was set via setURL -- only applies to campus placemarks on worldmap
             $result['url'] = $url;
         } else {
             $urlArgs = $mapItem->getURLParams();
             $addBreadcrumb = $options && isset($options['addBreadcrumb']) && $options['addBreadcrumb'];
             $result['url'] = $this->buildBreadcrumbURL($this->pageForPlacemark($mapItem), $urlArgs, $addBreadcrumb);
         }
         if (($distance = $mapItem->getField('distance')) && $this->getOptionalModuleVar('SHOW_DISTANCES', true)) {
             $result['subtitle'] = $this->displayTextFromMeters($distance);
         }
     } else {
         $external = $options && isset($options['external']) && $options['external'];
         $feedId = $options && isset($options['feed']) ? $options['feed'] : null;
         $groupId = $options && isset($options['group']) ? $options['group'] : null;
         $category = implode(MAP_CATEGORY_DELIMITER, $mapItem->getIdStack());
         $result['url'] = $this->categoryURL($category, $feedId, $groupId, $external);
     }
     return $result;
 }