function getPath($path) { if (substr($path, 0, 4) == 'EXT:') { $keyEndPos = strpos($path, '/', 6); $key = substr($path, 4, $keyEndPos - 4); $keyPath = t3lib_extMgm::siteRelpath($key); $newPath = $keyPath . substr($path, $keyEndPos + 1); return $newPath; } else { return $path; } }
function user_rgslideshow_addJS($content, $conf) { // include main class of rgslideshow plugin require_once t3lib_extMgm::siteRelpath('rgslideshow') . 'pi1/class.tx_rgslideshow_pi1.php'; $this->rgslideshow = t3lib_div::makeInstance('tx_rgslideshow_pi1'); // load the necessary JS $this->rgslideshow->loadJS($conf); // configuration $config = array(); if ($conf['slideInterval'] > 0) { $config[] = "slideInterval: {$conf['slideInterval']},auto:true"; } if ($conf['bigNavigation'] != 1) { $config[] = "bigNavigation:false"; } if ($conf['smallNavigation'] != 1) { $config[] = "smallNavigation:false"; } if ($conf['imageBrowser'] != 1) { $config[] = "browser:false"; } if ($conf['prevText'] != '"« "') { $config[] = "prev:{$conf['prevText']}"; } if ($conf['nextText'] != '" »"') { $config[] = "next:{$conf['nextText']}"; } if ($conf['playText'] != '"∞"') { $config[] = "play:{$conf['playText']}"; } if ($conf['stopText'] != '"φ"') { $config[] = "stop:{$conf['stopText']}"; } $configuration = implode(',', $config); $GLOBALS['TSFE']->additionalHeaderData['rgslideshow2'] .= '<script type="text/javascript"> window.addEvent("domready", function(){ var slideshow' . $this->cObj->data['uid'] . ' = new SimpleSlideShowDemo( $$("#rgslideshow-' . $this->cObj->data['uid'] . ' img"),{' . $configuration . '}); }); </script>'; //return nothing $content = ''; return $content; }
/** * Creates the javascript which needs to be build dynamically * * @return all the js */ function getJs() { $postvars = t3lib_div::_GP('tx_rggooglemap_pi1'); $poiOnDefault = 0; if ($this->config['mapShowOnDefault']) { $table = 'tt_address'; $defaultPoiId = $this->config['mapShowOnDefault']; $poiOnDefault++; } if ($postvars['poi']) { $table = $postvars['table'] ? $postvars['table'] : 'tt_address'; $defaultPoiId = intval($postvars['poi']); $poiOnDefault++; } if ($poiOnDefault > 0) { //x $field = 'uid, tx_rggooglemap_lng, tx_rggooglemap_lat '; $where = 'hidden= 0 AND deleted = 0 AND uid = ' . $defaultPoiId; //x $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($field,$table,$where,$groupBy='',$orderBy='',$limit=''); //x $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res); # $table = 'tx_veguestbook_entries,tt_address'; $field = 'uid, lng, lat'; #$table = 'tx_veguestbook_entries'; $res = $this->generic->exec_SELECTquery($field, $table, $where, $groupBy, $orderBy, $offset); $row = array_shift($res); if ($row['uid']) { $showPOIonStart = 'myclick(' . $row['uid'] . ',' . $row['lng'] . ',' . $row['lat'] . ',"' . $table . '");'; } } // some settings for controlling $settings = 'map.setMapType(' . $this->config['mapType'] . ');'; if ($this->config['mapNavControl'] == 'large') { $settings .= 'map.addControl(new GLargeMapControl());'; } if ($this->config['mapNavControl'] == 'small') { $settings .= 'map.addControl(new GSmallMapControl());'; } if ($this->config['mapTypeControl'] == 'show') { $settings .= 'map.addControl(new GMapTypeControl());'; } if ($this->config['mapOverview'] == 1) { $settings .= 'map.addControl(new GOverviewMapControl());'; } if ($this->config['mapControlOnMouseOver'] == 1) { $hideControlsOnMouseOut = 'map.hideControls(); GEvent.addListener(map, "mouseover", function(){ map.showControls(); }); GEvent.addListener(map, "mouseout", function(){ map.hideControls(); });'; } if ($this->conf['enableDoubleClickZoom'] == 1) { $settings .= 'map.enableDoubleClickZoom();'; } if ($this->conf['enableContinuousZoom'] == 1) { $settings .= 'map.enableContinuousZoom();'; } // urls $url = t3lib_div::getIndpEnv('TYPO3_SITE_URL') . 'index.php?id=' . $GLOBALS["TSFE"]->id . '&type=500'; $url .= $GLOBALS['TSFE']->sys_language_uid != 0 ? '&L=' . $GLOBALS['TSFE']->sys_language_uid : ''; $urlForIcons = t3lib_div::getIndpEnv('TYPO3_SITE_URL') . 'uploads/tx_rggooglemap/'; $urlExt = t3lib_div::getIndpEnv('TYPO3_SITE_URL') . t3lib_extMgm::siteRelpath('rggooglemap'); // records for the selected categories if ($this->config['categories'] != '') { $selectedCat = 'var cat = new Array(); cat["cb"] = new Object();'; $cats = explode(',', $this->config['categories']); foreach ($cats as $key => $value) { $selectedCat .= 'cat["cb"][' . $value . '] = ' . $value . ';'; } $selectedCat .= ' tx_rggooglemap_pi1processCat(cat);'; } else { $selectedCat .= ' tx_rggooglemap_pi1processCat("default");'; } // use cluster, defaultt = 0 $addMarker = $this->conf['activateCluster'] == 1 ? 'clusterer.AddMarker(marker,title);' : 'map.addOverlay( marker );'; $out = '/*<![CDATA[*/ function makeMap() { if (GBrowserIsCompatible()) { ' . $selectedCat . ' map = new GMap2(document.getElementById("' . $this->config['mapDiv'] . '")); geocoder = new GClientGeocoder(); new GKeyboardHandler(map); //map.setCenter(new GLatLng(47.54687159892238, 15.150146484375), 3);// gosau map.setCenter(new GLatLng(' . $this->config['mapLat'] . ', ' . $this->config['mapLng'] . '), ' . $this->config['mapZoom'] . '); //map.addControl(new GSmallMapControl()); ' . $settings . ' //map.addControl(new GOverviewMapControl(new GSize(200,200))); //setTimeout("positionOverview(10,60)",10); //###__MAKEMAP### getXMLData(1); // create the clusterer cat = document.getElementById("mapcatlist").innerHTML; GEvent.addListener(map, \'moveend\', function() { myXmlVar="' . $url . '&tx_rggooglemap_pi1[cat]="+cat+"&tx_rggooglemap_pi1[area]=" + getBound() + "&tx_rggooglemap_pi1[zoom]="+map.getZoom()+"&r=" + Math.random(); if(!stopReload) getXMLData(123); stopReload=false; }); ' . $hideControlsOnMouseOut . ' //getXMLData(1); ' . $showPOIonStart . ' } } function getXMLData(clearOverlay) { // getCategories cat = document.getElementById("mapcatlist").innerHTML; myXmlVar="' . $url . '&tx_rggooglemap_pi1[cat]="+cat+"&tx_rggooglemap_pi1[area]=" + getBound() + "&tx_rggooglemap_pi1[zoom]="+map.getZoom()+"&r=" + Math.random(); /* if (test) { test=false; getXMLData(12); } */ var request = GXmlHttp.create(); request.open("GET", myXmlVar, true); request.onreadystatechange = function() { if (request.readyState == 4) { var xmlDoc = request.responseXML; // obtain the array of markers and loop through it var markers = xmlDoc.documentElement.getElementsByTagName("marker"); var clusterer = new Clusterer(map); if (clearOverlay ==12) { map.clearOverlays();gmarkers.length = 0; setTimeout(\'getXMLData(11)\', 100000); } if(d("rggooglemap-recordsonmap")){tx_rggooglemap_pi1activeRecords(getBound()); } var rggmbound =document.getElementById(\'rggmBound\'); if (rggmbound ) { rggmbound.value = getBound(); } //x document.getElementById(\'coordinfo\').innerHTML= markers.length + " ---- "+test+"<a href=\\" "+myXmlVar+"\\">XML</a>"; for (var i = 0; i < markers.length; i++) { // obtain the attribues of each marker var lat = parseFloat(markers[i].getAttribute("lat")); var lng = parseFloat(markers[i].getAttribute("lng")); var point = new GLatLng(lat,lng); var title = [GXml.value(markers[i].getElementsByTagName("t")[0]) ]; var id = parseFloat(markers[i].getAttribute("uid")); var table = markers[i].getAttribute("table"); var img = markers[i].getAttribute("img"); marker = createMarker(point, id, img, title, table); clusterer.RemoveMarker( marker ); if (!gmarkers[id]) { gmarkers[id] = marker; //clusterer.AddMarker(marker,title); ' . $addMarker . ' } } } } request.send(null); } function createMarker(point, id, img, title,table) { var icon = new GIcon(baseIcon); icon.image = "' . $urlForIcons . '"+img; // var marker = new GxMarker( point, icon, ""+ title, { "offset": new GSize(10, -20), "isStatic": false } ); var marker = new GxMarker( point, icon, ""+title ); //var marker = new GMarker (point); // var marker = new GxMarker( point, "http://www.rggooglemap.com/uploads/tx_rggooglemap/VirtError_02.gif", ""+title ); var url = "' . $url . '&no_cache=1&tx_rggooglemap_pi1[detail]="+id+"&tx_rggooglemap_pi1[table]="+table; // alert (url); GEvent.addListener(marker, "click", function() { var req = GXmlHttp.create(); req.open("GET", url, true ); req.onreadystatechange = function() { if ( req.readyState == 4 ) { marker.openInfoWindowHtml( req.responseText ); } }; req.send(null); }); return marker; } // This function picks up the click and opens the corresponding info window function myclick(i, lng, lat, table,showMarker) { var req = GXmlHttp.create(); var url = "' . $url . '&type=500&no_cache=1&tx_rggooglemap_pi1[detail]="+i+"&tx_rggooglemap_pi1[table]="+table; req.open("GET", url, true); var t=this; req.onreadystatechange = function() { if ( req.readyState == 4 ) { t.map.openInfoWindowHtml( new GLatLng(lat, lng), req.responseText ); // map.setCenter(new GLatLng(lat, lng)); /* if(showMarker==1) { var marker = new GMarker (new GLatLng(lat, lng)); map.addOverlay( marker ); tempmarkers[i] = marker; } */ } }; req.send(null); }; function clearCat() { test = true; map.clearOverlays(); gmarkers.length = 0; setTimeout("getXMLData(12);",1000); } '; // Adds hook for processing of extra javascript if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rggooglemap']['extraGetJsHook'])) { foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rggooglemap']['extraGetJsHook'] as $_classRef) { $_procObj =& t3lib_div::getUserObj($_classRef); $out = $_procObj->extraGetJsProcessor($out, $data, $this->config, $this); } } $out .= '/*]]>*/'; return $out; }
/** * creates a map for a single/detail page. * Getting uid from postvars and lng&lat from DB * * @param string $key: google map key * @return array the modified $saveData array */ function singleMap($key) { // generic function require_once t3lib_extMgm::siteRelpath('rggooglemap') . 'res/class.tx_rggooglemap_table.php'; $this->generic = t3lib_div::makeInstance('tx_rggooglemap_table'); // making the query $postvars = $this->postvars = t3lib_div::_GP($this->realConf->conf['rggm.']['detailUidParam']); $id = $postvars[$this->realConf->conf['rggm.']['detailUidParamID']]; $table = $this->realConf->conf['rggm.']['detailTable']; $where = 'hidden = 0 AND deleted = 0 AND uid=' . $id; $res = $this->generic->exec_SELECTquery('*', $table, $where, '', '', ''); $row = array_shift($res); /* // if lng+lat available if ($row['lng']!='' && $row['lat']!='') { // url for the POI content $url = t3lib_div::getIndpEnv('TYPO3_SITE_URL').'index.php?id='.$GLOBALS["TSFE"]->id.'&type=500'; $url.= ($GLOBALS['TSFE']->sys_language_uid != 0) ? '&L='.$GLOBALS['TSFE']->sys_language_uid : ''; // if ==1, pi1 is loaded to get all tabs, otherwise lower load, lower content # if ( $this->realConf->conf['rggm.']['fullDetail'] ==1) { require_once(t3lib_extMgm::extPath('rggooglemap').'pi1/class.tx_rggooglemap_pi1.php'); $this->rggm2 = t3lib_div::makeInstance('tx_rggooglemap_pi1'); # } // set an icon, if none set, take the default icon if ($this->realConf->conf['rggm.']['detailIcon']) { $icon = 'var icon = new GIcon(); icon.image = "'.$this->realConf->conf['rggm.']['detailIcon'].'"; icon.iconAnchor = new GPoint(6, 20); icon.infoWindowAnchor = new GPoint(5, 1); var marker = new GMarker (center,icon); '; } else { $icon = 'var marker = new GMarker (center);'; } // the needed js for the googlemap $GLOBALS['TSFE']->additionalHeaderData['b121211'] = '<script src="http://maps.google.com/maps?file=api&v=2.61&key='.$key.'" type="text/javascript"></script>'; $GLOBALS['TSFE']->additionalHeaderData['b121212ttnews'] = '<script type="text/javascript"> function makeMap() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("mapDetail")); var center = new GLatLng('.$row['lat'].', '.$row['lng'].'); map.setCenter(center, 3); '.$icon.' GEvent.addListener(marker, "click", function() { var url = "'.$url.'&no_cache=1&tx_rggooglemap_pi1[detail]='.$row['uid'].'&tx_rggooglemap_pi1[table]='.$table.'"; var req = GXmlHttp.create(); req.open("GET", url, true ); req.onreadystatechange = function() { if ( req.readyState == 4 ) { marker.openInfoWindowHtml( req.responseText ); } }; req.send(null); }); map.addOverlay(marker); } } </script>'; $map = '<div style="height:'.$this->realConf->conf['rggm.']['mapHeight'].'px;width:'.$this->realConf->conf['rggm.']['mapWidth'].'px" id="mapDetail"></div>'; } else { $map = ''; } */ // save selected uids into session $GLOBALS["TSFE"]->fe_user->setKey('ses', 'rggmttnews2', $id); $GLOBALS['TSFE']->fe_user->storeSessionData(); require_once t3lib_extMgm::extPath('rggooglemap') . 'pi1/class.tx_rggooglemap_pi1.php'; $this->rggm2 = t3lib_div::makeInstance('tx_rggooglemap_pi1'); $map = $this->rggm2->showMap('', $this->realConf->conf['rggm.']); return $map; }
/** * Emebed a mp3 file using the 1pixelout player. Possible to embed it as an * object or by using the SWFObject * * @param string $url: The url to the mp3 file * @param boolean $swfObject: If set, the SWFObject is used * @param array $mootools: If mootools is on the page, the array is filled with some code to use it * @param array $config: configuration of the 1pixeloutplayer * * @return string The video */ function getMp3($url, $swfObject, $config) { $url = trim($url); $url = str_replace('http://', '', $url); // unqiue keys $uniqueKey = md5($url); $uniqueUid = ' rgmi' . $this->getUniqueID() . ' '; // get the necessary js $playerPath = t3lib_div::getIndpEnv('TYPO3_SITE_URL') . t3lib_extMgm::siteRelpath('rgmediaimages') . 'res/audio/'; $GLOBALS['TSFE']->additionalHeaderData['rgmediaimagesaudio'] = '<script type="text/javascript" src="' . $playerPath . 'audio-player.js"></script>'; // get widht/height and unset it because not needed in following configuration $width = $config['width']; $height = $config['height']; unset($config['width']); unset($config['height']); // change magenta to ff00ff with a helping class require_once t3lib_extMgm::extPath('rgmediaimages') . 'lib/class.tx_rgmediaimages_colormap.php'; $this->color = t3lib_div::makeInstance('tx_rgmediaimages_colormap'); // Create new instance for div class // trim errors from colors foreach ($config as $key => $value) { $value = $this->color->nameToRGB($value); $config[$key] = trim($value, '#'); } // color configuration if ($config['bg'] == 'f8f8f8') { unset($config['bg']); } if ($config['leftbg'] == 'eeeeee') { unset($config['leftbg']); } if ($config['lefticon'] == '666666') { unset($config['lefticon']); } if ($config['rightbg'] == 'cccccc') { unset($config['rightbg']); } if ($config['rightbghover'] == '999999') { unset($config['rightbghover']); } if ($config['righticon'] == '666666') { unset($config['righticon']); } if ($config['righticonhover'] == 'ffffff') { unset($config['righticonhover']); } if ($config['text'] == '666666') { unset($config['text']); } if ($config['slider'] == '666666') { unset($config['slider']); } if ($config['track'] == 'ffffff') { unset($config['track']); } if ($config['border'] == '666666') { unset($config['border']); } if ($config['loader'] == '9FFFB8') { unset($config['loader']); } if ($config['loop'] == 'no' || $config['loop'] == 0) { unset($config['loop']); } if ($config['autostart'] == 'no' || $config['autostart'] == 0) { unset($config['autostart']); } if (is_array($config)) { foreach ($config as $key => $value) { // if loop || autostart, no color prefix (0x) is needed $prefix = $key != 'loop' && $key != 'autostart' ? '0x' : ''; $configuration .= '&' . $key . '=' . $prefix . $value; } } # t3lib_div::print_array($config); // set the mp3 player as embedded object if ($swfObject != 1) { $mxp3 = '<object type="application/x-shockwave-flash" data="' . $playerPath . 'player.swf" id="audioplayer' . $uniqueKey . '" height="' . $height . '" width="' . $width . '"> <param name="movie" value="' . $url . 'player.swf"> <param name="FlashVars" value="playerID=' . $uniqueKey . '&soundFile=http://' . $url . $configuration . '"> <param name="quality" value="high"> <param name="menu" value="false"> <param name="wmode" value="transparent"> </object>'; // set the mp3 player as SWFObj } else { $mp3 = '<span class="rgmediaimages-player' . $uniqueUid . '" id="player' . $uniqueKey . '">' . $this->getNoFlashText() . '</span> <script type="text/javascript"> ' . $this->mootools['begin'] . ' var so = new SWFObject("' . $playerPath . 'player.swf", "audioplayer", "' . $width . '", "' . $height . '", "7", "#FFFFFFF"); so.addParam("http://' . $url . '"); so.addParam("quality", "high"); so.addParam("wmode", "transparent"); so.addParam("menu", "false"); so.addParam("pluginurl","http://www.macromedia.com/go/getflashplayer"); so.addParam("flashvars","playerID=' . $uniqueKey . '&soundFile=http://' . $url . $configuration . '"); so.write("player' . $uniqueKey . '"); ' . $this->mootools['end'] . ' </script>'; } return $mp3; }