source: branches/2.3/ac/inc/class.mobiletemplate.inc.php @ 5107

Revision 5107, 4.0 KB checked in by rafaelraymundo, 13 years ago (diff)

Ticket #2286 - Adicionado modulo acessivel ao Expresso.

  • Property svn:executable set to *
Line 
1<?php
2include_once(PHPGW_INCLUDE_ROOT.'/ac/inc/class.ui_mobilecc.inc.php');
3        class mobiletemplate
4        {
5                private $template;
6
7                /*
8                * @function mobiletemplate
9                * @abstract Construtor da classe, que monta o template home
10                * @author Nilton Emilio Buhrer Neto <niltonneto@celepar.pr.gov.br>
11                */
12                function mobiletemplate(){
13                        $this->template = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/ac/templates/'.$GLOBALS['phpgw_info']['server']['template_set']);
14                        $this->template->set_file(Array('home_t' => 'home.tpl'));
15                        $this->template->set_block('home_t', 'mobile_home');
16                }
17
18                /*
19                * @function set_content
20                * @abstract Carrega o atributo "content" do template principal
21                * @author Nilton Emilio Buhrer Neto <niltonneto@celepar.pr.gov.br>
22                */
23                public function set_content($content){
24                        $pre_content = $this->template->get_var("content");
25                        $this->template->set_var("content", $pre_content.$content);
26                }
27
28                /*
29                * @function print_all
30                * @abstract Imprime toda tela do Expresso Acessível
31                * @author Nilton Emilio Buhrer Neto <niltonneto@celepar.pr.gov.br>
32                */
33                public function print_page($class, $method){
34                        $this->print_header();
35                        $this->print_navbar();
36                        $filename = 'inc/class.'.$class.'.inc.php';
37                        include_once($filename);
38                        $obj = new $class();
39                        $obj -> $method();
40                        $this->template->pfp('out', 'mobile_home');
41                }
42
43                /*
44                * @function print_navbar
45                * @abstract Imprime o início da tela do Expresso Acessível => barra de navegação
46                * @author Mário César Kolling <mario.kolling@serpro.gov.br>
47                */
48                private function print_navbar(){
49                        $ui_mobilemail = CreateObject('ac.ui_mobilemail');
50
51                        $this-> template->set_var('href_newmail', 'index.php?menuaction=ac.ui_mobilemail.new_msg&clk=01');
52                        $this-> template->set_var('lang_newmail', lang('Create mail'));
53                        $this-> template->set_var('href_email', "index.php?menuaction=ac.ui_mobilemail.change_folder&folder=0");
54                        $this-> template->set_var('lang_email', lang('E-mail'));
55
56                        $save_in_folder = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['save_in_folder'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['save_in_folder'] : "-1";
57                        $save_in_folder = @eregi_replace("INBOX/", "INBOX".$_SESSION['phpgw_info']['expressomail']['email_server']['imapDelimiter'], $save_in_folder);
58                        $save_in_folder = @eregi_replace("INBOX.", "INBOX".$_SESSION['phpgw_info']['expressomail']['email_server']['imapDelimiter'], $save_in_folder);
59                        $save_in_folder = $save_in_folder == '' ? 'INBOX/Sent':$save_in_folder;
60                        $folder_number = $ui_mobilemail->get_folder_number($save_in_folder);
61                        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['save_in_folder'] = $save_in_folder;
62
63                        $this-> template->set_var('href_sent', "index.php?menuaction=ac.ui_mobilemail.change_folder&folder=".$folder_number);
64                        $this-> template->set_var('lang_sent', str_replace('*','',lang(str_replace('INBOX/','',$save_in_folder))));
65                        $this-> template->set_var('href_more', 'index.php?menuaction=ac.ui_mobilemail.list_folders');
66                        $this-> template->set_var('lang_more_folders', lang('More folders...'));
67                        $this-> template->set_var('href_calendar', "index.php?menuaction=ac.ui_mobilecalendar.index");
68                        $this-> template->set_var('lang_calendar', lang('Calendar'));
69                        $this-> template->set_var('href_cc', 'index.php?menuaction=mobile.ui_mobilecc.contacts_list');
70                        $this-> template->set_var('lang_cc', lang('Contact Center'));
71                }
72
73                /*
74                * @function print_header
75                * @abstract Imprime o início da tela do Expresso Acessível => headers html
76                * @author Mário César Kolling <mario.kolling@serpro.gov.br>
77                */
78                private function print_header(){
79                        $GLOBALS['phpgw']->accounts->read_repository();
80                        $var  = Array(
81                                'fullname'      => $GLOBALS['phpgw']->accounts->data['fullname'],
82                                'account_lid'   => $GLOBALS['phpgw_info']['user']['account_lid'],
83                                'lang_logout'   => lang('Logout'),
84                                'template_set'  => $GLOBALS['phpgw_info']['server']['template_set'],
85                                'lang_search'   => lang('Search')
86                        );
87                        $this->template->set_var($var);
88                }
89        }
90?>
Note: See TracBrowser for help on using the repository browser.