forked from miraheze/mw-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSitenotice.php
84 lines (72 loc) · 4.12 KB
/
Sitenotice.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
$wgNoticeProject = 'all';
if ( $wmgSiteNoticeOptOut ) {
// Only show important notices when optout
$wgNoticeProject = 'optout';
}
// Increment this version number whenever you change the site notice
$wgMajorSiteNoticeID = 80;
/**
* Wrap your sitenotice with <div data-nosnippet>(sitenotice)</div>
* or Google will use the sitenotice for their search result snippet.
*/
// Global SiteNotice
// if ( !$wmgSiteNoticeOptOut ) {
/* $wgHooks['SiteNoticeAfter'][] = 'wfGlobalSiteNotice';
function wfGlobalSiteNotice( &$siteNotice, $skin ) {
$skin->getOutput()->enableOOUI();
$skin->getOutput()->addInlineStyle(
'.mw-dismissable-notice .mw-dismissable-notice-body { margin: unset; }' .
'.skin-cosmos #sitenotice-learnmore-button { margin-left: 50px; }'
);
$siteNotice .= <<<EOF
<table style="width: 100%;">
<tbody><tr><td style="font-size: 120%; border-left: 4px solid #ff1e00; background-color: #ff5200cf; padding: 10px 15px; color: whitesmoke;">
<div data-nosnippet style="padding-top:0.3em; padding-bottom:0.1em;">
<div class="floatleft"><img alt="Miraheze Logo" src="https://upload.wikimedia.org/wikipedia/commons/b/b7/Miraheze-Logo.svg" decoding="async" width="50" height="50"></div>
<div style="padding-bottom: 15px; font-size: 13pt; font-weight: bold;">
Miraheze will be doing server maintenance beginning at 21:00 UTC on Sunday, 18 December 2022 lasting until 05:00 UTC on Monday, 19 December 2022. During this time, some wikis may be intermittently unavailable or go into read-only.
</div>
<!-- <span id="sitenotice-learnmore-button" class="oo-ui-widget oo-ui-widget-enabled oo-ui-buttonElement oo-ui-buttonElement-framed oo-ui-iconElement oo-ui-labelElement oo-ui-buttonWidget">
<a class="oo-ui-buttonElement-button" role="button" tabindex="0" href="...">
<span class="oo-ui-iconElement-icon oo-ui-icon-notice"></span>
<span class="oo-ui-labelElement-label">{$skin->msg( 'miraheze-sitenotice-learnmore' )->escaped()}</span>
<span class="oo-ui-indicatorElement-indicator oo-ui-indicatorElement-noIndicator"></span>
</a>
</span> -->
</div>
</td></tr></tbody>
</table>
EOF;
}*/
// }
// Specific wiki SiteNotice
/* if ( !preg_match( '/^([0-9]|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|q)/', $wgDBname ) ) {
$wgHooks['SiteNoticeAfter'][] = 'wfConditionalSiteNotice';
function wfConditionalSiteNotice( &$siteNotice, $skin ) {
$skin->getOutput()->enableOOUI();
$skin->getOutput()->addInlineStyle(
'.mw-dismissable-notice .mw-dismissable-notice-body { margin: unset; }' .
'.skin-cosmos #sitenotice-learnmore-button { margin-left: 50px; }'
);
$siteNotice .= <<<EOF
<table style="width: 100%;">
<tbody><tr><td style="font-size: 120%; border-left: 4px solid #ff1e00; background-color: #ff5200cf; padding: 10px 15px; color: whitesmoke;">
<div data-nosnippet style="padding-top:0.3em; padding-bottom:0.1em;">
<div class="floatleft"><img alt="Miraheze Logo" src="https://upload.wikimedia.org/wikipedia/commons/b/b7/Miraheze-Logo.svg" decoding="async" width="50" height="50"></div>
<div style="padding-bottom: 15px; font-size: 13pt; font-weight: bold;">
This wiki has been migrated to our new file storage software (Swift). If files appear missing for this wiki, please let us know by <a href="https://phabricator.miraheze.org/maniphest/task/edit/form/1">creating a task on Phabricator</a>. Thank you.
</div>
<span id="sitenotice-learnmore-button" class="oo-ui-widget oo-ui-widget-enabled oo-ui-buttonElement oo-ui-buttonElement-framed oo-ui-iconElement oo-ui-labelElement oo-ui-buttonWidget">
<a class="oo-ui-buttonElement-button" role="button" tabindex="0" href="https://meta.miraheze.org/wiki/Community_noticeboard#Note_from_SRE_Regarding_the_Swift_Migration">
<span class="oo-ui-iconElement-icon oo-ui-icon-notice"></span>
<span class="oo-ui-labelElement-label">{$skin->msg( 'miraheze-sitenotice-learnmore' )->escaped()}</span>
<span class="oo-ui-indicatorElement-indicator oo-ui-indicatorElement-noIndicator"></span>
</a>
</span>
</div>
</td></tr></tbody>
</table>
EOF;
}
} */