patch_4.5.23_4.5.23_changed.diff

Frank Frewer, 2013-03-04 14:32

Download (31.6 KB)

View differences:

typo3_src-4.5.23_changed/t3lib/js/extjs/components/pagetree/javascript/app.js 2013-03-04 09:47:28.000000000 +0100
116 116
				app: this
117 117
			}).hide();
118 118

  
119
			var languageTree = new TYPO3.Components.PageTree.LanguageTree({
120
				id: this.id + '-languageTree',
121
				deletionDropZoneId: this.id + '-deletionDropZone',
122
				ddGroup: this.id,
123
				stateful: true,
124
				stateId: 'Pagetree' + TYPO3.Components.PageTree.Configuration.temporaryMountPoint,
125
				stateEvents: [],
126
				autoScroll: true,
127
				autoHeight: false,
128
				plugins: new Ext.ux.state.TreePanel(),
129
				commandProvider: TYPO3.Components.PageTree.Actions,
130
				contextMenuProvider: TYPO3.Components.PageTree.ContextMenuDataProvider,
131
				treeDataProvider: TYPO3.Components.PageTree.DataProvider,
132
				app: this
133
			});
134

  
119 135
			var topPanel = new TYPO3.Components.PageTree.TopPanel({
120 136
				dataProvider: TYPO3.Components.PageTree.DataProvider,
121 137
				filteringTree: filteringTree,
138
				languageTree: languageTree,
122 139
				ddGroup: this.id,
123 140
				tree: tree,
124 141
				app: this
......
155 172
						id: this.id + '-treeContainer',
156 173
						region: 'center',
157 174
						layout: 'fit',
158
						items: [tree, filteringTree]
175
						items: [tree, filteringTree,languageTree]
159 176
					},
160 177
					deletionDropZone
161 178
				]
typo3_src-4.5.23_changed/t3lib/js/extjs/components/pagetree/javascript/filteringtree.js 2013-03-03 21:02:01.000000000 +0100
43 43
	searchWord: '',
44 44

  
45 45
	/**
46
	 * language ID
47
	 *
48
	 * @type {Integer}
49
	 */
50
	language: 0,
51

  
52
	/**
46 53
	 * Tree loader implementation for the filtering tree
47 54
	 *
48 55
	 * @return {void}
......
61 68
					if (!node.ownerTree.searchWord || node.ownerTree.searchWord === '') {
62 69
						return false;
63 70
					}
64

  
71
					node.attributes.nodeData.language = node.ownerTree.language;
65 72
					treeLoader.baseParams.nodeId = node.id;
66 73
					treeLoader.baseParams.searchWord = node.ownerTree.searchWord;
67 74
					treeLoader.baseParams.attributes = node.attributes.nodeData;
typo3_src-4.5.23_changed/t3lib/js/extjs/components/pagetree/javascript/languagetree.js 2013-03-03 21:03:07.000000000 +0100
1
/***************************************************************
2
*  Copyright notice
3
*
4
*  (c) 2010-2011 Stefan Galinski <stefan.galinski@gmail.com>
5
*  All rights reserved
6
*
7
*  This script is part of the TYPO3 project. The TYPO3 project is
8
*  free software; you can redistribute it and/or modify
9
*  it under the terms of the GNU General Public License as published by
10
*  the Free Software Foundation; either version 2 of the License, or
11
*  (at your option) any later version.
12
*
13
*  The GNU General Public License can be found at
14
*  http://www.gnu.org/copyleft/gpl.html.
15
*  A copy is found in the textfile GPL.txt and important notices to the license
16
*  from the author is found in LICENSE.txt distributed with these scripts.
17
*
18
*
19
*  This script is distributed in the hope that it will be useful,
20
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
21
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22
*  GNU General Public License for more details.
23
*
24
*  This copyright notice MUST APPEAR in all copies of the script!
25
***************************************************************/
26
Ext.namespace('TYPO3.Components.PageTree');
27

  
28
/**
29
 * @class TYPO3.Components.PageTree.LanguageTree
30
 *
31
 * Language Tree
32
 *
33
 * @namespace TYPO3.Components.PageTree
34
 * @extends TYPO3.Components.PageTree.Tree
35
 * @author Stefan Galinski <stefan.galinski@gmail.com>
36
 */
