$this_idartlang = $db->f('idartlang');
$oPage = new cPage();
$oPage->setMargin(10);
$oTree = new pApiContentAllocationComplexList('06bd456d-fe76-40cb-b041-b9ba90dc400a');
$oAlloc = new pApiContentAllocation();
if ($_POST['action'] == 'storeallocation') {
    $oAlloc->storeAllocations($this_idartlang, $_POST['allocation']);
}
if ($_GET['step'] == 'collapse') {
    $oTree->setTreeStatus($_GET['idpica_alloc']);
}
#build category path
$catString = '';
prCreateURLNameLocationString($idcat, '/', $catString);
$oArticle = new Article($idart, $client, $lang);
$sArticleTitle = $oArticle->getField('title');
$sLocationString = "<div class=\"categorypath\">" . $catString . '/' . htmlspecialchars($sArticleTitle) . "</div>";
// load allocations
$loadedAllocations = $oAlloc->loadAllocations($this_idartlang);
$oTree->setChecked($loadedAllocations);
$result = $oTree->renderTree(true);
if ($result == false) {
    $result = $notification->returnNotification("warning", i18n('There is no Content Allocation tree.', 'content_allocation'));
} else {
    if (!is_object($tpl)) {
        $tpl = new Template();
    }
    $hiddenfields = '<input type="hidden" name="action" value="storeallocation">
		<input type="hidden" name="idart" value="' . $idart . '">
		<input type="hidden" name="contenido" value="' . $sess->id . '">
		<input type="hidden" name="area" value="' . $area . '">