"TYPO3 4.0.1: typo3_src-4.0.1/typo3/sysext/rtehtmlarea/htmlarea/plugins/SpellChecker/spell-check-logic.php Source File", "datetime" => "Sat Dec 2 19:22:34 2006", "date" => "2 Dec 2006", "doxygenversion" => "1.4.6", "projectname" => "TYPO3 4.0.1", "projectnumber" => "4.0.1" ); get_header($doxygen_vars); ?>

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         $spellChecker = t3lib_div::makeInstance('tx_rtehtmlarea_pi1');
00088         $spellChecker->cObj = t3lib_div::makeInstance('tslib_cObj');
00089         $conf = $GLOBALS['TSFE']->tmpl->setup['plugin.'][$spellChecker->prefixId.'.'];
00090         $spellChecker->main($conf);
00091 ?>