00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00050 require_once(PATH_t3lib.'class.t3lib_rteapi.php');
00058 class tx_rte_base extends t3lib_rteapi {
00059
00060
00061 var $RTEdivStyle;
00062
00063
00064 var $ID = 'rte';
00065 var $debugMode = FALSE;
00066
00067
00074 function isAvailable() {
00075 global $CLIENT;
00076
00077 if (TYPO3_DLOG) t3lib_div::devLog('Checking for availability...','rte');
00078
00079 $this->errorLog = array();
00080 if (!$this->debugMode) {
00081 if ($CLIENT['BROWSER']!='msie') $this->errorLog[] = '"rte": Browser is not MSIE';
00082 if ($CLIENT['SYSTEM']!='win') $this->errorLog[] = '"rte": Client system is not Windows';
00083 if ($CLIENT['VERSION']<5) $this->errorLog[] = '"rte": Browser version below 5';
00084 }
00085 if (!count($this->errorLog)) return TRUE;
00086 }
00087
00103 function drawRTE(&$pObj,$table,$field,$row,$PA,$specConf,$thisConfig,$RTEtypeVal,$RTErelPath,$thePidValue) {
00104
00105
00106 if ($this->debugMode) {
00107 $item = parent::drawRTE($pObj,$table,$field,$row,$PA,$specConf,$thisConfig,$RTEtypeVal,$RTErelPath,$thePidValue);
00108 } else {
00109
00110
00111 $pObj->additionalJS_pre['rte_loader_function'] = $this->loaderFunc($pObj->formName);
00112 $pObj->additionalJS_submit[] = "
00113 if(TBE_RTE_WINDOWS['".$PA['itemFormElName']."']) { document.".$pObj->formName."['".$PA['itemFormElName']."'].value = TBE_RTE_WINDOWS['".$PA['itemFormElName']."'].getHTML(); } else { OK=0; }";
00114
00115
00116 $RTEWidth = 460+($pObj->docLarge ? 150 : 0);
00117 $RTEdivStyle = $this->RTEdivStyle ? $this->RTEdivStyle : 'position:relative; left:0px; top:0px; height:380px; width:'.$RTEWidth.'px; border:solid 0px;';
00118
00119
00120 $rteURL = $pObj->backPath.'ext/rte/app/rte.php?'.
00121 'elementId='.rawurlencode($PA['itemFormElName']).
00122 '&pid='.$thePidValue.
00123 '&typeVal='.rawurlencode($RTEtypeVal).
00124 '&bgColor='.rawurlencode($pObj->colorScheme[0]).
00125 '&sC='.rawurlencode($PA['extra']).
00126 '&defaultExtras='.rawurlencode($PA['fieldConf']['defaultExtras']).
00127 '&formName='.rawurlencode($pObj->formName);
00128
00129
00130 $value = $this->transformContent('rte',$PA['itemFormElValue'],$table,$field,$row,$specConf,$thisConfig,$RTErelPath,$thePidValue);
00131
00132
00133 $pObj->RTEwindows[] = $PA['itemFormElName'];
00134 $item = '
00135 '.$this->triggerField($PA['itemFormElName']).'
00136 <input type="hidden" name="'.htmlspecialchars($PA['itemFormElName']).'" value="'.htmlspecialchars($value).'" />
00137 <div id="cdiv'.count($pObj->RTEwindows).'" style="'.htmlspecialchars($RTEdivStyle).'">
00138 <iframe
00139 src="'.htmlspecialchars($rteURL).'"
00140 id="'.$PA['itemFormElName'].'_RTE"
00141 style="visibility:visible; position:absolute; left:0px; top:0px; height:100%; width:100%;"></iframe>
00142 </div>';
00143 }
00144
00145
00146 return $item;
00147 }
00148
00155 function loaderFunc($formname) {
00156 return '
00157 var TBE_RTE_WINDOWS = new Array();
00158
00159 function TBE_EDITOR_setRTEref(RTEobj,theField,loadContent) {
00160 TBE_RTE_WINDOWS[theField] = RTEobj;
00161 if (loadContent) {
00162 RTEobj.setHTML(document.'.$formname.'[theField].value);
00163 }
00164 }
00165 ';
00166 }
00167 }
00168
00169
00170 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rte/class.tx_rte_base.php']) {
00171 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rte/class.tx_rte_base.php']);
00172 }
00173 ?>