source: trunk/includes/main.php @ 187

Revision 187, 2.4 KB checked in by Ernest0x, 3 years ago (diff)

PHP 5.x fixes (mostly fixes for warnings and notices)

Line 
1<?php
2/*
3 * WiND - Wireless Nodes Database
4 *
5 * Copyright (C) 2005 Nikolaos Nikalexis <winner@cube.gr>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 dated June, 1991.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19 *
20 */
21
22include_once(ROOT_PATH."includes/html.php");
23include_once(ROOT_PATH."globals/classes/userdata.php");
24include_once(ROOT_PATH."globals/classes/message.php");
25include_once(ROOT_PATH."includes/main_header.php");
26include_once(ROOT_PATH."includes/main_center.php");
27include_once(ROOT_PATH."includes/main_footer.php");
28include_once(ROOT_PATH."includes/main_menu.php");
29
30class main {
31       
32        var $html;
33        var $userdata;
34        var $message;
35        var $header;
36        var $center;
37        var $footer;
38        var $menu;
39       
40        function main() {
41                $this->html = new html;
42                $this->userdata = new userdata;
43                $this->message = new message;
44                $this->header = new header;
45                $this->center = new center;
46                $this->footer = new footer;
47                $this->menu = new menu;
48        }
49       
50        function output() {
51                global $lang;
52               
53                if (get('session_lang') != '') $_SESSION['lang'] = get('session_lang');
54                if (isset($this->userdata->info)) {
55                    language_set($this->userdata->info['language']);
56                }
57                else {
58                    language_set();
59                }
60               
61                // Reload user info from database using SET NAMES (workaround)
62                $this->userdata->load_info();
63               
64                $this->html->head->add_title($lang['site_title']);
65                $this->html->head->add_meta("text/html; charset=".$lang['charset'], "", "Content-Type");
66                header("Content-Type: text/html; charset=".$lang['charset']);
67               
68                $this->html->body->tpl['center'] = $this->center->output();
69                $this->html->body->tpl['menu'] = $this->menu->output();
70                $this->html->body->tpl['header'] = $this->header->output();
71                $this->html->body->tpl['footer'] = $this->footer->output();
72                if ($this->message->show) $this->html->body->tpl['message'] = $this->message->output();
73               
74                return $this->html->output();
75        }
76       
77}
78
79?>
Note: See TracBrowser for help on using the repository browser.