[TYPO3-core] RFC: #16228: [Feature] TCA tree

Ernesto Baschny [cron IT] ernst at cron-it.de
Tue Nov 2 23:31:50 CET 2010


Hi Steffen,


sorry, I reviewed v1 yet.. I've just seen your v2 on the list, too quick
for my review... anyway:

A)
I fixed some CGL issues in v2 and also some documentation and other
minor issues. For your convenience I attached a patch documenting the
changes between your "v1" and my "v2" patch.

B)
Another note would be:
t3lib/tree/renderer/class.t3lib_tree_renderer_extjs_json.php

should be called:
t3lib/tree/renderer/class.t3lib_tree_renderer_extjsjson.php

and thus the class:
t3lib_tree_Renderer_ExtJsJson

Else you would need another directory (because of the "_").

C)
Question, why is t3lib/js/extjs/tree/tree.js a mix up of "generic" tree
stuff and "Tca" stuff? Couldn't that be split up? Is tree.js the start
of the ExtJS part which will later on also handle our "page tree" etc?

D)
Lots of methods are still not phpDocumented, if you can, consider adding
those too. Also many are only phpdoc headers without any explanation of
parameters and method functionality.


Other than that nitpicks: +1 by reading and testing


I would split up the commits in these changesets, which would ease later
reviewing of the changes. Instead of a "monster commit":

1) fixed sprite generator (why is this needed?)
M      t3lib/spritemanager/class.t3lib_spritemanager_spritegenerator.php

2) fixed abstract tree classes:
M      t3lib/tree/renderer/class.t3lib_tree_renderer_abstract.php
M      t3lib/tree/renderer/class.t3lib_tree_renderer_unorderedlist.php
M      t3lib/tree/extdirect/class.t3lib_tree_extdirect_abstractextjstree.php

3) register new classes
M      t3lib/core_autoload.php

4) added a new ExtJS renderer for trees:
A      t3lib/tree/renderer/class.t3lib_tree_renderer_extjs_json.php
A      t3lib/js/extjs/tree/tree.js

5) implemented TCA rendering in TCEforms "renderMode=tree":
M      t3lib/class.t3lib_tceforms.php
A      t3lib/tceforms/class.t3lib_tceforms_tree.php
A      t3lib/tree/tca/class.t3lib_tree_tca_extjsarrayrenderer.php
A      t3lib/tree/tca/class.t3lib_tree_tca_tcatree.php
A      t3lib/tree/tca/class.t3lib_tree_tca_databasetreedataprovider.php
A      t3lib/tree/tca/class.t3lib_tree_tca_databasenode.php
A      t3lib/tree/tca/class.t3lib_tree_tca_dataproviderfactory.php
A      t3lib/tree/tca/class.t3lib_tree_tca_abstracttcatreedataprovider.php

6) sample styling for the new ExtJS trees
A      typo3/sysext/t3skin/extjs/images/tree/expand-all.gif
A      typo3/sysext/t3skin/extjs/images/tree/collapse-all.gif
M      typo3/sysext/t3skin/extjs/xtheme-t3skin.css
M      typo3/sysext/t3skin/stylesheets/ie6/z_t3-icons-gifSprites.css
M      typo3/sysext/t3skin/stylesheets/sprites/t3skin.css


Cheers,
Ernesto


Steffen Kamper schrieb am 02.11.2010 19:36:

> this is a SVN patch request.
> 
> Type: Feature
> 
> BT Reference: http://bugs.typo3.org/view.php?id=16228
> 
> Branches: trunk
> 
> This feature renders a tree from TCA with the type "select" and
> renderMode "tree".
> 
> It uses the abstract tree classes, adds special tca tree classes and
> work with a minimum of configuration needed. it supports all properties
> that select supports.
> 
> It use an additional config parameter "treeConfig" which has following
> options:
> parentField => the field where the parent id is defined
> childField => the field where the child id is defined
> appeareance => array:
>   expandAll => expands all nodes on show
>   showHeader => boolean, the header consists of a filter text with
> options, and icons for collapse/expand all
> 
> if size is defined, the tree height allow to show this amount of nodes
> if autoSizemax is defined, it shows at least this amount of nodes before
> showing scroll bar
> 
> Please unzip the attached archive in typo3/sysext
> 
> For testing use the fe_groups field of pages, add the following to you
> extTables.php:
> 
> $GLOBALS['TCA']['pages']['columns']['fe_group']['config']['renderMode']
> = 'tree';
> //$GLOBALS['TCA']['pages']['columns']['fe_group']['config']['size'] = '6';
> //$GLOBALS['TCA']['pages']['columns']['fe_group']['config']['autoSizeMax']
> = '10';
> $GLOBALS['TCA']['pages']['columns']['fe_group']['config']['treeConfig']
> = array(
>     'parentField' => 'subgroup',
>     'appearance' => array(
>         'expandAll' => TRUE,
>         'showHeader' => TRUE,
>     )
> );
> 
> Notes:
> This patch was mainly developed by Steffen Ritter at T3CSS10 and
> finished as teamwork.
> 
> Please remind that the example with fe_groups is only a showcase and not
> a real life example, as fe_froups allow to apply more than one parents,
> while a tree node only can have one parent node.
> 
> The 2 icons are pending in HCI tracker and will be reviewed or renewed
> by them.
> 
> vg Steffen

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 16228-v2.diff
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20101102/8cbd7580/attachment-0001.asc>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 16228-v1-v2.diff
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20101102/8cbd7580/attachment-0001.txt>


More information about the TYPO3-team-core mailing list