Added missing functions logSqlError() and loadPageHeader()/loadPageFooter().
[mailer.git] / js.php
1 <?php
2 /************************************************************************
3  * Mailer v0.2.1-FINAL                                Start: 10/15/2008 *
4  * ===================                          Last change: 10/15/2008 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : js.php                                           *
8  * -------------------------------------------------------------------- *
9  * Short description : Image code for multi-purposes                    *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Code-Bild fuer verschiedene Zwecke               *
12  * -------------------------------------------------------------------- *
13  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
14  * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
15  * For more information visit: http://mxchange.org                      *
16  *                                                                      *
17  * This program is free software; you can redistribute it and/or modify *
18  * it under the terms of the GNU General Public License as published by *
19  * the Free Software Foundation; either version 2 of the License, or    *
20  * (at your option) any later version.                                  *
21  *                                                                      *
22  * This program is distributed in the hope that it will be useful,      *
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
25  * GNU General Public License for more details.                         *
26  *                                                                      *
27  * You should have received a copy of the GNU General Public License    *
28  * along with this program; if not, write to the Free Software          *
29  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
30  * MA  02110-1301  USA                                                  *
31  ************************************************************************/
32
33 // XDEBUG call
34 //* DEBUG: */ xdebug_start_trace();
35
36 // Load security stuff here
37 require('inc/libs/security_functions.php');
38
39 // Init start time
40 $GLOBALS['__start_time'] = microtime(TRUE);
41
42 /*
43  * This is a fake-CSS file loader, more a JavaScript loader...
44  * This is in one way good and in one not. The whole reset part will be
45  * by-passed even in this "faked" CSS mode. The bad news is that this makes all
46  * JS calls on this script to CSS calls. So no real "request" like in MVC
47  * pattern is given...
48  *
49  * But Mailer-Project 0.3.0 will show that in better way! :D :D :D
50  */
51 $GLOBALS['__module']      = 'js';
52 $GLOBALS['__output_mode'] = 1;
53
54 // Load the required file(s)
55 require('inc/config-global.php');
56
57 // Set header and HTTP status
58 setContentType('text/javascript');
59 setHttpStatus('404 Not Found');
60
61 // Is 'js' is provied?
62 if (isGetRequestElementSet('js')) {
63         // Load header
64         loadPageHeader();
65
66         // Prepare include file for looking
67         $inc = sprintf('inc/js/js-%s.php', getRequestElement('js'));
68
69         // Is that file readable?
70         if (isIncludeReadable($inc)) {
71                 // Okay, found
72                 setHttpStatus('200 OK');
73
74                 // Include it
75                 loadIncludeOnce($inc);
76         } // END - if
77
78         // Load footer
79         loadPageFooter();
80 } // END - if
81
82 // Shutdown
83 doShutdown();
84
85 // [EOF]
86 ?>