Index: typo3/alt_main.php
===================================================================
--- typo3/alt_main.php (revision 2880)
+++ typo3/alt_main.php (working copy)
@@ -457,7 +457,7 @@
function startModule() {
global $BE_USER;
$module = preg_replace('/[^[:alnum:]_]/','',t3lib_div::_GET('module'));
-
+
if (!$module) {
if ($BE_USER->uc['startModule']) {
$module = $BE_USER->uc['startModule'];
@@ -492,6 +492,7 @@
$GLOBALS['TBE_TEMPLATE']->JScode= '
+
';
$GLOBALS['TBE_TEMPLATE']->JScode.=$GLOBALS['TBE_TEMPLATE']->wrapScriptTags($this->mainJScode);
Index: typo3/js/backend.js
===================================================================
--- typo3/js/backend.js (revision 0)
+++ typo3/js/backend.js (revision 0)
@@ -0,0 +1,73 @@
+/***************************************************************
+* Copyright notice
+*
+* (c) 2007 Ingo Renner
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+* A copy is found in the textfile GPL.txt and important notices to the license
+* from the author is found in LICENSE.txt distributed with these scripts.
+*
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * general backend javascript functions
+ */
+
+/**
+ * jump the backend to a module
+ */
+function jump(url, modName, mainModName) {
+ // clear information about which entry in nav. tree that might have been highlighted.
+ top.fsMod.navFrameHighlightedID = new Array();
+
+ if (top.content && top.content.nav_frame && top.content.nav_frame.refresh_nav) {
+ top.content.nav_frame.refresh_nav();
+ }
+
+ top.nextLoadModuleUrl = url;
+ top.goToModule(modName);
+}
+
+/**
+ * shortcut manager to delegate the action of creating shortcuts to the new
+ * backend.php shortcut menu or the old shortcut frame depending on what is available
+ */
+var ShortcutManager = {
+
+ /**
+ * central entry point to create a shortcut, delegates the call to correct endpoint
+ */
+ createShortcut: function(confirmQuestion, backPath, moduleName, url) {
+ if(confirm(confirmQuestion)) {
+ if(typeof TYPO3BackendShortcutMenu != 'undefined') {
+ TYPO3BackendShortcutMenu.createShortcut(moduleName, url);
+ }
+
+ if(top.shortcutFrame) {
+ var location = backPath + 'alt_shortcut.php?modName=' + moduleName + '&URL=' + url;
+ shortcutFrame.location.href = location;
+ }
+ }
+ }
+}
+
+
+
+
+
+
Index: typo3/template.php
===================================================================
--- typo3/template.php (revision 2880)
+++ typo3/template.php (working copy)
@@ -448,12 +448,12 @@
$mMN='&motherModName='.rawurlencode($motherModName);
} else $mMN='';
- $onClick = 'if (top.shortcutFrame && confirm('.
- $GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.makeShortcut')).
- ')){top.shortcutFrame.location.href=\''.$backPath.'alt_shortcut.php?modName='.rawurlencode($modName).
- '&URL='.rawurlencode($pathInfo['path']."?".$storeUrl).
- $mMN.
- '\';}return false;';
+ $onClick = 'top.ShortcutManager.createShortcut('
+ .$GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.makeShortcut')).', '
+ .'\''.$backPath.'\', '
+ .'\''.rawurlencode($modName).'\', '
+ .'\''.rawurlencode($pathInfo['path']."?".$storeUrl).$mMN.'\''
+ .');return false;';
$sIcon = '';
return $sIcon;
@@ -1247,7 +1247,7 @@
/**
- * Includes a javascript library that exists in the core /typo3/ directory. The
+ * Includes a javascript library that exists in the core /typo3/ directory. The
* backpath is automatically applied
*
* @param string $lib: Library name. Call it with the full path
@@ -1414,7 +1414,7 @@
* @param boolean If set, tab table cells are not allowed to wrap their content
* @param boolean If set, the tabs will span the full width of their position
* @param integer Default tab to open (for toggle <=0). Value corresponds to integer-array index + 1 (index zero is "1", index "1" is 2 etc.). A value of zero (or something non-existing) will result in no default tab open.
- * @param integer If set to '1' empty tabs will be remove, If set to '2' empty tabs will be disabled
+ * @param integer If set to '1' empty tabs will be remove, If set to '2' empty tabs will be disabled
* @return string JavaScript section for the HTML header.
*/
function getDynTabMenu($menuItems,$identString,$toggle=0,$foldout=FALSE,$newRowCharLimit=50,$noWrap=1,$fullWidth=FALSE,$defaultTabIndex=1,$dividers2tabs=2) {
@@ -1539,7 +1539,7 @@
}
return $content;
}
-
+
/**
* Creates the id for dynTabMenus.
*