Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1426378
CodeEditorHooks.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
925 B
Referenced Files
None
Subscribers
None
CodeEditorHooks.php
View Options
<?php
namespace
MediaWiki\Extension\TemplateStyles
;
/**
* @file
* @license GPL-2.0-or-later
*/
use
MediaWiki\Extension\CodeEditor\Hooks\CodeEditorGetPageLanguageHook
;
use
MediaWiki\Title\Title
;
/**
* TemplateStyles extension hooks
* All hooks from the CodeEditor extension which is optional to use with this extension.
*/
class
CodeEditorHooks
implements
CodeEditorGetPageLanguageHook
{
/**
* Edit our CSS content model like core's CSS
* @param Title $title Title being edited
* @param string|null &$lang CodeEditor language to use
* @param string $model Content model
* @param string $format Content format
* @return bool
*/
public
function
onCodeEditorGetPageLanguage
(
Title
$title
,
?
string
&
$lang
,
string
$model
,
string
$format
):
bool
{
if
(
$model
===
'sanitized-css'
&&
Hooks
::
getConfig
()->
get
(
'TemplateStylesUseCodeEditor'
)
)
{
$lang
=
'css'
;
return
false
;
}
return
true
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 16, 13:07 (1 d, 15 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
a4/d5/829b6e03c42ad5ede116af9b0c4b
Default Alt Text
CodeEditorHooks.php (925 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment