Blame
Date:
Tue May 17 04:00:37 2022 UTC
Message:
Daily backup
01
2021-12-17
jrmu
<?php if (!defined('PmWiki')) exit();
02
2021-12-17
jrmu
/* Copyright 2005-2019 Patrick R. Michaud (pmichaud@pobox.com)
03
2021-12-17
jrmu
This file is part of PmWiki; you can redistribute it and/or modify
04
2021-12-17
jrmu
it under the terms of the GNU General Public License as published
05
2021-12-17
jrmu
by the Free Software Foundation; either version 2 of the License, or
06
2021-12-17
jrmu
(at your option) any later version. See pmwiki.php for full details.
07
2021-12-17
jrmu
08
2021-12-17
jrmu
This script handles per-browser preferences. Preference settings
09
2021-12-17
jrmu
are stored in wiki pages as XLPage translations, and a cookie on
10
2021-12-17
jrmu
the browser tells PmWiki where to find the browser's preferred
11
2021-12-17
jrmu
settings.
12
2021-12-17
jrmu
13
2021-12-17
jrmu
This script looks for a ?setprefs= request parameter (e.g., in
14
2021-12-17
jrmu
a url); when it finds one it sets a 'setprefs' cookie on the browser
15
2021-12-17
jrmu
identifying the page to be used to load browser preferences,
16
2021-12-17
jrmu
and loads the associated preferences.
17
2021-12-17
jrmu
18
2021-12-17
jrmu
If there is no ?setprefs= request, then the script uses the
19
2021-12-17
jrmu
'setprefs' cookie from the browser to load the preference settings.
20
2021-12-17
jrmu
21
2021-12-17
jrmu
Script maintained by Petko YOTOV www.pmwiki.org/petko
22
2021-12-17
jrmu
*/
23
2021-12-17
jrmu
24
2021-12-17
jrmu
SDV($PrefsCookie, $CookiePrefix.'setprefs');
25
2021-12-17
jrmu
SDV($PrefsCookieExpires, $Now + 60 * 60 * 24 * 365);
26
2021-12-17
jrmu
$LogoutCookies[] = $PrefsCookie;
27
2021-12-17
jrmu
28
2021-12-17
jrmu
$sp = '';
29
2021-12-17
jrmu
if (@$_COOKIE[$PrefsCookie]) $sp = $_COOKIE[$PrefsCookie];
30
2021-12-17
jrmu
if (isset($_GET['setprefs'])) {
31
2021-12-17
jrmu
$sp = MakePageName($pagename, $_GET['setprefs']);
32
2021-12-17
jrmu
pmsetcookie($PrefsCookie, $sp, $PrefsCookieExpires, '/');
33
2021-12-17
jrmu
}
34
2021-12-17
jrmu
if ($sp && PageExists($sp)) XLPage('prefs', $sp, true);
35
2021-12-17
jrmu
36
2021-12-17
jrmu
if(@is_array($XL['prefs'])) {
37
2021-12-17
jrmu
foreach($XL['prefs'] as $k=>$v) {
38
2021-12-17
jrmu
if(! preg_match('/^(e_rows|e_cols|TimeFmt|Locale|Site\\.EditForm)$|^ak_/', $k))
39
2021-12-17
jrmu
unset($XL['prefs'][$k]);
40
2021-12-17
jrmu
}
41
2021-12-17
jrmu
}
42
2021-12-17
jrmu
43
2021-12-17
jrmu
XLSDV('en', array(
44
2021-12-17
jrmu
'ak_view' => '',
45
2021-12-17
jrmu
'ak_edit' => 'e',
46
2021-12-17
jrmu
'ak_history' => 'h',
47
2021-12-17
jrmu
'ak_attach' => '',
48
2021-12-17
jrmu
'ak_backlinks' => '',
49
2021-12-17
jrmu
'ak_logout' => '',
50
2021-12-17
jrmu
'ak_print' => '',
51
2021-12-17
jrmu
'ak_recentchanges' => 'c',
52
2021-12-17
jrmu
'ak_save' => 's',
53
2021-12-17
jrmu
'ak_saveedit' => 'u',
54
2021-12-17
jrmu
'ak_savedraft' => 'd',
55
2021-12-17
jrmu
'ak_preview' => 'p',
56
2021-12-17
jrmu
'ak_em' => '',
57
2021-12-17
jrmu
'ak_strong' => '',
58
2021-12-17
jrmu
));
59
2021-12-17
jrmu
IRCNow