Fixed bug #16597: TCA tree: Adapt Signature of own select renderMode tree to match...
authorSteffen Ritter <info@rs-websystems.de>
Mon, 29 Nov 2010 11:16:07 +0000 (11:16 +0000)
committerSteffen Ritter <info@rs-websystems.de>
Mon, 29 Nov 2010 11:16:07 +0000 (11:16 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9667 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_tceforms.php
t3lib/tceforms/class.t3lib_tceforms_tree.php

index a5a851c..7117105 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-11-29  Steffen Ritter  <typo3@steffen-ritter.net>
+
+       * Fixed bug #16597: TCA tree: Adapt Signature of own select renderMode tree to match the signature other select-modes 
+
 2010-11-29  Jigal van Hemert <jigal@xs4all.nl>
 
        * Fixed bug #16417: Field module is not rendered for sysfolders (Thanks to Georg Ringer)
index 662d02f..f9864a9 100644 (file)
@@ -1557,8 +1557,8 @@ class t3lib_TCEforms {
                } elseif (!strcmp($config['renderMode'], 'singlebox')) { // Single selector box renderMode
                        $item = $this->getSingleField_typeSelect_singlebox($table, $field, $row, $PA, $config, $selItems, $nMV_label);
                } elseif (!strcmp($config['renderMode'], 'tree')) { // Tree renderMode
-                       $treeClass = t3lib_div::makeInstance('t3lib_TCEforms_Tree');
-                       $item = $treeClass->renderField($table, $field, $row, $PA, $this);
+                       $treeClass = t3lib_div::makeInstance('t3lib_TCEforms_Tree', $this);
+                       $item = $treeClass->renderField($table, $field, $row, $PA, $config, $selItems, $nMV_label);
                } else { // Traditional multiple selector box:
                        $item = $this->getSingleField_typeSelect_multiple($table, $field, $row, $PA, $config, $selItems, $nMV_label);
                }
index 008527d..0e6bb00 100644 (file)
  */
 
 class t3lib_TCEforms_Tree {
+       /**
+        * Stores a reference to the original tceForms object
+        *
+        * @var t3lib_TCEforms
+        */
+       protected $tceForms = NULL;
+
+       /**
+        * Constructor which sets the tceForms.
+        * 
+        * @param t3lib_TCEforms $tceForms
+        *
+        */
+       public function __construct(t3lib_TCEforms &$tceForms) {
+               $this->tceForms = $tceForms;
+       }
 
        /**
+        * renders the tree as replacement for the selector
+        *
         * @param string The table name of the record
         * @param string The field name which this element is supposed to edit
         * @param array The record data array where the value(s) for the field can be found
         * @param array An array with additional configuration options.
+        * @param array (Redundant) content of $PA['fieldConf']['config'] (for convenience)
+        * @param array Items available for selection
+        * @param string Label for no-matching-value
         * @return string The HTML code for the TCEform field
         */
-       public function renderField($table, $field, $row, &$PA, &$tceForms) {
+       public function renderField($table, $field, $row, &$PA, $config, $possibleSelectboxItems, $noMatchLabel) {
                $valueArray = explode(',', $row[$field]);
                $selectedNodes = array();
                if (count($valueArray)) {
@@ -61,7 +82,7 @@ class t3lib_TCEforms_Tree {
                );
                $treeDataProvider->setSelectedList(implode(',', $selectedNodes));
                $treeDataProvider->initializeTreeData();
-               $treeDataProvider->setGeneratedTSConfig($tceForms->setTSconfig($table, $row));
+               $treeDataProvider->setGeneratedTSConfig($this->tceForms->setTSconfig($table, $row));
 
                $treeRenderer = t3lib_div::makeInstance('t3lib_tree_Tca_ExtJsArrayRenderer');
                $tree = t3lib_div::makeInstance('t3lib_tree_Tca_TcaTree');