Feature #23768 ยป treeAndContextMenuAPI_v2.patch
tests/t3lib/tree/t3lib_tree_nodecollectionTest.php (Revision 0) | ||
---|---|---|
<?php
|
||
/***************************************************************
|
||
* Copyright notice
|
||
*
|
||
* (c) 2010 Stefan Galinski <stefan.galinski@gmail.com>
|
||
* All rights reserved
|
||
*
|
||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||
* free software; you can redistribute it and/or modify
|
||
* it under the terms of the GNU General Public License as published by
|
||
* the Free Software Foundation; either version 2 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* The GNU General Public License can be found at
|
||
* http://www.gnu.org/copyleft/gpl.html.
|
||
*
|
||
* This script is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
* GNU General Public License for more details.
|
||
*
|
||
* This copyright notice MUST APPEAR in all copies of the script!
|
||
***************************************************************/
|
||
/**
|
||
* Testcase for class t3lib_tree_NodeCollection.
|
||
*
|
||
* @author Stefan Galinski <stefan.galinski@gmail.com>
|
||
* @package TYPO3
|
||
* @subpackage t3lib
|
||
*/
|
||
class t3lib_tree_NodeCollectionTest extends tx_phpunit_testcase {
|
||
public function setUp() {
|
||
}
|
||
public function tearDown() {
|
||
}
|
||
/**
|
||
* @test
|
||
*/
|
||
public function sortNodes() {
|
||
$nodeCollection = new t3lib_tree_NodeCollection(array(
|
||
array('serializeClassName' => 't3lib_tree_Node', 'id' => 15),
|
||
array('serializeClassName' => 't3lib_tree_Node', 'id' => 25),
|
||
array('serializeClassName' => 't3lib_tree_Node', 'id' => 5),
|
||
array('serializeClassName' => 't3lib_tree_Node', 'id' => 2),
|
||
array('serializeClassName' => 't3lib_tree_Node', 'id' => 150),
|
||
array('serializeClassName' => 't3lib_tree_Node', 'id' => 67),
|
||
));
|
||
$nodeCollection->asort();
|
||
$expected = array(2, 5, 15, 25, 67, 150);
|
||
$ids = array();
|
||
foreach ($nodeCollection as $node) {
|
||
$ids[] = $node->getId();
|
||
}
|
||
$this->assertSame($expected, $ids);
|
||
}
|
||
}
|
||
?>
|
tests/t3lib/tree/t3lib_tree_sortednodecollectionTest.php (Revision 0) | ||
---|---|---|
<?php
|
||
/***************************************************************
|
||
* Copyright notice
|
||
*
|
||
* (c) 2010 Stefan Galinski <stefan.galinski@gmail.com>
|
||
* All rights reserved
|
||
*
|
||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||
* free software; you can redistribute it and/or modify
|
||
* it under the terms of the GNU General Public License as published by
|
||
* the Free Software Foundation; either version 2 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* The GNU General Public License can be found at
|
||
* http://www.gnu.org/copyleft/gpl.html.
|
||
*
|
||
* This script is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
* GNU General Public License for more details.
|
||
*
|
||
* This copyright notice MUST APPEAR in all copies of the script!
|
||
***************************************************************/
|
||
/**
|
||
* Testcase for class t3lib_tree_SortedNodeCollection.
|
||
*
|
||
* @author Stefan Galinski <stefan.galinski@gmail.com>
|
||
* @package TYPO3
|
||
* @subpackage t3lib
|
||
*/
|
||
class t3lib_tree_SortedNodeCollectionTest extends tx_phpunit_testcase {
|
||
public function setUp() {
|
||
}
|
||
public function tearDown() {
|
||
}
|
||
protected function createTestCollection() {
|
||
$nodeCollection = new t3lib_tree_SortedNodeCollection();
|
||
$node = new t3lib_tree_Node(array('id' => 5));
|
||
$nodeCollection->addNode($node);
|
||
$node = new t3lib_tree_Node(array('id' => 15));
|
||
$nodeCollection->addNode($node);
|
||
$node = new t3lib_tree_Node(array('id' => 3));
|
||
$nodeCollection->addNode($node);
|
||
return $nodeCollection;
|
||
}
|
||
protected function createTestCollectionWithTwoNodes() {
|
||
$nodeCollection = new t3lib_tree_SortedNodeCollection();
|
||
$node = new t3lib_tree_Node(array('id' => 5));
|
||
$nodeCollection->addNode($node);
|
||
$node = new t3lib_tree_Node(array('id' => 3));
|
||
$nodeCollection->addNode($node);
|
||
return $nodeCollection;
|
||
}
|
||
/**
|
||
* @test
|
||
*/
|
||
public function addNodesSorted() {
|
||
$nodeCollection = $this->createTestCollection();
|
||
|
||
$expected = array(3, 5, 15);
|
||
$ids = array();
|
||
foreach ($nodeCollection as $node) {
|
||
$ids[] = $node->getId();
|
||
}
|
||
$this->assertSame($expected, $ids);
|
||
}
|
||
/**
|
||
* @test
|
||
*/
|
||
public function removeNodeByNodeId() {
|
||
$nodeCollection = $this->createTestCollection();
|
||
$node = new t3lib_tree_Node(array('id' => '5'));
|
||
$nodeCollection->removeNode($node);
|
||
$expected = array(3, 15);
|
||
$ids = array();
|
||
foreach ($nodeCollection as $node) {
|
||
$ids[] = $node->getId();
|
||
}
|
||
$this->assertSame($expected, $ids);
|
||
}
|
||
/**
|
||
* @test
|
||
*/
|
||
public function collectionContainsNode() {
|
||
$nodeCollection = $this->createTestCollection();
|
||
$node = new t3lib_tree_Node(array('id' => 5));
|
||
$this->assertTrue($nodeCollection->contains($node));
|
||
}
|
||
/**
|
||
* @test
|
||
*/
|
||
public function searchDataWithBinarySearch() {
|
||
$nodeCollection = $this->createTestCollection();
|
||
$node = new t3lib_tree_Node(array('id' => 15));
|
||
$this->assertTrue($nodeCollection->contains($node));
|
||
$node = new t3lib_tree_Node(array('id' => 99));
|
||
$this->assertFalse($nodeCollection->contains($node));
|
||
$nodeCollection = $this->createTestCollectionWithTwoNodes();
|
||
$node = new t3lib_tree_Node(array('id' => 3));
|
||
$this->assertTrue($nodeCollection->contains($node));
|
||
$node = new t3lib_tree_Node(array('id' => 99));
|
||
$this->assertFalse($nodeCollection->contains($node));
|
||
}
|
||
}
|
||
?>
|
tests/t3lib/tree/t3lib_tree_nodeTest.php (Revision 0) | ||
---|---|---|
<?php
|
||
/***************************************************************
|
||
* Copyright notice
|
||
*
|
||
* (c) 2010 Stefan Galinski <stefan.galinski@gmail.com>
|
||
* All rights reserved
|
||
*
|
||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||
* free software; you can redistribute it and/or modify
|
||
* it under the terms of the GNU General Public License as published by
|
||
* the Free Software Foundation; either version 2 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* The GNU General Public License can be found at
|
||
* http://www.gnu.org/copyleft/gpl.html.
|
||
*
|
||
* This script is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
* GNU General Public License for more details.
|
||
*
|
||
* This copyright notice MUST APPEAR in all copies of the script!
|
||
***************************************************************/
|
||
/**
|
||
* Testcase for class t3lib_tree_Node.
|
||
*
|
||
* @author Stefan Galinski <stefan.galinski@gmail.com>
|
||
* @package TYPO3
|
||
* @subpackage t3lib
|
||
*/
|
||
class t3lib_tree_NodeTest extends tx_phpunit_testcase {
|
||
public function setUp() {
|
||
}
|
||
public function tearDown() {
|
||
}
|
||
protected function setUpNodeTestData() {
|
||
$fixture = new t3lib_tree_Node;
|
||
$fixture->setId('Root');
|
||
$nodeCollection = new t3lib_tree_NodeCollection;
|
||
for ($i = 0; $i < 10; ++$i) {
|
||
$node = new t3lib_tree_Node;
|
||
$node->setId($i);
|
||
$node->setParentNode($fixture);
|
||
$subNodeCollection = new t3lib_tree_NodeCollection;
|
||
for ($j = 0; $j < 5; ++$j) {
|
||
$subNode = new t3lib_tree_RepresentationNode;
|
||
$subNode->setId($j);
|
||
$subNode->setLabel('SubTest');
|
||
$subNode->setType('Type');
|
||
$subNode->setClass('Class');
|
||
$subNode->setIcon('Icon');
|
||
$subNode->setCallbackAction('Callback Action');
|
||
$subNode->setParentNode($node);
|
||
$subNodeCollection->append($subNode);
|
||
}
|
||
$node->setChildNodes($subNodeCollection);
|
||
$nodeCollection->append($node);
|
||
}
|
||
$fixture->setChildNodes($nodeCollection);
|
||
return $fixture;
|
||
}
|
||
/**
|
||
* @test
|
||
*/
|
||
public function serializeFixture() {
|
||
$expected = file_get_contents(PATH_site . 'tests/t3lib/tree/fixtures/serialized.txt');
|
||
$fixture = $this->setUpNodeTestData();
|
||
$serializedString = $fixture->serialize();
|
||
$this->assertSame($expected, $serializedString);
|
||
}
|
||
/**
|
||
* @test
|
||
*/
|
||
public function deserializeFixture() {
|
||
$source = file_get_contents(PATH_site . 'tests/t3lib/tree/fixtures/serialized.txt');
|
||
$node = new t3lib_tree_Node;
|
||
$node->unserialize($source);
|
||
$serializedString = $node->serialize();
|
||
$this->assertSame($source, $serializedString);
|
||
}
|
||
/**
|
||
* @test
|
||
*/
|
||
public function compareNodes() {
|
||
$node = new t3lib_tree_Node(array('id' => '15'));
|
||
$otherNode = new t3lib_tree_Node(array('id' => '5'));
|
||
$compareResult = $node->compareTo($otherNode);
|
||
$otherNode->setId('25');
|
||
$compareResult = $node->compareTo($otherNode);
|
||
$this->assertSame(-1, $compareResult);
|
||
$otherNode->setId('15');
|
||
$compareResult = $node->compareTo($otherNode);
|
||
$this->assertSame(0, $compareResult);
|
||
}
|
||
}
|
||
?>
|
tests/t3lib/tree/fixtures/serialized.txt (Revision 0) | ||
---|---|---|
a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";a:11:{s:18:"serializeClassName";s:25:"t3lib_tree_NodeCollection";i:0;a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:0;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";a:6:{s:18:"serializeClassName";s:25:"t3lib_tree_NodeCollection";i:0;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:0;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:0;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:1;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:1;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:0;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:2;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:2;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:0;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:3;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:3;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:0;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:4;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:4;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:0;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}}}i:1;a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:1;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";a:6:{s:18:"serializeClassName";s:25:"t3lib_tree_NodeCollection";i:0;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:0;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:1;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:1;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:1;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:1;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:2;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:2;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:1;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:3;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:3;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:1;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:4;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:4;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:1;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}}}i:2;a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:2;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";a:6:{s:18:"serializeClassName";s:25:"t3lib_tree_NodeCollection";i:0;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:0;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:2;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:1;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:1;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:2;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:2;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:2;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:2;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:3;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:3;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:2;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:4;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:4;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:2;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}}}i:3;a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:3;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";a:6:{s:18:"serializeClassName";s:25:"t3lib_tree_NodeCollection";i:0;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:0;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:3;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:1;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:1;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:3;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:2;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:2;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:3;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:3;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:3;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:3;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:4;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:4;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:3;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}}}i:4;a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:4;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";a:6:{s:18:"serializeClassName";s:25:"t3lib_tree_NodeCollection";i:0;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:0;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:4;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:1;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:1;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:4;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:2;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:2;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:4;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:3;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:3;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:4;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:4;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:4;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:4;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}}}i:5;a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:5;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";a:6:{s:18:"serializeClassName";s:25:"t3lib_tree_NodeCollection";i:0;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:0;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:5;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:1;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:1;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:5;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:2;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:2;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:5;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:3;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:3;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:5;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:4;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:4;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:5;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}}}i:6;a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:6;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";a:6:{s:18:"serializeClassName";s:25:"t3lib_tree_NodeCollection";i:0;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:0;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:6;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:1;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:1;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:6;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:2;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:2;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:6;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:3;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:3;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:6;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:4;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:4;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:6;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}}}i:7;a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:7;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";a:6:{s:18:"serializeClassName";s:25:"t3lib_tree_NodeCollection";i:0;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:0;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:7;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:1;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:1;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:7;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:2;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:2;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:7;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:3;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:3;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:7;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:4;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:4;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:7;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}}}i:8;a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:8;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";a:6:{s:18:"serializeClassName";s:25:"t3lib_tree_NodeCollection";i:0;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:0;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:8;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:1;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:1;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:8;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:2;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:2;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:8;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:3;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:3;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:8;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:4;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:4;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:8;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}}}i:9;a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:9;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";a:6:{s:18:"serializeClassName";s:25:"t3lib_tree_NodeCollection";i:0;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:0;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:9;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:1;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:1;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:9;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:2;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:2;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:9;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:3;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:3;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:9;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}i:4;a:9:{s:18:"serializeClassName";s:29:"t3lib_tree_RepresentationNode";s:2:"id";i:4;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";i:9;s:10:"parentNode";a:4:{s:18:"serializeClassName";s:15:"t3lib_tree_Node";s:2:"id";s:4:"Root";s:10:"parentNode";s:0:"";s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";}s:10:"childNodes";s:0:"";s:5:"label";s:7:"SubTest";s:4:"type";s:4:"Type";s:5:"class";s:5:"Class";s:4:"icon";s:4:"Icon";s:14:"callbackAction";s:15:"Callback Action";}}}}}
|
t3lib/interfaces/tree/interface.t3lib_tree_draggableanddropable.php (Revision 0) | ||
---|---|---|
<?php
|
||
/***************************************************************
|
||
* Copyright notice
|
||
*
|
||
* (c) 2010 TYPO3 Tree Team <http://forge.typo3.org/projects/typo3v4-extjstrees>
|
||
* All rights reserved
|
||
*
|
||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||
* free software; you can redistribute it and/or modify
|
||
* it under the terms of the GNU General Public License as published by
|
||
* the Free Software Foundation; either version 2 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* The GNU General Public License can be found at
|
||
* http://www.gnu.org/copyleft/gpl.html.
|
||
* A copy is found in the textfile GPL.txt and important notices to the license
|
||
* from the author is found in LICENSE.txt distributed with these scripts.
|
||
*
|
||
*
|
||
* This script is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
* GNU General Public License for more details.
|
||
*
|
||
* This copyright notice MUST APPEAR in all copies of the script!
|
||
***************************************************************/
|
||
/**
|
||
* Describes necessary methods if the nodes are draggable and dropable
|
||
* within the tree.
|
||
*
|
||
* @author Stefan Galinski <stefan.galinski@gmail.com>
|
||
* @author Steffen Ritter <info@steffen-ritter.net>
|
||
* @package TYPO3
|
||
* @subpackage t3lib
|
||
*/
|
||
interface t3lib_tree_DraggableAndDropable {
|
||
/**
|
||
* Moves given node inside a destination node
|
||
*
|
||
* @param t3lib_tree_Node $node
|
||
* @param t3lib_tree_Node $destination
|
||
* @return void
|
||
*/
|
||
public function moveNodeInDestinationNode($node, $destination);
|
||
/**
|
||
* Moves given node after a destination node
|
||
*
|
||
* @param t3lib_tree_Node $node
|
||
* @param t3lib_tree_Node $destination
|
||
* @return void
|
||
*/
|
||
public function moveNodeAfterDestinationNode($node, $destination);
|
||
/**
|
||
* Copies given node inside a destination node
|
||
*
|
||
* @param t3lib_tree_Node $node
|
||
* @param t3lib_tree_Node $destination
|
||
* @return void
|
||
*/
|
||
public function copyNodeInDestinationNode($node, $destination);
|
||
/**
|
||
* Copies given node after a destination node
|
||
*
|
||
* @param t3lib_tree_Node $node
|
||
* @param t3lib_tree_Node $destination
|
||
* @return void
|
||
*/
|
||
public function copyNodeAfterDestinationNode($node, $destination);
|
||
}
|
t3lib/interfaces/tree/interface.t3lib_tree_labeleditable.php (Revision 0) | ||
---|---|---|
<?php
|
||
/***************************************************************
|
||
* Copyright notice
|
||
*
|
||
* (c) 2010 TYPO3 Tree Team <http://forge.typo3.org/projects/typo3v4-extjstrees>
|
||
* All rights reserved
|
||
*
|
||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||
* free software; you can redistribute it and/or modify
|
||
* it under the terms of the GNU General Public License as published by
|
||
* the Free Software Foundation; either version 2 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* The GNU General Public License can be found at
|
||
* http://www.gnu.org/copyleft/gpl.html.
|
||
* A copy is found in the textfile GPL.txt and important notices to the license
|
||
* from the author is found in LICENSE.txt distributed with these scripts.
|
||
*
|
||
*
|
||
* This script is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
* GNU General Public License for more details.
|
||
*
|
||
* This copyright notice MUST APPEAR in all copies of the script!
|
||
***************************************************************/
|
||
/**
|
||
* Describes necessary methods if the node label should be editable
|
||
* within the tree.
|
||
*
|
||
* @author Stefan Galinski <stefan.galinski@gmail.com>
|
||
* @author Steffen Ritter <info@steffen-ritter.net>
|
||
* @package TYPO3
|
||
* @subpackage t3lib
|
||
*/
|
||
interface t3lib_tree_LabelEditable {
|
||
/**
|
||
* Sets the new label
|
||
*
|
||
* @param string $label
|
||
* @return void
|
||
*/
|
||
public function setLabel($label);
|
||
}
|
t3lib/interfaces/tree/interface.t3lib_tree_comparablenode.php (Revision 0) | ||
---|---|---|
<?php
|
||
/***************************************************************
|
||
* Copyright notice
|
||
*
|
||
* (c) 2010 TYPO3 Tree Team <http://forge.typo3.org/projects/typo3v4-extjstrees>
|
||
* All rights reserved
|
||
*
|
||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||
* free software; you can redistribute it and/or modify
|
||
* it under the terms of the GNU General Public License as published by
|
||
* the Free Software Foundation; either version 2 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* The GNU General Public License can be found at
|
||
* http://www.gnu.org/copyleft/gpl.html.
|
||
* A copy is found in the textfile GPL.txt and important notices to the license
|
||
* from the author is found in LICENSE.txt distributed with these scripts.
|
||
*
|
||
*
|
||
* This script is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
* GNU General Public License for more details.
|
||
*
|
||
* This copyright notice MUST APPEAR in all copies of the script!
|
||
***************************************************************/
|
||
/**
|
||
* Interface that defines the comparison of nodes
|
||
*
|
||
* @author Stefan Galinski <stefan.galinski@gmail.com>
|
||
* @package TYPO3
|
||
* @subpackage t3lib
|
||
*/
|
||
interface t3lib_tree_ComparableNode {
|
||
/**
|
||
* Compare Node against another one
|
||
*
|
||
* Returns:
|
||
* 1 if the current node is greater than the $other,
|
||
* -1 if $other is greater than the current node and
|
||
* 0 if the nodes are equal
|
||
*
|
||
* <strong>Example</strong>
|
||
* <pre>
|
||
* if ($this->sortValue > $other->sortValue) {
|
||
* return 1;
|
||
* } elseif ($this->sortValue < $other->sortValue) {
|
||
* return -1;
|
||
* } else {
|
||
* return 0;
|
||
* }
|
||
* </pre>
|
||
*
|
||
* @param t3lib_tree_Node $other
|
||
* @return integer see description
|
||
*/
|
||
public function compareTo($other);
|
||
}
|
t3lib/tree/class.t3lib_tree_abstractstateprovider.php (Revision 0) | ||
---|---|---|
<?php
|
||
/***************************************************************
|
||
* Copyright notice
|
||
*
|
||
* (c) 2010 TYPO3 Tree Team <http://forge.typo3.org/projects/typo3v4-extjstrees>
|
||
* All rights reserved
|
||
*
|
||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||
* free software; you can redistribute it and/or modify
|
||
* it under the terms of the GNU General Public License as published by
|
||
* the Free Software Foundation; either version 2 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* The GNU General Public License can be found at
|
||
* http://www.gnu.org/copyleft/gpl.html.
|
||
* A copy is found in the textfile GPL.txt and important notices to the license
|
||
* from the author is found in LICENSE.txt distributed with these scripts.
|
||
*
|
||
*
|
||
* This script is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
* GNU General Public License for more details.
|
||
*
|
||
* This copyright notice MUST APPEAR in all copies of the script!
|
||
***************************************************************/
|
||
/**
|
||
* Abstract State Provider
|
||
*
|
||
* @TODO This class is incomplete, because the methods still need
|
||
* some variables or other state object
|
||
*
|
||
* @author Stefan Galinski <stefan.galinski@gmail.com>
|
||
* @author Steffen Ritter <info@steffen-ritter.net>
|
||
* @package TYPO3
|
||
* @subpackage t3lib
|
||
*/
|
||
abstract class t3lib_tree_AbstractStateProvider {
|
||
/**
|
||
* Sets the current tree state
|
||
* @return void
|
||
*/
|
||
abstract public function setState();
|
||
/**
|
||
* Returns the last tree state
|
||
* @return something
|
||
*/
|
||
abstract public function getState();
|
||
}
|
t3lib/tree/renderer/class.t3lib_tree_renderer_abstract.php (Revision 0) | ||
---|---|---|
<?php
|
||
/***************************************************************
|
||
* Copyright notice
|
||
*
|
||
* (c) 2010 TYPO3 Tree Team <http://forge.typo3.org/projects/typo3v4-extjstrees>
|
||
* All rights reserved
|
||
*
|
||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||
* free software; you can redistribute it and/or modify
|
||
* it under the terms of the GNU General Public License as published by
|
||
* the Free Software Foundation; either version 2 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* The GNU General Public License can be found at
|
||
* http://www.gnu.org/copyleft/gpl.html.
|
||
* A copy is found in the textfile GPL.txt and important notices to the license
|
||
* from the author is found in LICENSE.txt distributed with these scripts.
|
||
*
|
||
*
|
||
* This script is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
* GNU General Public License for more details.
|
||
*
|
||
* This copyright notice MUST APPEAR in all copies of the script!
|
||
***************************************************************/
|
||
/**
|
||
* Abstract Renderer
|
||
*
|
||
* @author Steffen Ritter <info@steffen-ritter.net>
|
||
* @package TYPO3
|
||
* @subpackage t3lib
|
||
*/
|
||
abstract class t3lib_tree_renderer_Abstract {
|
||
/**
|
||
* Renders a node recursive or just a single instance
|
||
*
|
||
* @param t3lib_tree_RepresentationNode $node
|
||
* @param bool $recursive
|
||
* @return mixed
|
||
*/
|
||
abstract public function renderNode(t3lib_tree_RepresentationNode $node, $recursive = TRUE);
|
||
/**
|
||
* Renders a node collection recursive or just a single instance
|
||
*
|
||
* @param t3lib_tree_NodeCollection $node
|
||
* @param bool $recursive
|
||
* @return mixed
|
||
*/
|
||
abstract public function renderNodeCollection(t3lib_tree_NodeCollection $collection, $recursive = TRUE);
|
||
/**
|
||
* Renders an tree recursive or just a single instance
|
||
*
|
||
* @param t3lib_tree_AbstractTree $node
|
||
* @param bool $recursive
|
||
* @return mixed
|
||
*/
|
||
abstract public function renderTree(t3lib_tree_AbstractTree $tree, $recursive = TRUE);
|
||
}
|
t3lib/tree/renderer/class.t3lib_tree_renderer_unorderedlist.php (Revision 0) | ||
---|---|---|
<?php
|
||
/***************************************************************
|
||
* Copyright notice
|
||
*
|
||
* (c) 2010 TYPO3 Tree Team <http://forge.typo3.org/projects/typo3v4-extjstrees>
|
||
* All rights reserved
|
||
*
|
||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||
* free software; you can redistribute it and/or modify
|
||
* it under the terms of the GNU General Public License as published by
|
||
* the Free Software Foundation; either version 2 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* The GNU General Public License can be found at
|
||
* http://www.gnu.org/copyleft/gpl.html.
|
||
* A copy is found in the textfile GPL.txt and important notices to the license
|
||
* from the author is found in LICENSE.txt distributed with these scripts.
|
||
*
|
||
*
|
||
* This script is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
* GNU General Public License for more details.
|
||
*
|
||
* This copyright notice MUST APPEAR in all copies of the script!
|
||
***************************************************************/
|
||
/**
|
||
* Renderer for unordered lists
|
||
*
|
||
* @author Steffen Ritter <info@steffen-ritter.net>
|
||
* @package TYPO3
|
||
* @subpackage t3lib
|
||
*/
|
||
class t3lib_tree_renderer_UnorderedList extends t3lib_tree_renderer_Abstract {
|
||
/**
|
||
* recursion level
|
||
*
|
||
* @var int
|
||
*/
|
||
protected $recursionLevel = 0;
|
||
|
||
/**
|
||
* Renders a node recursive or just a single instance
|
||
*
|
||
* @param t3lib_tree_RepresentationNode $node
|
||
* @param bool $recursive
|
||
* @return mixed
|
||
*/
|
||
public function renderNode(t3lib_tree_RepresentationNode $node, $recursive = TRUE) {
|
||
$code = '<li><span class="' . $node->getIcon() .'"> </span>' . $node->getLabel();
|
||
if ($recursive && $node->getChildNodes() !== NULL) {
|
||
$this->recursionLevel++;
|
||
$code .= $this->renderCollection($node->getChildNodes());
|
||
$this->recursionLevel--;
|
||
|
||
}
|
||
$code .= '</li>';
|
||
return $code;
|
||
}
|
||
/**
|
||
* Renders a node collection recursive or just a single instance
|
||
*
|
||
* @param t3lib_tree_NodeCollection $node
|
||
* @param bool $recursive
|
||
* @return mixed
|
||
*/
|
||
public function renderTree(t3lib_tree_AbstractTree $tree, $recursive = TRUE) {
|
||
$this->recursionLevel = 0;
|
||
$code = '<ul class="level' . $this->recursionLevel . '" style="margin-left:10px">';
|
||
$code .= $this->renderNode($tree->getRoot(), $recursive);
|
||
$code .= '</ul>';
|
||
return $code;
|
||
}
|
||
/**
|
||
* Renders an tree recursive or just a single instance
|
||
*
|
||
* @param t3lib_tree_AbstractTree $node
|
||
* @param bool $recursive
|
||
* @return mixed
|
||
*/
|
||
public function renderNodeCollection(t3lib_tree_NodeCollection $collection, $recursive = TRUE) {
|
||
$code = '<ul class="level' . $this->recursionLevel . '" style="margin-left:10px">';
|
||
foreach($collection as $node) {
|
||
$code .= $this->renderNode($node, $recursive);
|
||
}
|
||
$code .= '</ul>';
|
||
return $code;
|
||
}
|
||
}
|
t3lib/tree/class.t3lib_tree_nodecollection.php (Revision 0) | ||
---|---|---|
<?php
|
||
/***************************************************************
|
||
* Copyright notice
|
||
*
|
||
* (c) 2010 TYPO3 Tree Team <http://forge.typo3.org/projects/typo3v4-extjstrees>
|
||
* All rights reserved
|
||
*
|
||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||
* free software; you can redistribute it and/or modify
|
||
* it under the terms of the GNU General Public License as published by
|
||
* the Free Software Foundation; either version 2 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* The GNU General Public License can be found at
|
||
* http://www.gnu.org/copyleft/gpl.html.
|
||
* A copy is found in the textfile GPL.txt and important notices to the license
|
||
* from the author is found in LICENSE.txt distributed with these scripts.
|
||
*
|
||
*
|
||
* This script is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
* GNU General Public License for more details.
|
||
*
|
||
* This copyright notice MUST APPEAR in all copies of the script!
|
||
***************************************************************/
|
||
/**
|
||
* Tree Node Collection
|
||
*
|
||
* @author Stefan Galinski <stefan.galinski@gmail.com>
|
||
* @author Steffen Ritter <info@steffen-ritter.net>
|
||
* @package TYPO3
|
||
* @subpackage t3lib
|
||
*/
|
||
class t3lib_tree_NodeCollection extends ArrayObject {
|
||
/**
|
||
* Constructor
|
||
*
|
||
* You can move an initial data array to initialize the instance and further objects.
|
||
* This is useful for the deserialization.
|
||
*
|
||
* @param array $data
|
||
*/
|
||
public function __construct(array $data = array()) {
|
||
if (count($data)) {
|
||
$this->dataFromArray($data);
|
||
}
|
||
}
|
||
/**
|
||
* Sorts the internal nodes array
|
||
*
|
||
* @return void
|
||
*/
|
||
public function asort() {
|
||
$this->uasort(array($this, 'nodeCompare'));
|
||
}
|
||
/**
|
||
* Compares a node with another one
|
||
*
|
||
* @noapi
|
||
* @see t3lib_tree_Node::compareTo
|
||
* @return void
|
||
*/
|
||
public function nodeCompare(t3lib_tree_Node $node, t3lib_tree_Node $otherNode) {
|
||
return $node->compareTo($otherNode);
|
||
}
|
||
/**
|
||
* Returns the serialized instance
|
||
*
|
||
* @return string
|
||
*/
|
||
public function serialize() {
|
||
return serialize($this->toArray());
|
||
}
|
||
/**
|
||
* Initializes the current object with a serialized instance
|
||
*
|
||
* @throws t3lib_exception if the deserialized is not identical to the current class
|
||
* @param string $serializedString
|
||
* @return void
|
||
*/
|
||
public function unserialize($serializedString) {
|
||
$arrayRepresentation = unserialize($serializedString);
|
||
if ($arrayRepresentation['serializeClassName'] !== get_class($this)) {
|
||
throw new t3lib_exception('Deserialized object type is not identical!');
|
||
}
|
||
$this->dataFromArray($arrayRepresentation);
|
||
}
|
||
/**
|
||
* Returns the collection in an array representation for e.g. serialization
|
||
*
|
||
* @return array
|
||
*/
|
||
public function toArray() {
|
||
$arrayRepresentation = array(
|
||
'serializeClassName' => get_class($this),
|
||
);
|
||
$iterator = $this->getIterator();
|
||
while ($iterator->valid()) {
|
||
$arrayRepresentation[] = $iterator->current()->toArray();
|
||
$iterator->next();
|
||
}
|
||
return $arrayRepresentation;
|
||
}
|
||
/**
|
||
* Sets the data of the node collection by a given array
|
||
*
|
||
* @param array $data
|
||
* @return void
|
||
*/
|
||
public function dataFromArray($data) {
|
||
unset($data['serializeClassName']);
|
||
foreach ($data as $index => $nodeArray) {
|
||
$node = t3lib_div::makeInstance($nodeArray['serializeClassName'], $nodeArray);
|
||
$this->offsetSet($index, $node);
|
||
}
|
||
}
|
||
}
|
t3lib/tree/class.t3lib_tree_sortednodecollection.php (Revision 0) | ||
---|---|---|
<?php
|
||
/***************************************************************
|
||
* Copyright notice
|
||
*
|
||
* (c) 2010 TYPO3 Tree Team <http://forge.typo3.org/projects/typo3v4-extjstrees>
|
||
* All rights reserved
|
||
*
|
||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||
* free software; you can redistribute it and/or modify
|
||
* it under the terms of the GNU General Public License as published by
|
||
* the Free Software Foundation; either version 2 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* The GNU General Public License can be found at
|
||
* http://www.gnu.org/copyleft/gpl.html.
|
||
* A copy is found in the textfile GPL.txt and important notices to the license
|
||
* from the author is found in LICENSE.txt distributed with these scripts.
|
||
*
|
||
*
|
||
* This script is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
* GNU General Public License for more details.
|
||
*
|
||
* This copyright notice MUST APPEAR in all copies of the script!
|
||
***************************************************************/
|
||
/**
|
||
* Sorted Tree Node Collection
|
||
*
|
||
* Note: This collection works only with integers as offset keys and not
|
||
* with much datasets. You have been warned!
|
||
*
|
||
* @author Stefan Galinski <stefan.galinski@gmail.com>
|
||
* @author Steffen Ritter <info@steffen-ritter.net>
|
||
* @package TYPO3
|
||
* @subpackage t3lib
|
||
*/
|
||
class t3lib_tree_SortedNodeCollection extends t3lib_tree_NodeCollection {
|
||
/**
|
||
* Checks if a specific node is inside the collection
|
||
*
|
||
* @param t3lib_tree_Node $node
|
||
* @return boolean
|
||
*/
|
||
public function contains(t3lib_tree_Node $node) {
|
||
return $this->offsetOf($node) !== -1;
|
||
}
|
||
/**
|
||
* Returns the offset key of given node
|
||
*
|
||
* @param t3lib_tree_Node $node
|
||
* @return int
|
||
*/
|
||
protected function offsetOf(t3lib_tree_Node $node) {
|
||
return $this->binarySearch($node, 0, $this->count() - 1);
|
||
}
|
||
/**
|
||
* Binary search that returns the offset of a given node
|
||
*
|
||
* @param t3lib_tree_Node $node
|
||
* @param int $start
|
||
* @param int $end
|
||
* @return int
|
||
*/
|
||
protected function binarySearch(t3lib_tree_Node $node, $start, $end) {
|
||
if ((!$start && ($end - $start) >= 2) || ($end - $start) > 2) {
|
||
$divider = ceil(($end - $start) / 2);
|
||
if ($this->offsetGet($divider)->equals($node)) {
|
||
return $divider;
|
||
} elseif ($this->offsetGet($divider)->compareTo($node) > 0) {
|
||
return $this->binarySearch($node, $start , $divider - 1);
|
||
} else {
|
||
return $this->binarySearch($node, $divider + 1 , $end);
|
||
}
|
||
} else {
|
||
if ($this->offsetGet($start)->equals($node)) {
|
||
return $start;
|
||
} elseif ($this->offsetGet($end)->equals($node)) {
|
||
return $end;
|
||
} else {
|
||
return -1;
|
||
}
|
||
}
|
||
}
|
||
/**
|
||
* Normalizes the array by reordering the keys
|
||
*
|
||
* @return void
|
||
*/
|
||
protected function normalize() {
|
||
$nodes = array();
|
||
foreach ($this as $node) {
|
||
$nodes[] = $node;
|
||
}
|
||
$this->exchangeArray($nodes);
|
||
}
|
||
/**
|
||
* Adds a node to the internal list in a sorted approach
|
||
*
|
||
* @param t3lib_tree_Node $node
|
||
* @return void
|
||
*/
|
||
public function addNode(t3lib_tree_Node $node) {
|
||
$this->append($node);
|
||
$this->asort();
|
||
$this->normalize();
|
||
}
|
||
/**
|
||
* Removes a specific node from the internal array
|
||
*
|
||
* @param t3lib_tree_Node $node
|
||
* @return void
|
||
*/
|
||
public function removeNode(t3lib_tree_Node $node) {
|
||
$offset = $this->offsetOf($node);
|
||
if ($offset !== -1) {
|
||
$this->offsetUnset($offset);
|
||
$this->normalize();
|
||
}
|
||
}
|
||
}
|
t3lib/tree/class.t3lib_tree_abstracttree.php (Revision 0) | ||
---|---|---|
<?php
|
||
/***************************************************************
|
||
* Copyright notice
|
||
*
|
||
* (c) 2010 TYPO3 Tree Team <http://forge.typo3.org/projects/typo3v4-extjstrees>
|
||
* All rights reserved
|
||
*
|
||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||
* free software; you can redistribute it and/or modify
|
||
* it under the terms of the GNU General Public License as published by
|
||
* the Free Software Foundation; either version 2 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* The GNU General Public License can be found at
|
||
* http://www.gnu.org/copyleft/gpl.html.
|
||
* A copy is found in the textfile GPL.txt and important notices to the license
|
||
* from the author is found in LICENSE.txt distributed with these scripts.
|
||
*
|
||
*
|
||
* This script is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
* GNU General Public License for more details.
|
||
*
|
||
* This copyright notice MUST APPEAR in all copies of the script!
|
||
***************************************************************/
|
||
/**
|
||
* Abstract Tree
|
||
*
|
||
* @author Stefan Galinski <stefan.galinski@gmail.com>
|
||
* @package TYPO3
|
||
* @subpackage t3lib
|
||
*/
|
||
abstract class t3lib_tree_AbstractTree {
|
||
/**
|
||
* Data Provider
|
||
*
|
||
* @var t3lib_tree_AbstractDataProvider
|
||
*/
|
||
protected $dataProvider = NULL;
|
||
/**
|
||
* Tree Node Decorator
|
||
*
|
||
* @var t3lib_tree_renderer_Abstract
|
||
*/
|
||
protected $nodeRenderer = NULL;
|
||
/**
|
||
* @param t3lib_tree_AbstractDataProvider $dataProvider
|
||
* @return void
|
||
*/
|
||
public function setDataProvider(t3lib_tree_AbstractDataProvider $dataProvider) {
|
||
$this->dataProvider = $dataProvider;
|
||
}
|
||
/**
|
||
* @return t3lib_tree_AbstractDataProvider
|
||
*/
|
||
public function getDataProvider() {
|
||
return $this->dataProvider;
|
||
}
|
||
/**
|
||
* @param t3lib_tree_renderer_Abstract $dataProvider
|
||
* @return void
|
||
*/
|
||
public function setNodeRenderer(t3lib_tree_renderer_Abstract $nodeRenderer) {
|
||
$this->nodeRenderer = $nodeRenderer;
|
||
}
|
||
/**
|
||
* @return t3lib_tree_renderer_Abstract
|
||
*/
|
||
public function getNodeRenderer() {
|
||
return $this->nodeRenderer;
|
||
}
|
||
/**
|
||
* Returns the root node
|
||
*
|
||
* @return t3lib_tree_Node
|
||
*/
|
||
abstract public function getRoot();
|
||
}
|
||
?>
|
t3lib/tree/class.t3lib_tree_node.php (Revision 0) | ||
---|---|---|
<?php
|
||
/***************************************************************
|
||
* Copyright notice
|
||
*
|
||
* (c) 2010 TYPO3 Tree Team <http://forge.typo3.org/projects/typo3v4-extjstrees>
|
||
* All rights reserved
|
||
*
|
||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||
* free software; you can redistribute it and/or modify
|
||
* it under the terms of the GNU General Public License as published by
|
||
* the Free Software Foundation; either version 2 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* The GNU General Public License can be found at
|
||
* http://www.gnu.org/copyleft/gpl.html.
|
||
* A copy is found in the textfile GPL.txt and important notices to the license
|
||
* from the author is found in LICENSE.txt distributed with these scripts.
|
||
*
|
||
*
|
||
* This script is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
* GNU General Public License for more details.
|
||
*
|
||
* This copyright notice MUST APPEAR in all copies of the script!
|
||
***************************************************************/
|
||
/**
|
||
* Tree Node
|
||
*
|
||
* @author Stefan Galinski <stefan.galinski@gmail.com>
|
||
* @author Steffen Ritter <info@steffen-ritter.net>
|
||
* @package TYPO3
|
||
* @subpackage t3lib
|
||
*/
|
||
class t3lib_tree_Node implements t3lib_tree_ComparableNode, Serializable {
|
||
/**
|
||
* Node Identifier
|
||
*
|
||
* @var string
|
||
*/
|
||
protected $id = '';
|
||
/**
|
||
* Parent Node
|
||
*
|
||
* @var t3lib_tree_Node
|
||
*/
|
||
protected $parentNode = NULL;
|
||
/**
|
||
* Child Nodes
|
||
*
|
||
* @var t3lib_tree_NodeCollection
|
||
*/
|
||
protected $childNodes = NULL;
|
||
/**
|
||
* Constructor
|
||
*
|
||
* You can move an initial data array to initialize the instance and further objects.
|
||
* This is useful for the deserialization.
|
||
*
|
||
* @param array $data
|
||
* @return void
|
||
*/
|
||
public function __construct(array $data = array()) {
|
||
if (count($data)) {
|
||
$this->dataFromArray($data);
|
||
}
|
||
}
|
||
/**
|
||
* Sets the child nodes collection
|
||
*
|
||
* @param t3lib_tree_NodeCollection $childNodes
|
||
* @return void
|
||
*/
|
||
public function setChildNodes (t3lib_tree_NodeCollection $childNodes) {
|
||
$this->childNodes = $childNodes;
|
||
}
|
||
/**
|
||
* Removes child nodes collection
|
||
*
|
||
* @return void
|
||
*/
|
||
public function removeChildNodes() {
|
||
if ($this->childNodes !== NULL) {
|
||
unset($this->childNodes);
|
||
$this->childNodes = NULL;
|
||
}
|
||
}
|
||
/**
|
||
* Returns child nodes collection
|
||
*
|
||
* @return t3lib_tree_NodeCollection
|
||
*/
|
||
public function getChildNodes() {
|
||
return $this->childNodes;
|
||
}
|
||
/**
|
||
* Returns true if the node has child nodes attached
|
||
*
|
||
* @return boolean
|
||
*/
|
||
public function hasChildNodes() {
|
||
if ($this->childNodes !== NULL) {
|
||
return TRUE;
|
||
}
|
||
return FALSE;
|
||
}
|
||
/**
|
||
* Sets the identifier
|
||
*
|
||
* @param string $id
|
||
* @return void
|
||
*/
|
||
public function setId($id) {
|
||
$this->id = $id;
|
||
}
|
||
/**
|
||
* Returns the identifier
|
||
*
|
||
* @return string
|
||
*/
|
||
public function getId() {
|
||
return $this->id;
|
||
}
|
||
/**
|
||
* Sets the parent node
|
||
*
|
||
* @param t3lib_tree_Node $parentNode
|
||
* @return void
|
||
*/
|
||
public function setParentNode (t3lib_tree_Node $parentNode = NULL) {
|
||
$this->parentNode = $parentNode;
|
||
}
|
||
/**
|
||
* Returns the parent node
|
||
*
|
||
* @return t3lib_tree_Node
|
||
*/
|
||
public function getParentNode () {
|
||
return $this->parentNode;
|
||
}
|
||
/**
|
||
* Compares a node if it's identical to another node by the id property.
|
||
*
|
||
* @param t3lib_tree_Node $other
|
||
* @return boolean
|
||
*/
|
||
public function equals(t3lib_tree_Node $other) {
|
||
return $this->id == $other->getId();
|
||
}
|
||
/**
|
||
* Compares a node to another one.
|
||
*
|
||
* Returns:
|
||
* 1 if its greater than the other one
|
||
* -1 if its smaller than the other one
|
||
* 0 if its equal
|
||
*
|
||
* @param t3lib_tree_Node $other
|
||
* @return int see description above
|
||
*/
|
||
public function compareTo($other) {
|
||
if ($this->equals($other)) {
|
||
return 0;
|
||
}
|
||
return ($this->id > $other->getId()) ? 1 : -1;
|
||
}
|
||
/**
|
||
* Returns the node in an array representation that can be used for serialization
|
||
*
|
||
* @param bool $addChildNodes
|
||
* @return array
|
||
*/
|
||
public function toArray($addChildNodes = TRUE) {
|
||
$arrayRepresentation = array(
|
||
'serializeClassName' => get_class($this),
|
||
'id' => $this->id
|
||
);
|
||
if ($this->parentNode !== NULL) {
|
||
$arrayRepresentation['parentNode'] = $this->parentNode->toArray(FALSE);
|
||
} else {
|
||
$arrayRepresentation['parentNode'] = '';
|
||
}
|
||
if ($this->hasChildNodes() && $addChildNodes) {
|
||
$arrayRepresentation['childNodes'] = $this->childNodes->toArray();
|
||
} else {
|
||
$arrayRepresentation['childNodes'] = '';
|
||
}
|
||
|
||
return $arrayRepresentation;
|
||
}
|
||
/**
|
||
* Sets data of the node by a given data array
|
||
*
|
||
* @param array $data
|
||
* @return void
|
||
*/
|
||
public function dataFromArray($data) {
|
||
$this->setId($data['id']);
|
||
if (isset($data['parentNode']) && $data['parentNode'] !== '') {
|
||
$this->setParentNode(t3lib_div::makeInstance(
|
||
$data['parentNode']['serializeClassName'],
|
||
$data['parentNode']
|
||
));
|
||
}
|
||
if (isset($data['childNodes']) && $data['childNodes'] !== '') {
|
||
$this->setChildNodes(t3lib_div::makeInstance(
|
||
$data['childNodes']['serializeClassName'],
|
||
$data['childNodes']
|
||
));
|
||
}
|
||
}
|
||
/**
|
||
* Returns the serialized instance
|
||
*
|
||
* @return string
|
||
*/
|
||
public function serialize() {
|
||
return serialize($this->toArray());
|
||
}
|
||
/**
|
||
* Fills the current node with the given serialized informations
|
||
*
|
||
* @throws t3lib_exception if the deserialized object type is not identical to the current one
|
||
* @param string $serializedString
|
||
* @return void
|
||
*/
|
||
public function unserialize($serializedString) {
|
||
$arrayRepresentation = unserialize($serializedString);
|
||
if ($arrayRepresentation['serializeClassName'] !== get_class($this)) {
|
||
throw new t3lib_exception('Deserialized object type is not identical!');
|
||
}
|
||
$this->dataFromArray($arrayRepresentation);
|
||
}
|
||
}
|
t3lib/tree/extdirect/class.t3lib_tree_extdirect_abstractextjstree.php (Revision 0) | ||
---|---|---|
<?php
|
||
/***************************************************************
|
||
* Copyright notice
|
||
*
|
||
* (c) 2010 TYPO3 Tree Team <http://forge.typo3.org/projects/typo3v4-extjstrees>
|
||
* All rights reserved
|
||
*
|
||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||
* free software; you can redistribute it and/or modify
|
||
* it under the terms of the GNU General Public License as published by
|
||
* the Free Software Foundation; either version 2 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* The GNU General Public License can be found at
|
||
* http://www.gnu.org/copyleft/gpl.html.
|
||
* A copy is found in the textfile GPL.txt and important notices to the license
|
||
* from the author is found in LICENSE.txt distributed with these scripts.
|
||
*
|
||
*
|
||
* This script is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
* GNU General Public License for more details.
|
||
*
|
||
* This copyright notice MUST APPEAR in all copies of the script!
|
||
***************************************************************/
|
||
/**
|
||
* Abstract ExtJS tree based on ExtDirect
|
||
*
|
||
* @author Stefan Galinski <stefan.galinski@gmail.com>
|
||
* @package TYPO3
|
||
* @subpackage t3lib
|
||
*/
|
||
abstract class t3lib_tree_extdirect_AbstractExtJsTree extends t3lib_tree_AbstractTree {
|
||
/**
|
||
* State Provider
|
||
*
|
||
* @var t3lib_tree_AbstractStateProvider
|
||
*/
|
||
protected $stateProvider = NULL;
|
||
/**
|
||
* @param t3lib_tree_AbstractStateProvider $stateProvider
|
||
* @return void
|
||
*/
|
||
public function setStateProvider(t3lib_tree_AbstractStateProvider $stateProvider) {
|
||
$this->stateProvider = $stateProvider;
|
||
}
|
||
/**
|
||
* @return t3lib_tree_AbstractStateProvider
|
||
*/
|
||
public function getStateProvider() {
|
||
return $this->stateProvider;
|
||
}
|
||
/**
|
||
* Fetches the next tree level
|
||
*
|
||
* @abstract
|
||
* @param t3lib_tree_Node $node
|
||
* @return array
|
||
*/
|
||
abstract public function getNextTreeLevel(t3lib_tree_Node $node);
|
||
}
|
t3lib/tree/class.t3lib_tree_abstractdataprovider.php (Revision 0) | ||
---|---|---|
<?php
|
||
/***************************************************************
|
||
* Copyright notice
|
||
*
|
||
* (c) 2010 TYPO3 Tree Team <http://forge.typo3.org/projects/typo3v4-extjstrees>
|
||
* All rights reserved
|
||
*
|
||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||
* free software; you can redistribute it and/or modify
|
||
* it under the terms of the GNU General Public License as published by
|
||
* the Free Software Foundation; either version 2 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* The GNU General Public License can be found at
|
||
* http://www.gnu.org/copyleft/gpl.html.
|
||
* A copy is found in the textfile GPL.txt and important notices to the license
|
||
* from the author is found in LICENSE.txt distributed with these scripts.
|
||
*
|
||
*
|
||
* This script is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
* GNU General Public License for more details.
|
||
*
|
||
* This copyright notice MUST APPEAR in all copies of the script!
|
||
***************************************************************/
|
||
/**
|
||
* Abstract Tree Data Provider
|
||
*
|
||
* @author Stefan Galinski <stefan.galinski@gmail.com>
|
||
* @author Steffen Ritter <info@steffen-ritter.net>
|
||
* @package TYPO3
|
||
* @subpackage t3lib
|
||
*/
|
||
abstract class t3lib_tree_AbstractDataProvider {
|
||
/**
|
||
* Root Node
|
||
*
|
||
* @var t3lib_tree_Node
|
||
*/
|
||
protected $rootNode = NULL;
|
||
/**
|
||
* Returns the root node
|
||
*
|
||
* @abstract
|
||
* @return t3lib_tree_Node
|
||
*/
|
||
abstract public function getRoot();
|
||
/**
|
||
* Fetches the subnodes of the given node
|
||
*
|
||
* @abstract
|
||
* @param t3lib_tree_Node $node
|
||
* @return t3lib_tree_NodeCollection
|
||
*/
|
||
abstract public function getNodes(t3lib_tree_Node $node);
|
||
}
|