Changeset 3484


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

Location:
branches/2.2/mobile
Files:
4 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?> 
  • branches/2.2/mobile/login.php

    r3483 r3484  
    3535        $tmpl->set_file(array('login_form' => 'login.tpl')); 
    3636        $tmpl->set_var('cd',check_logoutcode($_GET['cd'])); 
     37        $tmpl->set_var('css',CreateObject("mobile.mobiletemplate")->get_mobile_css()); 
     38 
    3739 
    3840        function check_logoutcode($code) { 
  • branches/2.2/mobile/templates/default/home.tpl

    r3473 r3484  
    44<meta http-equiv="Content-Language" content="pt-BR" /> 
    55<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
    6 <LINK href="./templates/css/mobile.css" type=text/css rel=StyleSheet> 
     6{css} 
    77<title>Expresso Mobile {lang_home}</title> 
    88</head> 
  • branches/2.2/mobile/templates/default/login.tpl

    r588 r3484  
    1 <HTML> 
    2 <HEAD> 
    3 <!-- <link href="../phpgwapi/templates/celepar/login.css" rel="stylesheet" type="text/css"> --> 
    4 <LINK href="./templates/css/mobile.css" type=text/css rel=StyleSheet>  
    5 <TITLE>{website_title} - {lang_login}</TITLE> 
    6 </HEAD> 
     1<html> 
     2<head> 
     3        <title>{website_title} - {lang_login}</title> 
     4        {css} 
     5</head> 
    76<body scroll="no"  style="overflow:hidden" bgcolor="#ffffff"> 
    87        <table border="0" height="100%" width="100%"> 
Note: See TracChangeset for help on using the changeset viewer.