diff -wurx .svn typo3_svnco/t3lib/class.t3lib_tceforms.php typo3_svn/t3lib/class.t3lib_tceforms.php
--- typo3_svnco/t3lib/class.t3lib_tceforms.php	2007-05-13 14:41:25.515706879 +0200
+++ typo3_svn/t3lib/class.t3lib_tceforms.php	2007-05-12 18:19:07.422896095 +0200
@@ -1193,6 +1193,16 @@
 					$wrap = ($config['wrap'] ? $config['wrap'] : 'virtual');
 				}
 
+				if (!$GLOBALS['BE_USER']->uc['disableTsEditor'] && $config['highlighting'] == 1)	{
+					// $this->printNeededJS['codepress'] = 'Hallo';
+					$item='';
+					// $item.= '<script src="'.$this->backPath.'contrib/codepress/codepress.js" type="text/javascript" id="cp-script" lang="en-us"></script>';
+					// $item.= '<script src="'.$this->backPath.'contrib/prototype/prototype.js" type="text/javascript" id="prototype-script"></script>';
+					$item.= '<link href="'.$this->backPath.'contrib/codepress/t3codepress.css" rel="stylesheet" type="text/css"></link>';
+					$item.= '<script src="'.$this->backPath.'contrib/codepress/t3codepress_t3lib_tceforms.js" type="text/javascript" id="t3codepress-t3libtceforms-script"></script>';
+					$item.='<code id="'.$PA['itemFormElID'].'" wrap="off" title="'.$PA['label'].'.'.$config['highlighting_lang'].'" style="height: 300px;" class="cp hideLanguage"'.$this->formWidthText($cols,$wrap).'>'.t3lib_div::formatForTextarea($PA['itemFormElValue']).'</code>';
+					$item.='<textarea id="'.$PA['itemFormElID'].'_ta" name="'.$PA['itemFormElName'].'" rows="'.$rows.'" wrap="off" class="cp fixed-font enable-tab"'.$this->formWidthText($cols,$wrap).'>'.t3lib_div::formatForTextarea($PA['itemFormElValue']).'</textarea>';
+				} else {
 				$classes = array();
 				if ($specConf['fixed-font'])	{ $classes[] = 'fixed-font'; }
 				if ($specConf['enable-tab'])	{ $classes[] = 'enable-tab'; }
@@ -1214,6 +1224,7 @@
 							<textarea name="'.$PA['itemFormElName'].'"'.$formWidthText.$class.' rows="'.$rows.'" wrap="'.$wrap.'" onchange="'.htmlspecialchars($iOnChange).'"'.$PA['onFocus'].'>'.
 							t3lib_div::formatForTextarea($PA['itemFormElValue']).
 							'</textarea>';
+				}
 				$item = $this->renderWizards(array($item,$altItem),$config['wizards'],$table,$row,$field,$PA,$PA['itemFormElName'],$specConf,$RTEwouldHaveBeenLoaded);
 			}
 		}
diff -wurx .svn ../typo3_svnco/typo3/sysext/cms/tbl_cms.php ./typo3/sysext/cms/tbl_cms.php
--- ../typo3_svnco/typo3/sysext/cms/tbl_cms.php	2007-05-13 14:42:33.359206854 +0200
+++ ./typo3/sysext/cms/tbl_cms.php	2007-05-11 00:25:29.045038856 +0200
@@ -689,7 +689,9 @@
 				'cols' => '48',
 				'rows' => '10',
 				'wrap' => 'OFF',
-				'softref' => 'TStemplate,email[subst],url[subst]'
+				'softref' => 'TStemplate,email[subst],url[subst]',
+				'highlighting' => '1',
+				'highlighting_lang' => 'ts', // TypoScript
 			),
 			'defaultExtras' => 'fixed-font : enable-tab',
 		),
@@ -804,7 +806,9 @@
 					)
 				),
 				'wrap' => 'OFF',
-				'softref' => 'TStemplate,email[subst],url[subst]'
+				'softref' => 'TStemplate,email[subst],url[subst]',
+				'highlighting' => '1',
+				'highlighting_lang' => 'ts', // TypoScript
 			),
 			'defaultExtras' => 'fixed-font : enable-tab',
 		),
diff -wurx .svn typo3_svnco/typo3/sysext/tstemplate_info/class.tx_tstemplateinfo.php typo3_svn/typo3/sysext/tstemplate_info/class.tx_tstemplateinfo.php
--- typo3_svnco/typo3/sysext/tstemplate_info/class.tx_tstemplateinfo.php	2007-05-13 14:42:53.996386569 +0200
+++ typo3_svn/typo3/sysext/tstemplate_info/class.tx_tstemplateinfo.php	2007-05-12 18:26:42.735556656 +0200
@@ -263,6 +263,15 @@
 						}
 					}
 				}
+
+					// if TSEditor is enabled
+					// this POST is a Ajax-Request
+				if (!$GLOBALS['BE_USER']->uc['disableTsEditor']
+				  && t3lib_div::_POST('submitAjax')) {
+					// abort request here and return message
+					echo "Saved";
+					exit();
+				}
 			}
 
 			$theOutput.=$this->pObj->doc->spacer(5);
@@ -272,6 +281,7 @@
 				$theOutput.=$this->pObj->doc->divider(5);
 			}
 
