本文整理汇总了PHP中TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath方法的典型用法代码示例。如果您正苦于以下问题:PHP ExtensionManagementUtility::extRelPath方法的具体用法?PHP ExtensionManagementUtility::extRelPath怎么用?PHP ExtensionManagementUtility::extRelPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Utility\ExtensionManagementUtility
的用法示例。
在下文中一共展示了ExtensionManagementUtility::extRelPath方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* @todo Variable Locations aus den Orten, dazu tt_address ergänzen
*
* @param \Mittwald\MmEvents\Domain\Model\Location $address
* @return string $content HTML code
*/
public function render($address)
{
$postalcode = urlencode('90403');
$street = urlencode('Ludwigsplatz 12');
$city = urlencode('Nürnberg');
$content2 = '<iframe width="600" height="400" src="http://nominatim.openstreetmap.org/search.php?street=' . $street . '&postalcode=' . $postalcode . '&city=' . $city . '&addressdetails=1&dedupe=1&viewbox=9.69%2C52.37%2C9.76%2C52.34"></iframe>';
$path = str_replace('../', '/', \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('mm_events') . 'Resources/Public/OpenLayers/lib/OpenLayers.js');
$content = '<div class="" id="demoMap" style="height:350px;background-color: #FFFFFF;border: 1px solid #DDDDDD;border-radius: 4px 4px 4px 4px;line-height: 1.42857;max-width: 100%;padding: 4px;transition: all 0.2s ease-in-out 0s;"></div>
<script src="' . $path . '"></script>
<script>
var lon = 11.07075;
var lat = 49.45060;
var zoom = 18;
var map, layer;
map = new OpenLayers.Map("demoMap");
map.addLayer(new OpenLayers.Layer.OSM());
// map.addControl(new OpenLayers.Control.PanZoomBar());
// OpenLayers.ImgPath = "/resources/external/images/ol/";
// map.zoomToMaxExtent();
map.setCenter(
new OpenLayers.LonLat(lon, lat).transform(
new OpenLayers.Projection("EPSG:4326"),
map.getProjectionObject()
), zoom
);
</script>';
return $content;
}
示例2: init
public function init()
{
$ico = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('mydashboard') . 'widgets/icon/tx_mydashboard_serverinfo.png';
$this->setIcon($ico);
$this->setTitle('Server Info');
return true;
}
示例3: init
public function init($PA, $fobj)
{
$GLOBALS['LANG']->includeLLFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('cal') . 'Resources/Private/Language/locallang_db.xml');
$this->frequency = $PA['row']['freq'];
if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 7005000) {
$this->frequency = $PA['row']['freq'][0];
}
$this->uid = $PA['row']['uid'];
$this->row = $PA['row'];
$this->table = $PA['table'];
$this->rdateType = $this->row['rdate_type'];
$this->rdate = $this->row['rdate'];
$this->rdateValues = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->row['rdate'], 1);
if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 7004000) {
$this->garbageIcon = '<span class="t3-icon fa t3-icon fa fa-trash"> </span>';
$this->newIcon = '<span title="' . $GLOBALS['LANG']->getLL('tx_cal_event.add_recurrence') . '" class="t3-icon fa t3-icon fa fa-plus-square"> </span>';
} else {
$this->garbageIcon = '<img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/garbage.gif') . ' title="' . $GLOBALS['LANG']->getLL('tx_cal_event.remove_recurrence') . '" alt="' . $GLOBALS['LANG']->getLL('tx_cal_event.delete_recurrence') . '" />';
$this->newIcon = '<img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/new_el.gif') . ' title="' . $GLOBALS['LANG']->getLL('tx_cal_event.add_recurrence') . '" alt="' . $GLOBALS['LANG']->getLL('tx_cal_event.add_recurrence') . '" />';
}
$this->commonJS = '';
if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 7004000) {
$this->commonJS .= '<script src="' . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('cal') . 'Resources/Public/js/recurui2.js" type="text/javascript"></script>' . chr(10) . '<script src="' . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('cal') . 'Resources/Public/js/url2.js" type="text/javascript"></script>';
} else {
$this->commonJS .= '<script src="' . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('cal') . 'Resources/Public/js/recurui.js" type="text/javascript"></script>' . chr(10) . '<script src="' . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('cal') . 'Resources/Public/js/url.js" type="text/javascript"></script>';
}
$this->everyMonthText = $GLOBALS['LANG']->getLL('tx_cal_event.recurs_every_month');
$this->selectedMonthText = $GLOBALS['LANG']->getLL('tx_cal_event.recurs_selected_months');
$this->counts = $this->getCountsArray();
$startDay = $this->getWeekStartDay($PA);
$this->weekdays = $this->getWeekDaysArray($startDay);
$this->months = $this->getMonthsArray();
}
示例4: proc
/**
* Processing the wizard items array
*
* @param array $wizardItems: The wizard items
* @return Modified array with wizard items
*/
public function proc($wizardItems)
{
global $LANG;
$LL = $this->includeLocalLang();
$wizardItems['plugins_tx_rgsmoothgallery_pi1'] = array('icon' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('rgsmoothgallery') . 'pi1/ce_wiz.gif', 'title' => $LANG->getLLL('pi1_title', $LL), 'description' => $LANG->getLLL('pi1_plus_wiz_description', $LL), 'params' => '&defVals[tt_content][CType]=list&defVals[tt_content][list_type]=rgsmoothgallery_pi1');
return $wizardItems;
}
示例5: initializeAction
public function initializeAction()
{
$this->targetGroupRepository = $this->objectManager->get('MUM\\BjrFreizeit\\Domain\\Repository\\TargetGroupRepository');
$css = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($this->request->getControllerExtensionKey()) . 'Resources/Public/Css/bjrfreizeitfeadmin.css';
/** */
$GLOBALS['TSFE']->getPageRenderer()->addCssFile($css);
}
示例6: proc
/**
* Processing the wizard items array
*
* @param array $wizardItems: The wizard items
* @return Modified array with wizard items
*/
function proc($wizardItems)
{
global $LANG;
$LL = $this->includeLocalLang();
$wizardItems['plugins_tx_test_pi2'] = array('icon' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('gorillary') . 'pi2/wizicon.png', 'title' => $LANG->getLLL('pi2_title', $LL), 'description' => $LANG->getLLL('pi2_plus_wiz_description', $LL), 'params' => '&defVals[tt_content][CType]=list&defVals[tt_content][list_type]=gorillary_pi2');
return $wizardItems;
}
示例7: initialize_editor
/**
* Initialize editor
*
* Initializes the module.
* Done in this function because we may need to re-initialize if data is submitted!
*
* @param int $pageId
* @param int $template_uid
* @return bool
*/
public function initialize_editor($pageId, $template_uid = 0)
{
$templateService = GeneralUtility::makeInstance(ExtendedTemplateService::class);
$GLOBALS['tmpl'] = $templateService;
// Do not log time-performance information
$templateService->tt_track = false;
$templateService->init();
$templateService->ext_localGfxPrefix = ExtensionManagementUtility::extPath('tstemplate');
$templateService->ext_localWebGfxPrefix = ExtensionManagementUtility::extRelPath('tstemplate') . 'Resources/Public/';
// Get the row of the first VISIBLE template of the page. whereclause like the frontend.
$GLOBALS['tplRow'] = $templateService->ext_getFirstTemplate($pageId, $template_uid);
// IF there was a template...
if (is_array($GLOBALS['tplRow'])) {
// Gets the rootLine
$sys_page = GeneralUtility::makeInstance(PageRepository::class);
$rootLine = $sys_page->getRootLine($pageId);
// This generates the constants/config + hierarchy info for the template.
$templateService->runThroughTemplates($rootLine, $template_uid);
// The editable constants are returned in an array.
$GLOBALS['theConstants'] = $templateService->generateConfig_constants();
// The returned constants are sorted in categories, that goes into the $tmpl->categories array
$templateService->ext_categorizeEditableConstants($GLOBALS['theConstants']);
// This array will contain key=[expanded constant name], value=line number in template. (after edit_divider, if any)
$templateService->ext_regObjectPositions($GLOBALS['tplRow']['constants']);
return true;
}
return false;
}
开发者ID:Audibene-GMBH,项目名称:TYPO3.CMS,代码行数:38,代码来源:TypoScriptTemplateConstantEditorModuleFunctionController.php
示例8: initialize_editor
/**
* Initialize editor
*
* @param integer $pageId
* @param integer $template_uid
* @return integer
* @todo Define visibility
*/
public function initialize_editor($pageId, $template_uid = 0)
{
// Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
global $tmpl, $tplRow, $theConstants;
$tmpl = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\TypoScript\\ExtendedTemplateService');
// Defined global here!
$tmpl->tt_track = 0;
// Do not log time-performance information
$tmpl->init();
$tmpl->ext_localGfxPrefix = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('tstemplate');
$tmpl->ext_localWebGfxPrefix = $GLOBALS['BACK_PATH'] . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('tstemplate') . 'Resources/Public/';
// Get the row of the first VISIBLE template of the page. whereclause like the frontend.
$tplRow = $tmpl->ext_getFirstTemplate($pageId, $template_uid);
// IF there was a template...
if (is_array($tplRow)) {
// Gets the rootLine
$sys_page = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Page\\PageRepository');
$rootLine = $sys_page->getRootLine($pageId);
// This generates the constants/config + hierarchy info for the template.
$tmpl->runThroughTemplates($rootLine, $template_uid);
// The editable constants are returned in an array.
$theConstants = $tmpl->generateConfig_constants();
// The returned constants are sorted in categories, that goes into the $tmpl->categories array
$tmpl->ext_categorizeEditableConstants($theConstants);
// This array will contain key=[expanded constantname], value=linenumber in template. (after edit_divider, if any)
$tmpl->ext_regObjectPositions($tplRow['constants']);
return 1;
}
}
开发者ID:khanhdeux,项目名称:typo3test,代码行数:37,代码来源:TypoScriptTemplateConstantEditorModuleFunctionController.php
示例9: autoloaderTest
/**
* Build up the HDNET contact Info Box
*
* @return string
*/
protected function autoloaderTest()
{
$icon = ExtensionManagementUtility::extRelPath('autoloader') . 'ext_icon.png';
$box = '<div id="t3-login-news-outer" class="t3-login-box">
<div class="t3-headline">
<h2 style="background: url(' . $icon . ') no-repeat scroll 10px center transparent;">Contact</h2>
</div>
<div class="t3-login-box-body">
<dl id="t3-login-news" style="margin-top: 0;">
<!-- ###NEWS_ITEM### begin -->
<div class="t3-login-news-item first-item">
<dl>
<dt>
<span class="t3-news-date"></span>
<span class="t3-news-title">Autoloader</span>
</dt>
<dd>
This is the Autoloader Test
</dd>
</dl>
</div>
<!-- ###NEWS_ITEM### end -->
</dl>
</div>
</div>
<div class="t3-login-box-border-bottom"></div>';
return $box;
}
示例10: indexAction
/**
* action index
*
* @return void
*/
public function indexAction()
{
$this->extKey = 'twitterbox';
$this->pluginKey = 'twitterbox';
$this->extPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($this->extKey);
$this->extRelPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($this->extKey);
$this->config = $this->loadConfig();
$this->view->assign('config', $this->config);
$headerData = array();
if ($this->config['includeCSS']) {
$headerData[] = '<link rel="stylesheet" type="text/css" href="' . $this->extRelPath . 'Resources/Public/Css/' . $this->pluginKey . '.css" />';
}
$GLOBALS['TSFE']->additionalHeaderData['tx_' . $this->extKey . '_' . $this->pluginKey] = implode('', $headerData);
if ($this->config['templateDir'] !== false) {
$this->view->setTemplateRootPath($this->config['templateDir']);
}
$tweets = array();
if ($this->config['consumerKey'] !== false && $this->config['consumerSecret']) {
$tokenUrl = "https://api.twitter.com/oauth2/token";
$auth = base64_encode(urlencode($this->config['consumerKey']) . ':' . urlencode($this->config['consumerSecret']));
try {
$getTokenCH = curl_init();
curl_setopt($getTokenCH, CURLOPT_URL, $tokenUrl);
curl_setopt($getTokenCH, CURLOPT_POST, 1);
curl_setopt($getTokenCH, CURLOPT_HTTPHEADER, array('Authorization: Basic ' . $auth));
curl_setopt($getTokenCH, CURLOPT_POSTFIELDS, "grant_type=client_credentials");
curl_setopt($getTokenCH, CURLOPT_RETURNTRANSFER, 1);
$token = json_decode(curl_exec($getTokenCH));
curl_close($getTokenCH);
if (isset($token->errors)) {
throw new \Exception('Error ' . $token->errors[0]->code . ': ' . $token->errors[0]->message);
}
$token = $token->access_token;
if ($this->settings['mode'] == 'user') {
$quest = 'https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=' . urlencode($this->settings['filter']);
} else {
$quest = 'https://api.twitter.com/1.1/search/tweets.json?q=' . urlencode($this->settings['filter']) . '&result_type=recent';
}
$quest .= '&count=' . $this->config['numTweets'];
$questCH = curl_init();
curl_setopt($questCH, CURLOPT_URL, $quest);
curl_setopt($questCH, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($questCH, CURLOPT_HTTPHEADER, array('Authorization: Bearer ' . $token));
$result = json_decode(curl_exec($questCH));
curl_close($questCH);
if (isset($result->errors)) {
throw new \Exception('Error ' . $token->errors[0]->code . ': ' . $token->errors[0]->message);
}
if (isset($result->statuses)) {
$tweets = $result->statuses;
} else {
$tweets = $result;
}
} catch (\Exception $e) {
echo $e->getMessage();
}
}
$this->view->assign('heading', array('mode' => $this->settings['mode'], 'filter' => $this->settings['filter']));
$this->view->assign('tweets', $tweets);
}
示例11: proc
function proc($wizardItems)
{
$languageService = $this->getLanguageService();
$localLang = $this->getLocalLang();
$wizardItems['plugins_tx_irfaq_pi1'] = array('icon' => ExtensionManagementUtility::extRelPath('irfaq') . 'res/ce_wiz.gif', 'title' => $languageService->getLLL('pi1_title_irfaq', $localLang), 'description' => $languageService->getLLL('pi1_plus_wiz_description_irfaq', $localLang), 'params' => '&defVals[tt_content][CType]=list&defVals[tt_content][list_type]=irfaq_pi1');
return $wizardItems;
}
示例12: main
/**
* Main function
*
* @param [type] $$backRef: ...
* @param [type] $menuItems: ...
* @param [type] $table: ...
* @param [type] $uid: ...
* @return [type] ...
*/
function main(&$backRef, $menuItems, $table, $uid)
{
global $BE_USER, $TCA, $LANG;
$localItems = array();
if (!$backRef->cmLevel) {
// Returns directly, because the clicked item was not from the pages table
if ($table == "tx_l10nmgr_cfg") {
// Adds the regular item:
$LL = $this->includeLL();
// Repeat this (below) for as many items you want to add!
// Remember to add entries in the localconf.php file for additional titles.
$url = ExtensionManagementUtility::extRelPath("l10nmgr") . "cm1/index.php?id=" . $uid;
$localItems[] = $backRef->linkItem($GLOBALS["LANG"]->getLLL("cm1_title", $LL), $backRef->excludeIcon('<img src="' . ExtensionManagementUtility::extRelPath("l10nmgr") . 'cm1/cm_icon.gif" width="15" height="12" border="0" align="top" />'), $backRef->urlRefForCM($url), 1);
}
$localItems["moreoptions_tx_l10nmgr_cm3"] = $backRef->linkItem('L10Nmgr tools', '', "top.loadTopMenu('" . GeneralUtility::linkThisScript() . "&cmLevel=1&subname=moreoptions_tx_l10nmgrXX_cm3');return false;", 0, 1);
// Simply merges the two arrays together and returns ...
$menuItems = array_merge($menuItems, $localItems);
} elseif (GeneralUtility::_GET('subname') == 'moreoptions_tx_l10nmgrXX_cm3') {
$url = ExtensionManagementUtility::extRelPath("l10nmgr") . "cm3/index.php?id=" . $uid . '&table=' . $table;
$localItems[] = $backRef->linkItem('Create priority', '', $backRef->urlRefForCM($url . '&cmd=createPriority'), 1);
$localItems[] = $backRef->linkItem('Manage priorities', '', $backRef->urlRefForCM($url . '&cmd=managePriorities'), 1);
$localItems[] = $backRef->linkItem('Update Index', '', $backRef->urlRefForCM($url . '&cmd=updateIndex'), 1);
$localItems[] = $backRef->linkItem('Flush Translations', '', $backRef->urlRefForCM($url . '&cmd=flushTranslations'), 1);
$menuItems = array_merge($menuItems, $localItems);
}
return $menuItems;
}
示例13: getBackendSetting
/**
* Hook function for the user settings module
*
* @param array $PA
* @param \TYPO3\CMS\Setup\Controller\SetupModuleController $fsobj
* @return string
*/
public function getBackendSetting(&$PA, &$fsobj)
{
/** @var \TYPO3\CMS\Core\Page\PageRenderer $pageRenderer */
$pageRenderer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Page\PageRenderer::class);
$pageRenderer->addJsFile(ExtensionManagementUtility::extRelPath('authenticator') . '/Resources/Public/JavaScript/qrcode.js');
return $this->createImageAndText($GLOBALS['BE_USER']);
}
示例14: render
/**
* Calls addJsFile for each file in the given folder on the Instance of TYPO3\CMS\Core\Page\PageRenderer.
*
* @param string $name the file to include
* @param string $extKey the extension, where the file is located
* @param string $pathInsideExt the path to the file relative to the ext-folder
* @param bool $recursive
*/
public function render($name = null, $extKey = null, $pathInsideExt = 'Resources/Public/JavaScript/', $recursive = false)
{
if ($extKey == null) {
$extKey = $this->controllerContext->getRequest()->getControllerExtensionKey();
}
$extPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($extKey);
if (TYPO3_MODE === 'FE') {
$extRelPath = substr($extPath, strlen(PATH_site));
} else {
$extRelPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($extKey);
}
$absFolderPath = $extPath . $pathInsideExt . $name;
// $files will include all files relative to $pathInsideExt
if ($recursive === false) {
$files = \TYPO3\CMS\Core\Utility\GeneralUtility::getFilesInDir($absFolderPath);
foreach ($files as $hash => $filename) {
$files[$hash] = $name . $filename;
}
} else {
$files = \TYPO3\CMS\Core\Utility\GeneralUtility::getAllFilesAndFoldersInPath([], $absFolderPath, '', 0, 99, '\\.svn');
foreach ($files as $hash => $absPath) {
$files[$hash] = str_replace($extPath . $pathInsideExt, '', $absPath);
}
}
foreach ($files as $name) {
$this->pageRenderer->addJsFile($extRelPath . $pathInsideExt . $name);
}
}
示例15: getExtensionSummary
/**
* Returns information about this extension plugin
*
* @param array $params Parameters to the hook
*
* @return string Information about pi1 plugin
* @hook TYPO3_CONF_VARS|SC_OPTIONS|cms/layout/class.tx_cms_layout.php|list_type_Info|calendarize_calendar
*/
public function getExtensionSummary(array $params)
{
if ($params['row']['list_type'] != 'calendarize_calendar') {
return '';
}
$this->flexFormService = GeneralUtility::makeInstance('HDNET\\Calendarize\\Service\\FlexFormService');
$this->flexFormService->load($params['row']['pi_flexform']);
if (!$this->flexFormService->isValid()) {
return '';
}
$extensionIcon = IconUtility::getByExtensionKey('calendarize', true);
$extensionRelPath = ExtensionManagementUtility::extRelPath('calendarize');
$this->layoutService = GeneralUtility::makeInstance('HDNET\\Calendarize\\Service\\ContentElementLayoutService');
$this->layoutService->setTitle('<img src="' . str_replace('EXT:calendarize/', $extensionRelPath, $extensionIcon) . '" width="32" height="32" /> Calendarize');
$actions = $this->flexFormService->get('switchableControllerActions', 'main');
$parts = GeneralUtility::trimExplode(';', $actions, true);
$parts = array_map(function ($element) {
$split = explode('->', $element);
return ucfirst($split[1]);
}, $parts);
$actionKey = lcfirst(implode('', $parts));
$this->layoutService->addRow(TranslateUtility::get('mode'), TranslateUtility::get('mode.' . $actionKey));
$this->layoutService->addRow(TranslateUtility::get('configuration'), $this->flexFormService->get('settings.configuration', 'main'));
if ((bool) $this->flexFormService->get('settings.hidePagination', 'main')) {
$this->layoutService->addRow(TranslateUtility::get('hide.pagination.teaser'), '!!!');
}
$this->addPageIdsToTable();
return $this->layoutService->render();
}