Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 11
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
ThreadProtectionFormView
0.00% covered (danger)
0.00%
0 / 11
0.00% covered (danger)
0.00%
0 / 2
30
0.00% covered (danger)
0.00%
0 / 1
 customizeNavigation
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
12
 __construct
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
6
1<?php
2
3// Pass-through wrapper
4class ThreadProtectionFormView extends LqtView {
5
6    /** @var Thread */
7    public $thread;
8
9    public function customizeNavigation( $skintemplate, &$links ) {
10        ThreadPermalinkView::customizeThreadNavigation( $skintemplate, $links, $this );
11
12        if ( isset( $links['actions']['protect'] ) ) {
13            $links['actions']['protect']['class'] = 'selected';
14        }
15
16        if ( isset( $links['actions']['unprotect'] ) ) {
17            $links['actions']['unprotect']['class'] = 'selected';
18        }
19    }
20
21    public function __construct( &$output, &$article, &$title, &$user, &$request ) {
22        parent::__construct( $output, $article, $title, $user, $request );
23
24        $t = Threads::withRoot( $this->article->getPage() );
25
26        $this->thread = $t;
27        if ( !$t ) {
28            return;
29        }
30
31        $this->article = $t->article();
32    }
33}