Public Member Functions | |
isAvailable () | |
Returns true if the RTE is available. | |
drawRTE (&$pObj, $table, $field, $row, $PA, $specConf, $thisConfig, $RTEtypeVal, $RTErelPath, $thePidValue) | |
Draws the RTE as a form field or whatever is needed (inserts JavaApplet, creates iframe, renders ....) Default is to output the transformed content in a plain textarea field. | |
transformContent ($dirRTE, $value, $table, $field, $row, $specConf, $thisConfig, $RTErelPath, $pid) | |
Performs transformation of content to/from RTE. | |
triggerField ($fieldName) | |
Trigger field - this field tells the TCEmain that processing should be done on this value! | |
Public Attributes | |
$errorLog = array() | |
$ID = '' |
|
Draws the RTE as a form field or whatever is needed (inserts JavaApplet, creates iframe, renders ....) Default is to output the transformed content in a plain textarea field. This mode is great for debugging transformations!
Definition at line 118 of file class.t3lib_rteapi.php. References table(), and transformContent(). 00118 { 00119 00120 // Transform value: 00121 $value = $this->transformContent('rte',$PA['itemFormElValue'],$table,$field,$row,$specConf,$thisConfig,$RTErelPath,$thePidValue); 00122 00123 // Create item: 00124 $item = ' 00125 '.$this->triggerField($PA['itemFormElName']).' 00126 <textarea name="'.htmlspecialchars($PA['itemFormElName']).'"'.$pObj->formWidthText('48','off').' rows="20" wrap="off" style="background-color: #99eebb;">'. 00127 t3lib_div::formatForTextarea($value). 00128 '</textarea>'; 00129 00130 // Return form item: 00131 return $item; 00132 }
|
|
Returns true if the RTE is available. Here you check if the browser requirements are met. If there are reasons why the RTE cannot be displayed you simply enter them as text in ->errorLog
Definition at line 93 of file class.t3lib_rteapi.php. References $CLIENT. 00093 { 00094 global $CLIENT; 00095 00096 $this->errorLog = array(); 00097 if (!$CLIENT['FORMSTYLE']) $this->errorLog[] = 'RTE API: Browser didn\'t support styles'; 00098 00099 if (!count($this->errorLog)) return TRUE; 00100 }
|
|
Performs transformation of content to/from RTE. The keyword $dirRTE determines the direction. This function is called in two situations: a) Right before content from database is sent to the RTE (see ->drawRTE()) it might need transformation b) When content is sent from the RTE and into the database it might need transformation back again (going on in TCEmain class; You can't affect that.)
Definition at line 151 of file class.t3lib_rteapi.php. References t3lib_BEfunc::getSpecConfParametersFromArray(), and table(). Referenced by drawRTE(). 00151 { 00152 00153 #debug(array($dirRTE,$value,$table,$field,array(),$specConf,$thisConfig,$RTErelPath,$pid)); 00154 00155 if ($specConf['rte_transform']) { 00156 $p = t3lib_BEfunc::getSpecConfParametersFromArray($specConf['rte_transform']['parameters']); 00157 if ($p['mode']) { // There must be a mode set for transformation 00158 #debug($p['mode'],'MODE'); 00159 00160 // Initialize transformation: 00161 $parseHTML = t3lib_div::makeInstance('t3lib_parsehtml_proc'); 00162 $parseHTML->init($table.':'.$field, $pid); 00163 $parseHTML->setRelPath($RTErelPath); 00164 00165 // Perform transformation: 00166 $value = $parseHTML->RTE_transform($value, $specConf, $dirRTE, $thisConfig); 00167 } 00168 } 00169 00170 #debug(array($dirRTE,$value),'OUT: '.$dirRTE); 00171 return $value; 00172 }
|
|
Trigger field - this field tells the TCEmain that processing should be done on this value!
Definition at line 197 of file class.t3lib_rteapi.php. 00197 { 00198 00199 $triggerFieldName = ereg_replace('\[([^]]+)\]$','[_TRANSFORM_\1]', $fieldName); 00200 return '<input type="hidden" name="'.htmlspecialchars($triggerFieldName).'" value="RTE" />'; 00201 }
|
|
Definition at line 67 of file class.t3lib_rteapi.php. |
|
Definition at line 70 of file class.t3lib_rteapi.php. |