Subversion Repositories oidplus

Rev

Rev 104 | Rev 122 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 daniel-mar 1
<?php
2
 
3
/*
4
 * OIDplus 2.0
5
 * Copyright 2019 Daniel Marschall, ViaThinkSoft
6
 *
7
 * Licensed under the Apache License, Version 2.0 (the "License");
8
 * you may not use this file except in compliance with the License.
9
 * You may obtain a copy of the License at
10
 *
11
 *     http://www.apache.org/licenses/LICENSE-2.0
12
 *
13
 * Unless required by applicable law or agreed to in writing, software
14
 * distributed under the License is distributed on an "AS IS" BASIS,
15
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
 * See the License for the specific language governing permissions and
17
 * limitations under the License.
18
 */
19
 
120 daniel-mar 20
require_once __DIR__ . '/includes/oidplus.inc.php';
2 daniel-mar 21
 
120 daniel-mar 22
ob_start(); // allow cookie headers to be sent
23
 
24
header('Content-Type:text/html; charset=UTF-8');
25
 
26
OIDplus::init(true);
27
 
28
OIDplus::db()->set_charset("UTF8");
29
OIDplus::db()->query("SET NAMES 'utf8'");
30
 
31
$static_node_id = isset($_REQUEST['goto']) ? $_REQUEST['goto'] : 'oidplus:system';
32
$static = OIDplus::gui()::generateContentPage($static_node_id);
33
$static_title = $static['title'];
34
$static_icon = $static['icon'];
35
$static_content = $static['text'];
36
 
37
function combine_systemtitle_and_pagetitle($systemtitle, $pagetitle) {
38
        if ($systemtitle == $pagetitle) {
39
                return $systemtitle;
40
        } else {
41
                return $systemtitle . ' - ' . $pagetitle;
42
        }
5 daniel-mar 43
}
120 daniel-mar 44
 
45
$sysid_oid = OIDplus::system_id(true);
46
if (!$sysid_oid) $sysid_oid = 'unknown';
47
header('X-OIDplus-SystemID:'.$sysid_oid);
48
 
49
$sys_url = OIDplus::system_url();
50
header('X-OIDplus-SystemURL:'.$sys_url);
51
 
52
$sys_ver = OIDplus::getVersion();
53
if (!$sys_ver) $sys_ver = 'unknown';
54
header('X-OIDplus-SystemVersion:'.$sys_ver);
55
 
56
$sys_title = OIDplus::config()->systemTitle();
57
header('X-OIDplus-SystemTitle:'.$sys_title);
58
 
59
?><!DOCTYPE html>
60
<html lang="en">
61
 
62
<head>
63
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
64
        <meta name="OIDplus-SystemID" content="<?php echo htmlentities($sysid_oid); ?>">
65
        <meta name="OIDplus-SystemURL" content="<?php echo htmlentities($sys_url); ?>">
66
        <meta name="OIDplus-SystemVersion" content="<?php echo htmlentities($sys_ver); ?>">
67
        <meta name="OIDplus-SystemTitle" content="<?php echo htmlentities($sys_title); /* Do not remove. This meta tag is acessed via JS */ ?>">
68
        <meta name="theme-color" content="#A9DCF0">
69
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
70
 
71
        <title><?php echo combine_systemtitle_and_pagetitle(OIDplus::config()->systemTitle(), $static_title); ?></title>
72
 
73
        <!-- We are using jQuery 2.2.1, because 3.3.1 seems to be incompatible with jsTree (HTML content will not be loaded into jsTree!) TODO: File bug report -->
74
        <script src="3p/jquery/jquery-2.2.1.min.js"></script>
75
        <script src="3p/bootstrap/js/bootstrap.min.js"></script>
76
        <script src="3p/jstree/jstree.min.js"></script>
77
        <script src='3p/tinymce/tinymce.min.js'></script>
78
        <script src="3p/jquery-ui/jquery-ui.min.js"></script>
79
        <script src="3p/layout/jquery.layout.min.js"></script>
80
        <script src="3p/spamspan/spamspan.js"></script>
81
        <script src='https://www.google.com/recaptcha/api.js'></script>
82
        <script src="oidplus.min.js.php"></script>
83
 
84
        <link rel="stylesheet" href="3p/jstree/themes/default/style.min.css">
85
        <link rel="stylesheet" href="oidplus.min.css.php">
86
        <link rel="stylesheet" href="3p/bootstrap/css/bootstrap.min.css">
87
 
88
        <link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
89
 
90
        <!-- <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.css" /> -->
91
        <!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.js"></script> -->
92
        <link rel="stylesheet" type="text/css" href="3p/cookieconsent/cookieconsent.min.css">
93
        <script src="3p/cookieconsent/cookieconsent.min.js"></script>
94
        <script>
95
                window.addEventListener("load", function(){
96
                window.cookieconsent.initialise({
97
                        "palette": {
98
                                "popup": {
99
                                        "background": "#edeff5",
100
                                        "text": "#838391"
101
                                },
102
                                "button": {
103
                                        "background": "#4b81e8"
104
                                }
105
                        },
106
                        "position": "bottom-right"
107
                })});
108
        </script>
109
</head>
110
 
111
<body>
112
 
113
<div id="frames">
114
        <div id="system_title_bar">
115
                <div id="system_title_menu" onclick="mobileNavButtonClick(this)" onmouseenter="mobileNavButtonHover(this)" onmouseleave="mobileNavButtonHover(this)" style="visibility:hidden">
116
                        <div id="bar1"></div>
117
                        <div id="bar2"></div>
118
                        <div id="bar3"></div>
119
                </div>
120
 
121
                <div>
122
                        <a <?php echo oidplus_link('oidplus:system'); ?>>
123
                                <span id="system_title_1">ViaThinkSoft OIDplus 2.0</span><br>
124
                                <span id="system_title_2"><?php echo htmlentities(OIDplus::config()->systemTitle()); ?></span>
125
                        </a>
126
                </div>
127
        </div>
128
 
129
        <div id="oidtree" class="borderbox">
130
                <noscript>
131
                        <p><b>Please enable JavaScript to use all features</b></p>
132
                </noscript>
133
                <?php OIDplusTree::nonjs_menu(); ?>
134
        </div>
135
 
136
        <div id="content_window" class="borderbox">
137
                <?php
138
                $static_content = preg_replace_callback(
139
                        '|<a\s([^>]*)href="mailto:([^"]+)"([^>]*)>([^<]*)</a>|ismU',
140
                        function ($treffer) {
141
                                $email = $treffer[2];
142
                                $text = $treffer[4];
143
                                return secure_email($email, $text, 1); // AntiSpam
144
                        }, $static_content);
145
 
146
                echo '<h1 id="real_title">';
147
                if ($static_icon != '') echo '<img src="'.htmlentities($static_icon).'" width="48" height="48" alt="'.htmlentities($static_title).'"> ';
148
                echo htmlentities($static_title).'</h1>';
149
                echo '<div id="real_content">'.$static_content.'</div>';
150
                if ($_SERVER['REQUEST_METHOD'] == 'GET') {
151
                        echo '<br><p><img src="img/share.png" width="15" height="15" alt="Share"> <a href="?goto='.htmlentities($static_node_id).'" id="static_link" class="gray_footer_font">Static link to this page</a>';
152
                        echo '</p>';
153
                }
154
                echo '<br>';
155
                ?>
156
        </div>
157
</div>
158
 
159
</body>
160
</html>
161
<?php
162
 
163
$cont = ob_get_contents();
164
ob_end_clean();
165
 
166
echo $cont;