<?php
// cms/api/menu/list.php

    header("Content-Type:application/json");
    include("../dbconn.php");
    include("../utils.php");
    
    // parametros obligatorios
    $parmsob = array("sessionid");
    if (!parametrosValidos($_GET, $parmsob)){
        badEnd("400", array("msg"=>"Parametros obligatorios " . implode(", ", $parmsob)));
    }
    
    $out = new stdClass();
    $sessionid = $_GET["sessionid"];
    
    isSessionValidCMS($db, $sessionid);
    
    $out -> options = getMenu($db);
    
    header("HTTP/1.1 200");
    echo (json_encode($out));
    die();
?>

