Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 39 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
TalkpageHeaderView | |
0.00% |
0 / 39 |
|
0.00% |
0 / 2 |
20 | |
0.00% |
0 / 1 |
customizeNavigation | |
0.00% |
0 / 14 |
|
0.00% |
0 / 1 |
6 | |||
show | |
0.00% |
0 / 25 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | // Pass-through wrapper with an extra note at the top |
4 | class TalkpageHeaderView extends LqtView { |
5 | public function customizeNavigation( $skin, &$links ) { |
6 | $remove = [ |
7 | 'actions/edit', |
8 | 'actions/addsection', |
9 | 'views/history', |
10 | 'actions/watch', 'actions/move' |
11 | ]; |
12 | |
13 | foreach ( $remove as $rem ) { |
14 | [ $section, $item ] = explode( '/', $rem, 2 ); |
15 | unset( $links[$section][$item] ); |
16 | } |
17 | |
18 | $links['views']['header'] = [ |
19 | 'class' => 'selected', |
20 | 'text' => wfMessage( 'lqt-talkpage-history-tab' )->text(), |
21 | 'href' => '', |
22 | ]; |
23 | } |
24 | |
25 | public function show() { |
26 | if ( $this->request->getVal( 'action' ) === 'edit' ) { |
27 | $html = ''; |
28 | |
29 | $warn_bold = Xml::tags( |
30 | 'strong', |
31 | null, |
32 | wfMessage( 'lqt_header_warning_bold' )->parse() |
33 | ); |
34 | |
35 | $warn_link = $this->talkpageLink( |
36 | $this->title, |
37 | wfMessage( 'lqt_header_warning_new_discussion' )->text(), |
38 | 'talkpage_new_thread' |
39 | ); |
40 | |
41 | $html .= wfMessage( 'lqt_header_warning_before_big' ) |
42 | ->rawParams( $warn_bold, $warn_link )->parse(); |
43 | $html .= Xml::tags( |
44 | 'big', |
45 | null, |
46 | wfMessage( 'lqt_header_warning_big' )->rawParams( $warn_bold, $warn_link )->parse() |
47 | ); |
48 | $html .= wfMessage( 'word-separator' )->escaped(); |
49 | $html .= wfMessage( 'lqt_header_warning_after_big' ) |
50 | ->rawParams( $warn_bold, $warn_link )->parse(); |
51 | |
52 | $html = Xml::tags( 'p', [ 'class' => 'lqt_header_warning' ], $html ); |
53 | |
54 | $this->output->addHTML( $html ); |
55 | } |
56 | |
57 | return true; |
58 | } |
59 | } |