Ignore:
Timestamp:
02/28/11 11:22:55 (13 years ago)
Author:
thiagoaos
Message:

Ticket #1620 - Corrigido link voltar do expresso mini. Voltando agora para o último request.

File:
1 edited

Legend:

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

    r3734 r3829  
    44        { 
    55                private $template; 
     6                private $href_back; 
    67                 
    78                /* 
     
    2324                                $this->template->set_var('lang_search_error_message',lang("need choose one option")); 
    2425                                $this->template->set_var('lang_search_error_message_four_digits',lang("search word need not be empty and has more then four char")); 
    25                                  
    26                                  
    2726                        }       else { 
    2827                                $this->template->set_file(array('home_t' => 'template.tpl')); 
     
    134133                        $this->template->set_var('lang_contacts', lang('Contact Center')); 
    135134                        $this->template->set_var('lang_calendar', lang('Calendar')); 
    136                         $this->template->set_var('href_back', 'javascript:history.back()'); 
    137135                        $this->template->set_var('href_cc', 'index.php?menuaction=mobile.ui_mobilecc.init_cc'); 
    138136                        $this->template->set_var('href_email', "index.php?menuaction=mobile.ui_mobilemail.change_folder&folder=0"); 
    139137                        $this->template->set_var('href_calendar', "index.php?menuaction=mobile.ui_mobilecalendar.index"); 
    140138                        $this->template->set_var('href_home', "index.php?menuaction=mobile.ui_home.index"); 
     139                } 
     140 
     141                private function process_back_link() { 
     142                        $url = $GLOBALS['phpgw']->session->appsession('mobile.last_url','mobile'); 
     143 
     144                        if($url) { 
     145                                $params = $GLOBALS['phpgw']->session->appsession('mobile.last_request','mobile'); 
     146 
     147                                $query_string = ""; 
     148                                unset($params['sessionid']); 
     149                                unset($params['domain']); 
     150                                unset($params['last_loginid']); 
     151                                unset($params['last_domain']); 
     152                                unset($params['kp3']); 
     153                                unset($params['showHeader']); 
     154                                 
     155                                foreach ($params as $key => $value) { 
     156                                        $query_string .= "&".$key."=".$value; 
     157                                } 
     158 
     159                                if($query_string != "") 
     160                                        $url .= "?".substr($query_string,1); 
     161 
     162                                $this->href_back = $url; 
     163                        } else { 
     164                                $this->href_back = 'javascript:history.back()'; 
     165                        } 
     166 
     167                        $GLOBALS['phpgw']->session->appsession('mobile.last_url','mobile',$_SERVER["SCRIPT_URL"]); 
     168                        $GLOBALS['phpgw']->session->appsession('mobile.last_request','mobile',$_REQUEST); 
     169                } 
     170 
     171                function get_back_link(){ 
     172                        return $this->href_back; 
    141173                } 
    142174 
     
    150182                        $var  = Array('title' => lang("expresso mini")); 
    151183                        $this->template->set_var($var); 
     184                        $this->process_back_link(); 
    152185                } 
    153186 
Note: See TracChangeset for help on using the changeset viewer.