Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 23
0.00% covered (danger)
0.00%
0 / 4
CRAP
0.00% covered (danger)
0.00%
0 / 1
IndividualThreadHistoryView
0.00% covered (danger)
0.00%
0 / 23
0.00% covered (danger)
0.00%
0 / 4
30
0.00% covered (danger)
0.00%
0 / 1
 customizeNavigation
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
 customizeSubtitle
0.00% covered (danger)
0.00%
0 / 11
0.00% covered (danger)
0.00%
0 / 1
2
 getSubtitle
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
 show
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
6
1<?php
2
3use MediaWiki\MediaWikiServices;
4
5class IndividualThreadHistoryView extends ThreadPermalinkView {
6    /** @var int|null */
7    protected $oldid;
8
9    public function customizeNavigation( $skin, &$links ) {
10        $links['views']['history']['class'] = 'selected';
11        parent::customizeNavigation( $skin, $links );
12        return true;
13    }
14
15    /**
16     * This customizes the subtitle of a history *listing* from the hook, and of an old revision
17     * from getSubtitle() below.
18     */
19    public function customizeSubtitle() {
20        $msg = wfMessage( 'lqt_hist_view_whole_thread' )->text();
21        $threadhist = $this->permalink(
22            $this->thread->topmostThread(),
23            $msg,
24            'thread_history'
25        );
26        $this->output->setSubtitle(
27            parent::getSubtitle() . '<br />' .
28            $this->output->getSubtitle() .
29            "<br />$threadhist"
30        );
31    }
32
33    public function getSubtitle() {
34        $this->article->setOldSubtitle( $this->oldid );
35        $this->customizeSubtitle();
36        return $this->output->getSubtitle();
37    }
38
39    public function show() {
40        if ( !$this->thread ) {
41            $this->showMissingThreadPage();
42            return false;
43        }
44
45        $hookContainer = MediaWikiServices::getInstance()->getHookContainer();
46        $hookContainer->register( 'PageHistoryBeforeList', [ $this, 'customizeSubtitle' ] );
47
48        return true;
49    }
50}