Changeset 3727 for branches/2.2/mobile


Ignore:
Timestamp:
02/01/11 14:29:20 (13 years ago)
Author:
eduardoalex
Message:

Ticket #1523 - Alterando estrutura do mobile para disponibilizar a versão desktop

Location:
branches/2.2/mobile
Files:
3 added
4 edited

Legend:

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

    r3690 r3727  
    1212                function mobiletemplate(){ 
    1313                        $this->template = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 
    14                         $this->template->set_file(Array('home_t' => 'template.tpl'));    
     14                         
     15                        $template = $GLOBALS['phpgw']->session->appsession('mobile.layout','mobile'); 
     16                         
     17                        $this->template->set_file(Array('home_t' => $template=="mini"?'pc_template.tpl':'template.tpl'));        
    1518                        $this->template->set_block('home_t', 'mobile_home');     
    1619                        $this->template->set_block('home_t','success_message'); 
     
    2629                        $pre_content = $this->template->get_var("content"); 
    2730                        $this->template->set_var("content", $pre_content.$content); 
     31                } 
     32                 
     33                /* 
     34                * @function set_home 
     35                * @abstract Carrega o atributo "home" do template principal para PC. 
     36                * @author Diógenes Ribeiro Duarte <diogenes.duarte@prodeb.ba.gov.br> 
     37                */       
     38                public function set_home($content) { 
     39                        $pre_content = $this->template->get_var("home"); 
     40                        $this->template->set_var("home", $pre_content.$content); 
    2841                } 
    2942                 
     
    6881                        $class=='ui_home' && $method=='index'?$this->print_logout():$this->print_navbar(); 
    6982                        $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                        } 
    7087                        include_once($filename); 
    7188                        $obj = new $class();             
     
    120137                        $var  = Array( 
    121138                                'css'   => $this->get_mobile_css(), 
     139                                'title' => lang("expresso mini") 
    122140                        );               
    123141                        $this->template->set_var($var);          
  • branches/2.2/mobile/inc/class.ui_home.inc.php

    r3706 r3727  
    99                var $public_functions = array( 
    1010                        'index' => true, 
    11                         'search' => true 
     11                        'search' => true, 
     12                        'change_template' => true 
    1213                ); 
    1314                 
     
    1819                        $this->db       = CreateObject('phpgwapi.db'); 
    1920                        $this->bocalendar = CreateObject('calendar.bocalendar'); 
     21                } 
     22                 
     23                function change_template($params) { 
     24                         
     25                        $GLOBALS['phpgw']->session->appsession('mobile.layout','mobile',$params['template']); 
     26                        header("location: index.php"); 
    2027                } 
    2128                 
     
    98105                        $GLOBALS['phpgw_info']['mobiletemplate']->set_error_msg($params["error_message"]); 
    99106                        $GLOBALS['phpgw_info']['mobiletemplate']->set_success_msg($params["success_message"]); 
    100                         $GLOBALS['phpgw_info']['mobiletemplate']->set_content($this->template->fp('out', 'page')); 
     107                        if($GLOBALS['phpgw']->session->appsession('mobile.layout','mobile')=="mini") 
     108                                $GLOBALS['phpgw_info']['mobiletemplate']->set_home($this->template->fp('out', 'page')); 
     109                        else 
     110                                $GLOBALS['phpgw_info']['mobiletemplate']->set_content($this->template->fp('out', 'page')); 
     111 
    101112                } 
    102113                 
  • branches/2.2/mobile/mobile_header.inc.php

    r3564 r3727  
    33        * eGroupWare                                                               * 
    44        * http://www.egroupware.org                                                * 
    5         * The file written by Mário César Kolling <mario.kolling@serpro.gov.br>    * 
     5        * The file written by Mï¿œrio Cï¿œsar Kolling <mario.kolling@serpro.gov.br>    * 
    66        * --------------------------------------------                             * 
    77        *  This program is free software; you can redistribute it and/or modify it * 
     
    1212 
    1313        /*******************************************\ 
    14          * Define a aplicação mobile preferencial  * 
     14         * Define a aplicaᅵᅵo mobile preferencial  * 
    1515        \*******************************************/ 
    16         //TODO: Ler do banco do expresso as preferências do usuário e definir a aplicação móvel padrão 
    17         // por enquanto isto será hardcoded para mobilemail. 
     16        //TODO: Ler do banco do expresso as preferï¿œncias do usuï¿œrio e definir a aplicaᅵᅵo mï¿œvel padrï¿œo 
     17        // por enquanto isto serï¿œ hardcoded para mobilemail. 
    1818 
    1919        $GLOBALS['phpgw_info']['flags']['currentapp'] = 'mobile'; 
    20         $GLOBALS['phpgw_info']['user']['preferences']['common']['default_mobile_app'] = 'home'; //home, mobilecalendar, mobilecc ou mobilemail 
     20        $GLOBALS['phpgw_info']['user']['preferences']['common']['default_mobile_app'] =  
     21                                                $GLOBALS['phpgw']->session->appsession('mobilemail.folders','mobile')=="mini"?'mobilecalendar':'home'; //home, mobilecalendar, mobilecc ou mobilemail 
    2122 
    2223        if ( is_null($GLOBALS['phpgw_info']['server']['template_set']) ) 
     
    2627 
    2728        /* 
    28          * @function start_prefered_app 
    29          * @abstract Função que chama a aplicação móvel preferencial. 
    30          * @author Mário César Kolling <mario.kolling@serpro.gov.br> 
     29         * @ 
     30 
     31         * @abstract Funᅵᅵo que chama a aplicaᅵᅵo mï¿œvel preferencial. 
     32         * @author Mï¿œrio Cï¿œsar Kolling <mario.kolling@serpro.gov.br> 
    3133         */ 
    3234        function start_prefered_app(){ 
    33                 //TODO: Determinar qual a aplicação móvel preferida e iniciá-la.                         
     35                //TODO: Determinar qual a aplicaᅵᅵo mï¿œvel preferida e iniciï¿œ-la.                         
    3436                switch($GLOBALS['phpgw_info']['user']['preferences']['common']['default_mobile_app']){ 
    3537                        case home: 
     
    3739                                break;                   
    3840                        case mobilemail: 
    39                                 $link = "ui_mobilemail.mail_list";               
     41                                $link = "ui_mobilemail.change_folder&folder=0";          
    4042                                break; 
    4143                        case mobilecalendar: 
  • branches/2.2/mobile/templates/default/template.tpl

    r3703 r3727  
    3030                </div> 
    3131                <div class="rodape">Projeto ExpressoLivre 2004 - 2010 :: Licen&ccedil;a de Software</div> 
     32                 <div class="rodape center"><a href="index.php?menuaction=mobile.ui_home.change_template&template=mini">Utilizar versão para Desktops</a></div> 
    3233        </body> 
    3334</html> 
Note: See TracChangeset for help on using the changeset viewer.