[TASK] Clean up phpDoc comments in typo3/sysext/
[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 * @var TYPO3AJAX
39 */
40 protected $ajaxObjext = NULL;
41
42 /**
43 * Routes the given eID action to the related ExtDirect method with the necessary
44 * ajax object.
45 *
46 * @return void
47 */
48 public function routeAction() {
49 tslib_eidtools::initLanguage();
50 tslib_eidtools::connectDB();
51
52 $ajaxID = t3lib_div::_GP('action');
53 $ajaxScript = $GLOBALS['TYPO3_CONF_VARS']['BE']['AJAX']['ExtDirect::' . $ajaxID];
54 $this->ajaxObject = t3lib_div::makeInstance('TYPO3AJAX', 'ExtDirect::' . $ajaxID);
55
56 $parameters = array();
57 t3lib_div::callUserFunction($ajaxScript, $parameters, $this->ajaxObject, FALSE, TRUE);
58 }
59
60 /**
61 * Returns TRUE if the associated action in _GET is allowed.
62 *
63 * @return boolean
64 */
65 public function actionIsAllowed() {
66 if (!in_array(t3lib_div::_GP('action'), array('route', 'getAPI'))) {
67 return FALSE;
68 }
69
70 return TRUE;
71 }
72
73 /**
74 * Renders/Echoes the ajax output
75 *
76 * @return void
77 */
78 public function render() {
79 $this->ajaxObject->render();
80 }
81 }
82
83 ?>