From 60e8b55856524fd2b5db6e6f0315175c1f9047c1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Thu, 19 Nov 2015 21:34:27 +0100 Subject: [PATCH] Reduce usage of inline Inspired by T119055. Change-Id: I6829a67fb77c00e87772983f35b884bf03fad7e3 --- includes/logging/LogEventsList.php | 6 +-- includes/specials/SpecialContributions.php | 10 ++--- includes/specials/SpecialProtectedpages.php | 49 ++++++++++----------- 3 files changed, 32 insertions(+), 33 deletions(-) diff --git a/includes/logging/LogEventsList.php b/includes/logging/LogEventsList.php index 4c0bd8ef98..df3761072e 100644 --- a/includes/logging/LogEventsList.php +++ b/includes/logging/LogEventsList.php @@ -233,7 +233,7 @@ class LogEventsList extends ContextSource { array( 'class' => 'mw-autocomplete-user' ) ); - return '' . $label . ''; + return '' . $label . ''; } /** @@ -249,7 +249,7 @@ class LogEventsList extends ContextSource { $title ); - return '' . $label . ''; + return '' . $label . ''; } /** @@ -257,7 +257,7 @@ class LogEventsList extends ContextSource { * @return string Checkbox */ private function getTitlePattern( $pattern ) { - return '' . + return '' . Xml::checkLabel( $this->msg( 'log-title-wildcard' )->text(), 'pattern', 'pattern', $pattern ) . ''; } diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index f0a5aa6c89..81668e1250 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -543,7 +543,7 @@ class SpecialContributions extends IncludableSpecialPage { ) . ' ' . Html::rawElement( 'span', - array( 'style' => 'white-space: nowrap' ), + array( 'class' => 'mw-input-with-label' ), Xml::checkLabel( $this->msg( 'invert' )->text(), 'nsInvert', @@ -555,7 +555,7 @@ class SpecialContributions extends IncludableSpecialPage { ) ) . ' ' ) . - Html::rawElement( 'span', array( 'style' => 'white-space: nowrap' ), + Html::rawElement( 'span', array( 'class' => 'mw-input-with-label' ), Xml::checkLabel( $this->msg( 'namespace_association' )->text(), 'associated', @@ -572,7 +572,7 @@ class SpecialContributions extends IncludableSpecialPage { if ( $this->getUser()->isAllowed( 'deletedhistory' ) ) { $deletedOnlyCheck = Html::rawElement( 'span', - array( 'style' => 'white-space: nowrap' ), + array( 'class' => 'mw-input-with-label' ), Xml::checkLabel( $this->msg( 'history-show-deleted' )->text(), 'deletedOnly', @@ -587,7 +587,7 @@ class SpecialContributions extends IncludableSpecialPage { $checkLabelTopOnly = Html::rawElement( 'span', - array( 'style' => 'white-space: nowrap' ), + array( 'class' => 'mw-input-with-label' ), Xml::checkLabel( $this->msg( 'sp-contributions-toponly' )->text(), 'topOnly', @@ -598,7 +598,7 @@ class SpecialContributions extends IncludableSpecialPage { ); $checkLabelNewOnly = Html::rawElement( 'span', - array( 'style' => 'white-space: nowrap' ), + array( 'class' => 'mw-input-with-label' ), Xml::checkLabel( $this->msg( 'sp-contributions-newonly' )->text(), 'newOnly', diff --git a/includes/specials/SpecialProtectedpages.php b/includes/specials/SpecialProtectedpages.php index 00e56c1c79..685931052d 100644 --- a/includes/specials/SpecialProtectedpages.php +++ b/includes/specials/SpecialProtectedpages.php @@ -100,17 +100,16 @@ class SpecialProtectedpages extends SpecialPage { Xml::openElement( 'fieldset' ) . Xml::element( 'legend', array(), $this->msg( 'protectedpages' )->text() ) . Html::hidden( 'title', $title->getPrefixedDBkey() ) . "\n" . - $this->getNamespaceMenu( $namespace ) . " \n" . - $this->getTypeMenu( $type ) . " \n" . - $this->getLevelMenu( $level ) . " \n" . - "
" . - $this->getExpiryCheck( $indefOnly ) . " \n" . - $this->getCascadeCheck( $cascadeOnly ) . " \n" . - $this->getRedirectCheck( $noRedirect ) . " \n" . - "
" . - $this->getSizeLimit( $sizetype, $size ) . " \n" . - "" . - " " . Xml::submitButton( $this->msg( 'allpagessubmit' )->text() ) . "\n" . + $this->getNamespaceMenu( $namespace ) . "\n" . + $this->getTypeMenu( $type ) . "\n" . + $this->getLevelMenu( $level ) . "\n" . + "
\n" . + $this->getExpiryCheck( $indefOnly ) . "\n" . + $this->getCascadeCheck( $cascadeOnly ) . "\n" . + $this->getRedirectCheck( $noRedirect ) . "\n" . + "
\n" . + $this->getSizeLimit( $sizetype, $size ) . "\n" . + Xml::submitButton( $this->msg( 'allpagessubmit' )->text() ) . "\n" . Xml::closeElement( 'fieldset' ) . Xml::closeElement( 'form' ); } @@ -123,7 +122,7 @@ class SpecialProtectedpages extends SpecialPage { * @return string */ protected function getNamespaceMenu( $namespace = null ) { - return Html::rawElement( 'span', array( 'style' => 'white-space: nowrap;' ), + return Html::rawElement( 'span', array( 'class' => 'mw-input-with-label' ), Html::namespaceSelector( array( 'selected' => $namespace, @@ -143,12 +142,12 @@ class SpecialProtectedpages extends SpecialPage { * @return string Formatted HTML */ protected function getExpiryCheck( $indefOnly ) { - return Xml::checkLabel( + return '' . Xml::checkLabel( $this->msg( 'protectedpages-indef' )->text(), 'indefonly', 'indefonly', $indefOnly - ) . "\n"; + ) . "\n"; } /** @@ -156,12 +155,12 @@ class SpecialProtectedpages extends SpecialPage { * @return string Formatted HTML */ protected function getCascadeCheck( $cascadeOnly ) { - return Xml::checkLabel( + return '' . Xml::checkLabel( $this->msg( 'protectedpages-cascade' )->text(), 'cascadeonly', 'cascadeonly', $cascadeOnly - ) . "\n"; + ) . "\n"; } /** @@ -169,12 +168,12 @@ class SpecialProtectedpages extends SpecialPage { * @return string Formatted HTML */ protected function getRedirectCheck( $noRedirect ) { - return Xml::checkLabel( + return '' . Xml::checkLabel( $this->msg( 'protectedpages-noredirect' )->text(), 'noredirect', 'noredirect', $noRedirect - ) . "\n"; + ) . "\n"; } /** @@ -185,14 +184,14 @@ class SpecialProtectedpages extends SpecialPage { protected function getSizeLimit( $sizetype, $size ) { $max = $sizetype === 'max'; - return Xml::radioLabel( + return '' . Xml::radioLabel( $this->msg( 'minimum-size' )->text(), 'sizetype', 'min', 'wpmin', !$max ) . - ' ' . + ' ' . Xml::radioLabel( $this->msg( 'maximum-size' )->text(), 'sizetype', @@ -200,10 +199,10 @@ class SpecialProtectedpages extends SpecialPage { 'wpmax', $max ) . - ' ' . + ' ' . Xml::input( 'size', 9, $size, array( 'id' => 'wpsize' ) ) . - ' ' . - Xml::label( $this->msg( 'pagesize' )->text(), 'wpsize' ); + ' ' . + Xml::label( $this->msg( 'pagesize' )->text(), 'wpsize' ) . "\n"; } /** @@ -228,7 +227,7 @@ class SpecialProtectedpages extends SpecialPage { $options[] = Xml::option( $text, $type, $selected ) . "\n"; } - return "" . + return '' . Xml::label( $this->msg( 'restriction-type' )->text(), $this->IdType ) . ' ' . Xml::tags( 'select', array( 'id' => $this->IdType, 'name' => $this->IdType ), @@ -260,7 +259,7 @@ class SpecialProtectedpages extends SpecialPage { $options[] = Xml::option( $text, $type, $selected ); } - return "" . + return '' . Xml::label( $this->msg( 'restriction-level' )->text(), $this->IdLevel ) . ' ' . Xml::tags( 'select', array( 'id' => $this->IdLevel, 'name' => $this->IdLevel ), -- 2.20.1