Added javascript source collecting functions
[fa-stable.git] / includes / main.inc
1 <?php
2
3     include_once($path_to_root . "/includes/db/connect_db.inc");
4
5     include_once($path_to_root . "/includes/reserved.inc");
6     include_once($path_to_root . "/includes/errors.inc");
7     include_once($path_to_root . "/includes/types.inc");
8     include_once($path_to_root . "/includes/systypes.inc");
9     include_once($path_to_root . "/includes/references.inc");
10     include_once($path_to_root . "/includes/prefs/sysprefs.inc");
11     include_once($path_to_root . "/includes/db/comments_db.inc");
12         include_once($path_to_root . "/includes/db/sql_functions.inc");
13
14     include_once($path_to_root . "/admin/db/users_db.inc");
15     include_once($path_to_root . "/includes/ui/ui_view.inc");
16         
17     function page($title, $no_menu=false, $is_index=false, $onload="", $js="")
18     {
19
20         global $path_to_root, $js_lib;
21
22         $hide_menu = $no_menu;
23
24         include($path_to_root . "/includes/page/header.inc");
25
26         page_header($title, $no_menu, $is_index, $onload, $js);
27     }
28
29     function end_page($no_menu=false, $is_index=false)
30     {
31         global $path_to_root;
32
33         $hide_menu = $no_menu;
34
35         include($path_to_root . "/includes/page/footer.inc");
36
37         page_footer($no_menu, $is_index);
38     }
39         
40         function add_js_file($filename) 
41         {
42           global $js_static;
43           $search = array_search($filename, $js_static);
44           if ($search === false || $search === null) // php>4.2.0 returns null
45                 $js_static[] = $filename;
46         }
47
48         function add_js_source($text) 
49         {
50           global $js_lib;
51           
52           $search = array_search($text, $js_lib);
53           if ($search === false || $search === null) // php>4.2.0 returns null
54                 $js_lib[] = $text;
55         }
56 ?>