Пример #1
0
            $feedback['success'] = tra("Your changes were successfully saved.");
        } else {
            $feedback['error'] = $gStructure->mErrors;
        }
    } elseif (isset($_REQUEST["create"]) || isset($_REQUEST["action"]) && $_REQUEST["action"] == 'add') {
        $structureHash['root_structure_id'] = $rootStructure->mStructureId;
        $structureHash['parent_id'] = $_REQUEST['structure_id'];
        $after = null;
        if (isset($_REQUEST['after_ref_id'])) {
            $structureHash['after_ref_id'] = $_REQUEST['after_ref_id'];
        }
        if (!empty($_REQUEST['name'])) {
            $gStructure->s_create_page($_REQUEST["structure_id"], $after, $_REQUEST["name"], '');
        } elseif (!empty($_REQUEST['content'])) {
            foreach ($_REQUEST['content'] as $conId) {
                $structureHash['content_id'] = $conId;
                if ($new_structure_id = $gStructure->storeNode($structureHash)) {
                    $structureHash['after_ref_id'] = $new_structure_id;
                    $feedback['success'] = tra("added to") . ' ' . $gContent->getContentTypeName();
                } else {
                    $feedback['failure'] = $gStructure->mErrors;
                }
            }
        }
    }
    $structureTocId = $rootStructure->mStructureId;
    $gBitSmarty->assign('structureToc', $rootStructure->getToc());
    $gBitSmarty->assign('structureTocId', $structureTocId);
    $gBitSmarty->assign_by_ref('feedback', $feedback);
}
$gBitSmarty->assign('editingStructure', FALSE);