Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
CSU
tweeki
Commits
d019e01b
Commit
d019e01b
authored
Oct 25, 2020
by
thaider
Browse files
disabling parser cache the new way, fixes #165
parent
28191bb3
Changes
2
Hide whitespace changes
Inline
Side-by-side
includes/Hooks.php
View file @
d019e01b
...
...
@@ -170,6 +170,7 @@ class TweekiHooks {
*/
static
function
setHiddenElements
(
Parser
$parser
)
{
global
$wgTweekiSkinHideAll
,
$wgTweekiSkinHideable
;
$parser
->
getOutput
()
->
updateCacheExpiry
(
0
);
for
(
$i
=
1
;
$i
<
func_num_args
();
$i
++
)
{
if
(
in_array
(
func_get_arg
(
$i
),
$wgTweekiSkinHideable
)
)
{
...
...
@@ -187,6 +188,7 @@ class TweekiHooks {
*/
static
function
setHiddenElementsGroups
(
Parser
$parser
)
{
global
$wgTweekiSkinHideAll
,
$wgTweekiSkinHideable
;
$parser
->
getOutput
()
->
updateCacheExpiry
(
0
);
$groups_except
=
explode
(
','
,
func_get_arg
(
1
)
);
$groups_user
=
$parser
->
getUser
()
->
getEffectiveGroups
();
...
...
@@ -207,6 +209,8 @@ class TweekiHooks {
* @return string
*/
static
function
addBodyclass
(
Parser
$parser
)
{
$parser
->
getOutput
()
->
updateCacheExpiry
(
0
);
for
(
$i
=
1
;
$i
<
func_num_args
();
$i
++
)
{
$GLOBALS
[
'wgTweekiSkinAdditionalBodyClasses'
][]
=
func_get_arg
(
$i
);
}
...
...
@@ -940,13 +944,4 @@ class TweekiHooks {
}
return
true
;
}
public
static
function
onOutputPageBodyAttributes
(
$out
,
$sk
,
&
$bodyAttrs
)
{
if
(
isset
(
$bodyAttrs
[
'class'
]
)
&&
strlen
(
$bodyAttrs
[
'class'
]
)
>
0
)
{
$bodyAttrs
[
'class'
]
.
=
' '
.
implode
(
' '
,
SkinTweeki
::
$bodyClasses
);
}
else
{
$bodyAttrs
[
'class'
]
=
implode
(
' '
,
SkinTweeki
::
$bodyClasses
);
}
}
}
skin.json
View file @
d019e01b
...
...
@@ -38,8 +38,7 @@
"MagicWordMagicWords"
:
"TweekiHooks::onMagicWordMagicWords"
,
"MagicWordwgVariableIDs"
:
"TweekiHooks::onMagicWordwgVariableIDs"
,
"InternalParseBeforeLinks"
:
"TweekiHooks::onInternalParseBeforeLinks"
,
"OutputPageBeforeHTML"
:
"TweekiHooks::onOutputPageBeforeHTML"
,
"OutputPageBodyAttributes"
:
"TweekiHooks::onOutputPageBodyAttributes"
"OutputPageBeforeHTML"
:
"TweekiHooks::onOutputPageBeforeHTML"
},
"ResourceModules"
:
{
"skins.tweeki.bootstrap.styles"
:
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment