Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7455574
CodeEditorHooks.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
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'
)
||
// Temporary while CodeMirror is still in beta (T373711#11018957).
!(
\MediaWiki\Extension\CodeEditor\Hooks
::
tempIsCodeMirrorEnabled
()
)
)
)
{
$lang
=
'css'
;
return
false
;
}
return
true
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Nov 23, 00:05 (2 d, 11 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
47/54/d008b0caf75975051e49d2e8f4fb
Default Alt Text
CodeEditorHooks.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment