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

Location:
branches/2.2/mobile/inc
Files:
5 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 
  • branches/2.2/mobile/inc/class.ui_home.inc.php

    r3727 r3731  
    2222                 
    2323                function change_template($params) { 
    24                          
    2524                        $GLOBALS['phpgw']->session->appsession('mobile.layout','mobile',$params['template']); 
    26                         header("location: index.php"); 
     25                        header("location: index.php?menuaction=mobile.ui_mobilemail.change_folder&folder=0"); 
    2726                } 
    2827                 
     
    4948                        $this->template->set_var('lang_selected', lang("selected")); 
    5049                         
    51                         $this->template->set_var('search',$this->template->fp('out','search_bar')); 
    52                          
    5350                        $accountId = $GLOBALS['phpgw_info']['user']['account_id']; 
    5451                         
     
    5956                        $this->set_folder_block($default_folders, "default_folders_box"); 
    6057                         
    61                         if(isset($params["expand_folders"]) && $params["expand_folders"] == 1)  
    62                         { 
    63                                 $personal_folders = $this->imap_functions->get_folders_list(array('noSharedFolders' => true, 'folderType' => 'personal', 'noQuotaInfo' => true)); 
    64                                 $this->set_folder_block($personal_folders, "personal_folders_box", sizeof($default_folders)); 
    65                                 $this->template->set_var('expand_folders', 0);                   
    66                         } else { 
    67                                 $this->template->set_var('expand_folders', 1); 
    68                         } 
     58                        $personal_folders = $this->imap_functions->get_folders_list(array('noSharedFolders' => true, 'folderType' => 'personal', 'noQuotaInfo' => true)); 
     59                        $this->set_folder_block($personal_folders, "personal_folders_box", sizeof($default_folders)); 
    6960                         
    7061                        $this->template->set_var('quota_percent', $total_quota["quota_percent"]); 
     
    9283                        ) ); 
    9384                         
    94                         $events  = $this->bocalendar->cached_events; 
     85                        $events = $this->bocalendar->cached_events; 
    9586                         
    9687                        foreach($events[$year.$this->common->complete_string($month,2,"R","0").$this->common->complete_string($day,2,"R","0")] as $index=>$event)  
     
    10596                        $GLOBALS['phpgw_info']['mobiletemplate']->set_error_msg($params["error_message"]); 
    10697                        $GLOBALS['phpgw_info']['mobiletemplate']->set_success_msg($params["success_message"]); 
    107                         if($GLOBALS['phpgw']->session->appsession('mobile.layout','mobile')=="mini") 
     98                         
     99                        if($GLOBALS['phpgw']->session->appsession('mobile.layout','mobile')=="mini_desktop") { 
    108100                                $GLOBALS['phpgw_info']['mobiletemplate']->set_home($this->template->fp('out', 'page')); 
    109                         else 
     101                        } else { 
     102                                $this->template->set_var('search',$this->template->fp('out','search_bar')); 
    110103                                $GLOBALS['phpgw_info']['mobiletemplate']->set_content($this->template->fp('out', 'page')); 
     104                        } 
    111105 
    112106                } 
     
    149143 
    150144                        $p = $this->template; 
    151                         $p->set_file( 
    152                                 Array( 
    153                                         'search' => 'home_search.tpl', 
    154                                         'home_search_bar' => 'search_bar.tpl' 
    155                                 ) 
    156                         ); 
     145                        $p->set_file(array('home_search' => 'home_search.tpl')); 
     146                        $p->set_file(array('home_search_bar' => 'search_bar.tpl')); 
    157147                         
    158148                        //Langs gerais da página 
    159                         $p->set_block('search','home_search'); 
    160                         $p->set_block("search","row_events"); 
    161                         $p->set_block("search","no_events"); 
     149                        $p->set_block('home_search','main'); 
     150                        $p->set_block("home_search","row_events"); 
     151                        $p->set_block("home_search","no_events"); 
    162152                        $p->set_block('home_search_bar','search_bar'); 
    163153                         
     
    184174                        $p->set_var('show_more_events',"none"); 
    185175                        $p->set_var('contacts_request_from', 
    186                                                         isset($params["request_from"])? 
    187                                                         $params["request_from"]:"none"); 
    188                          
    189                         $p->set_var('search',$p->fp('out','search_bar')); 
     176                                isset($params["request_from"])? 
     177                                $params["request_from"]:"none"); 
     178                                 
     179                        if($GLOBALS['phpgw']->session->appsession('mobile.layout','mobile')!="mini_desktop") { 
     180                                $p->set_var('search',$p->fp('out','search_bar')); 
     181                        } 
    190182 
    191183                        //E-mails 
     
    194186                                if($params['default_folders']==="1") { 
    195187                                        if($params['personal_folders']!=="1") 
    196                                                 $mail_params['folderType'] = 'default';                  
     188                                                $mail_params['folderType'] = 'default'; 
    197189                                } 
    198190                                else { 
     
    324316                        } 
    325317                         
    326                         $GLOBALS['phpgw_info']['mobiletemplate']->set_content($p->fp('out','home_search')); 
     318                        $GLOBALS['phpgw_info']['mobiletemplate']->set_content($p->fp('out','main')); 
    327319 
    328320                } 
  • branches/2.2/mobile/inc/class.ui_mobilecalendar.inc.php

    r3696 r3731  
    4141                        $this->template->set_var('lang_search',lang("search")); 
    4242                         
    43                         $this->template->set_var('search',$this->template->fp('out','search_bar')); 
     43                        if($GLOBALS['phpgw']->session->appsession('mobile.layout','mobile')!="mini_desktop") 
     44                                $this->template->set_var('search',$this->template->fp('out','search_bar')); 
    4445                         
    4546                        if(!function_exists("get_events")){ 
  • branches/2.2/mobile/inc/class.ui_mobilecc.inc.php

    r3710 r3731  
    146146                                                                                "none":$this->page_info["request_from"]); 
    147147                         
    148                         $this->template->set_var('search',$this->template->fp('out','search_bar')); 
     148                        if($GLOBALS['phpgw']->session->appsession('mobile.layout','mobile')!="mini_desktop") 
     149                                $this->template->set_var('search',$this->template->fp('out','search_bar')); 
    149150                         
    150151                        //Combo de catálogos 
  • branches/2.2/mobile/inc/class.ui_mobilemail.inc.php

    r3697 r3731  
    446446                        $p->set_var("lang_more",lang("more")); 
    447447                        $p->set_var("lang_messages",lang("messages")); 
    448                         $p->set_var('search',$p->fp('out','search_bar')); 
     448                         
     449                        if($GLOBALS['phpgw']->session->appsession('mobile.layout','mobile')!="mini_desktop") 
     450                                $p->set_var('search',$p->fp('out','search_bar')); 
    449451                         
    450452                        $max_per_page =  
Note: See TracChangeset for help on using the changeset viewer.