Index: t3lib/config_default.php
===================================================================
--- t3lib/config_default.php	(Revision 2880)
+++ t3lib/config_default.php	(Arbeitskopie)
@@ -172,8 +172,8 @@
 		'compactFlexFormXML' => 0,				// If set, the flexform XML will not contain indentation spaces making XML more compact
 		'elementVersioningOnly' => FALSE,		// If true, only element versioning is allowed in the backend. This is recommended for new installations of TYPO3 4.2+ since "page" and "branch" versioning types are known for the drawbacks of loosing ids and "element" type versions supports moving now.
 		'AJAX' => array(				// array of key-value pairs for a unified use of AJAX calls in the TYPO3 backend. Keys are the unique ajaxIDs where the value will be resolved to call a method in an object. See ajax.php and the classes/class.typo3ajax.php for more information.
-			'pagetree_ExpandCollapse'   => 'typo3/alt_db_navframe.php:SC_alt_db_navframe->ajaxExpandCollapse',
-			'foldertree_ExpandCollapse' => 'typo3/alt_file_navframe.php:SC_alt_file_navframe->ajaxExpandCollapse',
+			'SC_alt_db_navframe::expandCollapse'   => 'typo3/alt_db_navframe.php:SC_alt_db_navframe->ajaxExpandCollapse',
+			'SC_alt_file_navframe::expandCollapse' => 'typo3/alt_file_navframe.php:SC_alt_file_navframe->ajaxExpandCollapse',
 		),
 	),
 	'FE' => Array(			// Configuration for the TypoScript frontend (FE). Nothing here relates to the administration backend!
Index: typo3/tree.js
===================================================================
--- typo3/tree.js	(Revision 2880)
+++ typo3/tree.js	(Arbeitskopie)
@@ -75,7 +75,7 @@
 
 var Tree = {
 	thisScript: 'ajax.php',
-	ajaxID: 'pagetree_ExpandCollapse',	// has to be either "pagetree_ExpandCollapse" or "foldertree_ExpandCollapse"
+	ajaxID: 'SC_alt_db_navframe::expandCollapse',	// has to be either "SC_alt_db_navframe::expandCollapse" or "SC_alt_file_navframe::expandCollapse"
 	frameSetModule: null,
 	activateDragDrop: true,
 	highlightClass: 'active',
Index: typo3/classes/class.typo3ajax.php
===================================================================
--- typo3/classes/class.typo3ajax.php	(Revision 2880)
+++ typo3/classes/class.typo3ajax.php	(Arbeitskopie)
@@ -68,19 +68,37 @@
 
 
 	/**
+	 * overwrites the existing content with the first parameter
+	 *
+	 * @param	array	the new content
+	 * @return	mixed	the old content as array; if the new content was not an array, false is returned
+	 */
+	public function setContent($content) {
+		$oldcontent = false;
+		if (is_array($content)) {
+			$oldcontent = $this->content;
+			$this->content = $content;
+		}
+		return $oldcontent;
+	}
+
+
+	/**
 	 * adds new content
 	 *
 	 * @param	string	the new content key where the content should be added in the content array
 	 * @param	string	the new content to add
-	 * @return	string	the old content
+	 * @return	mixed	the old content; if the old content didn't exist before, false is returned
 	 */
 	public function addContent($key, $content) {
-		$oldcontent = '';
+		$oldcontent = false;
 		if (array_key_exists($key, $this->content)) {
 			$oldcontent = $this->content[$key];
 		}
-		if (!$content) {
+		if (!isset($content) || !strlen($content)) {
 			unset($this->content[$key]);
+		} elseif (!isset($key) || !strlen($key)) {
+			$this->content[] = $content;
 		} else {
 			$this->content[$key] = $content;
 		}
@@ -105,7 +123,7 @@
 	 * @return	void
 	 */
 	public function setContentFormat($format) {
-		if (t3lib_div::inArray(array('plain', 'xml', 'json'), $format)) {
+		if (t3lib_div::inArray(array('plain', 'xml', 'json', 'jsonhead', 'jsonbody'), $format)) {
 			$this->contentFormat = $format;
 		}
 	}
Index: typo3/alt_db_navframe.php
===================================================================
--- typo3/alt_db_navframe.php	(Revision 2880)
+++ typo3/alt_db_navframe.php	(Arbeitskopie)
@@ -332,8 +332,9 @@
 	 * Makes the AJAX call to expand or collapse the pagetree.
 	 * Called by typo3/ajax.php
 	 * 
-	 * @param	array	additional parameters (not used here)
-	 * @param	object	the TYPO3AJAX object of this request
+	 * @param	array		$params: additional parameters (not used here)
+	 * @param	TYPO3AJAX	&$ajaxObj: reference of the TYPO3AJAX object of this request
+	 * @return	void
 	 */
 	public function ajaxExpandCollapse($params, &$ajaxObj) {
 		global $LANG;
Index: typo3/alt_file_navframe.php
===================================================================
--- typo3/alt_file_navframe.php	(Revision 2880)
+++ typo3/alt_file_navframe.php	(Arbeitskopie)
@@ -135,7 +135,7 @@
 		($this->currentSubScript?'top.currentSubScript=unescape("'.rawurlencode($this->currentSubScript).'");':'').'
 
 		// setting prefs for foldertree
-		Tree.ajaxID = "foldertree_ExpandCollapse";
+		Tree.ajaxID = "SC_alt_file_navframe::expandCollapse";
 
 		// Function, loading the list frame from navigation tree:
 		function jumpTo(id, linkObj, highlightID, bank)	{
@@ -214,8 +214,9 @@
 	 * Makes the AJAX call to expand or collapse the foldertree.
 	 * Called by typo3/ajax.php
 	 * 
-	 * @param	array	additional parameters (not used here)
-	 * @param	object	the TYPO3AJAX object of this request
+	 * @param	array		$params: additional parameters (not used here)
+	 * @param	TYPO3AJAX	&$ajaxObj: reference of the TYPO3AJAX object of this request
+	 * @return	void
 	 */
 	public function ajaxExpandCollapse($params, &$ajaxObj)	{
 		global $LANG;
