Ignore:
Timestamp:
11/10/10 10:05:02 (13 years ago)
Author:
rafaelraymundo
Message:

Ticket #1390 - habilita a utilização de folhas de estilo para templates e temas

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/mobile/inc/class.mobiletemplate.inc.php

    r3346 r3484  
    8383                                'lang_logout'   => lang('Logout'), 
    8484                                'template_set'  => $GLOBALS['phpgw_info']['server']['template_set'], 
     85                                'css'   => $this->get_mobile_css(), 
    8586                                'lang_search'   => lang('Search')                                
    8687                        );               
    8788                        $this->template->set_var($var);          
    88                 }                
     89                } 
     90 
     91 
     92                public function get_mobile_css() { 
     93                        $css = "/mobile/templates/%s.css"; 
     94 
     95                        global $path, $link; 
     96 
     97                        $path = PHPGW_SERVER_ROOT . str_replace( '/', SEP, $css ); 
     98 
     99                        $link = '<LINK href="%s" type="text/css" rel="StyleSheet">'; 
     100                        $link = sprintf( $link, 
     101                                "{$GLOBALS[ 'phpgw_info' ][ 'server' ][ 'webserver_url' ]}{$css}" 
     102                        ); 
     103 
     104                        function _css( $css ) 
     105                        { 
     106                                global $link, $path; 
     107 
     108                                if ( file_exists( sprintf( $path, str_replace( '/', SEP, $css ) ) ) ) 
     109                                        return sprintf( $link, $css ); 
     110 
     111                                return ''; 
     112                        } 
     113 
     114                        $css = _css( 'css/mobile' ); 
     115                        $css .= _css( $GLOBALS['phpgw_info']['server']['template_set'].'/css/base'); 
     116                        $css .= _css( $GLOBALS['phpgw_info']['server']['template_set'].'/css/'.$GLOBALS['phpgw_info']['user']['preferences']['common']['theme']); 
     117 
     118                        return ( $css ); 
     119 
     120                } 
     121 
    89122        } 
    90123?> 
Note: See TracChangeset for help on using the changeset viewer.