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