37
TYPO3.Components.PageTree.LanguageTree = Ext.extend(TYPO3.Components.PageTree.Tree, {
38
	/**
39
	 * language ID
40
	 *
41
	 * @type {Integer}
42
	 */
43
	language: 0,
44

  
45
	/**
46
	 * Tree loader implementation for the filtering tree
47
	 *
48
	 * @return {void}
49
	 */
50
	addTreeLoader: function() {
51
		this.loader = new Ext.tree.TreeLoader({
52
			directFn: this.treeDataProvider.getLanguageTree,
53
			paramOrder: 'nodeId,attributes,language',
54
			nodeParameter: 'nodeId',
55
			baseAttrs: {
56
				uiProvider: this.uiProvider
57
			},
58

  
59
			listeners: {
60
				beforeload: function(treeLoader, node) {
61
					if (!node.ownerTree.language || node.ownerTree.language === '') {
62
						return false;
63
					}
64

  
65
					treeLoader.baseParams.nodeId = node.id;
66
					treeLoader.baseParams.language = node.ownerTree.language;
67
					treeLoader.baseParams.attributes = node.attributes.nodeData;
68
				}
69
			}
70
		});
71
	}
72
});
73

  
74
// XTYPE Registration
75
Ext.reg('TYPO3.Components.PageTree.LanguageTree', TYPO3.Components.PageTree.LanguageTree);
typo3_src-4.5.23_changed/t3lib/js/extjs/components/pagetree/javascript/loadorder.txt 2013-02-27 12:14:46.000000000 +0100
1 1
treeeditor.js
2 2
tree.js
3 3
filteringtree.js
4
languagetree.js
4 5
nodeui.js
5 6
deletiondropzone.js
6 7
toppanel.js
typo3_src-4.5.23_changed/t3lib/js/extjs/components/pagetree/javascript/toppanel.js 2013-03-04 09:54:01.000000000 +0100
99 99
	filteringTree: null,
100 100

  
101 101
	/**
102
	 * Language Tree
103
	 *
104
	 * @cfg {TYPO3.Components.PageTree.LanguageTree}
105
	 */
106
	languageTree: null,
107

  
108
	/**
102 109
	 * Page Tree
103 110
	 *
104 111
	 * @cfg {TYPO3.Components.PageTree.Tree}
......
112 119
	 */
113 120
	app: null,
114 121

  
122
	languages: null,
123

  
115 124
	/**
116 125
	 * Initializes the component
117 126
	 *
......
135 144
		}
136 145

  
137 146
		this.getTopToolbar().addItem({xtype: 'tbfill'});
147

  
148
		if (!TYPO3.Components.PageTree.Configuration.hideLanguageSelection
149
			|| TYPO3.Components.PageTree.Configuration.hideLanguageSelection === '0'
150
		) {
151
			this.addLanguageSelection();
152
		}
153

  
138 154
		this.addRefreshTreeFeature();
139 155
	},
140 156

  
......
215 231

  
216 232
		this.filteringTree.searchWord = searchWord;
217 233
		if (this.filteringTree.searchWord === '') {
218
			this.app.activeTree = this.tree;
219

  
234
			if (this.filteringTree.language == '0' || !this.languageTree) {
235
				this.app.activeTree = this.tree;
236
			} else {
237
				this.app.activeTree = this.languageTree
238
			}
220 239
			textField.setHideTrigger(true);
221 240
			this.filteringTree.hide();
222
			this.tree.show().refreshTree(function() {
223
				textField.focus(false, 500);
224
			}, this);
241

  
242
			if (this.filteringTree.language == '0' || !this.languageTree) {
243
				this.tree.show().refreshTree(function() {
244
					textField.focus(false, 500);
245
				}, this);
246
			} else {
247
				this.languageTree.show().refreshTree(function() {
248
					textField.focus(false, 500);
249
				}, this);
250
			}
225 251

  
226 252
			if (this.filteringIndicator) {
227 253
				this.app.removeIndicator(this.filteringIndicator);
......
478 504
		});
479 505

  
480 506
		this.addButton(topPanelButton);
507
	},
508

  
509
	/**
510
	 * Adds a combobox to the toolbar for language selection
511
	 *
512
	 * @return {void}
513
	 */
