本文整理汇总了PHP中TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue方法的典型用法代码示例。如果您正苦于以下问题:PHP GeneralUtility::quoteJSvalue方法的具体用法?PHP GeneralUtility::quoteJSvalue怎么用?PHP GeneralUtility::quoteJSvalue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Utility\GeneralUtility
的用法示例。
在下文中一共展示了GeneralUtility::quoteJSvalue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: enableRsaEncryption
/**
* Load all necessary Javascript files
*
* @param bool $useRequireJsModule
*/
public function enableRsaEncryption($useRequireJsModule = false)
{
if ($this->moduleLoaded || !$this->isAvailable()) {
return;
}
$this->moduleLoaded = true;
$pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
// Include necessary javascript files
if ($useRequireJsModule) {
$pageRenderer->loadRequireJsModule('TYPO3/CMS/Rsaauth/RsaEncryptionModule');
} else {
// Register ajax handler url
$code = 'var TYPO3RsaEncryptionPublicKeyUrl = ' . GeneralUtility::quoteJSvalue(GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . 'index.php?eID=RsaPublicKeyGenerationController') . ';';
$pageRenderer->addJsInlineCode('TYPO3RsaEncryptionPublicKeyUrl', $code);
$javascriptPath = ExtensionManagementUtility::siteRelPath('rsaauth') . 'Resources/Public/JavaScript/';
if (!$GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['debug']) {
$files = array('RsaEncryptionWithLib.min.js');
} else {
$files = array('RsaLibrary.js', 'RsaEncryption.js');
}
foreach ($files as $file) {
$pageRenderer->addJsFile($javascriptPath . $file);
}
}
}
示例2: wrapIcon
/**
* Wrapping icon in browse tree
*
* @param string $thePageIcon Icon IMG code
* @param array $row Data row for element.
* @return string Page icon
* @todo Define visibility
*/
public function wrapIcon($thePageIcon, &$row)
{
// If the record is locked, present a warning sign.
if ($lockInfo = \TYPO3\CMS\Backend\Utility\BackendUtility::isRecordLocked('pages', $row['uid'])) {
$aOnClick = 'alert(' . GeneralUtility::quoteJSvalue($lockInfo['msg']) . ');return false;';
$lockIcon = '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . IconUtility::getSpriteIcon('status-warning-in-use', array('title' => $lockInfo['msg'])) . '</a>';
} else {
$lockIcon = '';
}
// Wrap icon in click-menu link.
if (!$this->ext_IconMode) {
$thePageIcon = $GLOBALS['TBE_TEMPLATE']->wrapClickMenuOnIcon($thePageIcon, 'pages', $row['uid'], 0, '&bank=' . $this->bank);
} elseif ($this->ext_IconMode === 'titlelink') {
$aOnClick = 'return jumpTo(\'' . $this->getJumpToParam($row) . '\',this,\'' . $this->treeName . '\');';
$thePageIcon = '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $thePageIcon . '</a>';
}
// Wrap icon in a drag/drop span.
$dragDropIcon = '<span class="dragIcon" id="dragIconID_' . $row['uid'] . '">' . $thePageIcon . '</span>';
// Add Page ID:
$pageIdStr = '';
if ($this->ext_showPageId) {
$pageIdStr = '<span class="dragId">[' . $row['uid'] . ']</span> ';
}
// Call stats information hook
$stat = '';
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['recStatInfoHooks'])) {
$_params = array('pages', $row['uid']);
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['recStatInfoHooks'] as $_funcRef) {
$stat .= GeneralUtility::callUserFunction($_funcRef, $_params, $this);
}
}
return $dragDropIcon . $lockIcon . $pageIdStr . $stat;
}
示例3: viewHelperReturnsCorrectJs
/**
* Test if default file format works
*
* @test
* @return void
*/
public function viewHelperReturnsCorrectJs()
{
$newsItem = new Tx_News_Domain_Model_News();
$newsItem->setTitle('fobar');
$language = 'en';
$viewHelper = new Tx_News_ViewHelpers_Social_DisqusViewHelper();
$settingsService = $this->getAccessibleMock('Tx_News_Service_SettingsService');
$settingsService->expects($this->any())->method('getSettings')->will($this->returnValue(array('disqusLocale' => $language)));
$viewHelper->injectSettingsService($settingsService);
$actualResult = $viewHelper->render($newsItem, 'abcdef', 'http://typo3.org/dummy/fobar.html');
$expectedCode = '<script type="text/javascript">
var disqus_shortname = ' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue('abcdef', TRUE) . ';
var disqus_identifier = ' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue('news_' . $newUid, TRUE) . ';
var disqus_url = ' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue('http://typo3.org/dummy/fobar.html') . ';
var disqus_title = ' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue('fobar', TRUE) . ';
var disqus_config = function () {
this.language = ' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($language) . ';
};
(function() {
var dsq = document.createElement("script"); dsq.type = "text/javascript"; dsq.async = true;
dsq.src = "http://" + disqus_shortname + ".disqus.com/embed.js";
(document.getElementsByTagName("head")[0] || document.getElementsByTagName("body")[0]).appendChild(dsq);
})();
</script>';
$this->assertEquals($expectedCode, $actualResult);
}
示例4: render
/**
* Render videos from various video portals
*
* @param Tx_News_Domain_Model_Media $element
* @param integer $width
* @param integer $height
* @return string
*/
public function render(Tx_News_Domain_Model_Media $element, $width, $height)
{
$content = $finalUrl = '';
$url = Tx_News_Service_FileService::getCorrectUrl($element->getContent());
// get the correct rewritten url
$mediaWizard = \TYPO3\CMS\Frontend\MediaWizard\MediaWizardProviderManager::getValidMediaWizardProvider($url);
if ($mediaWizard !== NULL) {
$finalUrl = $mediaWizard->rewriteUrl($url);
}
// override width & height if both are set
if ($element->getWidth() > 0 && $element->getHeight() > 0) {
$width = $element->getWidth();
$height = $element->getHeight();
}
if (!empty($finalUrl)) {
$GLOBALS['TSFE']->getPageRenderer()->addJsFile('typo3conf/ext/news/Resources/Public/JavaScript/Contrib/swfobject-2-2.js');
$uniqueDivId = 'mediaelement' . Tx_News_Service_FileService::getUniqueId($element);
$content .= '<div id="' . htmlspecialchars($uniqueDivId) . '"></div>
<script type="text/javascript">
var params = { allowScriptAccess: "always", allowfullscreen : "true" };
var atts = { id: ' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($uniqueDivId) . ' };
swfobject.embedSWF(' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($finalUrl) . ',
' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($uniqueDivId) . ', "' . (int) $width . '", "' . (int) $height . '", "8", null, null, params, atts);
</script>';
}
return $content;
}
示例5: printTree
/**
* Create the page navigation tree in HTML
*
* @param array Tree array
* @return string HTML output.
* @todo Define visibility
*/
public function printTree($treeArr = '')
{
$titleLen = (int) $GLOBALS['BE_USER']->uc['titleLen'];
if (!is_array($treeArr)) {
$treeArr = $this->tree;
}
$out = '';
$c = 0;
foreach ($treeArr as $k => $v) {
$c++;
$bgColorClass = ($c + 1) % 2 ? 'bgColor' : 'bgColor-10';
if ($GLOBALS['SOBE']->browser->curUrlInfo['act'] == 'page' && $GLOBALS['SOBE']->browser->curUrlInfo['pageid'] == $v['row']['uid'] && $GLOBALS['SOBE']->browser->curUrlInfo['pageid']) {
$arrCol = '<td><img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/blinkarrow_right.gif', 'width="5" height="9"') . ' class="c-blinkArrowR" alt="" /></td>';
$bgColorClass = 'bgColor4';
} else {
$arrCol = '<td></td>';
}
$aOnClick = 'return jumpToUrl(' . GeneralUtility::quoteJSvalue($this->getThisScript() . 'act=' . $GLOBALS['SOBE']->browser->act . '&editorNo=' . $GLOBALS['SOBE']->browser->editorNo . '&contentTypo3Language=' . $GLOBALS['SOBE']->browser->contentTypo3Language . '&mode=' . $GLOBALS['SOBE']->browser->mode . '&expandPage=' . $v['row']['uid']) . ');';
$cEbullet = $this->ext_isLinkable($v['row']['doktype'], $v['row']['uid']) ? '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '"><img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/ol/arrowbullet.gif', 'width="18" height="16"') . ' alt="" /></a>' : '';
$out .= '
<tr class="' . $bgColorClass . '">
<td nowrap="nowrap"' . ($v['row']['_CSSCLASS'] ? ' class="' . $v['row']['_CSSCLASS'] . '"' : '') . '>' . $v['HTML'] . $this->wrapTitle($this->getTitleStr($v['row'], $titleLen), $v['row'], $this->ext_pArrPages) . '</td>' . $arrCol . '<td>' . $cEbullet . '</td>
</tr>';
}
$out = '
<!--
Navigation Page Tree:
-->
<table border="0" cellpadding="0" cellspacing="0" id="typo3-tree">
' . $out . '
</table>';
return $out;
}
示例6: main
/**
* Main function.
* Creates the header code in XHTML, the JavaScript, then the frameset for the two frames.
*
* @return void
*/
public function main()
{
// Setting GPvars:
$mode = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('mode');
$bparams = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('bparams');
$moduleUrl = BackendUtility::getModuleUrl('wizard_element_browser') . '&mode=';
// Set doktype:
$GLOBALS['TBE_TEMPLATE']->docType = 'xhtml_frames';
$GLOBALS['TBE_TEMPLATE']->JScode = $GLOBALS['TBE_TEMPLATE']->wrapScriptTags('
function closing() { //
close();
}
function setParams(mode,params) { //
parent.content.location.href = ' . GeneralUtility::quoteJSvalue($moduleUrl) . '+mode+"&bparams="+params;
}
if (!window.opener) {
alert("ERROR: Sorry, no link to main window... Closing");
close();
}
');
$this->content .= $GLOBALS['TBE_TEMPLATE']->startPage($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:TYPO3_Element_Browser'));
// URL for the inner main frame:
$url = $GLOBALS['BACK_PATH'] . $moduleUrl . rawurlencode($mode) . '&bparams=' . rawurlencode($bparams);
// Create the frameset for the window:
// Formerly there were a ' onunload="closing();"' in the <frameset> tag - but it failed on Safari browser on Mac unless the handler was "onUnload"
$this->content .= '
<frameset rows="*,1" framespacing="0" frameborder="0" border="0">
<frame name="content" src="' . htmlspecialchars($url) . '" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" noresize="noresize" />
<frame name="menu" src="' . $GLOBALS['BACK_PATH'] . 'dummy.php" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" noresize="noresize" />
</frameset>
';
$this->content .= '
</html>';
}
示例7: buildJavascriptConfiguration
/**
* Return JS configuration of the htmlArea plugins registered by the extension
*
* @param string $rteNumberPlaceholder A dummy string for JS arrays
* @return string JS configuration for registered plugins, in this case, JS configuration of block elements
*/
public function buildJavascriptConfiguration($rteNumberPlaceholder)
{
$registerRTEinJavascriptString = '';
$button = 'link';
if (in_array($button, $this->toolbar)) {
if (!is_array($this->thisConfig['buttons.']) || !is_array($this->thisConfig['buttons.'][$button . '.'])) {
$registerRTEinJavascriptString .= '
RTEarea[' . $rteNumberPlaceholder . '].buttons.' . $button . ' = new Object();';
}
$registerRTEinJavascriptString .= '
RTEarea[' . $rteNumberPlaceholder . '].buttons.' . $button . '.pathLinkModule = ' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('rtehtmlarea_wizard_browse_links')) . ';';
if ($this->htmlAreaRTE->is_FE()) {
$RTEProperties = $this->htmlAreaRTE->RTEsetup;
} else {
$RTEProperties = $this->htmlAreaRTE->RTEsetup['properties'];
}
if (is_array($RTEProperties['classesAnchor.'])) {
$registerRTEinJavascriptString .= '
RTEarea[' . $rteNumberPlaceholder . '].buttons.' . $button . '.classesAnchorUrl = "' . $this->htmlAreaRTE->writeTemporaryFile('classesAnchor_' . $this->htmlAreaRTE->contentLanguageUid, 'js', $this->buildJSClassesAnchorArray()) . '";';
}
$registerRTEinJavascriptString .= '
RTEarea[' . $rteNumberPlaceholder . '].buttons.' . $button . '.additionalAttributes = "data-htmlarea-external' . ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extensionKey]['plugins'][$this->pluginName]['additionalAttributes'] ? ',' . $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extensionKey]['plugins'][$this->pluginName]['additionalAttributes'] : '') . '";';
}
return $registerRTEinJavascriptString;
}
示例8: renderStatic
/**
* @param array $arguments
* @param callable $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
*
* @return string
*/
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
$documentTranslation = $arguments['documentTranslation'];
$icons = array('html' => '<a class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</a>', 'pdf' => '<a class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</a>', 'sxw' => '<a class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</a>');
$formats = $documentTranslation->getFormats();
foreach ($formats as $format) {
$output = '';
/** @var \TYPO3\CMS\Documentation\Domain\Model\DocumentFormat $format */
$output .= '<a ';
$uri = '../' . $format->getPath();
$extension = substr($uri, strrpos($uri, '.') + 1);
if (strlen($extension) < 5) {
// This is direct link to a file
$output .= 'href="' . $uri . '" class="btn btn-default"';
} else {
$extension = $format->getFormat();
if ($extension === 'json') {
$extension = 'js';
}
$output .= 'href="#" onclick="top.TYPO3.Backend.ContentContainer.setUrl(' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($uri) . ')" class="btn btn-default"';
}
$xliff = 'LLL:EXT:documentation/Resources/Private/Language/locallang.xlf';
$title = sprintf($GLOBALS['LANG']->sL($xliff . ':tx_documentation_domain_model_documentformat.format.title'), $format->getFormat());
$output .= ' title="' . htmlspecialchars($title) . '">';
$spriteIconHtml = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForFile($extension);
$output .= $spriteIconHtml . '</a>' . LF;
$keyFormat = $format->getFormat();
if ($keyFormat === 'json') {
// It should take over the place of sxw which will then never be used
$keyFormat = 'sxw';
}
$icons[$keyFormat] = $output;
}
return implode('', array_values($icons));
}
示例9: queryTable
/**
* Queries a table for records and completely processes them
*
* Returns a two-dimensional array of almost finished records;
* they only need to be put into a <li>-structure
*
* @param array $params
* @param integer $recursionCounter recursion counter
* @return mixed array of rows or FALSE if nothing found
*/
public function queryTable(&$params, $recursionCounter = 0)
{
$uid = (int) GeneralUtility::_GP('uid');
$records = parent::queryTable($params, $recursionCounter);
$table = $this->config['currentTable'];
if ($this->checkIfTagIsNotFound($records)) {
$text = $params['value'];
$javaScriptCode = '
var value=' . GeneralUtility::quoteJSvalue($text) . ';
Ext.Ajax.request({
url : \'ajax.php\' ,
params : { ajaxID:\'TagItems::createTag\', item:value, table:\'' . htmlspecialchars($table) . '\', uid:\'' . $uid . '\' },
success: function ( result, request ) {
var arr = result.responseText.split(\'-\');
setFormValueFromBrowseWin(arr[5], arr[2] + \'_\' + arr[0], arr[1]);
TBE_EDITOR.fieldChanged(arr[3], arr[6], arr[4], arr[5]);
},
failure: function ( result, request) {
Ext.MessageBox.alert(\'Failed\', result.responseText);
}
});
';
$javaScriptCode = trim(str_replace('"', '\'', $javaScriptCode));
$link = implode(' ', explode(chr(10), $javaScriptCode));
$records['tx_tagitems_domain_model_tag_' . strlen($text)] = array('text' => '<div onclick="' . $link . '">
<span class="suggest-path">
<a>' . sprintf($GLOBALS['LANG']->sL('LLL:EXT:tag_items/Resources/Private/Language/locallang_db.xlf:tag_suggest'), htmlspecialchars($text)) . '</a>
</span></div>', 'table' => 'tx_tagitems_domain_model_tag', 'class' => 'suggest-noresults', 'style' => 'background-color:#E9F1FE !important;background-image:url(' . $this->getDummyIconPath() . ');');
}
return $records;
}
示例10: queryTable
/**
* Queries a table for records and completely processes them
*
* Returns a two-dimensional array of almost finished records;
* they only need to be put into a <li>-structure
*
* @param array $params
* @param int $recursionCounter recursion counter
* @return mixed array of rows or FALSE if nothing found
*/
public function queryTable(&$params, $recursionCounter = 0)
{
$uid = (int) GeneralUtility::_GP('uid');
$records = parent::queryTable($params, $recursionCounter);
if ($this->checkIfTagIsNotFound($records)) {
$text = GeneralUtility::quoteJSvalue($params['value']);
$javaScriptCode = '
var value=' . $text . ';
Ext.Ajax.request({
url : \'ajax.php\' ,
method: "GET",
params : { ajaxID : \'News::createTag\', item:value,newsid:\'' . $uid . '\' },
success: function ( result, request ) {
var arr = result.responseText.split(\'-\');
setFormValueFromBrowseWin(arr[5], arr[2] + \'_\' + arr[0], arr[1]);
TBE_EDITOR.fieldChanged(arr[3], arr[6], arr[4], arr[5]);
},
failure: function ( result, request) {
Ext.MessageBox.alert(\'Failed\', result.responseText);
}
});
';
$javaScriptCode = trim(str_replace('"', '\'', $javaScriptCode));
$link = implode(' ', explode(LF, $javaScriptCode));
$records['tx_news_domain_model_tag_' . strlen($text)] = ['text' => '<div onclick="' . $link . '">
<span class="suggest-path">
<a>' . sprintf($GLOBALS['LANG']->sL('LLL:EXT:news/Resources/Private/Language/locallang_be.xlf:tag_suggest'), $text) . '</a>
</span></div>', 'table' => 'tx_news_domain_model_tag', 'class' => 'suggest-noresults', 'icon' => $this->getDummyIcon()->render()];
}
return $records;
}
示例11: renderOpenID
/**
* Render OpenID identifier field for user setup
*
* @return string HTML input field to change the OpenId
*/
public function renderOpenID()
{
$openid = $this->getBackendUser()->user['tx_openid_openid'];
$add = htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:openid/Resources/Private/Language/locallang.xlf:addopenid'));
$parameters = ['P[itemName]' => 'data[be_users][tx_openid_openid]'];
$popUpUrl = GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('wizard_openid', $parameters));
return '<div class="input-group">' . '<input id="field_tx_openid_openid"' . ' class="form-control"' . ' type="text" name="data[be_users][tx_openid_openid]"' . ' value="' . htmlspecialchars($openid) . '" />' . '<div class="input-group-addon">' . '<a href="#" onclick="' . 'vHWin=window.open(' . $popUpUrl . ',null,\'width=800,height=600,status=0,menubar=0,scrollbars=0\');' . 'vHWin.focus();return false;' . '">' . '<img src="../typo3/sysext/openid/ext_icon_small.png" alt="' . $add . '" title="' . $add . '"/>' . '</a>' . '</div>' . '</div>';
}
示例12: render
/**
* Render confirm link with sprite icon
*
* @param string $link
* @param string $message
* @param string $title
* @param string $class
* @param string $icon
* @return string
*/
public function render($link, $message = '', $title = '', $class = '', $icon = 'actions-edit-delete')
{
if (!empty($link)) {
$attributes = array('href' => $link, 'onclick' => 'return confirm(' . GeneralUtility::quoteJSvalue($message) . ')', 'title' => $title, 'class' => $class);
return '<a ' . GeneralUtility::implodeAttributes($attributes, false, true) . '>' . IconUtility::getSpriteIcon($icon) . '</a>';
}
return '';
}
示例13: onClickInsertRecord
/**
* Create on-click event value.
*
* @param array $row The record.
* @param string $vv Column position value.
* @param int $moveUid Move uid
* @param int $pid PID value.
* @param int $sys_lang System language
* @return string
*/
public function onClickInsertRecord($row, $vv, $moveUid, $pid, $sys_lang = 0)
{
if (is_array($row)) {
$location = $GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => 'tt_content:new/-' . $row['uid'] . '/' . $row['colPos']));
} else {
$location = $GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => 'tt_content:new/' . $pid . '/' . $vv));
}
return 'jumpToUrl(' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($location) . ');return false;';
}
示例14: wrapTitle
/**
* Wrapping the title in a link, if applicable.
*
* @param string $title Title, ready for output.
* @param \TYPO3\CMS\Core\Resource\Folder $folderObject The folderObject 'record'
*
* @return string Wrapping title string.
*/
public function wrapTitle($title, $folderObject)
{
if ($this->ext_isLinkable($folderObject)) {
$aOnClick = 'return jumpToUrl(' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($this->getThisScript() . 'act=' . $GLOBALS['SOBE']->browser->act . '&mode=' . $GLOBALS['SOBE']->browser->mode . '&expandFolder=' . rawurlencode($folderObject->getCombinedIdentifier())) . ');';
return '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $title . '</a>';
} else {
return '<span class="typo3-dimmed">' . $title . '</span>';
}
}
示例15: render
/**
* Render link with sprite icon to remove user
*
* @param \TYPO3\CMS\Beuser\Domain\Model\BackendUser $backendUser Target backendUser to switch active session to
* @return string
*/
public function render(\TYPO3\CMS\Beuser\Domain\Model\BackendUser $backendUser)
{
if ($backendUser->getUid() == $GLOBALS['BE_USER']->user['uid']) {
return '';
}
$redirectUrl = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REQUEST_URI');
$parameters = 'cmd[be_users][' . $backendUser->getUid() . '][delete]=1';
$url = $GLOBALS['BACK_PATH'] . 'tce_db.php?&' . $parameters . '&redirect=' . ($redirectUrl == '' ? '\' + T3_THIS_LOCATION + \'' : rawurlencode($redirectUrl)) . '&vC=' . rawurlencode($GLOBALS['BE_USER']->veriCode()) . \TYPO3\CMS\Backend\Utility\BackendUtility::getUrlToken('tceAction') . '&prErr=1&uPT=1';
return '<a href="' . $url . '" onclick="return confirm(' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue(\TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('confirm', 'beuser', array($backendUser->getUserName()))) . ')">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-edit-delete') . '</a>';
}