Subversion Repositories oidplus

Rev

Rev 448 | Rev 453 | 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
360 daniel-mar 5
 * Copyright 2019-2020 Daniel Marschall, ViaThinkSoft
2 daniel-mar 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
 
207 daniel-mar 20
header('Content-Type:text/html; charset=UTF-8');
2 daniel-mar 21
 
207 daniel-mar 22
require_once __DIR__ . '/includes/oidplus.inc.php';
23
 
366 daniel-mar 24
set_exception_handler(array('OIDplusGui', 'html_exception_handler'));
240 daniel-mar 25
 
207 daniel-mar 26
ob_start(); // allow cookie headers to be sent
27
 
120 daniel-mar 28
OIDplus::init(true);
29
 
30
$static_node_id = isset($_REQUEST['goto']) ? $_REQUEST['goto'] : 'oidplus:system';
31
$static = OIDplus::gui()::generateContentPage($static_node_id);
32
$static_title = $static['title'];
33
$static_icon = $static['icon'];
34
$static_content = $static['text'];
35
 
362 daniel-mar 36
OIDplus::handleLangArgument();
37
 
120 daniel-mar 38
function combine_systemtitle_and_pagetitle($systemtitle, $pagetitle) {
309 daniel-mar 39
        // Please also change the function in oidplus_base.js
120 daniel-mar 40
        if ($systemtitle == $pagetitle) {
41
                return $systemtitle;
42
        } else {
309 daniel-mar 43
                return $pagetitle . ' - ' . $systemtitle;
120 daniel-mar 44
        }
5 daniel-mar 45
}
120 daniel-mar 46
 
227 daniel-mar 47
$sysid_oid = OIDplus::getSystemId(true);
360 daniel-mar 48
if (!$sysid_oid) $sysid_oid = 'unknown'; // do not translate
120 daniel-mar 49
header('X-OIDplus-SystemID:'.$sysid_oid);
50
 
227 daniel-mar 51
$sys_url = OIDplus::getSystemUrl();
120 daniel-mar 52
header('X-OIDplus-SystemURL:'.$sys_url);
53
 
54
$sys_ver = OIDplus::getVersion();
360 daniel-mar 55
if (!$sys_ver) $sys_ver = 'unknown'; // do not translate
120 daniel-mar 56
header('X-OIDplus-SystemVersion:'.$sys_ver);
57
 
170 daniel-mar 58
$sys_install_type = OIDplus::getInstallType();
59
header('X-OIDplus-SystemInstallType:'.$sys_install_type);
60
 
257 daniel-mar 61
$sys_title = OIDplus::config()->getValue('system_title');
120 daniel-mar 62
header('X-OIDplus-SystemTitle:'.$sys_title);
63
 
448 daniel-mar 64
$add_css_args = array();
65
$add_css_args[] = 'theme='.urlencode(OIDplus::config()->getValue('design'));
142 daniel-mar 66
if (class_exists('OIDplusPageAdminColors')) {
451 daniel-mar 67
        // QUESTION: Should the additional parameters of the CSS script
68
        //           be moved into the OIDplusPageAdminColors plugins using "implementsFeature"?
69
        //           Problem: The JS function test_color_theme() has an hardcoded set of parameters
70
        //           and does not follow the arguments that might be set by other plugins.
448 daniel-mar 71
        $add_css_args[] = 'invert='.(OIDplus::config()->getValue('color_invert'));
72
        $add_css_args[] = 'h_shift='.(OIDplus::config()->getValue('color_hue_shift')/360);
73
        $add_css_args[] = 's_shift='.(OIDplus::config()->getValue('color_sat_shift')/100);
74
        $add_css_args[] = 'v_shift='.(OIDplus::config()->getValue('color_val_shift')/100);
142 daniel-mar 75
}
448 daniel-mar 76
$add_css_args = count($add_css_args) > 0 ? '?'.implode('&',$add_css_args) : '';
142 daniel-mar 77
 
120 daniel-mar 78
?><!DOCTYPE html>
434 daniel-mar 79
<html lang="<?php echo substr(OIDplus::getCurrentLang(),0,2); ?>">
120 daniel-mar 80
 
81
<head>
82
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
83
        <meta name="OIDplus-SystemID" content="<?php echo htmlentities($sysid_oid); ?>">
84
        <meta name="OIDplus-SystemURL" content="<?php echo htmlentities($sys_url); ?>">
85
        <meta name="OIDplus-SystemVersion" content="<?php echo htmlentities($sys_ver); ?>">
170 daniel-mar 86
        <meta name="OIDplus-SystemInstallType" content="<?php echo htmlentities($sys_install_type); ?>">
215 daniel-mar 87
        <meta name="OIDplus-SystemTitle" content="<?php echo htmlentities($sys_title); /* Do not remove. This meta tag is acessed by oidplus_base.js */ ?>">
