Bug #24228 ยป rfc16597.patch
t3lib/tceforms/class.t3lib_tceforms_tree.php (revision ) | ||
---|---|---|
*/
|
||
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)) {
|
||
... | ... | |
);
|
||
$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');
|
t3lib/class.t3lib_tceforms.php (revision ) | ||
---|---|---|
} 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);
|
||
}
|