[TASK] Move info popups to modal windows
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Resources / Private / TypeScript / InfoWindow.ts
1 /*
2 * This file is part of the TYPO3 CMS project.
3 *
4 * It is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License, either version 2
6 * of the License, or any later version.
7 *
8 * For the full copyright and license information, please read the
9 * LICENSE.txt file that was distributed with this source code.
10 *
11 * The TYPO3 project - inspiring people to share!
12 */
13
14 import Modal = require('TYPO3/CMS/Backend/Modal');
15 import Severity = require('TYPO3/CMS/Backend/Severity');
16
17 /**
18 * Module: TYPO3/CMS/Backend/InfoWindow
19 * @exports TYPO3/CMS/Backend/InfoWindow
20 */
21 class InfoWindow {
22 /**
23 * Shows the info modal
24 *
25 * @param {string} table
26 * @param {string | number} uid
27 */
28 public static showItem(table: string, uid: string|number): void {
29 Modal.advanced({
30 type: Modal.types.iframe,
31 size: Modal.sizes.large,
32 content: TYPO3.settings.ShowItem.moduleUrl
33 + '&table=' + encodeURIComponent(table)
34 + '&uid=' + (typeof uid === 'number' ? uid : encodeURIComponent(uid)),
35 severity: Severity.notice
36 });
37 }
38 }
39
40 // expose as global object
41 TYPO3.InfoWindow = InfoWindow;
42 export = InfoWindow;