Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 17
0.00% covered (danger)
0.00%
0 / 5
CRAP
0.00% covered (danger)
0.00%
0 / 1
HTMLEditTools
0.00% covered (danger)
0.00%
0 / 16
0.00% covered (danger)
0.00%
0 / 5
56
0.00% covered (danger)
0.00%
0 / 1
 getInputHTML
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getTableRow
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
2
 getDiv
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getRaw
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 formatMsg
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 1
12
1<?php
2
3namespace MediaWiki\HTMLForm\Field;
4
5use MediaWiki\HTMLForm\HTMLFormField;
6
7/*
8 * @stable to extend
9 */
10class HTMLEditTools extends HTMLFormField {
11    public function getInputHTML( $value ) {
12        return '';
13    }
14
15    public function getTableRow( $value ) {
16        $msg = $this->formatMsg();
17
18        return '<tr><td></td><td class="mw-input">' .
19            '<div class="mw-editTools">' .
20            $msg->parseAsBlock() .
21            "</div></td></tr>\n";
22    }
23
24    /**
25     * @param string $value
26     * @return string
27     * @since 1.20
28     */
29    public function getDiv( $value ) {
30        $msg = $this->formatMsg();
31
32        return '<div class="mw-editTools">' . $msg->parseAsBlock() . '</div>';
33    }
34
35    /**
36     * @param string $value
37     * @return string
38     * @since 1.20
39     */
40    public function getRaw( $value ) {
41        return $this->getDiv( $value );
42    }
43
44    protected function formatMsg() {
45        if ( empty( $this->mParams['message'] ) ) {
46            $msg = $this->msg( 'edittools' );
47        } else {
48            $msg = $this->getMessage( $this->mParams['message'] );
49            if ( $msg->isDisabled() ) {
50                $msg = $this->msg( 'edittools' );
51            }
52        }
53        $msg->inContentLanguage();
54
55        return $msg;
56    }
57}
58
59/** @deprecated class alias since 1.42 */
60class_alias( HTMLEditTools::class, 'HTMLEditTools' );