<?php

/*
 * Copyright 2017-09-07  Cámara de Comercio de Santa Marta para el Magdalena.
 * Autor: Luis Montoya <lmontoya@ccsm.org.co at www.ccsm.org.co>.
 * Archivo: index.
 *
 * Licenciado bajo la Licencia Apache, Versión 2.0;
 * Usted no puede usar este archivo excepto en conformidad con la Licencia.
 * Usted puede obtener una copia de la Licencia en
 *
 *   	http://www.apache.org/licenses/LICENSE-2.0
 *
 * A menos que sea requerido por la ley aplicable o acordado por escrito, el software
 * Distribuido bajo la licencia se distribuye en una "AS IS" o  "COMO ESTA" BASE,
 * SIN GARANTÃ�AS NI CONDICIONES DE NINGÃšN TIPO, expresas o implÃ­citas.
 * Consulte la Licencia para los permisos y Limitaciones bajo la Licencia.
 */
 

class Main {

    public static function init() {
        self::twigConfigPlantilla();
    }

    public static function twigConfigPlantilla($dirPlantilla) {
        $loader = new Twig_Loader_Filesystem(array($dirPlantilla));
        $twig = new Twig_Environment(
            $loader, array(
         'debug' => true
            )
        );
        return $twig;
    }

    public static function getGlobals() {
        SesionCliente::abrir();
        return array(
         'favicon' => 'favicon.html.php',
         'login' => PLANTILLA_ACTIVA . 'login.html.php',
         'dashboard' => PLANTILLA_ACTIVA . 'dashboard.html.php',
         'mantenimiento' => PLANTILLA_ACTIVA . 'mantenimiento.html.php',
         'bloqueo' => PLANTILLA_ACTIVA . 'bloqueo.html.php',
         'estaLogueado' => Cliente::estaLogueado(),
         'isEstadoSesion' => Cliente::is_inactividad(),
         'session' => Cliente::getUsuario(),
         'estado_session' => Cliente::get('ESTADO'),
         'isMantenimiento' => false,
        );
    }

}

