Subversion Repositories oidplus

Rev

Rev 4 | Go to most recent revision | Details | 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
 
20
require_once __DIR__ . '/includes/oidplus.inc.php';
21
 
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_content = $static['text'];
35
 
36
?><!DOCTYPE html>
37
<html lang="en">
38
<head>
39
        <meta charset="utf-8">
40
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
41
        <title><?php echo htmlentities(OIDplus::config()->systemTitle().' - '.$static_title); ?></title>
42
        <link rel="stylesheet" href="3p/jstree/themes/default/style.min.css">
43
 
44
        <!-- 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 -->
45
        <script src="3p/jquery/jquery-2.2.1.min.js"></script>
46
        <script src="3p/bootstrap/js/bootstrap.min.js"></script>
47
        <script src="3p/jstree/jstree.min.js"></script>
48
        <script src='3p/tinymce/tinymce.min.js'></script>
49
        <script src="3p/jquery-ui/jquery-ui.js"></script>
50
        <script src="3p/layout/jquery.layout.min.js"></script>
51
        <script src="3p/spamspan/spamspan.js"></script>
52
        <script src='https://www.google.com/recaptcha/api.js'></script>
53
 
54
        <script src="oidplus.js"></script>
55
        <?php
56
        $ary = glob(__DIR__ . '/plugins/publicPages/'.'*'.'/script.js');
57
        sort($ary);
58
        foreach ($ary as $a) {
59
                echo '<script src="'.str_replace(__DIR__ . '/', '', $a).'"></script>';
60
        }
61
        $ary = glob(__DIR__ . '/plugins/adminPages/'.'*'.'/script.js');
62
        sort($ary);
63
        foreach ($ary as $a) {
64
                echo '<script src="'.str_replace(__DIR__ . '/', '', $a).'"></script>';
65
        }
66
        $ary = glob(__DIR__ . '/plugins/raPages/'.'*'.'/script.js');
67
        sort($ary);
68
        foreach ($ary as $a) {
69
                echo '<script src="'.str_replace(__DIR__ . '/', '', $a).'"></script>';
70
        }
71
        ?>
72
 
73
        <link rel="stylesheet" href="oidplus.css">
74
        <?php
75
        $ary = glob(__DIR__ . '/plugins/publicPages/'.'*'.'/style.css');
76
        sort($ary);
77
        foreach ($ary as $a) {
78
                echo '<link rel="stylesheet" href="'.str_replace(__DIR__ . '/', '', $a).'">';
79
        }
80
        $ary = glob(__DIR__ . '/plugins/adminPages/'.'*'.'/style.css');
81
        sort($ary);
82
        foreach ($ary as $a) {
83
                echo '<link rel="stylesheet" href="'.str_replace(__DIR__ . '/', '', $a).'">';
84
        }
85
        $ary = glob(__DIR__ . '/plugins/raPages/'.'*'.'/style.css');
86
        sort($ary);
87
        foreach ($ary as $a) {
88
                echo '<link rel="stylesheet" href="'.str_replace(__DIR__ . '/', '', $a).'">';
89
        }
90
        ?>
91
        <link rel="stylesheet" href="3p/bootstrap/css/bootstrap.min.css">
92
 
93
        <link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
94
 
95
        <script>
96
        system_title = <?php echo js_escape(OIDplus::config()->systemTitle().' - '); ?>; // TODO: Is that timing OK or is that a race condition?
97
        </script>
98
 
99
<!-- https://cookieconsent.insites.com -->
100
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.css" />
101
<script src="https://cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.js"></script>
102
<script>
103
window.addEventListener("load", function(){
104
window.cookieconsent.initialise({
105
  "palette": {
106
    "popup": {
107
      "background": "#edeff5",
108
      "text": "#838391"
109
    },
110
    "button": {
111
      "background": "#4b81e8"
112
    }
113
  },
114
  "position": "bottom-right"
115
})});
116
</script>
117
 
118
</head>
119
<body>
120
        <div id="system_title_bar" class="ui-layout-north">
121
                <a href="?goto=oidplus:system"><font color="#2b336f">ViaThinkSoft OIDplus 2.0</font><!-- <sup><font color="red">ALPHA</font>--></sup></a>
122
        </div>
123
 
124
        <div id="oidtree" class="borderbox ui-layout-west">
125
                <noscript>
126
                        <p><b>Please enable JavaScript to use all features</b></p>
127
                </noscript>
128
                <?php OIDplusTree::nonjs_menu($static_node_id); ?> <!-- TODO: NonJS menu: Horizontal Scrol bar missing -->
129
        </div>
130
 
131
        <div id="content_window" class="borderbox ui-layout-center">
132
                <?php
133
                $static_content = preg_replace_callback(
134
                        '|<a\s([^>]*)href="mailto:(.+)"([^>]*)>([^<]*)</a>|ismU',
135
                        function ($treffer) {
136
                                $email = $treffer[2];
137
                                $text = $treffer[4];
138
                                return secure_email($email, $text, 1); // AntiSpam
139
                        }, $static_content);
140
 
141
                echo '<h1 id="real_title">'.htmlentities($static_title).'</h1>';
142
                echo '<div id="real_content">'.$static_content.'</div>';
143
                echo '<br><p><a href="?goto='.htmlentities($static_node_id).'" id="static_link"><img src="img/share.png" width="15" height="15" alt="Share"> Static link to this page</a></p>';
144
                echo '<br>';
145
                ?>
146
        </div>
147
</body>
148
</html>
149
<?php
150
 
151
$cont = ob_get_contents();
152
ob_end_clean();
153
 
154
echo $cont;