Пример #1
0
 function getSidebar()
 {
     if (empty($this->sidebarLinks)) {
         return null;
     }
     $c = '';
     foreach ($this->sidebarLinks as $link) {
         $c .= $link;
     }
     $out = tx_wecmap_shared::render(array('map_height' => $this->height, 'map_id' => $this->mapName, 'content' => $c), $this->conf['sidebar.']);
     return $out;
 }
    /**
     * Creates the Javascript to add a marker to the page.
     *
     * @access public
     * @return	string	The Javascript to add a marker to the page.
     */
    function writeJS()
    {
        $markerContent = array();
        foreach ($this->tabLabels as $index => $label) {
            $markerContent[] = json_encode($this->title[$index]) . '+' . json_encode($this->description[$index], JSON_HEX_APOS);
        }
        $tabLabels = array();
        foreach ($this->tabLabels as $index => $label) {
            $tabLabels[] = json_encode($label, JSON_HEX_APOS);
        }
        if ($this->directions) {
            $data = array('map_id' => $this->mapName, 'groupId' => $this->groupId, 'index' => $this->index, 'address' => $this->getUserAddress(), 'latitude' => $this->latitude, 'longitude' => $this->longitude, 'dirTitle' => htmlspecialchars(strip_tags($this->title[0])));
            if (is_array($this->directionsMenuConf)) {
                $markerContent[0] .= '+' . json_encode(tx_wecmap_shared::render($data, $this->directionsMenuConf), JSON_HEX_APOS);
            } else {
                // Workaround for EXT:cal
                // get default directionsMenu
                $directionsMenuConf = $GLOBALS['TSFE']->tmpl->setup['tx_wecmap_api.']['directionsMenu.'];
                if (is_array($directionsMenuConf)) {
                    $markerContent[0] .= '+' . json_encode(tx_wecmap_shared::render($data, $directionsMenuConf), JSON_HEX_APOS);
                }
            }
        }
        return '
WecMap.addBubble( "' . $this->mapName . '", ' . $this->groupId . ', ' . $this->index . ', [' . implode(',', $tabLabels) . '], [' . implode(',', $markerContent) . ']);';
    }