forked from hallowelt/mediawiki-extensions-ImageMapEdit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImageMapEdit.class.php
More file actions
23 lines (21 loc) · 759 Bytes
/
ImageMapEdit.class.php
File metadata and controls
23 lines (21 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
class ImageMapEdit{
public static function onOutputPageBeforeHTML( &$oParserOutput, &$sText ) {
$oCurrentTitle = $oParserOutput->getTitle();
if ( is_null( $oCurrentTitle ) || $oCurrentTitle->getNamespace() != NS_FILE || $oParserOutput->getRequest()->getVal( 'action', 'view' ) != 'view' ) {
return true;
}
$oCurrentFile = wfFindFile( $oCurrentTitle );
if ( $oCurrentFile && !$oCurrentFile->canRender() ) {
return true;
}
return true;
}
public static function onBeforePageDisplay( &$oOutputPage, &$oSkin ) {
if ( $oOutputPage->getTitle()->getNamespace() != NS_FILE || $oOutputPage->getRequest()->getVal( 'action', 'view' ) != 'view' ) {
return true;
}
$oOutputPage->addModules( 'ext.imagemapedit' );
return true;
}
}