Documentation TYPO3 par Ameos

rte_cleaner.php

00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *  
00005 *  (c) 1999-2004 Kasper Skaarhoj (kasperYYYY@typo3.com)
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 *  A copy is found in the textfile GPL.txt and important notices to the license 
00017 *  from the author is found in LICENSE.txt distributed with these scripts.
00018 *
00019 * 
00020 *  This script is distributed in the hope that it will be useful,
00021 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 *  GNU General Public License for more details.
00024 *
00025 *  This copyright notice MUST APPEAR in all copies of the script!
00026 ***************************************************************/
00047 unset($MCONF);
00048 require ('conf.php');
00049 require ($BACK_PATH.'init.php');
00050 require ($BACK_PATH.'template.php');
00051 
00052 
00053 
00054 
00062 class SC_rte_cleaner {
00063         var $content;
00064         var $siteURL;
00065         var $doc;       
00066         
00072         function init() {
00073                 global $BACK_PATH;
00074 
00075                 $this->siteURL = substr(t3lib_div::getIndpEnv('TYPO3_SITE_URL'),0,-1);
00076 
00077                 $this->doc = t3lib_div::makeInstance('template');
00078                 $this->doc->backPath = $BACK_PATH;
00079                 $this->doc->form = '';
00080                 $this->doc->JScode=$this->doc->wrapScriptTags('
00081                         var RTEobj = self.parent.parent;
00082                 
00083                         function setSelectedTextContent(content)        {       //
00084                                 var oSel = RTEobj.GLOBAL_SEL;
00085                                 var sType = oSel.type;
00086                                 if (sType=="Text")      {
00087                                         oSel.pasteHTML(content);
00088                                 }
00089                         }
00090                 ');
00091         }
00092 
00098         function main() {
00099                 $this->content='';
00100                 $this->content.=$this->doc->startPage('RTE cleaner');
00101 
00102                 $this->content.=$this->doc->wrapScriptTags('
00103                         setSelectedTextContent(unescape("'.rawurlencode(strip_tags(t3lib_div::_GP("processContent"))).'"));
00104                         RTEobj.edHidePopup();
00105                 ');
00106         }
00107 
00113         function printContent() {
00114                 $this->content.= $this->doc->endPage();
00115                 echo $this->content;
00116         }
00117 }
00118 
00119 // Include extension?
00120 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rte/app/rte_cleaner.php'])     {
00121         include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rte/app/rte_cleaner.php']);
00122 }
00123 
00124 
00125 
00126 
00127 
00128 // Make instance:
00129 $SOBE = t3lib_div::makeInstance('SC_rte_cleaner');
00130 $SOBE->init();
00131 $SOBE->main();
00132 $SOBE->printContent();
00133 ?>


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