本文整理匯總了PHP中TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript方法的典型用法代碼示例。如果您正苦於以下問題:PHP GeneralUtility::linkThisScript方法的具體用法?PHP GeneralUtility::linkThisScript怎麽用?PHP GeneralUtility::linkThisScript使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TYPO3\CMS\Core\Utility\GeneralUtility
的用法示例。
在下文中一共展示了GeneralUtility::linkThisScript方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: 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;
}
示例2: addData
/**
* Add return unl
*
* @param array $result
* @return array
*/
public function addData(array $result)
{
if ($result['returnUrl'] === null) {
$result['returnUrl'] = GeneralUtility::linkThisScript();
}
return $result;
}
示例3: render
/**
* @param \TYPO3\CMS\Beuser\Domain\Model\BackendUser $backendUser Target backendUser to switch active session to
* @param boolean $emulate Return to current session or logout after target session termination?
* @return string
*/
public function render(\TYPO3\CMS\Beuser\Domain\Model\BackendUser $backendUser, $emulate = FALSE)
{
if ($backendUser->getUid() == $GLOBALS['BE_USER']->user['uid']) {
return '';
}
$title = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate($emulate ? 'switchBackMode' : 'changeToMode', 'beuser');
return '<a href="' . \TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array('SwitchUser' => $backendUser->getUid(), 'switchBackUser' => $emulate)) . '" target="_top" title="' . htmlspecialchars($title) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-system-backend-user-' . ($emulate ? 'emulate' : 'switch')) . '</a>';
}
示例4: render
/**
* @param \TYPO3\CMS\Beuser\Domain\Model\BackendUser $backendUser Target backendUser to switch active session to
* @param boolean $emulate Return to current session or logout after target session termination?
* @return string
*/
public function render(\TYPO3\CMS\Beuser\Domain\Model\BackendUser $backendUser, $emulate = FALSE)
{
if ($backendUser->getIsAdministrator()) {
return '';
}
$title = $GLOBALS['LANG']->getLL('switchUserTo', TRUE) . ' ' . $backendUser->getUserName() . ' ' . $GLOBALS['LANG']->getLL('switchBackMode', TRUE);
return '<a href="' . \TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array('SwitchUser' => $backendUser->getUid(), 'switchBackUser' => $emulate)) . '" target="_top" title="' . htmlspecialchars($title) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-system-backend-user-' . ($emulate ? 'emulate' : 'switch')) . '</a>';
}
示例5: getVersionSelector
/**
* Creates the version selector for the page id inputted.
* Moved out of the core file \TYPO3\CMS\Backend\Template\DocumentTemplate
*
* @param int $id Page id to create selector for.
* @param bool $noAction If set, there will be no button for swapping page.
* @return void
* @see \TYPO3\CMS\Backend\Template\DocumentTemplate
*/
public function getVersionSelector($id, $noAction = FALSE)
{
if ($id <= 0) {
return;
}
if ($GLOBALS['BE_USER']->workspace == 0) {
// Get Current page record:
$curPage = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('pages', $id);
// If the selected page is not online, find the right ID
$onlineId = $curPage['pid'] == -1 ? $curPage['t3ver_oid'] : $id;
// Select all versions of online version:
$versions = \TYPO3\CMS\Backend\Utility\BackendUtility::selectVersionsOfRecord('pages', $onlineId, 'uid,pid,t3ver_label,t3ver_oid,t3ver_wsid,t3ver_id');
// If more than one was found...:
if (count($versions) > 1) {
$selectorLabel = '<strong>' . $GLOBALS['LANG']->sL('LLL:EXT:version/locallang.xlf:versionSelect.label', TRUE) . '</strong>';
// Create selector box entries:
$opt = array();
foreach ($versions as $vRow) {
if ($vRow['uid'] == $onlineId) {
// Live version
$label = '[' . $GLOBALS['LANG']->sL('LLL:EXT:version/locallang.xlf:versionSelect.live', TRUE) . ']';
} else {
$label = $vRow['t3ver_label'] . ' (' . $GLOBALS['LANG']->sL('LLL:EXT:version/locallang.xlf:versionId', TRUE) . ' ' . $vRow['t3ver_id'] . ($vRow['t3ver_wsid'] != 0 ? ' ' . $GLOBALS['LANG']->sL('LLL:EXT:version/locallang.xlf:workspaceId', TRUE) . ' ' . $vRow['t3ver_wsid'] : '') . ')';
}
$opt[] = '<option value="' . htmlspecialchars(GeneralUtility::linkThisScript(array('id' => $vRow['uid']))) . '"' . ($id == $vRow['uid'] ? ' selected="selected"' : '') . '>' . htmlspecialchars($label) . '</option>';
}
// Add management link:
$management = '<input type="button" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:ver.mgm', TRUE) . '" onclick="window.location.href=\'' . htmlspecialchars($GLOBALS['BACK_PATH'] . \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_txversionM1', array('table' => 'pages', 'uid' => $onlineId))) . '\';" />';
// Create onchange handler:
$onChange = 'window.location.href=this.options[this.selectedIndex].value;';
// Controls:
if ($id == $onlineId) {
$controls = '<img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/blinkarrow_left.gif', 'width="5" height="9"') . ' class="absmiddle" alt="" /> <strong>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:ver.online', TRUE) . '</strong>';
} elseif (!$noAction) {
$href = $GLOBALS['TBE_TEMPLATE']->issueCommand('&cmd[pages][' . $onlineId . '][version][swapWith]=' . $id . '&cmd[pages][' . $onlineId . '][version][action]=swap', GeneralUtility::linkThisScript(array('id' => $onlineId)));
$controls = '<a href="' . htmlspecialchars($href) . '" class="text-nowrap">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-version-swap-version', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:ver.swapPage', TRUE), 'style' => 'margin-left:5px;vertical-align:bottom;')) . '<strong>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:ver.swap', TRUE) . '</strong></a>';
}
// Write out HTML code:
return '
<!--
Version selector:
-->
<table border="0" cellpadding="0" cellspacing="0" id="typo3-versionSelector">
<tr>
<td>' . $selectorLabel . '</td>
<td>
<select onchange="' . htmlspecialchars($onChange) . '">
' . implode('', $opt) . '
</select></td>
<td>' . $controls . '</td>
<td>' . $management . '</td>
</tr>
</table>
';
}
}
}
示例6: renderWarning
/**
* Render warning
*
* @return string
*/
protected function renderWarning()
{
$action = GeneralUtility::linkThisScript(array('M' => GeneralUtility::_GP('M'), 'tx_extensionmanager_tools_extensionmanagerextensionmanager' => GeneralUtility::_GP('tx_extensionmanager_tools_extensionmanagerextensionmanager')));
$content = sprintf('</br>Do you want to start the migration?</br>
<form action="%1$s" method="POST">
<button name="tx_storefinder_update[confirm]" value="1">Start migration</button>
</form>', $action);
return $content;
}
示例7: renderStatic
/**
* @param array $arguments
* @param callable $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
*
* @return string
*/
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
$backendUser = $arguments['backendUser'];
if ($backendUser->getUid() == $GLOBALS['BE_USER']->user['uid'] || !$backendUser->isActive()) {
return '<span class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</span>';
}
$title = LocalizationUtility::translate('switchBackMode', 'beuser');
return '<a class="btn btn-default" href="' . htmlspecialchars(GeneralUtility::linkThisScript(array('SwitchUser' => $backendUser->getUid()))) . '" target="_top" title="' . htmlspecialchars($title) . '">' . IconUtility::getSpriteIcon('actions-system-backend-user-switch') . '</a>';
}
示例8: init
/**
* Initialization of the class
*
* @return void
*/
protected function init()
{
// Setting GPvars:
$this->P = GeneralUtility::_GP('P');
$this->popView = GeneralUtility::_GP('popView');
$this->R_URI = GeneralUtility::linkThisScript(array('popView' => ''));
// "Module name":
$this->MCONF['name'] = 'wizard_rte';
// Need to NOT have the page wrapped in DIV since if we do that we destroy
// the feature that the RTE spans the whole height of the page!!!
}
示例9: init
/**
* Initialization of the class
*
* @return void
*/
protected function init()
{
// Setting GPvars:
$this->P = GeneralUtility::_GP('P');
$this->popView = GeneralUtility::_GP('popView');
$this->R_URI = GeneralUtility::linkThisScript(array('popView' => ''));
// "Module name":
$this->MCONF['name'] = 'wizard_rte';
// Need to NOT have the page wrapped in DIV since if we do that we destroy
// the feature that the RTE spans the whole height of the page!!!
$this->moduleTemplate->setForm('<form action="' . htmlspecialchars(BackendUtility::getModuleUrl('tce_db')) . '" method="post" enctype="multipart/form-data" name="editform" ' . ' onsubmit="return TBE_EDITOR.checkSubmit(1);">');
}
示例10: main
/**
* Main function, returning the HTML content of the module
*
* @return string HTML
*/
public function main()
{
$onclick = 'document.forms[\'pageform\'].action = \'' . GeneralUtility::linkThisScript(array()) . '\';document.forms[\'pageform\'].submit();return false;';
$content = '';
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid, pid, name', 'tt_address', 'name != \'\' AND deleted = 0', '', 'uid');
$hasAddressgroups = FALSE;
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('addressgroups')) {
$hasAddressgroups = TRUE;
$groupRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tx_addressgroups_group', 'title != \'\' AND deleted = 0');
$contentRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid, list_type', 'tt_content', 'list_type = \'addressgroups_pi1\' AND deleted = 0');
}
if (!GeneralUtility::_GP('do_update')) {
// init
$count = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
$content .= '<p>' . $count . ' address records found.</p>';
if ($hasAddressgroups) {
$groupCount = $GLOBALS['TYPO3_DB']->sql_num_rows($groupRes);
$contentCount = $GLOBALS['TYPO3_DB']->sql_num_rows($contentRes);
$content .= '<p>Additionally ' . $groupCount . ' groups from EXT:addresgroups and ' . $contentCount . ' plugin content elements were found.</p>';
}
$content .= '<br />';
$content .= '<input type="hidden" name="do_update" value="1"/>';
$content .= '<input type="button" value="UPDATE!" style="color: #fff; background-color: #f00;" onclick="' . $onclick . '" />';
} else {
$updateCount = 0;
$groupUpdateCount = 0;
$groupRelUpdateCount = 0;
$contentUpdateCount = 0;
// do the update
if ($hasAddressgroups) {
while ($groupRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($groupRes)) {
// could easily be done with a INSERT INTO ... SELECT FROM ... but I don't know how this would work with DBAL
$GLOBALS['TYPO3_DB']->exec_INSERTquery('tt_address_group', $groupRow);
$groupUpdateCount++;
}
$relRows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'tt_address_tx_addressgroups_group_mm', '1 = 1');
foreach ($relRows as $relRow) {
$GLOBALS['TYPO3_DB']->exec_INSERTquery('tt_address_group_mm', $relRow);
$groupRelUpdateCount++;
}
$contentPlugins = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid, list_type', 'tt_content', 'list_type = \'addressgroups_pi1\' AND deleted = 0');
foreach ($contentPlugins as $contentPlugin) {
$GLOBALS['TYPO3_DB']->exec_UPDATEquery('tt_content', 'uid = ' . $contentPlugin['uid'], array('list_type' => 'tt_address_pi1'));
$contentUpdateCount++;
}
}
if ($hasAddressgroups) {
$content .= '<br /><strong>' . $groupUpdateCount . ' group records and ' . $groupRelUpdateCount . ' relations updated.';
$content .= '<br />' . $contentUpdateCount . ' address plugin content elements updated.</strong>';
}
}
return $content;
}
示例11: main
/**
* Main function, returning the HTML content of the module
*
* @return string HTML
*/
function main()
{
$GLOBALS['LANG']->includeLLFile('EXT:direct_mail/Resources/Private/Language/locallang_mod2-6.xml');
$content = $this->displayWarning();
if (!GeneralUtility::_GP('do_update')) {
$onClick = "document.location='" . GeneralUtility::linkThisScript(array('do_update' => 1)) . "'; return false;";
$content .= htmlspecialchars($GLOBALS['LANG']->getLL('update_convert_now')) . '
<br /><br />
<form action=""><input type="submit" value="' . htmlspecialchars($GLOBALS['LANG']->getLL('update_convert_do_it_now')) . '" onclick="' . htmlspecialchars($onClick) . '"></form>
';
} else {
$updated = $this->convertTable();
$content .= sprintf($GLOBALS['LANG']->getLL('update_convert_result'), $updated);
}
return $content;
}
示例12: main
/**
* Main function, returning the HTML content of the module
*
* @return string HTML
*/
public function main()
{
$content = array();
$content[] = '<h3>' . LocalizationUtility::translate('update.upgradeTo6', 'SrLanguageMenu') . '</h3>';
if (GeneralUtility::_GP('proceed')) {
$content[] = $this->updatePluginInstances();
$content[] = $this->updateTsTemplates();
$content[] = '<p>' . LocalizationUtility::translate('update.pleaseRead', 'SrLanguageMenu') . '</p>';
} else {
$linkThisScript = GeneralUtility::linkThisScript();
$content[] = '<form name="sr_language_menu_ext_update_form" action="' . $linkThisScript . '" method="post">';
$content[] = '<p><strong>' . LocalizationUtility::translate('update.warning', 'SrLanguageMenu') . '</strong><br />' . LocalizationUtility::translate('update.changesToDatabase', 'SrLanguageMenu') . '</p>';
$content[] = '<input type="submit" name="proceed" value="' . LocalizationUtility::translate('update.update', 'SrLanguageMenu') . '" onclick="this.form.action=\'' . GeneralUtility::slashJS($linkThisScript) . '\';submit();" />';
$content[] = '</form>';
}
return implode(LF, $content);
}
示例13: init
/**
* Initialization of the class
*
* @return void
*/
protected function init()
{
// Setting GPvars:
$this->P = GeneralUtility::_GP('P');
$this->popView = GeneralUtility::_GP('popView');
$this->R_URI = GeneralUtility::linkThisScript(array('popView' => ''));
// "Module name":
$this->MCONF['name'] = 'wizard_rte';
// Starting the document template object:
$this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
$this->doc->backPath = $this->getBackPath();
$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/wizard_rte.html');
// Need to NOT have the page wrapped in DIV since if we do that we destroy
// the feature that the RTE spans the whole height of the page!!!
$this->doc->divClass = '';
$this->doc->form = '<form action="' . htmlspecialchars(BackendUtility::getModuleUrl('tce_db')) . '" method="post" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '" name="editform" onsubmit="return TBE_EDITOR.checkSubmit(1);">';
}
示例14: init
/**
* Initialization of the class
*
* @return void
* @todo Define visibility
*/
public function init()
{
// Setting GPvars:
$this->P = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('P');
$this->popView = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('popView');
$this->R_URI = \TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array('popView' => ''));
// "Module name":
$this->MCONF['name'] = 'xMOD_wizard_rte.php';
// Starting the document template object:
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->setModuleTemplate('templates/wizard_rte.html');
// Need to NOT have the page wrapped in DIV since if we do that we destroy
// the feature that the RTE spans the whole height of the page!!!
$this->doc->divClass = '';
$this->doc->form = '<form action="tce_db.php" method="post" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '" name="editform" onsubmit="return TBE_EDITOR.checkSubmit(1);">';
}
示例15: main
/**
* The main function. Executes all updates.
* @return string The update process output.
*/
function main()
{
if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('do_update') == 'htaccess') {
$this->removeHtaccessFromUploadFolder();
}
$content = '';
foreach ($this->action as $action) {
if ($action == 'rename_tables') {
$content .= $this->renameTables();
}
}
if ($this->hasHtaccessFile()) {
$content .= '<a href="' . \TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array('do_update' => 'htaccess')) . '">Remove .htaccess file in upload dir<img style="vertical-align:bottom;" ' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/refresh_n.gif', 'width="18" height="16"') . '></a><br>';
}
if ($content == '') {
$content = 'Nothing to update!';
}
return $content;
}