MediaWiki  1.30.0
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
12  '<tr><td></td><td class="mw-input">' .
13  '<div class="mw-editTools">' .
14  $msg->parseAsBlock() .
15  "</div></td></tr>\n";
16  }
17 
23  public function getDiv( $value ) {
24  $msg = $this->formatMsg();
25 
26  return '<div class="mw-editTools">' . $msg->parseAsBlock() . '</div>';
27  }
28 
34  public function getRaw( $value ) {
35  return $this->getDiv( $value );
36  }
37 
38  protected function formatMsg() {
39  if ( empty( $this->mParams['message'] ) ) {
40  $msg = $this->msg( 'edittools' );
41  } else {
42  $msg = $this->getMessage( $this->mParams['message'] );
43  if ( $msg->isDisabled() ) {
44  $msg = $this->msg( 'edittools' );
45  }
46  }
47  $msg->inContentLanguage();
48 
49  return $msg;
50  }
51 }
HTMLFormField\getMessage
getMessage( $value)
Turns a *-message parameter (which could be a MessageSpecifier, or a message name,...
Definition: HTMLFormField.php:1165
php
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
HTMLEditTools\getDiv
getDiv( $value)
Definition: HTMLEditTools.php:23
HTMLFormField
The parent class to generate form fields.
Definition: HTMLFormField.php:7
HTMLEditTools\getRaw
getRaw( $value)
Definition: HTMLEditTools.php:34
$value
$value
Definition: styleTest.css.php:45
HTMLFormField\msg
msg()
Get a translated interface message.
Definition: HTMLFormField.php:77
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:38
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