+
 		/*	$e[constants]=1;
 			$e[config]=1;
 			$e[title]=1;
@@ -283,8 +293,13 @@
 
 			if (t3lib_div::_POST('abort'))		{unset($e);}	// If abort pressed, nothing should be edited.
 
+			$onclickAction = '';
+			if (!$GLOBALS['BE_USER']->uc['disableTsEditor'] && ($e["constants"] || $e["config"]))	{
+				$theOutput .= $this->pObj->doc->section("",'<script src="'.$BACK_PATH.'contrib/codepress/t3codepress_template.js" type="text/javascript" id="t3codepress-template-script"></script>');
+				$onclickAction = 'onclick="sendAjaxData(); return false;"';
+			}
 			if (is_array($e))	{
-				$theOutput.=$this->pObj->doc->section("",'<BR><input type="Submit" name="submit" value="Update"> <input type="Submit" name="abort" value="Cancel">');
+				$theOutput.=$this->pObj->doc->section("",'<BR><input type="Submit" name="submit" value="Update" '.$onclickAction.' > <input type="Submit" name="abort" value="Cancel">');
 			}
 			if ($e["title"])	{
 				$outCode='<input type="Text" name="data[title]" value="'.htmlspecialchars($tplRow[title]).'"'.$this->pObj->doc->formWidth().'>';
@@ -341,7 +356,13 @@
 				}
 			}
 			if ($e["constants"])	{
+				if (!$GLOBALS['BE_USER']->uc['disableTsEditor'])	{
+					$outCode='';					
+					$outCode.='<code id="constants" wrap="off" title="Constants.ts" class="cp hideLanguage"'.$this->pObj->doc->formWidthText(48,"width:98%;height:300px","off").'>'.t3lib_div::formatForTextarea($tplRow['constants']).'</code>';
+					$outCode.='<textarea id="constants_ta" name="data[constants]" rows="'.$numberOfRows.'" wrap="off" class="cp fixed-font enable-tab"'.$this->pObj->doc->formWidthText(48,'width:98%;height:70%','off').'>'.t3lib_div::formatForTextarea($tplRow['constants']).'</textarea>';
+				} else {
 				$outCode='<textarea name="data[constants]" rows="'.$numberOfRows.'" wrap="off" class="fixed-font enable-tab"'.$this->pObj->doc->formWidthText(48,"width:98%;height:70%","off").' class="fixed-font">'.t3lib_div::formatForTextarea($tplRow["constants"]).'</textarea>';
+				}
 				$outCode.='<input type="Hidden" name="e[constants]" value="1">';
 				$theOutput.=$this->pObj->doc->spacer(15);
 				$theOutput.=$this->pObj->doc->section("Constants:","");
@@ -368,7 +389,13 @@
 				}
 			}
 			if ($e["config"])	{
+				if (!$GLOBALS['BE_USER']->uc['disableTsEditor'])	{
+					$outCode='';					
+					$outCode.='<code id="config" wrap="off" title="Setup.ts" class="cp hideLanguage"'.$this->pObj->doc->formWidthText(48,"width:98%;height:70%","off").'>'.t3lib_div::formatForTextarea($tplRow["config"]).'</code>';
+					$outCode.='<textarea id="config_ta" name="data[config]" rows="'.$numberOfRows.'" wrap="off" class="cp fixed-font enable-tab">'.t3lib_div::formatForTextarea($tplRow["config"]).'</textarea>';
+				} else {
 				$outCode='<textarea name="data[config]" rows="'.$numberOfRows.'" wrap="off" class="fixed-font enable-tab"'.$this->pObj->doc->formWidthText(48,"width:98%;height:70%","off").' class="fixed-font">'.t3lib_div::formatForTextarea($tplRow["config"]).'</textarea>';
+				}
 
 				if (t3lib_extMgm::isLoaded("tsconfig_help"))	{
 					$url=$BACK_PATH."wizard_tsconfig.php?mode=tsref";
@@ -384,7 +411,7 @@
 				$theOutput.=$this->pObj->doc->sectionEnd().$outCode;
 			}
 			if (is_array($e))	{
-				$theOutput.=$this->pObj->doc->section("",'<BR><input type="Submit" name="submit" value="Update"> <input type="Submit" name="abort" value="Cancel">');
+				$theOutput.=$this->pObj->doc->section("",'<BR><input type="Submit" name="submit" value="Update" '.$onclickAction.'> <input type="Submit" name="abort" value="Cancel">');
 			}
 
 					// Processing:
diff -wurx .svn typo3_svnco/typo3/template.php typo3_svn/typo3/template.php
--- typo3_svnco/typo3/template.php	2007-05-13 14:41:38.075044112 +0200
+++ typo3_svn/typo3/template.php	2007-05-12 17:34:26.975016712 +0200
@@ -642,6 +642,19 @@
 		}
 
 		$tabJScode = '';
+		
+		if (!$GLOBALS['BE_USER']->uc['disableTsEditor'])	{
+				// disable the tab-in-textarea feature when the typoscript-editor is enabled
+			$GLOBALS['BE_USER']->uc['disableTabInTextarea'] = '1';
+
+			$this->postCode .= '<script src="'.$this->backPath.'contrib/codepress/codepress.js" type="text/javascript" id="cp-script" lang="en-us"></script>';
+			$tabJScode .= '<script src="'.$this->backPath.'contrib/prototype/prototype.js" type="text/javascript" id="prototype-script"></script>';
+			$tabJScode .= '<link href="'.$this->backPath.'contrib/codepress/t3codepress.css" rel="stylesheet" type="text/css"></link>';
+			// $tabJScode .= '<script src="'.$this->backPath.'contrib/codepress/t3codepress_template.js" type="text/javascript" id="t3codepress-template-script"></script>';
+
+		}
+		
+		
 		if (!$GLOBALS['BE_USER']->uc['disableTabInTextarea'])	{
 				// This loads the tabulator-in-textarea feature. It automatically modifies every textarea which is found.
 			$tabJScode = '<script src="'.$this->backPath.'tab.js" type="text/javascript"></script>';
