MediaWiki  master
HTMLEditTools.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * @stable to extend
5  */
6 class HTMLEditTools extends HTMLFormField {
7  public function getInputHTML( $value ) {
8  return '';
9  }
10 
11  public function getTableRow( $value ) {
12  $msg = $this->formatMsg();
13 
14  return '<tr><td></td><td class="mw-input">' .
15  '<div class="mw-editTools">' .
16  $msg->parseAsBlock() .
17  "</div></td></tr>\n";
18  }
19 
25  public function getDiv( $value ) {
26  $msg = $this->formatMsg();
27 
28  return '<div class="mw-editTools">' . $msg->parseAsBlock() . '</div>';
29  }
30 
36  public function getRaw( $value ) {
37  return $this->getDiv( $value );
38  }
39 
40  protected function formatMsg() {
41  if ( empty( $this->mParams['message'] ) ) {
42  $msg = $this->msg( 'edittools' );
43  } else {
44  $msg = $this->getMessage( $this->mParams['message'] );
45  if ( $msg->isDisabled() ) {
46  $msg = $this->msg( 'edittools' );
47  }
48  }
49  $msg->inContentLanguage();
50 
51  return $msg;
52  }
53 }
HTMLFormField\getMessage
getMessage( $value)
Turns a *-message parameter (which could be a MessageSpecifier, or a message name,...
Definition: HTMLFormField.php:1196
HTMLEditTools\getDiv
getDiv( $value)
Definition: HTMLEditTools.php:25
HTMLFormField
The parent class to generate form fields.
Definition: HTMLFormField.php:9
HTMLEditTools\getRaw
getRaw( $value)
Definition: HTMLEditTools.php:36
HTMLEditTools\getInputHTML
getInputHTML( $value)
This function must be implemented to return the HTML to generate the input object itself.
Definition: HTMLEditTools.php:7
HTMLEditTools\formatMsg
formatMsg()
Definition: HTMLEditTools.php:40
HTMLFormField\msg
msg( $key,... $params)
Get a translated interface message.
Definition: HTMLFormField.php:87
HTMLEditTools
Definition: HTMLEditTools.php:6
HTMLEditTools\getTableRow
getTableRow( $value)
Get the complete table row for the input, including help text, labels, and whatever.
Definition: HTMLEditTools.php:11