summaryrefslogtreecommitdiff
path: root/includes/htmlform/HTMLEditTools.php
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-05-01 15:12:12 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-05-01 15:12:12 -0400
commitc9aa36da061816dee256a979c2ff8d2ee41824d9 (patch)
tree29f7002b80ee984b488bd047dbbd80b36bf892e9 /includes/htmlform/HTMLEditTools.php
parentb4274e0e33eafb5e9ead9d949ebf031a9fb8363b (diff)
parentd1ba966140d7a60cd5ae4e8667ceb27c1a138592 (diff)
Merge branch 'archwiki'
# Conflicts: # skins/ArchLinux.php # skins/ArchLinux/archlogo.gif
Diffstat (limited to 'includes/htmlform/HTMLEditTools.php')
-rw-r--r--includes/htmlform/HTMLEditTools.php51
1 files changed, 51 insertions, 0 deletions
diff --git a/includes/htmlform/HTMLEditTools.php b/includes/htmlform/HTMLEditTools.php
new file mode 100644
index 00000000..77924ef2
--- /dev/null
+++ b/includes/htmlform/HTMLEditTools.php
@@ -0,0 +1,51 @@
+<?php
+
+class HTMLEditTools extends HTMLFormField {
+ public function getInputHTML( $value ) {
+ return '';
+ }
+
+ public function getTableRow( $value ) {
+ $msg = $this->formatMsg();
+
+ return
+ '<tr><td></td><td class="mw-input">' .
+ '<div class="mw-editTools">' .
+ $msg->parseAsBlock() .
+ "</div></td></tr>\n";
+ }
+
+ /**
+ * @param string $value
+ * @return string
+ * @since 1.20
+ */
+ public function getDiv( $value ) {
+ $msg = $this->formatMsg();
+
+ return '<div class="mw-editTools">' . $msg->parseAsBlock() . '</div>';
+ }
+
+ /**
+ * @param string $value
+ * @return string
+ * @since 1.20
+ */
+ public function getRaw( $value ) {
+ return $this->getDiv( $value );
+ }
+
+ protected function formatMsg() {
+ if ( empty( $this->mParams['message'] ) ) {
+ $msg = $this->msg( 'edittools' );
+ } else {
+ $msg = $this->msg( $this->mParams['message'] );
+ if ( $msg->isDisabled() ) {
+ $msg = $this->msg( 'edittools' );
+ }
+ }
+ $msg->inContentLanguage();
+
+ return $msg;
+ }
+}