Changeset 3410


Ignore:
Timestamp:
10/25/10 17:46:06 (14 years ago)
Author:
rafaelraymundo
Message:

Ticket #1309 - Escolha automática do tema, em função da url do cliente.

Location:
branches/2.2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/contactcenter/templates/classic/head.inc.php

    r2 r3410  
    3232 
    3333        #_debug_array($GLOBALS['phpgw_info']['user']['preferences']['common']); 
    34         $theme_css = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/celepar/css/'.$GLOBALS['phpgw_info']['user']['preferences']['common']['theme'].'.css'; 
     34        $theme_css = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/celepar/css/'.get_theme().'.css'; 
    3535        if(!file_exists($theme_css)) 
    3636        { 
    37                 $theme_css = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/celepar/css/'.$GLOBALS['phpgw_info']['user']['preferences']['common']['theme'].'.css'; 
     37                $theme_css = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/celepar/css/'.get_theme().'.css'; 
    3838        } 
    3939 
  • branches/2.2/contactcenter/templates/default/head.inc.php

    r1158 r3410  
    3232 
    3333        #_debug_array($GLOBALS['phpgw_info']['user']['preferences']['common']); 
    34         $theme_css = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/celepar/css/'.$GLOBALS['phpgw_info']['user']['preferences']['common']['theme'].'.css'; 
     34        $theme_css = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/celepar/css/'.get_theme().'.css'; 
    3535        if(!file_exists($theme_css)) 
    3636        { 
    37                 $theme_css = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/celepar/css/'.$GLOBALS['phpgw_info']['user']['preferences']['common']['theme'].'.css'; 
     37                $theme_css = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/celepar/css/'.get_theme().'.css'; 
    3838        } 
    3939 
  • branches/2.2/phpgwapi/inc/class.common.inc.php

    r3170 r3410  
    12731273                                $template = $GLOBALS['phpgw_info']['server']['template_set']; 
    12741274                                $GLOBALS['phpgw']->css->validate_file( "phpgwapi/templates/".$template."/css/base.css");  
    1275                                 $GLOBALS['phpgw']->css->validate_file( "phpgwapi/templates/".$template."/css/".$GLOBALS[ 'phpgw_info' ][ 'user' ][ 'preferences' ][ 'common' ][ 'theme' ].".css");  
    1276                                 $GLOBALS['phpgw']->css->validate_file( $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'currentapp' ]."/templates/".$template."/css/".$GLOBALS[ 'phpgw_info' ][ 'user' ][ 'preferences' ][ 'common' ][ 'theme' ].".css");  
     1275                                $GLOBALS['phpgw']->css->validate_file( "phpgwapi/templates/".$template."/css/".get_theme().".css"); 
     1276                                $GLOBALS['phpgw']->css->validate_file( $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'currentapp' ]."/templates/".$template."/css/".get_theme().".css"); 
    12771277                                $GLOBALS['phpgw']->css->validate_file( $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'currentapp' ]."/templates/".$template."/css/app.css");  
    12781278 
  • branches/2.2/phpgwapi/inc/functions.inc.php

    r3052 r3410  
    6464        } 
    6565 
     66        function get_theme() 
     67        { 
     68 
     69            $test_cookie = get_var('THEME', 'COOKIE'); 
     70 
     71            // se o cookie foi definido coloca tema na sessão 
     72            if (!empty($test_cookie)) 
     73            { 
     74                $_SESSION['THEME'] = $test_cookie; 
     75            } 
     76 
     77            // se tema não estiver definido na sessão retorna $GLOBALS['phpgw_info']['user']['preferences']['common']['theme'] 
     78            if (!$_SESSION['THEME']) 
     79            { 
     80                return $GLOBALS['phpgw_info']['user']['preferences']['common']['theme']; 
     81            } 
     82             
     83            // senão retorna o tema definido na sessão 
     84            return $_SESSION['THEME']; 
     85        } 
     86 
    6687        /* Make sure the header.inc.php is current. */ 
    6788        if ($GLOBALS['phpgw_info']['server']['versions']['header'] < $GLOBALS['phpgw_info']['server']['versions']['current_header']) 
Note: See TracChangeset for help on using the changeset viewer.