source: trunk/mobile/inc/class.mobiletemplate.inc.php @ 1474

Revision 1474, 3.7 KB checked in by eduardoalex, 15 years ago (diff)

Ticket #675 - Adicionadas as funcionalidades e o template add_recipients.tpl

  • Property svn:executable set to *
Line 
1<?php
2include_once(PHPGW_INCLUDE_ROOT.'/mobile/inc/class.ui_mobile.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 . '/mobile/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 Mini
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 Mini => barra de navegação
46                * @author Mário César Kolling <mario.kolling@serpro.gov.br>
47                */
48                private function print_navbar(){
49                        $this->ui_mobilemail = new ui_mobilemail();     
50                       
51                        $this-> template->set_var('href_newmail', 'index.php?menuaction=mobile.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=mobile.ui_mobilemail.mail_list");
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 = $this->ui_mobilemail->get_folder_number($save_in_folder);
61
62                        $this-> template->set_var('href_sent', "index.php?menuaction=mobile.ui_mobilemail.mail_list&folder=".$folder_number);
63                        $this-> template->set_var('lang_sent', str_replace('*','',lang(str_replace('INBOX/','',$save_in_folder))));
64                       
65                        $this-> template->set_var('href_calendar', "index.php?menuaction=mobile.ui_mobilecalendar.index");
66                        $this-> template->set_var('lang_calendar', lang('Calendar'));
67                        $this-> template->set_var('href_cc', 'index.php?menuaction=mobile.ui_mobilecc.contacts_list');
68                        $this-> template->set_var('lang_cc', lang('Contact Center'));           
69                }
70
71                /*
72                * @function print_header
73                * @abstract Imprime o início da tela do Expresso Mini => headers html
74                * @author Mário César Kolling <mario.kolling@serpro.gov.br>
75                */             
76                private function print_header(){
77                        $GLOBALS['phpgw']->accounts->read_repository();
78                        $var  = Array(
79                                'fullname'      => $GLOBALS['phpgw']->accounts->data['fullname'],
80                                'account_lid'   => $GLOBALS['phpgw_info']['user']['account_lid'],
81                                'lang_logout'   => lang('Logout'),
82                                'template_set'  => $GLOBALS['phpgw_info']['server']['template_set']
83                        );             
84                        $this->template->set_var($var);         
85                }               
86        }
87?>
Note: See TracBrowser for help on using the repository browser.