1 | <?php |
---|
2 | class mobiletemplate |
---|
3 | { |
---|
4 | private $template; |
---|
5 | |
---|
6 | /* |
---|
7 | * @function mobiletemplate |
---|
8 | * @abstract Construtor da classe, que monta o template home |
---|
9 | * @author Nilton Emilio Buhrer Neto <niltonneto@celepar.pr.gov.br> |
---|
10 | */ |
---|
11 | function mobiletemplate(){ |
---|
12 | $this->template = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); |
---|
13 | $this->template->set_file(Array('home_t' => 'home.tpl')); |
---|
14 | $this->template->set_block('home_t', 'mobile_home'); |
---|
15 | } |
---|
16 | |
---|
17 | /* |
---|
18 | * @function set_content |
---|
19 | * @abstract Carrega o atributo "content" do template principal |
---|
20 | * @author Nilton Emilio Buhrer Neto <niltonneto@celepar.pr.gov.br> |
---|
21 | */ |
---|
22 | public function set_content($content){ |
---|
23 | $pre_content = $this->template->get_var("content"); |
---|
24 | $this->template->set_var("content", $pre_content.$content); |
---|
25 | } |
---|
26 | |
---|
27 | /* |
---|
28 | * @function print_all |
---|
29 | * @abstract Imprime toda tela do Expresso Mini |
---|
30 | * @author Nilton Emilio Buhrer Neto <niltonneto@celepar.pr.gov.br> |
---|
31 | */ |
---|
32 | public function print_page($class, $method){ |
---|
33 | $this->print_header(); |
---|
34 | $this->print_navbar(); |
---|
35 | $filename = 'inc/class.'.$class.'.inc.php'; |
---|
36 | include_once($filename); |
---|
37 | $obj = new $class(); |
---|
38 | $obj -> $method(); |
---|
39 | $this->template->pfp('out', 'mobile_home'); |
---|
40 | } |
---|
41 | |
---|
42 | /* |
---|
43 | * @function print_navbar |
---|
44 | * @abstract Imprime o início da tela do Expresso Mini => barra de navegação |
---|
45 | * @author Mário César Kolling <mario.kolling@serpro.gov.br> |
---|
46 | */ |
---|
47 | private function print_navbar(){ |
---|
48 | $this-> template->set_var('href_newmail', 'index.php?menuaction=mobile.ui_mobilemail.new_msg&clk=01'); |
---|
49 | $this-> template->set_var('lang_newmail', lang('Create mail')); |
---|
50 | $this-> template->set_var('href_email', "index.php?menuaction=mobile.ui_mobilemail.mail_list"); |
---|
51 | $this-> template->set_var('lang_email', lang('E-mail')); |
---|
52 | $this-> template->set_var('href_calendar', "index.php?menuaction=mobile.ui_mobilecalendar.index"); |
---|
53 | $this-> template->set_var('lang_calendar', lang('Calendar')); |
---|
54 | $this-> template->set_var('href_cc', 'index.php?menuaction=mobile.ui_mobilecc.contacts_list'); |
---|
55 | $this-> template->set_var('lang_cc', lang('Contact Center')); |
---|
56 | } |
---|
57 | |
---|
58 | /* |
---|
59 | * @function print_header |
---|
60 | * @abstract Imprime o início da tela do Expresso Mini => headers html |
---|
61 | * @author Mário César Kolling <mario.kolling@serpro.gov.br> |
---|
62 | */ |
---|
63 | private function print_header(){ |
---|
64 | $GLOBALS['phpgw']->accounts->read_repository(); |
---|
65 | $var = Array( |
---|
66 | 'fullname' => $GLOBALS['phpgw']->accounts->data['fullname'], |
---|
67 | 'account_lid' => $GLOBALS['phpgw_info']['user']['account_lid'], |
---|
68 | 'lang_logout' => lang('Logout'), |
---|
69 | 'template_set' => $GLOBALS['phpgw_info']['server']['template_set'] |
---|
70 | ); |
---|
71 | $this->template->set_var($var); |
---|
72 | } |
---|
73 | } |
---|
74 | ?> |
---|