12d866c6fc257302f1408f515eafb17aa14a7ff3
[Packages/TYPO3.CMS.git] / typo3 / sysext / belog / Classes / Module / BackendLogModuleBootstrap.php
1 <?php
2 namespace TYPO3\CMS\Belog\Module;
3
4 /***************************************************************
5 * Copyright notice
6 *
7 * (c) 2012-2013 Christian Kuhn <lolli@schwarzbu.ch>
8 * All rights reserved
9 *
10 * This script is part of the TYPO3 project. The TYPO3 project is
11 * free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * The GNU General Public License can be found at
17 * http://www.gnu.org/copyleft/gpl.html.
18 * A copy is found in the textfile GPL.txt and important notices to the license
19 * from the author is found in LICENSE.txt distributed with these scripts.
20 *
21 * This script is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * This copyright notice MUST APPEAR in all copies of the script!
27 ***************************************************************/
28
29 /**
30 * This class is a wrapper for WebInfo controller of belog.
31 * It is registered in ext_tables.php with \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction()
32 * and called by the info extension via SCbase functionality.
33 *
34 * Extbase currently provides no way to register a "TBE_MODULES_EXT" module directly,
35 * therefore we need to bootstrap extbase on our own here to jump to the WebInfo controller.
36 *
37 * @author Christian Kuhn <lolli@schwarzbu.ch>
38 */
39 class BackendLogModuleBootstrap {
40
41 /**
42 * Dummy method, called by SCbase external object handling
43 *
44 * @return void
45 */
46 public function init() {
47
48 }
49
50 /**
51 * Dummy method, called by SCbase external object handling
52 *
53 * @return void
54 */
55 public function checkExtObj() {
56
57 }
58
59 /**
60 * Bootstrap extbase and jump to WebInfo controller
61 *
62 * @return string
63 */
64 public function main() {
65 $configuration = array(
66 'extensionName' => 'Belog',
67 'pluginName' => 'system_BelogLog',
68 'vendorName' => 'TYPO3\CMS',
69 );
70 // Yeah, this is ugly. But currently, there is no other direct way
71 // in extbase to force a specific controller in backend mode.
72 // Overwriting $_GET was the most simple solution here until extbase
73 // provides a clean way to solve this.
74 $_GET['tx_belog_system_beloglog']['controller'] = 'WebInfo';
75 /** @var $extbaseBootstrap \TYPO3\CMS\Extbase\Core\Bootstrap */
76 $extbaseBootstrap = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Core\\Bootstrap');
77 return $extbaseBootstrap->run('', $configuration);
78 }
79
80 }
81
82 ?>