本文整理汇总了PHP中TYPO3\CMS\Backend\Template\DocumentTemplate::redirectUrls方法的典型用法代码示例。如果您正苦于以下问题:PHP DocumentTemplate::redirectUrls方法的具体用法?PHP DocumentTemplate::redirectUrls怎么用?PHP DocumentTemplate::redirectUrls使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Backend\Template\DocumentTemplate
的用法示例。
在下文中一共展示了DocumentTemplate::redirectUrls方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
/**
* Main method.
*
* @return void
*/
public function main()
{
$listUrl = GeneralUtility::getIndpEnv('REQUEST_URI');
// Access check!
// The page will show only if there is a valid page and if user may access it
if ($this->id && (is_array($this->pageRow) ? 1 : 0)) {
// JavaScript
$this->doc->JScode = $this->doc->wrapScriptTags('
script_ended = 0;
function jumpToUrl(URL) {
document.location = URL;
}
function deleteRecord(table, id, url, warning) {
if (
confirm(eval(warning))
) {
window.location.href = "' . $this->getBackPath() . 'tce_db.php?cmd["+table+"]["+id+"][delete]=1&redirect="+escape(url);
}
return false;
}
' . $this->doc->redirectUrls($listUrl) . '
');
$this->doc->postCode = $this->doc->wrapScriptTags('
script_ended = 1;
if (top.fsMod) {
top.fsMod.recentIds["web"] = ' . (int) $this->id . ';
}
');
$this->doc->inDocStylesArray['mod_systemdata'] = '';
// Render content:
$this->moduleContent();
} else {
$this->content = 'Access denied or commerce pages not created yet!';
}
$docHeaderButtons = $this->getHeaderButtons();
$markers = array('CSH' => $docHeaderButtons['csh'], 'CONTENT' => $this->content);
$markers['FUNC_MENU'] = $this->doc->funcMenu('', BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']));
// put it all together
$this->content = $this->doc->startPage($this->getLanguageService()->getLL('title'));
$this->content .= $this->doc->moduleBody($this->pageRow, $docHeaderButtons, $markers);
$this->content .= $this->doc->endPage();
$this->content = $this->doc->insertStylesAndJS($this->content);
}
示例2: main
//.........这里部分代码省略.........
}
}
// Initialize the listing object, dblist, for rendering the list:
$this->pointer = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->pointer, 0, 100000);
$dblist->start($this->id, $this->table, $this->pointer, $this->search_field, $this->search_levels, $this->showLimit);
$dblist->setDispFields();
// Render versioning selector:
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('version')) {
$dblist->HTMLcode .= $this->doc->getVersionSelector($this->id);
}
// Render the list of tables:
$dblist->generateList();
$listUrl = substr($dblist->listURL(), strlen($GLOBALS['BACK_PATH']));
// Add JavaScript functions to the page:
$this->doc->JScode = $this->doc->wrapScriptTags('
function jumpExt(URL,anchor) { //
var anc = anchor?anchor:"";
window.location.href = URL+(T3_THIS_LOCATION?"&returnUrl="+T3_THIS_LOCATION:"")+anc;
return false;
}
function jumpSelf(URL) { //
window.location.href = URL+(T3_RETURN_URL?"&returnUrl="+T3_RETURN_URL:"");
return false;
}
function setHighlight(id) { //
top.fsMod.recentIds["web"]=id;
top.fsMod.navFrameHighlightedID["web"]="pages"+id+"_"+top.fsMod.currentBank; // For highlighting
if (top.content && top.content.nav_frame && top.content.nav_frame.refresh_nav) {
top.content.nav_frame.refresh_nav();
}
}
' . $this->doc->redirectUrls($listUrl) . '
' . $dblist->CBfunctions() . '
function editRecords(table,idList,addParams,CBflag) { //
window.location.href="' . $GLOBALS['BACK_PATH'] . 'alt_doc.php?returnUrl=' . rawurlencode(GeneralUtility::getIndpEnv('REQUEST_URI')) . '&edit["+table+"]["+idList+"]=edit"+addParams;
}
function editList(table,idList) { //
var list="";
// Checking how many is checked, how many is not
var pointer=0;
var pos = idList.indexOf(",");
while (pos!=-1) {
if (cbValue(table+"|"+idList.substr(pointer,pos-pointer))) {
list+=idList.substr(pointer,pos-pointer)+",";
}
pointer=pos+1;
pos = idList.indexOf(",",pointer);
}
if (cbValue(table+"|"+idList.substr(pointer))) {
list+=idList.substr(pointer)+",";
}
return list ? list : idList;
}
if (top.fsMod) top.fsMod.recentIds["web"] = ' . (int) $this->id . ';
');
// Setting up the context sensitive menu:
$this->doc->getContextMenuCode();
}
// access
// Begin to compile the whole page, starting out with page header:
$this->body = $this->doc->header($this->pageinfo['title']);
示例3: getJsCode
/**
* Generate JS code to be used on the link insert/modify dialogue
*
* @return string the generated JS code
*/
public function getJsCode()
{
// Rich Text Editor specific configuration:
$addPassOnParams = '';
if ((string) $this->mode == 'rte') {
$addPassOnParams .= '&RTEtsConfigParams=' . rawurlencode($this->RTEtsConfigParams);
}
// BEGIN accumulation of header JavaScript:
$JScode = '
// This JavaScript is primarily for RTE/Link. jumpToUrl is used in the other cases as well...
var add_href=' . GeneralUtility::quoteJSvalue($this->curUrlArray['href'] ? '&curUrl[href]=' . rawurlencode($this->curUrlArray['href']) : '') . ';
var add_target=' . GeneralUtility::quoteJSvalue($this->setTarget ? '&curUrl[target]=' . rawurlencode($this->setTarget) : '') . ';
var add_class=' . GeneralUtility::quoteJSvalue($this->setClass ? '&curUrl[class]=' . rawurlencode($this->setClass) : '') . ';
var add_title=' . GeneralUtility::quoteJSvalue($this->setTitle ? '&curUrl[title]=' . rawurlencode($this->setTitle) : '') . ';
var add_params=' . GeneralUtility::quoteJSvalue($this->bparams ? '&bparams=' . rawurlencode($this->bparams) : '') . ';
var cur_href=' . GeneralUtility::quoteJSvalue($this->curUrlArray['href'] ?: '') . ';
var cur_target=' . GeneralUtility::quoteJSvalue($this->setTarget ?: '') . ';
var cur_class=' . GeneralUtility::quoteJSvalue($this->setClass ?: '') . ';
var cur_title=' . GeneralUtility::quoteJSvalue($this->setTitle ?: '') . ';
var cur_params=' . GeneralUtility::quoteJSvalue($this->setParams ?: '') . ';
function browse_links_setTarget(target) { //
cur_target=target;
add_target="&curUrl[target]="+escape(target);
}
function browse_links_setClass(cssClass) { //
cur_class = cssClass;
add_class = "&curUrl[class]=" + escape(cssClass);
}
function browse_links_setTitle(title) { //
cur_title=title;
add_title="&curUrl[title]="+escape(title);
}
function browse_links_setValue(value) { //
cur_href=value;
add_href="&curUrl[href]="+value;
}
function browse_links_setParams(params) { //
cur_params=params;
add_params="&curUrl[params]="+escape(params);
}
' . $this->doc->redirectUrls();
// Functions used, if the link selector is in wizard mode (= TCEforms fields)
if ($this->mode == 'wizard') {
if (!$this->areFieldChangeFunctionsValid() && !$this->areFieldChangeFunctionsValid(TRUE)) {
$this->P['fieldChangeFunc'] = array();
}
unset($this->P['fieldChangeFunc']['alert']);
$update = '';
foreach ($this->P['fieldChangeFunc'] as $v) {
$update .= '
window.opener.' . $v;
}
$P2 = array();
$P2['uid'] = $this->P['uid'];
$P2['pid'] = $this->P['pid'];
$P2['itemName'] = $this->P['itemName'];
$P2['formName'] = $this->P['formName'];
$P2['fieldChangeFunc'] = $this->P['fieldChangeFunc'];
$P2['fieldChangeFuncHash'] = GeneralUtility::hmac(serialize($this->P['fieldChangeFunc']));
$P2['params']['allowedExtensions'] = isset($this->P['params']['allowedExtensions']) ? $this->P['params']['allowedExtensions'] : '';
$P2['params']['blindLinkOptions'] = isset($this->P['params']['blindLinkOptions']) ? $this->P['params']['blindLinkOptions'] : '';
$P2['params']['blindLinkFields'] = isset($this->P['params']['blindLinkFields']) ? $this->P['params']['blindLinkFields'] : '';
$addPassOnParams .= GeneralUtility::implodeArrayForUrl('P', $P2);
$JScode .= '
function link_typo3Page(id,anchor) { //
updateValueInMainForm(id + (anchor ? anchor : ""));
close();
return false;
}
function link_folder(folder) { //
updateValueInMainForm(folder);
close();
return false;
}
function link_current() { //
if (cur_href!="http://" && cur_href!="mailto:") {
returnBeforeCleaned = cur_href;
if (returnBeforeCleaned.substr(0, 7) == "http://") {
returnToMainFormValue = returnBeforeCleaned.substr(7);
} else if (returnBeforeCleaned.substr(0, 7) == "mailto:") {
if (returnBeforeCleaned.substr(0, 14) == "mailto:mailto:") {
returnToMainFormValue = returnBeforeCleaned.substr(14);
} else {
returnToMainFormValue = returnBeforeCleaned.substr(7);
}
} else {
returnToMainFormValue = returnBeforeCleaned;
}
updateValueInMainForm(returnToMainFormValue);
close();
}
return false;
}
//.........这里部分代码省略.........
示例4: getJsCode
/**
* Generate JS code to be used on the link insert/modify dialogue
*
* @return string the generated JS code
*/
public function getJsCode()
{
// BEGIN accumulation of header JavaScript:
$JScode = '
// This JavaScript is primarily for RTE/Link. jumpToUrl is used in the other cases as well...
var add_href=' . GeneralUtility::quoteJSvalue($this->curUrlArray['href'] ? '&curUrl[href]=' . rawurlencode($this->curUrlArray['href']) : '') . ';
var add_target=' . GeneralUtility::quoteJSvalue($this->setTarget ? '&curUrl[target]=' . rawurlencode($this->setTarget) : '') . ';
var add_class=' . GeneralUtility::quoteJSvalue($this->setClass ? '&curUrl[class]=' . rawurlencode($this->setClass) : '') . ';
var add_title=' . GeneralUtility::quoteJSvalue($this->setTitle ? '&curUrl[title]=' . rawurlencode($this->setTitle) : '') . ';
var add_params=' . GeneralUtility::quoteJSvalue($this->bparams ? '&bparams=' . rawurlencode($this->bparams) : '') . ';
var cur_href=' . GeneralUtility::quoteJSvalue($this->curUrlArray['href'] ?: '') . ';
var cur_target=' . GeneralUtility::quoteJSvalue($this->setTarget ?: '') . ';
var cur_class=' . GeneralUtility::quoteJSvalue($this->setClass ?: '') . ';
var cur_title=' . GeneralUtility::quoteJSvalue($this->setTitle ?: '') . ';
var cur_params=' . GeneralUtility::quoteJSvalue($this->setParams ?: '') . ';
function browse_links_setTarget(target) {
cur_target=target;
add_target="&curUrl[target]="+encodeURIComponent(target);
}
function browse_links_setClass(cssClass) {
cur_class = cssClass;
add_class = "&curUrl[class]="+encodeURIComponent(cssClass);
}
function browse_links_setTitle(title) {
cur_title=title;
add_title="&curUrl[title]="+encodeURIComponent(title);
}
function browse_links_setValue(value) {
cur_href=value;
add_href="&curUrl[href]="+value;
}
function browse_links_setParams(params) {
cur_params=params;
add_params="&curUrl[params]="+encodeURIComponent(params);
}
' . $this->doc->redirectUrls();
// Functions used, if the link selector is in wizard mode (= TCEforms fields)
$addPassOnParams = '';
if ($this->mode === 'rte') {
// Rich Text Editor specific configuration
$addPassOnParams .= '&RTEtsConfigParams=' . rawurlencode($this->RTEtsConfigParams);
}
$update = '';
if ($this->mode === 'wizard') {
if (!$this->areFieldChangeFunctionsValid() && !$this->areFieldChangeFunctionsValid(true)) {
$this->P['fieldChangeFunc'] = array();
}
unset($this->P['fieldChangeFunc']['alert']);
foreach ($this->P['fieldChangeFunc'] as $v) {
$update .= '
window.opener.' . $v;
}
$P2 = array();
$P2['uid'] = $this->P['uid'];
$P2['pid'] = $this->P['pid'];
$P2['itemName'] = $this->P['itemName'];
$P2['formName'] = $this->P['formName'];
$P2['fieldChangeFunc'] = $this->P['fieldChangeFunc'];
$P2['fieldChangeFuncHash'] = GeneralUtility::hmac(serialize($this->P['fieldChangeFunc']));
$P2['params']['allowedExtensions'] = isset($this->P['params']['allowedExtensions']) ? $this->P['params']['allowedExtensions'] : '';
$P2['params']['blindLinkOptions'] = isset($this->P['params']['blindLinkOptions']) ? $this->P['params']['blindLinkOptions'] : '';
$P2['params']['blindLinkFields'] = isset($this->P['params']['blindLinkFields']) ? $this->P['params']['blindLinkFields'] : '';
$addPassOnParams .= GeneralUtility::implodeArrayForUrl('P', $P2);
$JScode .= '
function link_typo3Page(id,anchor) { //
updateValueInMainForm(id + (anchor ? anchor : ""));
close();
return false;
}
function link_folder(folder) { //
updateValueInMainForm(folder);
close();
return false;
}
function link_current() { //
if (cur_href!="http://" && cur_href!="mailto:") {
returnBeforeCleaned = cur_href;
if (returnBeforeCleaned.substr(0, 7) == "http://") {
returnToMainFormValue = returnBeforeCleaned.substr(7);
} else if (returnBeforeCleaned.substr(0, 7) == "mailto:") {
if (returnBeforeCleaned.substr(0, 14) == "mailto:mailto:") {
returnToMainFormValue = returnBeforeCleaned.substr(14);
} else {
returnToMainFormValue = returnBeforeCleaned.substr(7);
}
} else {
returnToMainFormValue = returnBeforeCleaned;
}
updateValueInMainForm(returnToMainFormValue);
close();
}
return false;
}
//.........这里部分代码省略.........