514
	addLanguageSelection: function() {
515
		var topPanelLanguageSelection = new Ext.form.ComboBox({
516
			id: this.id + '-combo-language',
517
			cls: this.id + '-combo',
518
		    	fieldLabel: 'Language',
519
		    	hiddenName: 'language',
520
		    	store: new Ext.data.SimpleStore({
521
				fields: ['lid', 'languageLabel'],
522
				data: []
523
			}),
524
			displayField: 'languageLabel',
525
			valueField:'lid',
526
			typeAhead: true,
527
			mode: 'local',
528
			triggerAction: 'all',
529
			emptyText:TYPO3.Components.PageTree.LLL.comboLanguage,
530
			selectOnFocus:true,
531
			languageTree: this.languageTree,
532
			listeners:        {
533
				select:    {
534
					scope: this,
535
					fn: function(field, value, index) {
536
						var selectedLanguage = field.getValue();
537
						this.filteringTree.language = selectedLanguage;
538
						if (selectedLanguage == 0) {
539
							if (this.filteringIndicator) {
540
								this.app.ownerCt.getEl().mask('', 'x-mask-loading-message');
541
								this.app.ownerCt.getEl().addClass('t3-mask-loading');
542
								this.filteringTree.show().refreshTree(function() {
543
									if (selectedNode) {
544
										this.app.select(selectedNode.attributes.nodeData.id, false);
545
									}
546
									this.app.ownerCt.getEl().unmask();
547
								}, this);
548
							} else {
549
								this.app.activeTree = this.tree;
550

  
551
								this.languageTree.hide();
552
								this.tree.show().refreshTree(function() {
553
									//textField.focus(false, 500);
554
								}, this);
555
							}
556
						} else {
557
							if (this.filteringIndicator) {
558
								this.app.ownerCt.getEl().mask('', 'x-mask-loading-message');
559
								this.app.ownerCt.getEl().addClass('t3-mask-loading');
560
								this.filteringTree.show().refreshTree(function() {
561
									if (selectedNode) {
562
										this.app.select(selectedNode.attributes.nodeData.id, false);
563
									}
564
									this.app.ownerCt.getEl().unmask();
565
								}, this);
566

  
567
							} else {
568
								this.tree.hide();
569
								this.languageTree.language = selectedLanguage;
570
								var selectedNode = this.app.getSelected();
571
								this.app.activeTree = this.languageTree;
572
								this.app.ownerCt.getEl().mask('', 'x-mask-loading-message');
573
								this.app.ownerCt.getEl().addClass('t3-mask-loading');
574
								this.languageTree.show().refreshTree(function() {
575
									if (selectedNode) {
576
										this.app.select(selectedNode.attributes.nodeData.id, false);
577
									}
578
									//textField.focus();
579
									this.app.ownerCt.getEl().unmask();
580
								}, this);
581
							}
582
						}
583
					}
584
				}
585
			}
586
		}).hide();
587

  
588
		this.dataProvider.getLanguages(function(response) {
589
			languages = Ext.util.JSON.decode(response, true);
590
			languages.each(function(record) 
591
			{
592
				topPanelLanguageSelection.store.add(new Ext.data.Record(record));
593
			}, this); 
594
			if (languages.length > 1) {
595
				topPanelLanguageSelection.show();
596
			}
597
		}, this);
598

  
599
		this.getTopToolbar().addItem(topPanelLanguageSelection);
481 600
	}
482 601
});
483 602

  
typo3_src-4.5.23_changed/t3lib/tree/pagetree/class.t3lib_tree_pagetree_commands.php 2013-03-04 11:09:41.000000000 +0100
90 90
	 * @return void
91 91
	 */
92 92
	public static function updateNodeLabel(t3lib_tree_pagetree_Node $node, $updatedLabel) {
93
		$data['pages'][$node->getWorkspaceId()][$node->getTextSourceField()] = $updatedLabel;
94
		self::processTceCmdAndDataMap(array(), $data);
93
		preg_match('/\[.*\]/', $updatedLabel, $matches);
94
		$newPageLanguageOverlay = array();
95
		if ($node->getLanguage() == 0 || !empty($matches)) {
96
			if (!empty($matches)) {
97
				$updatedLabel = substr($updatedLabel, 1, strlen($updatedLabel)-2);
98
			}
99
			$data['pages'][$node->getWorkspaceId()][$node->getTextSourceField()] = $updatedLabel;
100
		} else { 
101
			$pageSelect = t3lib_div::makeInstance('t3lib_pageSelect');
102
			$pageLanguageOverlay = $pageSelect->getPageOverlay($node->getWorkspaceId(), $node->getLanguage());
103

  
104
			if ($pageLanguageOverlay['_PAGES_OVERLAY'] !== true) {
105
				$newPageLanguageOverlay = array (
106
							'pid' => $node->getWorkspaceId(),
107
							'language' => $node->getLanguage()
108
							);
109
				$data['pages_language_overlay'][$node->getWorkspaceId()][$node->getTextSourceField()] = $updatedLabel;
110
			} else {
111
				$data['pages_language_overlay'][$pageLanguageOverlay['_PAGES_OVERLAY_UID']][$node->getTextSourceField()] = $updatedLabel;
112
			}
113
		}
114
		self::processTceCmdAndDataMap(array(), $data, $newPageLanguageOverlay);
95 115
	}
