[TASK] Rename and deprecate config.minifyJS / config.minifyCSS
[Packages/TYPO3.CMS.git] / typo3 / sysext / cms / tslib / class.tslib_extdirecteid.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2010-2011 Stefan Galinski <stefan.galinski@gmail.com>
6 *
7 * All rights reserved
8 *
9 * This script is part of the TYPO3 project. The TYPO3 project is
10 * free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * The GNU General Public License can be found at
16 * http://www.gnu.org/copyleft/gpl.html.
17 *
18 * This script is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * This copyright notice MUST APPEAR in all copies of the script!
24 ***************************************************************/
25
26 require_once(PATH_site . 'typo3/classes/class.typo3ajax.php');
27
28 /**
29 * eID controller for ExtDirect
30 *
31 * @author Stefan Galinski <stefan.galinski@gmail.com>
32 * @package TYPO3
33 */
34 class tslib_ExtDirectEid {
35 /**
36 * Ajax Instance
37 *
38 * @property TYPO3AJAX
39 * @var TYPO3AJAX
40 */
41 protected $ajaxObjext = NULL;
42
43 /**
44 * Routes the given eID action to the related ExtDirect method with the necessary
45 * ajax object.
46 *
47 * @return void
48 */
49 public function routeAction() {
50 tslib_eidtools::initLanguage();
51 tslib_eidtools::connectDB();
52
53 $ajaxID = t3lib_div::_GP('action');
54 $ajaxScript = $GLOBALS['TYPO3_CONF_VARS']['BE']['AJAX']['ExtDirect::' . $ajaxID];
55 $this->ajaxObject = t3lib_div::makeInstance('TYPO3AJAX', 'ExtDirect::' . $ajaxID);
56
57 $parameters = array();
58 t3lib_div::callUserFunction($ajaxScript, $parameters, $this->ajaxObject, FALSE, TRUE);
59 }
60
61 /**
62 * Returns TRUE if the associated action in _GET is allowed.
63 *
64 * @return boolean
65 */
66 public function actionIsAllowed() {
67 if (!in_array(t3lib_div::_GP('action'), array('route', 'getAPI'))) {
68 return FALSE;
69 }
70
71 return TRUE;
72 }
73
74 /**
75 * Renders/Echoes the ajax output
76 *
77 * @return void
78 */
79 public function render() {
80 $this->ajaxObject->render();
81 }
82 }
83
84 ?>