[4246] | 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 | |
---|
| 19 | $GLOBALS['phpgw_info']['flags']['currentapp'] = 'mobile'; |
---|
| 20 | $GLOBALS['phpgw_info']['user']['preferences']['common']['default_mobile_app'] = 'home'; |
---|
| 21 | |
---|
| 22 | if ( is_null($GLOBALS['phpgw_info']['server']['template_set']) ) |
---|
| 23 | $GLOBALS['phpgw_info']['server']['template_set'] = $GLOBALS['phpgw_info']['login_template_set']; |
---|
| 24 | if ( !file_exists( PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set'] ) ) |
---|
| 25 | $GLOBALS['phpgw_info']['server']['template_set'] = 'default'; |
---|
| 26 | |
---|
| 27 | /* |
---|
| 28 | * @ |
---|
| 29 | |
---|
| 30 | * @abstract Função que chama a aplicação móvel preferencial. |
---|
| 31 | * @author Mário Cesar Kolling <mario.kolling@serpro.gov.br> |
---|
| 32 | */ |
---|
| 33 | function start_prefered_app(){ |
---|
| 34 | //TODO: Determinar qual a aplicaᅵᅵo mᅵvel preferida e iniciᅵ-la. |
---|
| 35 | |
---|
| 36 | switch($GLOBALS['phpgw_info']['user']['preferences']['common']['default_mobile_app']) |
---|
| 37 | { |
---|
| 38 | case home: |
---|
| 39 | $link = "ui_home.index"; |
---|
| 40 | break; |
---|
| 41 | case mobilemail: |
---|
| 42 | $link = "ui_mobilemail.change_folder&folder=0"; |
---|
| 43 | break; |
---|
| 44 | case mobilecalendar: |
---|
| 45 | $link = "ui_mobilecalendar.index"; |
---|
| 46 | break; |
---|
| 47 | case mobilecc: |
---|
| 48 | $link = "ui_mobilecc.contacts_list"; |
---|
| 49 | break; |
---|
| 50 | default: |
---|
| 51 | break; |
---|
| 52 | } |
---|
| 53 | $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link("index.php?menuaction=mobile.".$link)); |
---|
| 54 | } |
---|
| 55 | ?> |
---|