$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 . '">
		<input type="hidden" name="frame" value="' . $frame . '">
		<input type="hidden" name="idcat" value="' . $idcat . '">';
    $tpl->set('s', 'HIDDENFIELDS', $hiddenfields);
    if (sizeof($loadedAllocations) > 0) {
        $tpl->set('s', 'ARRAY_CHECKED_BOXES', 'var checkedBoxes = [' . implode(',', $loadedAllocations) . '];');
    } else {
        $tpl->set('s', 'ARRAY_CHECKED_BOXES', 'var checkedBoxes = [];');
    }
    $oDiv = new cHTMLDiv();
    $oDiv->updateAttributes(array('style' => 'text-align: right; padding: 5px; width: 730px; border: 1px #B3B3B3 solid; background-color: #FFFFFF;'));
    $oDiv->setContent('<input type="image" src="images/but_ok.gif" />');
    $tpl->set('s', 'DIV', '<br>' . $oDiv->render());
    $tpl->set('s', 'TREE', $result);
    $tpl->set('s', 'REMOVE_ALL', i18n("Remove all", 'content_allocation'));
    $tpl->set('s', 'REMOVE', i18n("Remove", 'content_allocation'));
    $result = $tpl->generate($cfg['pica']['treetemplate_complexlist'], true);
    $script = '<link rel="stylesheet" type="text/css" href="' . $cfg['pica']['style_complexlist'] . '"/>
	<script language="javascript" src="' . $cfg['pica']['script_complexlist'] . '"></script>';
    $oPage->addScript('style', $script);
}
$oPage->setContent($sLocationString . $result . markSubMenuItem(5, true));
$oPage->render();
    $pNotify = '<div style="width:410px;margin-bottom:20px;">';
    $sMessage = i18n("Category successfully deleted!", 'content_allocation');
    $notification->displayNotification("info", $sMessage);
    $pNotify .= '</div>';
    $oTree->deleteItem($_GET['idpica_alloc']);
}
if ($_GET['step'] == 'collapse') {
    $oTree->setTreeStatus($_GET['idpica_alloc']);
}
if ($_GET['step'] == 'online') {
    $oTree->setOnline($_GET['idpica_alloc']);
}
if ($_GET['step'] == 'offline') {
    $oTree->setOffline($_GET['idpica_alloc']);
}
$oDiv = new cHTMLDiv();
$oDiv->updateAttributes(array('style' => 'padding: 5px; width: 400px; border: 1px #B3B3B3 solid; background-color: #FFFFFF;'));
$sTemp = '';
if ($_GET['step'] == 'createRoot') {
    // create new root item
    $form = '
		<table cellspacing="0" cellpaddin="0" border="0">
		<form name="create" action="main.php" method="POST" onsubmit="return fieldCheck();">
		<input type="hidden" name="action" value="' . $action . '" />
		<input type="hidden" name="frame" value="' . intval($frame) . '" />
		<input type="hidden" name="contenido" value="' . $sess->id . '" />
		<input type="hidden" name="area" value="' . $area . '" />
		<input type="hidden" name="step" value="store" />
		<input type="hidden" name="treeItemPost[parentid]" value="root" />
		<tr><td colspan="2" class="text_medium">' . i18n("Create new tree", 'content_allocation') . '</td></tr>
		<tr>