Bug #17981 ยป 0007124.patch

Administrator Admin, 2008-01-11 14:00

View differences:

t3lib/config_default.php (Arbeitskopie)
172 172
		'compactFlexFormXML' => 0,				// If set, the flexform XML will not contain indentation spaces making XML more compact
173 173
		'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.
174 174
		'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.
175
			'pagetree_ExpandCollapse'   => 'typo3/alt_db_navframe.php:SC_alt_db_navframe->ajaxExpandCollapse',
176
			'foldertree_ExpandCollapse' => 'typo3/alt_file_navframe.php:SC_alt_file_navframe->ajaxExpandCollapse',
175
			'SC_alt_db_navframe::expandCollapse'   => 'typo3/alt_db_navframe.php:SC_alt_db_navframe->ajaxExpandCollapse',
176
			'SC_alt_file_navframe::expandCollapse' => 'typo3/alt_file_navframe.php:SC_alt_file_navframe->ajaxExpandCollapse',
177 177
		),
178 178
	),
179 179
	'FE' => Array(			// Configuration for the TypoScript frontend (FE). Nothing here relates to the administration backend!
typo3/tree.js (Arbeitskopie)
75 75

  
76 76
var Tree = {
77 77
	thisScript: 'ajax.php',
78
	ajaxID: 'pagetree_ExpandCollapse',	// has to be either "pagetree_ExpandCollapse" or "foldertree_ExpandCollapse"
78
	ajaxID: 'SC_alt_db_navframe::expandCollapse',	// has to be either "SC_alt_db_navframe::expandCollapse" or "SC_alt_file_navframe::expandCollapse"
79 79
	frameSetModule: null,
80 80
	activateDragDrop: true,
81 81
	highlightClass: 'active',
typo3/classes/class.typo3ajax.php (Arbeitskopie)
68 68

  
69 69

  
70 70
	/**
71
	 * overwrites the existing content with the first parameter
72
	 *
73
	 * @param	array	the new content
74
	 * @return	mixed	the old content as array; if the new content was not an array, false is returned
75
	 */
76
	public function setContent($content) {
77
		$oldcontent = false;
78
		if (is_array($content)) {
79
			$oldcontent = $this->content;
80
			$this->content = $content;
81
		}
82
		return $oldcontent;
83
	}
84

  
85

  
86
	/**
71 87
	 * adds new content
72 88
	 *
73 89
	 * @param	string	the new content key where the content should be added in the content array
74 90
	 * @param	string	the new content to add
75
	 * @return	string	the old content
91
	 * @return	mixed	the old content; if the old content didn't exist before, false is returned
76 92
	 */
77 93
	public function addContent($key, $content) {
78
		$oldcontent = '';
94
		$oldcontent = false;
79 95
		if (array_key_exists($key, $this->content)) {
80 96
			$oldcontent = $this->content[$key];
81 97
		}
82
		if (!$content) {
98
		if (!isset($content) || !strlen($content)) {
83 99
			unset($this->content[$key]);
100
		} elseif (!isset($key) || !strlen($key)) {
101
			$this->content[] = $content;
84 102
		} else {
85 103
			$this->content[$key] = $content;
86 104
		}
......
105 123
	 * @return	void
106 124
	 */
107 125
	public function setContentFormat($format) {
108
		if (t3lib_div::inArray(array('plain', 'xml', 'json'), $format)) {
126
		if (t3lib_div::inArray(array('plain', 'xml', 'json', 'jsonhead', 'jsonbody'), $format)) {
109 127
			$this->contentFormat = $format;
110 128
		}
111 129
	}
typo3/alt_db_navframe.php (Arbeitskopie)
332 332
	 * Makes the AJAX call to expand or collapse the pagetree.
333 333
	 * Called by typo3/ajax.php
334 334
	 * 
335
	 * @param	array	additional parameters (not used here)
336
	 * @param	object	the TYPO3AJAX object of this request
335
	 * @param	array		$params: additional parameters (not used here)
336
	 * @param	TYPO3AJAX	&$ajaxObj: reference of the TYPO3AJAX object of this request
337
	 * @return	void
337 338
	 */
338 339
	public function ajaxExpandCollapse($params, &$ajaxObj) {
339 340
		global $LANG;
typo3/alt_file_navframe.php (Arbeitskopie)
135 135
		($this->currentSubScript?'top.currentSubScript=unescape("'.rawurlencode($this->currentSubScript).'");':'').'
136 136

  
137 137
		// setting prefs for foldertree
138
		Tree.ajaxID = "foldertree_ExpandCollapse";
138
		Tree.ajaxID = "SC_alt_file_navframe::expandCollapse";
139 139

  
140 140
		// Function, loading the list frame from navigation tree:
141 141
		function jumpTo(id, linkObj, highlightID, bank)	{
......
214 214
	 * Makes the AJAX call to expand or collapse the foldertree.
215 215
	 * Called by typo3/ajax.php
216 216
	 * 
217
	 * @param	array	additional parameters (not used here)
218
	 * @param	object	the TYPO3AJAX object of this request
217
	 * @param	array		$params: additional parameters (not used here)
218
	 * @param	TYPO3AJAX	&$ajaxObj: reference of the TYPO3AJAX object of this request
219
	 * @return	void
219 220
	 */
220 221
	public function ajaxExpandCollapse($params, &$ajaxObj)	{
221 222
		global $LANG;
    (1-1/1)