function add_node($edit_id, $node_type)
 {
     if (isset($node_type)) {
         $new_node['id'] = '0';
         $new_node['lang'] = 'cz';
         $new_node['data_type'] = 'text';
         $new_node['node_type'] = $node_type;
         $new_node['tpl_name'] = 'index.tpl';
         $new_node['owner'] = '0';
         $admin_data_write = new ADMIN_DATA_WRITE($new_node);
         $inserted = $admin_data_write->write(0, $edit_id);
         echo $admin_data_write->saved;
     }
     return null;
 }
示例#2
0
        case "add_node":
            ADMIN_NODE::add_node(0, $_GET['node_type']);
            break;
        case "delete_node":
            ADMIN_NODE::delete_node($_GET['node_id']);
            break;
        case "delete_link":
            ADMIN_CHILDREN::delete_link($_GET['parent_id'], $_GET['node_id'], $_GET['rel_type'], $_GET['sort_order']);
            break;
        case "add_children_submit":
            ADMIN_CHILDREN::add_child($_GET['node_id']);
            break;
        case "edit_node":
            if (isset($_POST['data_edit']) && $_POST['data_edit'] == 'Odeslat') {
                $admin_data_write = new ADMIN_DATA_WRITE($_POST);
                $admin_data_write->write($_GET['edit_id']);
                echo $admin_data_write->saved;
            }
            if (isset($_GET['edit_id'])) {
                $admin_edit = new ADMIN_EDIT($_GET['edit_id']);
                $admin_edit->vypis();
            }
            break;
    }
    //vyrobi menu
    ADMIN_MENU::menu();
    ADMIN_MENU::orphans();
    ADMIN_NODE::choose_to_add(0);
    echo "<div id='logout'><a href='admin.php?action=logout'>Logout</a></div>";
} else {
    loginFunction();