コード例 #1
0
function toListaEditor($orga, $li_estilo, $ul_estilo)
{
    $htm = "<li class='{$li_estilo}'>" . $orga['funcion'] . " " . $orga['titulo'];
    $ID = $orga['id'];
    $htm = "{$htm} (<a href='organica-c.php?n={$ID}'>editar</a>)\n";
    if ($ID != 1) {
        $htm = "{$htm} (<a href='organica-b.php?n={$ID}&q=del'>borrar</a>)\n";
    }
    $htm = "{$htm} (<a href='organica-b.php?n={$ID}&q=new'>nuevo subnivel</a>)\n";
    if (trim($orga['glosa']) != "") {
        $htm = "{$htm}<br/>Descripci&oacute;n: <i>" . $orga['glosa'] . "</i>";
    }
    if (trim($orga['url']) != "") {
        $htm = "{$htm}<br/>URL: <u>" . $orga['url'] . "</u>";
    }
    $hijos = $orga['hijos'];
    if ($hijos != array()) {
        for ($i = 0; $i < count($hijos); $i++) {
            $htm = $htm . toListaEditor($hijos[$i], $i < count($hijos) - 1 ? "" : "fin", "menu");
        }
    }
    $htm = $htm . "</li>\n";
    return acentosHTML("<ul class='{$ul_estilo}'>\n{$htm}\n</ul>\n");
}
コード例 #2
0
    if ($_GET['q'] == 'new') {
        $organik = addChild($organik, $_GET['n']);
    }
    if ($_GET['q'] == 'del') {
        $organik = deleteNode($organik, $_GET['n']);
    }
}
if (isset($_POST['funcion'])) {
    $info = array('funcion' => acentosHTML($_POST['otra']), 'titulo' => acentosHTML($_POST['titulo']), 'glosa' => acentosHTML($_POST['glosa']), 'url' => acentosHTML($_POST['url']));
    $organik = updateInfo($organik, $_POST['id'], $info);
}
if (isset($_POST['cargo'])) {
    $_SESSION['comm'] = acentosHTML($_POST['cargo']);
}
$_SESSION['data'] = $organik;
org_header("Editor de Estructuras Org&aacute;nicas");
?>

<form action="organica-d.php" method="post">
<input type="button" value="Generar"
onclick="location.href='organica-d.php';" />
</form>


<?php 
echo toListaEditor($organik, "", "primer_nodo");
?>

<?php 
echo html_button($_SESSION['back']);
html_footer();