2 // vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4 foldmethod=marker:
3 // +----------------------------------------------------------------------+
5 // +----------------------------------------------------------------------+
6 // | Copyright (c) 1997-2003 The PHP Group |
7 // +----------------------------------------------------------------------+
8 // | This source file is subject to version 2.02 of the PHP license, |
9 // | that is bundled with this package in the file LICENSE, and is |
10 // | available at through the world-wide-web at |
11 // | http://www.php.net/license/2_02.txt. |
12 // | If you did not receive a copy of the PHP license and are unable to |
13 // | obtain it through the world-wide-web, please send a note to |
14 // | license@php.net so we can mail you a copy immediately. |
15 // +----------------------------------------------------------------------+
16 // | Created: mar may 27 15:16:38 ART 2003
17 // | Author: Martin Marrese <mmarre@mecon.gov.ar>
18 // +----------------------------------------------------------------------+
23 require_once 'MECON/HTML/Tabla.php';
24 require_once 'SAMURAI/Permiso.php';
26 //LINKS A PERMISOS-ABM {{{
27 $aHref = '<a href="permisos-abm?accion=##ACCION##&idPermiso=##NUEVO##">';
28 $aHrefModif = $aHref.'<img src="/MECON/images/general_modificar.gif" border="0" alt="Modificar Permiso"></a>';
29 $aHrefElim = $aHref.'<img src="/MECON/images/general_eliminar.gif" border="0" alt="Eliminar Permiso" ></a>';
31 //CREO LOS OBJETOS NECESARIOS {{{
32 $TABLA2 = new Tabla ('cellspacing=0');
33 $TABLA = new Tabla ('cellpadding=2');
35 //OBTENGO LA INFORMACION DE LA BASE {{{
36 $permisos = SAMURAI_Permiso::getPermisos($DB);
38 //AGREGO LOS DATOS A LAS TABLAS {{{
39 $row = array ($aHref.'<img src="/MECON/images/general_nuevo.gif" border="0">Ingresar Nuevo Permiso</a>');
40 $TABLA2->addRow($row,'align=right');
41 $row = array ('Id','Descripcion','Modif.','Elim.');
42 $TABLA->addRow($row,'cabecera');
43 foreach ($permisos as $permiso) {
44 $Modif = ereg_replace('##NUEVO##' , $permiso->getId(), $aHrefModif);
45 $Elim = ereg_replace('##NUEVO##' , $permiso->getId(), $aHrefElim );
46 $Modif = ereg_replace('##ACCION##' , 'm' , $Modif );
47 $Elim = ereg_replace('##ACCION##' , 'e' , $Elim );
48 $row = array ( $permiso->getId(),
49 $permiso->getDescripcion(),
56 //DIBUJO LA PAGINA {{{
57 $MARCO = new Marco ('../../conf/confSecciones.php');
58 $MARCO->addBody($TABLA2->toHtml(1));
59 $MARCO->addBody($TABLA);