function ListarTemplates() { global $action; $res = Seleccion("Template", "", "IdTemplate DESC", ""); if (!$res) { echo gas("aviso", "No hay templates disponibles"); } else { echo gas("titulo", _("Lista de templates")); echo "<table border=1>"; while ($oTemplate = TemplateFactory($res)) { $id = $oTemplate->getId(); //error("Info: id es '$id'"); $nombre = $oTemplate->getNombre(); $comentario = $oTemplate->get("Comentario"); $linkEdicion = "<a href='#' onclick='editatemplate({$id});'>Modificar</a>"; $linkExtra = "<a href='{$action}?modo=editextra&id={$id}'>Extra</a>"; echo "<tr><td>{$nombre}</td><td>{$comentario}</td><td>{$linkEdicion}</td><td>{$linkExtra}</td></tr>"; } echo "</table>"; } }
<?php echo trim($code); ?> ]]></html:div> </description> <hbox> <?php $menuWebmaster = array(_("Base CSS") => "editarCSS", _("Base xul CSS") => "editarxulCSS", _("Base JS") => "editarJS"); echo xulMakeMenuCommands("Rapido", $menuWebmaster); ?> <menulist label="Template"> <menupopup> <?php $res = Seleccion("Template", "", "Nombre ASC, IdTemplate DESC", ""); while ($oTemplate = TemplateFactory($res)) { $n = $oTemplate->getNombre(); echo "<menuitem label='{$n}' oncommand='load(\"{$n}\")'/>"; } ?> </menupopup> </menulist> <button label="Guardar" oncommand="salvar()"/> <textbox id="Nombre" value="<?php echo $Nombre; ?> "/> <textbox id="IdTemplate" value="<?php echo $idTemplate; ?> "/>