I would like to integrate it in the next version of the module. You agree?
If you need to modify the php code for display, ask me!
heyula wrote:
This will be great. I will then make a theme for this module.
class TDMObjectTree extends XoopsObjectTree {
protected function makeArrayTreeOptions($fieldName, $key, &$ret, $prefix_orig, $prefix_curr = '')
{
if ($key > 0) {
$value = $this->_tree[$key]['obj']->getVar($this->_myId);
$ret[$value] = $prefix_curr . $this->_tree[$key]['obj']->getVar($fieldName);
$prefix_curr .= $prefix_orig;
}
if (isset($this->_tree[$key]['child']) && !empty($this->_tree[$key]['child'])) {
foreach ($this->_tree[$key]['child'] as $childKey) {
$this->makeArrayTreeOptions($fieldName, $childKey, $ret, $prefix_orig, $prefix_curr);
}
}
}
public function makeArrayTree($fieldName, $prefix = '-', $key = 0) {
$ret = array();
$this->makeArrayTreeOptions($fieldName, $key, $ret, $prefix);
return $ret;
}
}