Documentation TYPO3 par Ameos

spell-check-logic.php

00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 2003-2006 Stanislas Rolland (stanislas.rolland(arobas)fructifor.ca)
00006 *  All rights reserved
00007 *
00008 *  This script is part of the Typo3 project. The Typo3 project is
00009 *  free software; you can redistribute it and/or modify
00010 *  it under the terms of the GNU General Public License as published by
00011 *  the Free Software Foundation; either version 2 of the License, or
00012 *  (at your option) any later version.
00013 *
00014 *  The GNU General Public License can be found at
00015 *  http://www.gnu.org/copyleft/gpl.html.
00016 *
00017 *  This script is distributed in the hope that it will be useful,
00018 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00019 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020 *  GNU General Public License for more details.
00021 *
00022 *  This copyright notice MUST APPEAR in all copies of the script!
00023 ***************************************************************/
00032         error_reporting (E_ALL ^ E_NOTICE);
00033         define('TYPO3_OS', (stristr(PHP_OS,'win') && !stristr(PHP_OS,'darwin')) ? 'WIN' : '');
00034         if (!defined('PATH_thisScript')) define('PATH_thisScript',str_replace('//','/', str_replace('\\','/', (php_sapi_name()=='cgi'||php_sapi_name()=='xcgi'||php_sapi_name()=='isapi' ||php_sapi_name()=='cgi-fcgi')&&((!empty($_SERVER['ORIG_PATH_TRANSLATED'])&&isset($_SERVER['ORIG_PATH_TRANSLATED']))?$_SERVER['ORIG_PATH_TRANSLATED']:$_SERVER['PATH_TRANSLATED'])? ((!empty($_SERVER['ORIG_PATH_TRANSLATED'])&&isset($_SERVER['ORIG_PATH_TRANSLATED']))?$_SERVER['ORIG_PATH_TRANSLATED']:$_SERVER['PATH_TRANSLATED']):((!empty($_SERVER['ORIG_SCRIPT_FILENAME'])&&isset($_SERVER['ORIG_SCRIPT_FILENAME']))?$_SERVER['ORIG_SCRIPT_FILENAME']:$_SERVER['SCRIPT_FILENAME']))));
00035         if (!defined('PATH_site')) define('PATH_site', dirname(dirname(dirname(dirname(dirname(dirname(dirname(PATH_thisScript))))))).'/');
00036         if (!defined('PATH_t3lib')) define('PATH_t3lib', PATH_site.'t3lib/');
00037         define('PATH_typo3conf', PATH_site.'typo3conf/');
00038         define('TYPO3_mainDir', 'typo3/');
00039         if (!defined('PATH_typo3')) define('PATH_typo3', PATH_site.TYPO3_mainDir);
00040         if (!defined('PATH_tslib')) {
00041                 if (@is_dir(PATH_site.'typo3/sysext/cms/tslib/')) {
00042                         define('PATH_tslib', PATH_site.'typo3/sysext/cms/tslib/');
00043                 } elseif (@is_dir(PATH_site.'tslib/')) {
00044                         define('PATH_tslib', PATH_site.'tslib/');
00045                 }
00046         }
00047         define('TYPO3_MODE','FE');
00048         
00049         require_once(PATH_t3lib.'class.t3lib_div.php');
00050         require_once(PATH_t3lib.'class.t3lib_extmgm.php');
00051         require_once(PATH_t3lib.'config_default.php');
00052         require_once(PATH_typo3conf.'localconf.php');
00053         require_once(PATH_tslib.'class.tslib_fe.php');
00054         require_once(PATH_t3lib.'class.t3lib_tstemplate.php');
00055         require_once(PATH_t3lib.'class.t3lib_page.php');
00056         require_once(PATH_tslib.'class.tslib_content.php');
00057         require_once(t3lib_extMgm::extPath('rtehtmlarea').'pi1/class.tx_rtehtmlarea_pi1.php');
00058         require_once(PATH_t3lib.'class.t3lib_userauth.php');
00059         require_once(PATH_tslib.'class.tslib_feuserauth.php');
00060         
00061         $typoVersion = t3lib_div::int_from_ver($GLOBALS['TYPO_VERSION']);
00062         require_once(PATH_t3lib.'class.t3lib_cs.php');
00063         
00064         if (!defined ('TYPO3_db'))  die ('The configuration file was not included.');
00065         if (isset($HTTP_POST_VARS['GLOBALS']) || isset($HTTP_GET_VARS['GLOBALS']))      die('You cannot set the GLOBALS-array from outside this script.');
00066         
00067         require_once(PATH_t3lib.'class.t3lib_db.php');
00068         $TYPO3_DB = t3lib_div::makeInstance('t3lib_DB');
00069         
00070         require_once(PATH_t3lib.'class.t3lib_timetrack.php');
00071         $GLOBALS['TT'] = new t3lib_timeTrack;
00072         
00073         // ***********************************
00074         // Creating a fake $TSFE object
00075         // ***********************************
00076         $TSFEclassName = t3lib_div::makeInstanceClassName('tslib_fe');
00077         $id = isset($HTTP_GET_VARS['id'])?$HTTP_GET_VARS['id']:0;
00078         $GLOBALS['TSFE'] = new $TSFEclassName($TYPO3_CONF_VARS, $id, '0', 1, '', '','','');
00079         $GLOBALS['TSFE']->connectToMySQL();
00080         $GLOBALS['TSFE']->initFEuser();
00081         $GLOBALS['TSFE']->fetch_the_id();
00082         $GLOBALS['TSFE']->getPageAndRootline();
00083         $GLOBALS['TSFE']->initTemplate();
00084         $GLOBALS['TSFE']->tmpl->getFileName_backPath = PATH_site;
00085         $GLOBALS['TSFE']->forceTemplateParsing = 1;
00086         $GLOBALS['TSFE']->getConfigArray();
00087 
00088         // *********
00089         // initialize a BE_USER if applicable
00090         // *********
00091         $BE_USER='';
00092         if ($_COOKIE['be_typo_user'])   {       // If the backend cookie is set, we proceed and checks if a backend user is logged in.
00093                 $TYPO3_MISC['microtime_BE_USER_start'] = microtime();
00094                 $TT->push('Back End user initialized','');
00095                 require_once (PATH_t3lib.'class.t3lib_befunc.php');
00096                 require_once (PATH_t3lib.'class.t3lib_userauthgroup.php');
00097                 require_once (PATH_t3lib.'class.t3lib_beuserauth.php');
00098                 require_once (PATH_t3lib.'class.t3lib_tsfebeuserauth.php');
00099 
00100                         // the value this->formfield_status is set to empty in order to disable login-attempts to the backend account through this script
00101                 $BE_USER = t3lib_div::makeInstance('t3lib_tsfeBeUserAuth');     // New backend user object
00102                 $BE_USER->OS = TYPO3_OS;
00103                 $BE_USER->lockIP = $TYPO3_CONF_VARS['BE']['lockIP'];
00104                 $BE_USER->start();      // Object is initialized
00105                 $BE_USER->unpack_uc('');
00106                 if ($BE_USER->user['uid'])      {
00107                         $BE_USER->fetchGroupData();
00108                         $TSFE->beUserLogin = 1;
00109                 }
00110                         // Now we need to do some additional checks for IP/SSL
00111                 if (!$BE_USER->checkLockToIP() || !$BE_USER->checkBackendAccessSettingsFromInitPhp())   {
00112                                 // Unset the user initialization.
00113                         $BE_USER='';
00114                         $TSFE->beUserLogin=0;
00115                 }
00116         }
00117 
00118         $spellChecker = t3lib_div::makeInstance('tx_rtehtmlarea_pi1');
00119         $spellChecker->cObj = t3lib_div::makeInstance('tslib_cObj');
00120         $conf = $GLOBALS['TSFE']->tmpl->setup['plugin.'][$spellChecker->prefixId.'.'];
00121         $spellChecker->main($conf);
00122 ?>


Généré par Les spécialistes TYPO3 avec  doxygen 1.4.6