* @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: include.right_bottom.php 128 2019-07-03 11:58:28Z oldperl $:
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
if (isset($_REQUEST['treeItem'])) {
die('Illegal call!');
}
#added 24.06.08 timo.trautmann security fix filter submitted treeItemPost array before insertion, name also changed according to security fix
$aPostTreeItem = array();
if (!is_object($db)) {
$db = new DB_ConLite();
}
if (isset($_REQUEST['treeItemPost']['idpica_alloc'])) {
$aPostTreeItem['idpica_alloc'] = (int) $_REQUEST['treeItemPost']['idpica_alloc'];
}
if (isset($_REQUEST['treeItemPost']['parentid'])) {
$aPostTreeItem['parentid'] = (int) $_REQUEST['treeItemPost']['parentid'];
}
if (isset($_REQUEST['treeItemPost']['name'])) {
$sName = stripslashes($_REQUEST['treeItemPost']['name']);
$sName = $db->escape($sName);
$aPostTreeItem['name'] = $sName;
}
$_GET['idpica_alloc'] = (int) $_GET['idpica_alloc'];
#end added 24.06.08 timo.trautmann
$oPage = new cPage();
$oPage->setMargin(10);
$oPage->setMessageBox();
$oTree = new pApiContentAllocationTreeView('f7771624-4874-4745-8b7e-21a49a71a447');
// store item
if ($_POST['step'] == 'store') {
$pNotify = '
';
$sMessage = sprintf(i18n("New Category %s successfully stored!", "cl-content-allocation"), $treeItem['name']);
$notification->displayNotification("info", $sMessage);
$pNotify .= '
';
$oTree->storeItem($aPostTreeItem);
}
// rename item
if ($_POST['step'] == 'storeRename') {
$pNotify = '';
$sMessage = sprintf(i18n("Category %s successfully renamed!", "cl-content-allocation"), $treeItem['name']);
$notification->displayNotification("info", $sMessage);
$pNotify .= '
';
$oTree->storeItem($aPostTreeItem);
}
// rename item
if ($_GET['step'] == 'moveup') {
$oTree->itemMoveUp($_GET['idpica_alloc']);
}
if ($_GET['step'] == 'deleteItem') { // delete item
$pNotify = '';
$sMessage = i18n("Category successfully deleted!", "cl-content-allocation");
$notification->displayNotification("info", $sMessage);
$pNotify .= '
';
$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 = '
';
$oDiv->setContent($form);
$sTemp = $oDiv->render();
} else {
$newTree = '' . i18n("Create new tree", "cl-content-allocation") . '';
}
$result = $oTree->renderTree(true);
if ($result === false) {
$result = ' ';
}
$js = '
';
$oPage->addScript('deleteCategory', $js);
$oPage->setContent($pNotify . $newTree . $sTemp . '
' . $result);
$oPage->render();
?>