本文整理汇总了PHP中t3lib_extMgm::siteRelpath方法的典型用法代码示例。如果您正苦于以下问题:PHP t3lib_extMgm::siteRelpath方法的具体用法?PHP t3lib_extMgm::siteRelpath怎么用?PHP t3lib_extMgm::siteRelpath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类t3lib_extMgm
的用法示例。
在下文中一共展示了t3lib_extMgm::siteRelpath方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPath
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;
}
}
示例2: user_rgslideshow_addJS
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;
}
示例3: getJs
/**
* 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);
//.........这里部分代码省略.........
示例4: singleMap
/**
* 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;
}
示例5: getMp3
/**
* 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'] . '
//.........这里部分代码省略.........