f2d8cbb2432ee62337a4071e09e0f5e4371688fc
[Packages/TYPO3.CMS.git] / typo3 / js / backend.js
1 /***************************************************************
2 * Copyright notice
3 *
4 * (c) 2007 Ingo Renner <ingo@typo3.org>
5 * All rights reserved
6 *
7 * This script is part of the TYPO3 project. The TYPO3 project is
8 * free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * The GNU General Public License can be found at
14 * http://www.gnu.org/copyleft/gpl.html.
15 * A copy is found in the textfile GPL.txt and important notices to the license
16 * from the author is found in LICENSE.txt distributed with these scripts.
17 *
18 *
19 * This script is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * This copyright notice MUST APPEAR in all copies of the script!
25 ***************************************************************/
26
27 /**
28 * general backend javascript functions
29 */
30
31 /**
32 * jump the backend to a module
33 */
34 function jump(url, modName, mainModName) {
35 // clear information about which entry in nav. tree that might have been highlighted.
36 top.fsMod.navFrameHighlightedID = new Array();
37
38 if (top.content && top.content.nav_frame && top.content.nav_frame.refresh_nav) {
39 top.content.nav_frame.refresh_nav();
40 }
41
42 top.nextLoadModuleUrl = url;
43 top.goToModule(modName);
44 }
45
46 /**
47 * shortcut manager to delegate the action of creating shortcuts to the new
48 * backend.php shortcut menu or the old shortcut frame depending on what is available
49 */
50 var ShortcutManager = {
51
52 /**
53 * central entry point to create a shortcut, delegates the call to correct endpoint
54 */
55 createShortcut: function(confirmQuestion, backPath, moduleName, url) {
56 if(confirm(confirmQuestion)) {
57 if(typeof TYPO3BackendShortcutMenu != 'undefined') {
58 TYPO3BackendShortcutMenu.createShortcut(backPath, moduleName, url);
59 }
60
61 if(top.shortcutFrame) {
62 var location = backPath + 'alt_shortcut.php?modName=' + moduleName + '&URL=' + url;
63 shortcutFrame.location.href = location;
64 }
65 }
66 }
67 }
68
69
70
71
72
73