} elseif ( $offender && IP::isIPAddress( $offender->getName() ) ) {
$qc = array( 'ls_field' => 'target_author_ip', 'ls_value' => $offender->getName() );
}
+ } else {
+ // Allow extensions to add relations to their search types
+ Hooks::run( 'SpecialLogAddLogSearchRelations', array( $opts->getValue( 'type' ), $this->getRequest(), &$qc ) );
}
# Some log types are only for a 'User:' title but we might have been given
# only the username instead of the full title 'User:username'. This part try
# to lookup for a user by that name and eventually fix user input. See bug 1697.
- wfRunHooks( 'GetLogTypesOnUser', array( &$this->typeOnUser ) );
+ Hooks::run( 'GetLogTypesOnUser', array( &$this->typeOnUser ) );
if ( in_array( $opts->getValue( 'type' ), $this->typeOnUser ) ) {
# ok we have a type of log which expect a user title.
$target = Title::newFromText( $opts->getValue( 'page' ) );
}
/**
- * Return an array of subpages beginning with $search that this special page will accept.
+ * Return an array of subpages that this special page will accept.
*
- * @param string $search Prefix to search for
- * @param int $limit Maximum number of results to return
- * @return string[] Matching subpages
+ * @return string[] subpages
*/
- public function prefixSearchSubpages( $search, $limit = 10 ) {
+ public function getSubpagesForPrefixSearch() {
$subpages = $this->getConfig()->get( 'LogTypes' );
$subpages[] = 'all';
sort( $subpages );
- return self::prefixSearchArray( $search, $limit, $subpages );
+ return $subpages;
}
private function parseParams( FormOptions $opts, $par ) {
*/
protected function addHeader( $type ) {
$page = new LogPage( $type );
- $this->getOutput()->setPageTitle( $page->getName()->text() );
- $this->getOutput()->addHTML( $page->getDescription()->parseAsBlock() );
+ $this->getOutput()->setPageTitle( $page->getName() );
+ $this->getOutput()->addHTML( $page->getDescription()
+ ->setContext( $this->getContext() )->parseAsBlock() );
}
protected function getGroupName() {