msg( 'doubleredirectstext' )->parseAsBlock(); } function reallyGetQueryInfo( $namespace = null, $title = null ) { $limitToTitle = !( $namespace === null && $title === null ); $retval = array ( 'tables' => array ( 'ra' => 'redirect', 'rb' => 'redirect', 'pa' => 'page', 'pb' => 'page', 'pc' => 'page' ), 'fields' => array ( 'namespace' => 'pa.page_namespace', 'title' => 'pa.page_title', 'value' => 'pa.page_title', 'nsb' => 'pb.page_namespace', 'tb' => 'pb.page_title', 'nsc' => 'pc.page_namespace', 'tc' => 'pc.page_title' ), 'conds' => array ( 'ra.rd_from = pa.page_id', 'pb.page_namespace = ra.rd_namespace', 'pb.page_title = ra.rd_title', 'rb.rd_from = pb.page_id', 'pc.page_namespace = rb.rd_namespace', 'pc.page_title = rb.rd_title' ) ); if ( $limitToTitle ) { $retval['conds']['pa.page_namespace'] = $namespace; $retval['conds']['pa.page_title'] = $title; } return $retval; } function getQueryInfo() { return $this->reallyGetQueryInfo(); } function getOrderFields() { return array ( 'ra.rd_namespace', 'ra.rd_title' ); } function formatResult( $skin, $result ) { $titleA = Title::makeTitle( $result->namespace, $result->title ); if ( $result && !isset( $result->nsb ) ) { $dbr = wfGetDB( DB_SLAVE ); $qi = $this->reallyGetQueryInfo( $result->namespace, $result->title ); $res = $dbr->select($qi['tables'], $qi['fields'], $qi['conds'], __METHOD__ ); if ( $res ) { $result = $dbr->fetchObject( $res ); } } if ( !$result ) { return '' . Linker::link( $titleA, null, array(), array( 'redirect' => 'no' ) ) . ''; } $titleB = Title::makeTitle( $result->nsb, $result->tb ); $titleC = Title::makeTitle( $result->nsc, $result->tc ); $linkA = Linker::linkKnown( $titleA, null, array(), array( 'redirect' => 'no' ) ); $edit = Linker::linkKnown( $titleA, $this->msg( 'parentheses', $this->msg( 'editlink' )->text() )->escaped(), array(), array( 'redirect' => 'no', 'action' => 'edit' ) ); $linkB = Linker::linkKnown( $titleB, null, array(), array( 'redirect' => 'no' ) ); $linkC = Linker::linkKnown( $titleC ); $lang = $this->getLanguage(); $arr = $lang->getArrow() . $lang->getDirMark(); return( "{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" ); } }