* @license http://www.contenido.org/license/LIZENZ.txt * @link http://www.4fb.de * @link http://www.contenido.org * @since file available since contenido release <= 4.6 * * {@internal * created unknown * modified 2008-07-02, Frederic Schneider, add security fix * * $Id: class.content_allocation_complexlist.php 128 2019-07-03 11:58:28Z oldperl $: * }} * */ if (!defined('CON_FRAMEWORK')) { die('Illegal call'); } class pApiContentAllocationComplexList extends pApiTree { var $idSetter = true; var $load = array(); public function __construct($uuid) { global $cfg; parent::__construct($uuid); } public function _buildRenderTree($tree) { global $action, $frame, $area, $sess, $idart; $oldIdSetter = $this->idSetter; $this->idSetter = false; $result = ''; $even = true; $levelElms = sizeof($tree); $cnt = 1; foreach ($tree as $item_tmp) { $item = ''; $checked = ''; if (in_array($item_tmp['idpica_alloc'], $this->load)) { $checked = ' checked="checked"'; } $li_closeElm = ''; if ($cnt == $levelElms) { $li_closeElm = 'style="border-bottom: 0;"'; } $cnt++; $even = !$even; $bgcolor = ($even) ? 'bright' : 'dark'; // for wrapping purposes $item_tmp['name'] = str_replace('-', '- ', $item_tmp['name']); $checkbox = ''; $item = "\n
  • " . $checkbox . " " . $item_tmp['name']; $result .= $item; if ($item_tmp['children']) { $children = $this->_buildRenderTree($item_tmp['children']); $result .= "\n"; } } public function setChecked($load) { $this->load = $load; } public function renderTree($return = true) { $tree = $this->fetchTree(); if ($tree === false) { return false; } $tree = $this->_buildRenderTree($tree); if ($return === true) { return $tree; } } } ?>