[ Index ] |
PHP Cross Reference of MediaWiki-1.24.0 |
[Summary view] [Print] [Text view]
1 <?php 2 3 class Scribunto_LuaTitleBlacklistLibrary extends Scribunto_LuaLibraryBase { 4 public function register() { 5 $lib = array( 6 'test' => array( $this, 'test' ), 7 ); 8 9 $this->getEngine()->registerInterface( __DIR__ . '/mw.ext.TitleBlacklist.lua', $lib, array() ); 10 } 11 12 public function test( $action = null, $title = null ) { 13 $this->checkType( 'mw.ext.TitleBlacklist.test', 1, $action, 'string' ); 14 $this->checkTypeOptional( 'mw.ext.TitleBlacklist.test', 2, $title, 'string', '' ); 15 $this->incrementExpensiveFunctionCount(); 16 if ( $title == '' ) { 17 $title = $this->getParser()->mTitle->getPrefixedText(); 18 } 19 $entry = TitleBlacklist::singleton()->isBlacklisted( $title, $action ); 20 if ( $entry ) { 21 return array( array( 22 'params' => $entry->getParams(), 23 'regex' => $entry->getRegex(), 24 'raw' => $entry->getRaw(), 25 'version' => $entry->getFormatVersion(), 26 'message' => $entry->getErrorMessage( $action ), 27 'custommessage' => $entry->getCustomMessage() 28 ) ); 29 } 30 return array( null ); 31 } 32 33 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 14:03:12 2014 | Cross-referenced by PHPXref 0.7.1 |