120 daniel-mar 88
        <meta name="theme-color" content="#A9DCF0">
89
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
90
 
395 daniel-mar 91
        <title><?php echo htmlentities(combine_systemtitle_and_pagetitle(OIDplus::config()->getValue('system_title'), $static_title)); ?></title>
120 daniel-mar 92
 
375 daniel-mar 93
        <script src="polyfill.min.js.php"></script>
376 daniel-mar 94
        <?php
95
        if (OIDplus::baseConfig()->getValue('RECAPTCHA_ENABLED', false) == true) {
96
                echo '<script src="https://www.google.com/recaptcha/api.js"></script>';
97
        }
98
        ?>
366 daniel-mar 99
        <script src="oidplus.min.js.php"></script>
215 daniel-mar 100
 
366 daniel-mar 101
        <link rel="stylesheet" href="oidplus.min.css.php<?php echo htmlentities($add_css_args); ?>">
314 daniel-mar 102
        <link rel="shortcut icon" type="image/x-icon" href="favicon.ico.php">
120 daniel-mar 103
</head>
104
 
105
<body>
106
 
107
<div id="frames">
126 daniel-mar 108
        <div id="content_window" class="borderbox">
109
                <?php
110
                $static_content = preg_replace_callback(
111
                        '|<a\s([^>]*)href="mailto:([^"]+)"([^>]*)>([^<]*)</a>|ismU',
112
                        function ($treffer) {
113
                                $email = $treffer[2];
114
                                $text = $treffer[4];
250 daniel-mar 115
                                return OIDplus::mailUtils()->secureEmailAddress($email, $text, 1); // AntiSpam
126 daniel-mar 116
                        }, $static_content);
117
 
118
                echo '<h1 id="real_title">';
127 daniel-mar 119
                if ($static_icon != '') echo '<img src="'.htmlentities($static_icon).'" width="48" height="48" alt=""> ';
126 daniel-mar 120
                echo htmlentities($static_title).'</h1>';
121
                echo '<div id="real_content">'.$static_content.'</div>';
315 daniel-mar 122
                if ((!isset($_SERVER['REQUEST_METHOD'])) || ($_SERVER['REQUEST_METHOD'] == 'GET')) {
360 daniel-mar 123
                        echo '<br><p><img src="img/share.png" width="15" height="15" alt="'._L('Share').'"> <a href="?goto='.htmlentities($static_node_id).'" id="static_link" class="gray_footer_font">'._L('Static link to this page').'</a>';
126 daniel-mar 124
                        echo '</p>';
125
                }
126
                echo '<br>';
127
                ?>
128
        </div>
129
 
120 daniel-mar 130
        <div id="system_title_bar">
360 daniel-mar 131
                <?php
132
                echo '<div id="system_title_menu" onclick="mobileNavButtonClick(this)" onmouseenter="mobileNavButtonHover(this)" onmouseleave="mobileNavButtonHover(this)">';
133
                echo '  <div id="bar1"></div>';
134
                echo '  <div id="bar2"></div>';
135
                echo '  <div id="bar3"></div>';
136
                echo '</div>';
137
                echo '';
138
                echo '<div id="system_title_text">';
451 daniel-mar 139
                echo '  <a '.OIDplus::gui()->link('oidplus:system').' id="system_title_a">';
140
                echo '          <span id="system_title_logo"></span>';
360 daniel-mar 141
                echo '          <span id="system_title_1">'._L('ViaThinkSoft OIDplus 2.0').'</span><br>';
142
                echo '          <span id="system_title_2">'.htmlentities(OIDplus::config()->getValue('system_title')).'</span>';
143
                echo '  </a>';
144
                echo '</div>';
145
                ?>
185 daniel-mar 146
        </div>
183 daniel-mar 147
 
362 daniel-mar 148
        <?php
149
        echo OIDplusGui::getLanguageBox($static_node_id, true);
150
        ?>
355 daniel-mar 151
 
186 daniel-mar 152
        <div id="gotobox">
360 daniel-mar 153
                <?php
154
                echo '<input type="text" name="goto" id="gotoedit" value="'.htmlentities($static_node_id).'">';
155
                echo '<input type="button" value="'._L('Go').'" onclick="gotoButtonClicked()" id="gotobutton">';
156
                ?>
186 daniel-mar 157
        </div>
158
 
120 daniel-mar 159
        <div id="oidtree" class="borderbox">
374 daniel-mar 160
                <?php
161
                //echo '<noscript>';
162
                //echo '<p><b>'._L('Please enable JavaScript to use all features').'</b></p>';
163
                //echo '</noscript>';
164
                OIDplus::menuUtils()->nonjs_menu();
165
                ?>
120 daniel-mar 166
        </div>
167
</div>
168
 
169
</body>
170
</html>
171
<?php
172
 
173
$cont = ob_get_contents();
174
ob_end_clean();
175
 
366 daniel-mar 176
echo $cont;