<?php
// vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4:
// +--------------------------------------------------------------------+
// |                          HORAS EXTRA                               |
// +--------------------------------------------------------------------+
// |    Sistema de Horas Extra - Ministerio de Economía - Argentina     |
// +--------------------------------------------------------------------+
// | Creado: mar jul 30 15:56:32 ART 2002                               |
// | Autor:  Leandro Lucarella <llucar@mecon.gov.ar>                    |
// +--------------------------------------------------------------------+
//
// $URL: file:///var/lib/subversion/he/tronco/src/includes/hooks/default-secciones.php $
// $Rev: 93 $
// $Date: 2002-09-19 14:45:55 -0300 (jue, 19 sep 2002) $
// $Author: luca $
//

// 'Importa' la configuración de los hooks.
global $hooksconf, $perm;

// Obtiene la seccion actual.
if ( preg_match( '|' . $hooksconf['webroot'] . '/([^/]+)/|', $_SERVER['PHP_SELF'], $m ) )
    $seccion = $m[1];
else
    $seccion = '';

// Secciones.
$secciones = array(
    '1' => 'administracion',
    '2' => 'carga',
    '3' => 'procesos',
    '4' => 'consultas',
    '5' => 'informes',
);

// Permisos para cada sección.
$permisos = array(
    '1' => array(
        HE_PERM_ITEM_ABM,
        HE_PERM_NIVEL_ABM,
        HE_PERM_PORCENTAJE_ABM,
        HE_PERM_USUARIO_ABM,
    ),
    '2' => array(
        HE_PERM_CARGA,
    ),
    '3' => array(
    ),
    '4' => array(
        HE_PERM_ITEM_CL,
        HE_PERM_NIVEL_CL,
        HE_PERM_PORCENTAJE_CL,
        HE_PERM_USUARIO_CL,
    ),
    '5' => array(
    ),
);

// Texto para poner una imagen seleccionada.
$selected   = '<a href="%s/%s/" onmouseout="MM_swapImgRestore()" onmouseover="MM_displayStatusMsg(\'HORAS EXTRAS\'); MM_swapImage(\'he%s\',\'\',\'%s/imagenes/he%s_f4.gif\',1); return document.MM_returnValue"><img name="he%s" src="%s/imagenes/he%s_f3.gif" border="0" alt="%s"></a>';
$unselected = '<a href="%s/%s/" onmouseout="MM_swapImgRestore()" onmouseover="MM_displayStatusMsg(\'HORAS EXTRAS\'); MM_swapImage(\'he%s\',\'\',\'%s/imagenes/he%s_f2.gif\',1); return document.MM_returnValue" onclick="MM_swapImage(\'he%s\',\'\',\'%s/imagenes/he%s_f3.gif\',1)"><img name="he%s" src="%s/imagenes/he%s.gif" border="0" alt="%s"></a>';

?>
<!-- INICIO $URL: file:///var/lib/subversion/he/tronco/src/includes/hooks/default-secciones.php $ $Rev: 93 $ $Date: 2002-09-19 14:45:55 -0300 (jue, 19 sep 2002) $ $Author: luca $ -->
<script language="JavaScript">
    <!-- hide 
        if (document.images) {
            he1_f4 = new Image(151 ,25); he1_f4.src = "<?= $hooksconf['webroot'] ?>/imagenes/he1_f4.gif";
            he1_f1 = new Image(151 ,25); he1_f1.src = "<?= $hooksconf['webroot'] ?>/imagenes/he1.gif";
            he2_f2 = new Image(91 ,25); he2_f2.src = "<?= $hooksconf['webroot'] ?>/imagenes/he2_f2.gif";
            he2_f1 = new Image(91 ,25); he2_f1.src = "<?= $hooksconf['webroot'] ?>/imagenes/he2.gif";
            he2_f3 = new Image(91 ,25); he2_f3.src = "<?= $hooksconf['webroot'] ?>/imagenes/he2_f3.gif";
            he3_f2 = new Image(167 ,25); he3_f2.src = "<?= $hooksconf['webroot'] ?>/imagenes/he3_f2.gif";
            he3_f1 = new Image(167 ,25); he3_f1.src = "<?= $hooksconf['webroot'] ?>/imagenes/he3.gif";
            he3_f3 = new Image(167 ,25); he3_f3.src = "<?= $hooksconf['webroot'] ?>/imagenes/he3_f3.gif";
            he4_f2 = new Image(95 ,25); he4_f2.src = "<?= $hooksconf['webroot'] ?>/imagenes/he4_f2.gif";
            he4_f1 = new Image(95 ,25); he4_f1.src = "<?= $hooksconf['webroot'] ?>/imagenes/he4.gif";
            he4_f3 = new Image(95 ,25); he4_f3.src = "<?= $hooksconf['webroot'] ?>/imagenes/he4_f3.gif";
            he5_f2 = new Image(96 ,25); he5_f2.src = "<?= $hooksconf['webroot'] ?>/imagenes/he5_f2.gif";
            he5_f1 = new Image(96 ,25); he5_f1.src = "<?= $hooksconf['webroot'] ?>/imagenes/he5.gif";
            he5_f3 = new Image(96 ,25); he5_f3.src = "<?= $hooksconf['webroot'] ?>/imagenes/he5_f3.gif";
        }
    // stop hiding -->
</script>
<div align="left"><?

    foreach ( $secciones as $n => $dir )
        if ( call_user_func_array( array( $perm, 'tieneO' ), $permisos[$n] ) ) {
            if ( $seccion == $dir )
                printf( $selected, $hooksconf['webroot'], $dir, $n, $hooksconf['webroot'], $n, $n, $hooksconf['webroot'], $n, ucfirst( $dir ) );
            else
                printf( $unselected, $hooksconf['webroot'], $dir, $n, $hooksconf['webroot'], $n, $n, $hooksconf['webroot'], $n, $n, $hooksconf['webroot'], $n, ucfirst( $dir ) );
        }

?></div>
<!-- FIN $URL: file:///var/lib/subversion/he/tronco/src/includes/hooks/default-secciones.php $ $Rev: 93 $ $Date: 2002-09-19 14:45:55 -0300 (jue, 19 sep 2002) $ $Author: luca $ -->

