source: trunk/prototype/app/config.php @ 5341

Revision 5341, 1.1 KB checked in by wmerlotto, 12 years ago (diff)

Ticket #2434 - Commit inicial do novo módulo de agenda do Expresso - expressoCalendar

Line 
1<?php
2
3class Config
4{
5    static $register;
6    static $sessionStarted;
7 
8    static function module($config , $module = false)
9    {
10        self::init();
11     
12        //Todo: registrar na nova api o currentapp
13        if(!$module)
14            $module =  $_SESSION['flags']['currentapp'];
15        /*
16        if( !isset( $_SESSION['config'][$module] ) )
17            Carregar Config do modulo
18         */ 
19       
20        return isset($_SESSION['config'][$module][$config]) ? $_SESSION['config'][$module][$config] : false;
21     
22    }
23   
24    static function me($config)
25    {
26        self::init();
27        return isset($_SESSION['wallet']['user'][$config]) ? $_SESSION['wallet']['user'][$config] : false;
28     
29    }
30
31    static function regSet( $name , $value)
32    {
33            self::$register[$name] = $value;
34    }
35    static function regGet ($name )
36    {
37            return (isset(self::$register[$name]) ? self::$register[$name] : false );
38    }
39
40    static function init()
41    {
42        if ( isset( $_COOKIE[ 'sessionid' ] ) )
43            session_id( $_COOKIE[ 'sessionid' ] );
44
45        if( !self::$sessionStarted )
46            self::$sessionStarted = session_start();
47    }
48}
49
50?>
Note: See TracBrowser for help on using the repository browser.