source: branches/2.2/mobile/mobile_header.inc.php @ 3491

Revision 3491, 2.3 KB checked in by rafaelraymundo, 13 years ago (diff)

Ticket #1397 - utiliza o template default caso no mobile não exista o template selecionado

Line 
1<?php
2        /**************************************************************************\
3        * eGroupWare                                                               *
4        * http://www.egroupware.org                                                *
5        * The file written by Mário César Kolling <mario.kolling@serpro.gov.br>    *
6        * --------------------------------------------                             *
7        *  This program is free software; you can redistribute it and/or modify it *
8        *  under the terms of the GNU General Public License as published by the   *
9        *  Free Software Foundation; either version 2 of the License, or (at your  *
10        *  option) any later version.                                              *
11        \**************************************************************************/
12
13        /*******************************************\
14         * Define a aplicação mobile preferencial  *
15        \*******************************************/
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.
18        $GLOBALS['phpgw_info']['flags']['currentapp'] = 'mobile';
19        $GLOBALS['phpgw_info']['user']['preferences']['common']['default_mobile_app'] = 'mobilemail'; // mobilecalendar, mobilecc ou mobilemail
20
21        if ( is_null($GLOBALS['phpgw_info']['server']['template_set']) )
22                $GLOBALS['phpgw_info']['server']['template_set'] = $GLOBALS['phpgw_info']['login_template_set'];
23        if ( !file_exists( PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set'] ) )
24                $GLOBALS['phpgw_info']['server']['template_set'] = 'default';
25
26        /*
27         * @function start_prefered_app
28         * @abstract Função que chama a aplicação móvel preferencial.
29         * @author Mário César Kolling <mario.kolling@serpro.gov.br>
30         */
31        function start_prefered_app(){
32                //TODO: Determinar qual a aplicação móvel preferida e iniciá-la.                       
33                switch($GLOBALS['phpgw_info']['user']['preferences']['common']['default_mobile_app']){
34                        case mobilemail:
35                                $link = "ui_mobilemail.mail_list";             
36                                break;
37                        case mobilecalendar:
38                                $link = "ui_mobilecalendar.index";
39                                break;
40                        case mobilecc:
41                                $link = "ui_mobilecc.contacts_list";
42                                break;         
43                        default:
44                                break;         
45                }               
46                $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link("index.php?menuaction=mobile.".$link));
47        }
48?>
Note: See TracBrowser for help on using the repository browser.