Ignore:
Timestamp:
02/03/11 17:13:42 (13 years ago)
Author:
eduardoalex
Message:

Ticket #1523 - Criado o layout do Expresso Mini para navegadores desktop

File:
1 edited

Legend:

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

    r3727 r3731  
    1515                        $template = $GLOBALS['phpgw']->session->appsession('mobile.layout','mobile'); 
    1616                         
    17                         $this->template->set_file(Array('home_t' => $template=="mini"?'pc_template.tpl':'template.tpl'));        
    18                         $this->template->set_block('home_t', 'mobile_home');     
     17                        if($template == "mini_desktop") { 
     18                                $this->template->set_file(array('home_t' => 'pc_template.tpl')); 
     19                                $this->template->set_file(array('home_t_search_bar' => 'search_bar.tpl')); 
     20                                $this->template->set_block('home_t_search_bar','search_bar'); 
     21                                $this->template->set_var('search',$this->template->fp('out','search_bar')); 
     22                                $this->template->set_var('lang_mini_mobile', lang('mini mobile')); 
     23                                $this->template->set_var('lang_search_error_message',lang("need choose one option")); 
     24                        }       else { 
     25                                $this->template->set_file(array('home_t' => 'template.tpl')); 
     26                                $this->template->set_var('lang_mini_desktop', lang('mini desktop')); 
     27                        } 
     28                         
     29 
     30                         
     31                        $this->template->set_block('home_t', 'mobile_home'); 
    1932                        $this->template->set_block('home_t','success_message'); 
    20                         $this->template->set_block('home_t','error_message');            
     33                        $this->template->set_block('home_t','error_message'); 
    2134                } 
    2235 
     
    5164                                $this->template->parse("message_box", $type."_message", true); 
    5265                        } 
    53                 }                
     66                } 
    5467                 
    5568                /* 
     
    7992                        $this->print_header(); 
    8093                        $this->init_mobile(); 
    81                         $class=='ui_home' && $method=='index'?$this->print_logout():$this->print_navbar(); 
     94                        if(!($class == 'ui_home' && $method == 'index')) $this->print_navbar(); 
    8295                        $filename = 'inc/class.'.$class.'.inc.php'; 
    83                         if($GLOBALS['phpgw']->session->appsession('mobile.layout','mobile')=="mini") { 
    84                                 $ui_home = CreateObject('mobile.ui_home'); 
    85                                 $ui_home->index(array()); 
    86                         } 
    8796                        include_once($filename); 
    8897                        $obj = new $class();             
    8998                        $obj -> $method($_REQUEST); 
     99                         
     100                        if($GLOBALS['phpgw']->session->appsession('mobile.layout','mobile') == "mini_desktop") { 
     101                                $ui_home = CreateObject('mobile.ui_home'); 
     102                                $ui_home->index($_REQUEST); 
     103                        } 
     104                         
    90105                        $this->template->pfp('out', 'mobile_home'); 
    91106                } 
     
    96111      // setting timezone preference 
    97112      $zones = $obj->getTimezones(); 
    98       $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['timezone'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['timezone'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['timezone'] : sprintf("%s", array_search("America/Sao_Paulo", $zones));                     
    99                 } 
    100                  
    101                 /* 
    102                 * @function print_logout 
    103                 * @abstract Exibe label e link para Logout 
    104                 * @author Diego Moreno 
    105                 */ 
    106                 public function print_logout(){ 
    107                         $this-> template->set_var('lang_logout', lang('logout')); 
    108                         $this-> template->set_var('href_logout', 'login.php?cd=1'); 
     113      $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['timezone'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['timezone'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['timezone'] : sprintf("%s", array_search("America/Sao_Paulo", $zones)); 
     114                         
     115                        $this->template->set_var('global_title', lang('expresso mini')); 
     116                        $this->template->set_var('lang_logout', lang('logout')); 
     117                        $this->template->set_var('lang_search', lang('search')); 
     118                         
     119                        $this->template->set_var('href_logout', 'login.php?cd=1'); 
    109120                } 
    110121                 
     
    115126                */ 
    116127                private function print_navbar(){ 
    117                         $this-> print_logout();                  
    118                         $this-> template->set_var('lang_back', lang('Back')); 
    119                         $this-> template->set_var('lang_home', lang('home')); 
    120                         $this-> template->set_var('lang_email', lang('E-mail')); 
    121                         $this-> template->set_var('lang_contacts', lang('Contact Center')); 
    122                         $this-> template->set_var('lang_calendar', lang('Calendar')); 
    123                         $this-> template->set_var('href_back', 'javascript:history.back()'); 
    124                         $this-> template->set_var('href_cc', 'index.php?menuaction=mobile.ui_mobilecc.init_cc'); 
    125                         $this-> template->set_var('href_email', "index.php?menuaction=mobile.ui_mobilemail.change_folder&folder=0"); 
    126                         $this-> template->set_var('href_calendar', "index.php?menuaction=mobile.ui_mobilecalendar.index"); 
    127                         $this-> template->set_var('href_home', "index.php?menuaction=mobile.ui_home.index"); 
     128                        $this->template->set_var('lang_back', lang('Back')); 
     129                        $this->template->set_var('lang_home', lang('home')); 
     130                        $this->template->set_var('lang_email', lang('E-mail')); 
     131                        $this->template->set_var('lang_contacts', lang('Contact Center')); 
     132                        $this->template->set_var('lang_calendar', lang('Calendar')); 
     133                        $this->template->set_var('href_back', 'javascript:history.back()'); 
     134                        $this->template->set_var('href_cc', 'index.php?menuaction=mobile.ui_mobilecc.init_cc'); 
     135                        $this->template->set_var('href_email', "index.php?menuaction=mobile.ui_mobilemail.change_folder&folder=0"); 
     136                        $this->template->set_var('href_calendar', "index.php?menuaction=mobile.ui_mobilecalendar.index"); 
     137                        $this->template->set_var('href_home', "index.php?menuaction=mobile.ui_home.index"); 
    128138                } 
    129139 
     
    135145                private function print_header(){ 
    136146                        $GLOBALS['phpgw']->accounts->read_repository(); 
    137                         $var  = Array( 
    138                                 'css'   => $this->get_mobile_css(), 
    139                                 'title' => lang("expresso mini") 
    140                         );               
    141                         $this->template->set_var($var);          
    142                 } 
    143  
    144  
    145                 public function get_mobile_css() { 
    146                         $css = "/mobile/templates/%s.css"; 
    147  
    148                         global $path, $link; 
    149  
    150                         $path = PHPGW_SERVER_ROOT . str_replace( '/', SEP, $css ); 
    151  
    152                         $link = '<LINK href="%s" type="text/css" rel="StyleSheet">'; 
    153                         $link = sprintf( $link, 
    154                                 "{$GLOBALS[ 'phpgw_info' ][ 'server' ][ 'webserver_url' ]}{$css}" 
    155                         ); 
    156  
    157                         function _css( $css ) 
    158                         { 
    159                                 global $link, $path; 
    160  
    161                                 if ( file_exists( sprintf( $path, str_replace( '/', SEP, $css ) ) ) ) 
    162                                         return sprintf( $link, $css ); 
    163  
    164                                 return ''; 
    165                         } 
    166  
    167                         $css = _css( 'css/mobile' ); 
    168                         $css .= _css( $GLOBALS['phpgw_info']['server']['template_set'].'/css/base'); 
    169                         $css .= _css( $GLOBALS['phpgw_info']['server']['template_set'].'/css/'.$GLOBALS['phpgw_info']['user']['preferences']['common']['theme']); 
    170  
    171                         return ( $css ); 
    172  
     147                        $var  = Array('title' => lang("expresso mini")); 
     148                        $this->template->set_var($var); 
    173149                } 
    174150 
Note: See TracChangeset for help on using the changeset viewer.