HTMLEditTools.php 989 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. class HTMLEditTools extends HTMLFormField {
  3. public function getInputHTML( $value ) {
  4. return '';
  5. }
  6. public function getTableRow( $value ) {
  7. $msg = $this->formatMsg();
  8. return '<tr><td></td><td class="mw-input">' .
  9. '<div class="mw-editTools">' .
  10. $msg->parseAsBlock() .
  11. "</div></td></tr>\n";
  12. }
  13. /**
  14. * @param string $value
  15. * @return string
  16. * @since 1.20
  17. */
  18. public function getDiv( $value ) {
  19. $msg = $this->formatMsg();
  20. return '<div class="mw-editTools">' . $msg->parseAsBlock() . '</div>';
  21. }
  22. /**
  23. * @param string $value
  24. * @return string
  25. * @since 1.20
  26. */
  27. public function getRaw( $value ) {
  28. return $this->getDiv( $value );
  29. }
  30. protected function formatMsg() {
  31. if ( empty( $this->mParams['message'] ) ) {
  32. $msg = $this->msg( 'edittools' );
  33. } else {
  34. $msg = $this->getMessage( $this->mParams['message'] );
  35. if ( $msg->isDisabled() ) {
  36. $msg = $this->msg( 'edittools' );
  37. }
  38. }
  39. $msg->inContentLanguage();
  40. return $msg;
  41. }
  42. }