96 116

  
97 117
	/**
......
171 191
	 *
172 192
	 * @param array $cmd
173 193
	 * @param array $data
194
	 * @param array $newPageLanguageOverlay
174 195
	 * @throws RuntimeException if an error happened while the TCE processing
175 196
	 * @return array
176 197
	 */
177
	protected static function processTceCmdAndDataMap(array $cmd, array $data = array()) {
198
	protected static function processTceCmdAndDataMap(array $cmd, array $data = array(), array $newPageLanguageOverlay = array()) {
178 199
		/** @var $tce t3lib_TCEmain */
179 200
		$tce = t3lib_div::makeInstance('t3lib_TCEmain');
180 201
		$tce->stripslashes_values = 0;
181 202
		$tce->start($data, $cmd);
182
		$tce->copyTree = t3lib_div::intInRange($GLOBALS['BE_USER']->uc['copyLevels'], 0, 100);
183 203

  
184
		if (count($cmd)) {
185
			$tce->process_cmdmap();
186
			$returnValues = $tce->copyMappingArray_merged;
187
		} elseif (count($data)) {
188
			$tce->process_datamap();
189
			$returnValues = $tce->substNEWwithIDs;
190
		}
204
		if (!empty($newPageLanguageOverlay)) {
205
			$newPageLanguageOverlay['uid'] = $tce->localize('pages', $newPageLanguageOverlay['pid'], $newPageLanguageOverlay['language']);
206
			$data['pages_language_overlay'][$newPageLanguageOverlay['uid']] = $data['pages_language_overlay'][$newPageLanguageOverlay['pid']];
207
			unset($data['pages_language_overlay'][$newPageLanguageOverlay['pid']]);
208
		
209
			$tce2 = t3lib_div::makeInstance('t3lib_TCEmain');
210
			$tce2->stripslashes_values = 0;
211
			$tce2->start($data, $cmd);
212
			$tce2->copyTree = t3lib_div::intInRange($GLOBALS['BE_USER']->uc['copyLevels'], 0, 100);
213
			$tce2->process_datamap();
214
			$returnValues = $tce2->substNEWwithIDs;
215
		} else {
216
			$tce->copyTree = t3lib_div::intInRange($GLOBALS['BE_USER']->uc['copyLevels'], 0, 100);
191 217

  
218
			if (count($cmd)) {
219
				$tce->process_cmdmap();
220
				$returnValues = $tce->copyMappingArray_merged;
221
			} elseif (count($data)) {
222
				$tce->process_datamap();
223
				$returnValues = $tce->substNEWwithIDs;
224
			}
225
		}
192 226
			// check errors
193 227
		if (count($tce->errorLog)) {
194 228
			throw new RuntimeException(implode(chr(10), $tce->errorLog), 1333754629);
195 229
		}
196 230

  
231
		if (count($tce2->errorLog)) {
232
			throw new RuntimeException(implode(chr(10), $tce2->errorLog), 1362391795);
233
		}
234

  
197 235
		return $returnValues;
198 236
	}
199 237

  
......
285 323
	 * Creates a node with the given record information's
286 324
	 *
287 325
	 * @param array $record
326
	 * @param int $mountPoint
327
	 * @param int $language
288 328
	 * @return t3lib_tree_pagetree_Node
289 329
	 */
290
	public static function getNewNode($record, $mountPoint = 0) {
330
	public static function getNewNode($record, $mountPoint = 0, $language = 0) {
291 331
		$useNavTitle = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showNavTitle');
292 332
		$addIdAsPrefix = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showPageIdWithTitle');
293 333
		$addDomainName = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showDomainNameWithTitle');
......
302 342
		$subNode->setId($record['uid']);
303 343
		$subNode->setMountPoint($mountPoint);
304 344
		$subNode->setWorkspaceId(($record['_ORIG_uid'] ? $record['_ORIG_uid'] : $record['uid']));
345
		$subNode->setLanguage($record['language']);
305 346

  
306 347
		$field = 'title';
307 348
		$text = $record['title'];
......
310 351
			$text = $record['nav_title'];
311 352
		}
312 353

  
354
		$qtipLanguage = '';
355
		if (($language > 0 || $record['language'] > 0) && $record['uid'] > 0) { 
356
			$pageSelect = t3lib_div::makeInstance('t3lib_pageSelect');
357
			$page = $pageSelect->getPage($record['uid']);
358
			$pageLanguageOverlay = $pageSelect->getPageOverlay($record['uid'], $language);
359

  
360
		 	if ($pageLanguageOverlay['title'] != '') {
361
				$text = $pageLanguageOverlay['title'];
362
			} 
363

  
364
		 	if ( $record['language'] > 0) {
365
				$qtipLanguage = '<br />' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:tree.StandardLanguagePageTitle', TRUE) . $page['title'];
366
			} 
367

  
368
			if (substr($record['title'], 0, 1) == '[' && substr($record['title'], -1) == ']') {
369
				$qtipLanguage = '<br />' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:tree.NoAlternativePageTitle', TRUE);
370
			}
371
		} 
372

  
313 373
		if (trim($text) === '') {
314 374
			$visibleText = '[' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.no_title', TRUE) . ']';
315 375
		} else {
......
326 386
		$qtip = str_replace(' - ', '<br />', htmlspecialchars(
327 387
			t3lib_BEfunc::titleAttribForPages($record, '', FALSE))
328 388
		);
389
		$qtip .= $qtipLanguage;
329 390

  
330 391
		$prefix = '';
331 392
		$lockInfo = t3lib_BEfunc::isRecordLocked('pages', $record['uid']);
typo3_src-4.5.23_changed/t3lib/tree/pagetree/class.t3lib_tree_pagetree_dataprovider.php 2013-03-04 11:22:03.000000000 +0100
91 91
	 * @param t3lib_tree_Node $node
92 92
	 * @param int $mountPoint
93 93
	 * @param int $level internally used variable as a recursion limiter
94
	 * @param int $language the language ID for the page titles
94 95
	 * @return t3lib_tree_NodeCollection
95 96
	 */
96
	 public function getNodes(t3lib_tree_Node $node, $mountPoint = 0, $level = 0) {
97
	 public function getNodes(t3lib_tree_Node $node, $mountPoint = 0, $level = 0, $language = 0) {
97 98
		/** @var $nodeCollection t3lib_tree_pagetree_NodeCollection */
98 99
		$nodeCollection = t3lib_div::makeInstance('t3lib_tree_pagetree_NodeCollection');
99 100

  
......
119 120
				continue;
120 121
			}
121 122

  
123
			if ($language > 0) { 
124
				$pageSelect = t3lib_div::makeInstance('t3lib_pageSelect');
125
				$pageLanguageOverlay = $pageSelect->getPageOverlay($subpage['uid'], $language);
126
			 	if ($pageLanguageOverlay['title'] != '') {
127
					$subpage['title'] = $pageLanguageOverlay['title'];
128
				} else {
129
					$subpage['title'] = "[".$subpage['title']."]";
130
				}
131
			} 
132
			$subpage['language'] = $language;
133

  
122 134
			$subNode = t3lib_tree_pagetree_Commands::getNewNode($subpage, $mountPoint);
123 135
			$subNode->setIsMountPoint($isMountPoint);
124 136
			if ($this->nodeCounter < $this->nodeLimit) {
125
				$childNodes = $this->getNodes($subNode, $mountPoint, $level + 1);
137
				$childNodes = $this->getNodes($subNode, $mountPoint, $level + 1, $language);
126 138
				$subNode->setChildNodes($childNodes);
127 139
				$this->nodeCounter += $childNodes->count();
128 140
			} else {
......
131 143

  
132 144
			$nodeCollection->append($subNode);
133 145
		}
134

  
135 146
		return $nodeCollection;
136 147
	}
137 148

  
......
141 152
	 * @param t3lib_tree_Node $node
142 153
	 * @param string $searchFilter
143 154
	 * @param int $mountPoint
155
	 * @param int $language
144 156
	 * @return void
145 157
	 */
146
	public function getFilteredNodes(t3lib_tree_Node $node, $searchFilter, $mountPoint = 0) {
158
	public function getFilteredNodes(t3lib_tree_Node $node, $searchFilter, $mountPoint = 0, $language = 0) {
147 159
		/** @var $nodeCollection t3lib_tree_pagetree_NodeCollection */
148 160
		$nodeCollection = t3lib_div::makeInstance('t3lib_tree_pagetree_NodeCollection');
149

  
150
		$records = $this->getSubpages(-1, $searchFilter);
161
		$language = intval($language);
162
		$records = $this->getSubpages(-1, $searchFilter, $language);
151 163
		if (!is_array($records) || !count($records)) {
152 164
			return $nodeCollection;
153 165
		} elseif (count($records) > 500) {
......
182 194
				}
183 195

  
184 196
				$rootlineElement = t3lib_tree_pagetree_Commands::getNodeRecord($rootlineElement['uid']);
197
				if ($language > 0) { 
198
					$pageSelect = t3lib_div::makeInstance('t3lib_pageSelect');
199
					$pageLanguageOverlay = $pageSelect->getPageOverlay($rootlineElement['uid'], $language);
200
				 	if ($pageLanguageOverlay['title'] != '') {
201
						$rootlineElement['title'] = $pageLanguageOverlay['title'];
202
					} else {
203
						$rootlineElement['title'] = "[".$rootlineElement['title']."]";
204
					}
205
				} 
206
				$rootlineElement['language'] = $language;
207

  
185 208
				$ident = intval($rootlineElement['sorting']) . intval($rootlineElement['uid']);
186 209
				if ($reference && $reference->offsetExists($ident)) {
187 210
					/** @var $refNode t3lib_tree_pagetree_Node */
......
195 218
						$refNode->setChildNodes($reference);
196 219
					}
197 220
				} else {
198
					$refNode = t3lib_tree_pagetree_Commands::getNewNode($rootlineElement, $mountPoint);
221
					$refNode = t3lib_tree_pagetree_Commands::getNewNode($rootlineElement, $mountPoint, $language);
199 222
					$replacement = '<span class="typo3-pagetree-filteringTree-highlight">$1</span>';
200 223
					if ($isNumericSearchFilter && intval($rootlineElement['uid']) === intval($searchFilter)) {
201 224
						$text = str_replace('$1', $refNode->getText(), $replacement);
......
214 237
					$childCollection = t3lib_div::makeInstance('t3lib_tree_pagetree_NodeCollection');
215 238

  
216 239
					if (($i +1) >= $amountOfRootlineElements) {
217
						$childNodes = $this->getNodes($refNode, $mountPoint);
240
						$childNodes = $this->getNodes($refNode, $mountPoint, '', $language);
218 241
						foreach ($childNodes as $childNode) {
219 242
							/** @var $childNode t3lib_tree_pagetree_Node */
220 243
							$childRecord = $childNode->getRecord();
......
242 265
	 * Note: If you add the search filter parameter, the nodes will be filtered by this string.
243 266
	 *
244 267
	 * @param string $searchFilter
268
	 * @param int $language
245 269
	 * @return array
246 270
	 */
247
	public function getTreeMounts($searchFilter = '') {
271
	public function getTreeMounts($searchFilter = '', $language = 0) {
248 272
		/** @var $nodeCollection t3lib_tree_pagetree_NodeCollection */
249 273
		$nodeCollection = t3lib_div::makeInstance('t3lib_tree_pagetree_NodeCollection');
250 274

  
251 275
		$isTemporaryMountPoint = FALSE;
276
		$language = intval($language);
252 277
		$mountPoints = intval($GLOBALS['BE_USER']->uc['pageTree_temporaryMountPoint']);
253 278
		if (!$mountPoints) {
254 279
			$mountPoints = array_map('intval', $GLOBALS['BE_USER']->returnWebmounts());
......
274 299
					'uid' => 0,
275 300
					'title' => $sitename,
276 301
				);
277
				$subNode = t3lib_tree_pagetree_Commands::getNewNode($record);
302
				$subNode = t3lib_tree_pagetree_Commands::getNewNode($record, 0, $language);
278 303
				$subNode->setLabelIsEditable(FALSE);
279 304
				$subNode->setType('pages_root');
280 305
			} else {
......
282 307
					continue;
283 308
				}
284 309

  
285
				$record = t3lib_BEfunc::getRecordWSOL('pages', $mountPoint, '*', '', TRUE);
310
				$record = t3lib_BEfunc::getRecordWSOL('pages', $mountPoint, '*', 0, TRUE);
286 311
				if (!$record) {
287 312
					continue;
288 313
				}
289 314

  
290
				$subNode = t3lib_tree_pagetree_Commands::getNewNode($record, $mountPoint);
315
				$subNode = t3lib_tree_pagetree_Commands::getNewNode($record, $mountPoint, $language);
291 316
				if ($showRootlineAboveMounts && !$isTemporaryMountPoint) {
292 317
					$rootline = t3lib_tree_pagetree_Commands::getMountPointPath($record['uid']);
293 318
					$subNode->setReadableRootline($rootline);
......
303 328
			$subNode->setDraggable(FALSE);
304 329

  
305 330
			if ($searchFilter === '') {
306
				$childNodes = $this->getNodes($subNode, $mountPoint);
331
				$childNodes = $this->getNodes($subNode, $mountPoint, 0, $language);
307 332
			} else {
308
				$childNodes = $this->getFilteredNodes($subNode, $searchFilter, $mountPoint);
333
				$childNodes = $this->getFilteredNodes($subNode, $searchFilter, $mountPoint, $language);
309 334
				$subNode->setExpanded(TRUE);
310 335
			}
311 336

  
......
354 379
	}
355 380

  
356 381
	/**
382
	 * Returns the where clause for fetching pages_language_overlay
383
	 *
384
	 * @param string $searchFilter
385
	 * @param int $language
386
	 * @return string
387
	 */
388
	protected function getWhereClausePagesLanguageOverlay($searchFilter = '', $language = 0) {
389
		$where = 'pages.uid=pages_language_overlay.pid AND pages_language_overlay.sys_language_uid=' . intval($language) . ' AND ';
390
		$where .= $GLOBALS['BE_USER']->getPagePermsClause(1) .
391
			t3lib_BEfunc::deleteClause('pages') .
392
			t3lib_BEfunc::versioningPlaceholderClause('pages');
393

  
394
		if ($searchFilter !== '') {
395
			if (is_numeric($searchFilter) && $searchFilter > 0) {
396
				$seachWhere .= 'pages.uid = ' . intval($searchFilter) . ' OR ';
397
			}
398

  
399
			$searchFilter = $GLOBALS['TYPO3_DB']->fullQuoteStr('%' . $searchFilter . '%', 'pages_language_overlay');
400
			$seachWhere .= 'pages_language_overlay.title LIKE ' . $searchFilter;
401
			$where .= ' AND (' . $seachWhere . ')';
402
		}
403

  
404
		return $where;
405
	}
406

  
407
	/**
357 408
	 * Returns all sub-pages of a given id
358 409
	 *
359 410
	 * @param int $id
360 411
	 * @param string $searchFilter
412
	 * @param int $language
361 413
	 * @return array
362 414
	 */
363
	protected function getSubpages($id, $searchFilter = '') {
364
		$where = $this->getWhereClause($id, $searchFilter);
365
		$subpages = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
366
			'uid', 'pages', $where, '', 'sorting', '', 'uid'
367
		);
415
	protected function getSubpages($id, $searchFilter = '', $language = 0) {
416
		if ($searchFilter !== '' && $language > 0) {
417
			$where = $this->getWhereClausePagesLanguageOverlay($searchFilter, $language);
418
			$subpages = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
419
				'pages.uid AS uid', 'pages,pages_language_overlay', $where, '', 'sorting', '', 'uid'
420
			);
421
		} else {
422
			$where = $this->getWhereClause($id, $searchFilter);
423
			$subpages = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
424
				'uid', 'pages', $where, '', 'sorting', '', 'uid'
425
			);
426
		}
368 427

  
369 428
		return $subpages;
370 429
	}
typo3_src-4.5.23_changed/t3lib/tree/pagetree/class.t3lib_tree_pagetree_node.php 2013-03-04 11:24:30.000000000 +0100
145 145
	}
146 146

  
147 147
	/**
148
	 * Sets the language
149
	 *
150
	 * @param int $language
151
	 * @return void
152
	 */
153
	public function setLanguage($language) {
154
		$this->language = $language;
155
	}
156

  
157
	/**
158
	 * Returns the language
159
	 *
160
	 * @return int
161
	 */
162
	public function getLanguage() {
163
		return $this->language;
164
	}
165

  
166
	/**
148 167
	 * Checks if the user may create pages below the given page
149 168
	 *
150 169
	 * @return void
......
317 336
		$arrayRepresentation['nodeData']['workspaceId'] = $this->getWorkspaceId();
318 337
		$arrayRepresentation['nodeData']['isMountPoint'] = $this->isMountPoint();
319 338
		$arrayRepresentation['nodeData']['serializeClassName'] = get_class($this);
339
		$arrayRepresentation['nodeData']['language'] = $this->getLanguage();
320 340

  
321 341
		return $arrayRepresentation;
322 342
	}
......
333 353
		$this->setMountPoint($data['mountPoint']);
334 354
		$this->setReadableRootline($data['readableRootline']);
335 355
		$this->setIsMountPoint($data['isMountPoint']);
356
		$this->setLanguage($data['language']);
336 357
	}
337 358
}
338 359

  
typo3_src-4.5.23_changed/t3lib/tree/pagetree/extdirect/class.t3lib_tree_pagetree_extdirect_tree.php 2013-03-04 11:28:43.000000000 +0100
103 103

  
104 104
		$this->initDataProvider();
105 105
		if ($nodeId === 'root') {
106
			$nodeCollection = $this->dataProvider->getTreeMounts($searchFilter);
106
			$nodeCollection = $this->dataProvider->getTreeMounts($searchFilter, $nodeData->language);
107 107
		} else {
108
			$nodeCollection = $this->dataProvider->getFilteredNodes($node, $searchFilter, $node->getMountPoint());
108
			$nodeCollection = $this->dataProvider->getFilteredNodes($node, $searchFilter, $node->getMountPoint(), $nodeData->language);
109
		}
110

  
111
		return $nodeCollection->toArray();
112
	}
113

  
114
	/**
115
	 * Fetches the next tree level with titles in choosen language
116
	 *
117
	 * @param int $nodeId
118
	 * @param stdClass $nodeData
119
	 * @param int $language
120
	 * @return array
121
	 */
122
	public function getLanguageTree($nodeId, $nodeData, $language = 0) {
123
		$language = intval($language);
124
		$this->initDataProvider();
125

  
126
		/** @var $node t3lib_tree_pagetree_Node */
127
		$node = t3lib_div::makeInstance('t3lib_tree_pagetree_Node', (array) $nodeData);
128

  
129
		if ($nodeId === 'root') {
130
			$nodeCollection = $this->dataProvider->getTreeMounts('', $language);
131
		} else {
132
			$nodeCollection = $this->dataProvider->getNodes($node, 0, 0, $language);
109 133
		}
110 134

  
111 135
		return $nodeCollection->toArray();
......
197 221
				'dropZoneElementRemoved' => $GLOBALS['LANG']->sL($file . 'tree.dropZoneElementRemoved', TRUE),
198 222
				'dropZoneElementRestored' => $GLOBALS['LANG']->sL($file . 'tree.dropZoneElementRestored', TRUE),
199 223
				'searchTermInfo' => $GLOBALS['LANG']->sL($file . 'tree.searchTermInfo', TRUE),
224
				'comboLanguage' => $GLOBALS['LANG']->sL($file . 'tree.comboLanguage', TRUE),
200 225
				'temporaryMountPointIndicatorInfo' => $GLOBALS['LANG']->sl($file . 'labels.temporaryDBmount', TRUE),
201 226
				'deleteDialogTitle' => $GLOBALS['LANG']->sL('LLL:EXT:cms/layout/locallang.xml:deleteItem', TRUE),
202 227
				'deleteDialogMessage' => $GLOBALS['LANG']->sL('LLL:EXT:cms/layout/locallang.xml:deleteWarning', TRUE),
......
205 230

  
206 231
			'Configuration' => array(
207 232
				'hideFilter' => $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.hideFilter'),
233
				'hideLanguageSelection' => $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.hideLanguageSelection'),
208 234
				'displayDeleteConfirmation' => $GLOBALS['BE_USER']->jsConfirmation(4),
209 235
				'canDeleteRecursivly' => $GLOBALS['BE_USER']->uc['recursiveDelete'] == TRUE,
210 236
				'disableIconLinkToContextmenu' => $GLOBALS['BE_USER']->getTSConfigVal(
......
227 253

  
228 254
		return $configuration;
229 255
	}
256

  
257

  
258
	/**
259
	 * Returns the json encoded list of system languages (id and title)
260
	 *
261
	 *
262
	 * @return string
263
	 */
264

  
265
	public function getLanguages() {
266
// in v6.0
267
//		$backendUtility = t3lib_div::makeInstance('BackendUtility');
268
//		$languages = $backendUtility->getSystemLanguages();
269
			// There is no way to get only active system languages via t3lib_BEfunc::getSystemLanguages
270
			// TODO ??
271
		$languages = t3lib_BEfunc::getSystemLanguages();
272
		$systemLanguages = array();
273
		foreach ($languages as $language) {
274
			$systemLanguages[] = array('lid' => $language[1],
275
						'languageLabel' => $language[0]);
276
				
277
		}
278

  
279
		return json_encode($systemLanguages);
280
	}
230 281
}
231 282

  
232 283
if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/tree/pagetree/extdirect/class.t3lib_tree_pagetree_extdirect_tree.php'])) {
typo3_src-4.5.23_changed/typo3/sysext/lang/locallang_core.xml 2013-03-04 00:55:36.000000000 +0100
268 268
			<label index="tree.buttonNewNode">Create new pages</label>
269 269
			<label index="tree.buttonFilter">Filter tree</label>
270 270
			<label index="tree.searchTermInfo">Enter search term</label>
271
			<label index="tree.comboLanguage">Choose language</label>
272
			<label index="tree.StandardLanguagePageTitle">Standard title: </label>
273
			<label index="tree.NoAlternativePageTitle">No alternative page title defined. Double click on title to edit and delete square brackets to create one</label>
271 274
			<label index="warning.install_password">The Install Tool is still using the default password &quot;joh316&quot;. Update this within the %sAbout section%s of the Install Tool.</label>
272 275
			<label index="warning.backend_admin">The default backend user "admin" with password &quot;password&quot; is still present. %sEdit this account%s, either deleting it completely or changing the username and password.</label>
273 276
			<label index="warning.file_deny_pattern">The value of fileDenyPattern is not set to its default:%s If TYPO3 is running on Apache, a customized value might enable backend or frontend users to execute malicious php scripts.</label>