[MediaWiki-commits] [Gerrit] Refactoring Special:CentralAuth to use XML and HTML forms. - change (mediawiki...CentralAuth)
jenkins-bot has submitted this change and it was merged. Change subject: Refactoring Special:CentralAuth to use XML and HTML forms. .. Refactoring Special:CentralAuth to use XML and HTML forms. Change-Id: If50c3e3e4d8d0396ca1d56c6e81cd2ff3c42d944 --- M specials/SpecialCentralAuth.php 1 file changed, 96 insertions(+), 61 deletions(-) Approvals: Reedy: Looks good to me, approved jenkins-bot: Verified diff --git a/specials/SpecialCentralAuth.php b/specials/SpecialCentralAuth.php index d1764c1..898994e 100644 --- a/specials/SpecialCentralAuth.php +++ b/specials/SpecialCentralAuth.php @@ -174,23 +174,21 @@ $lookup = $this-mCanEdit ? $this-msg( 'centralauth-admin-lookup-rw' )-text() : $this-msg( 'centralauth-admin-lookup-ro' )-text(); - $this-getOutput()-addHTML( - Xml::openElement( 'form', array( - 'method' = 'get', - 'action' = $wgScript ) ) . - 'fieldset' . - Xml::element( 'legend', array(), $this-msg( 'centralauth-admin-manage' )-text() ) . + + $html = Xml::openElement( 'form', array( 'method' = 'get', 'action' = $wgScript ) ); + $html .= Xml::fieldset( + $this-msg( 'centralauth-admin-manage' )-text(), Html::hidden( 'title', $this-getTitle()-getPrefixedText() ) . - 'p' . - Xml::inputLabel( $this-msg( 'centralauth-admin-username' )-text(), - 'target', 'target', 25, $this-mUserName ) . - '/p' . - 'p' . - Xml::submitButton( $lookup ) . - '/p' . - '/fieldset' . - '/form' + Xml::openElement( 'p' ) . + Xml::inputLabel( $this-msg( 'centralauth-admin-username' )-text(), + 'target', 'target', 25, $this-mUserName ) . + Xml::closeElement( 'p' ) . + Xml::openElement( 'p' ) . + Xml::submitButton( $lookup ) . + Xml::closeElement( 'p' ) ); + $html .= Xml::closeElement( 'form' ); + $this-getOutput()-addHTML( $html ); } /** @@ -258,39 +256,50 @@ $this-msg( 'centralauth-admin-list-legend-rw' )-escaped() : $this-msg( 'centralauth-admin-list-legend-ro' )-escaped(); - $this-getOutput()-addHTML( fieldsetlegend{$legend}/legend ); + $this-getOutput()-addHTML( Xml::fieldset( $legend ) ); $this-getOutput()-addHTML( $this-listHeader() ); $this-getOutput()-addHTML( $this-listMerged( $merged ) ); if ( $remainder ) { $this-getOutput()-addHTML( $this-listRemainder( $remainder ) ); } $this-getOutput()-addHTML( $this-listFooter() ); - $this-getOutput()-addHTML( '/fieldset' ); + $this-getOutput()-addHTML( Xml::closeElement( 'fieldset' ) ); } /** * @return string */ function listHeader() { - return - Xml::openElement( 'form', - array( - 'method' = 'post', - 'action' = - $this-getTitle( $this-mUserName )-getLocalUrl( 'action=submit' ), - 'id' = 'mw-centralauth-merged' ) ) . - Html::hidden( 'wpMethod', 'unmerge' ) . + $columns = array( + localwiki, // centralauth-admin-list-localwiki + attached-on, // centralauth-admin-list-attached-on + method, // centralauth-admin-list-method + blocked, // centralauth-admin-list-blocked + editcount, // centralauth-admin-list-editcount + ); + $header = Xml::openElement( 'form', + array( +'method' = 'post', +'action' = +$this-getTitle( $this-mUserName )-getLocalUrl( 'action=submit' ), +'id' = 'mw-centralauth-merged' ) ); + $header .= Html::hidden( 'wpMethod', 'unmerge' ) . Html::hidden( 'wpEditToken', $this-getUser()-getEditToken() ) . - Xml::openElement( 'table', array( 'class' = 'wikitable sortable
[MediaWiki-commits] [Gerrit] Refactoring Special:CentralAuth to use XML and HTML forms. - change (mediawiki...CentralAuth)
Pgehres has uploaded a new change for review. https://gerrit.wikimedia.org/r/52297 Change subject: Refactoring Special:CentralAuth to use XML and HTML forms. .. Refactoring Special:CentralAuth to use XML and HTML forms. Change-Id: If50c3e3e4d8d0396ca1d56c6e81cd2ff3c42d944 --- M specials/SpecialCentralAuth.php 1 file changed, 97 insertions(+), 61 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth refs/changes/97/52297/1 diff --git a/specials/SpecialCentralAuth.php b/specials/SpecialCentralAuth.php index 15e1a09..eabec21 100644 --- a/specials/SpecialCentralAuth.php +++ b/specials/SpecialCentralAuth.php @@ -182,23 +182,21 @@ $lookup = $this-mCanEdit ? $this-msg( 'centralauth-admin-lookup-rw' )-text() : $this-msg( 'centralauth-admin-lookup-ro' )-text(); - $this-getOutput()-addHTML( - Xml::openElement( 'form', array( - 'method' = 'get', - 'action' = $wgScript ) ) . - 'fieldset' . - Xml::element( 'legend', array(), $this-msg( 'centralauth-admin-manage' )-text() ) . + + $html = Xml::openElement( 'form', array( 'method' = 'get', 'action' = $wgScript ) ); + $html .= Xml::fieldset( + $this-msg( 'centralauth-admin-manage' )-text(), Html::hidden( 'title', $this-getTitle()-getPrefixedText() ) . - 'p' . - Xml::inputLabel( $this-msg( 'centralauth-admin-username' )-text(), - 'target', 'target', 25, $this-mUserName ) . - '/p' . - 'p' . - Xml::submitButton( $lookup ) . - '/p' . - '/fieldset' . - '/form' + Xml::openElement( 'p' ) . + Xml::inputLabel( $this-msg( 'centralauth-admin-username' )-text(), + 'target', 'target', 25, $this-mUserName ) . + Xml::closeElement( 'p' ) . + Xml::openElement( 'p' ) . + Xml::submitButton( $lookup ) . + Xml::closeElement( 'p' ) ); + $html .= Xml::closeElement( 'form' ); + $this-getOutput()-addHTML( $html ); } /** @@ -262,39 +260,50 @@ $this-msg( 'centralauth-admin-list-legend-rw' )-escaped() : $this-msg( 'centralauth-admin-list-legend-ro' )-escaped(); - $this-getOutput()-addHTML( fieldsetlegend{$legend}/legend ); + $this-getOutput()-addHTML( Xml::fieldset( $legend ) ); $this-getOutput()-addHTML( $this-listHeader() ); $this-getOutput()-addHTML( $this-listMerged( $merged ) ); if ( $remainder ) { $this-getOutput()-addHTML( $this-listRemainder( $remainder ) ); } $this-getOutput()-addHTML( $this-listFooter() ); - $this-getOutput()-addHTML( '/fieldset' ); + $this-getOutput()-addHTML( Xml::closeElement( 'fieldset' ) ); } /** * @return string */ function listHeader() { - return - Xml::openElement( 'form', - array( - 'method' = 'post', - 'action' = - $this-getTitle( $this-mUserName )-getLocalUrl( 'action=submit' ), - 'id' = 'mw-centralauth-merged' ) ) . - Html::hidden( 'wpMethod', 'unmerge' ) . + $columns = array( + localwiki, // centralauth-admin-list-localwiki + attached-on, // centralauth-admin-list-attached-on + method, // centralauth-admin-list-method + blocked, // centralauth-admin-list-blocked + editcount, // centralauth-admin-list-editcount + ); + $header = Xml::openElement( 'form', + array( +'method' = 'post', +'action' = +$this-getTitle( $this-mUserName )-getLocalUrl( 'action=submit' ), +'id' = 'mw-centralauth-merged' ) ); + $header .= Html::hidden( 'wpMethod', 'unmerge' ) . Html::hidden( 'wpEditToken', $this-getUser()-getEditToken() ) . -