X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialWatchlist.php;h=962e0c30e28f87af52abc6ba9b7bcd8ce78b6d2e;hb=ff9f2fa33719753ff0c708f9b4a84c57593b9e58;hp=211798ecb3f3402b76f46dcbe335db5472808598;hpb=099d9cf764d81fe4c0890201e77d978a762564b1;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index 211798ecb3..962e0c30e2 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -111,6 +111,10 @@ class SpecialWatchlist extends ChangesListSpecialPage { $opts->add( 'hidepatrolled', $user->getBoolOption( 'watchlisthidepatrolled' ) ); $opts->add( 'hidemyself', $user->getBoolOption( 'watchlisthideown' ) ); + if ( $this->getConfig()->get( 'RCWatchCategoryMembership' ) ) { + $opts->add( 'hidecategorization', $user->getBoolOption( 'watchlisthidecategorization' ) ); + } + $opts->add( 'extended', $user->getBoolOption( 'extendwatchlist' ) ); return $opts; @@ -396,8 +400,6 @@ class SpecialWatchlist extends ChangesListSpecialPage { */ public function doHeader( $opts, $numRows ) { $user = $this->getUser(); - $out = $this->getOutput(); - $out->addModules( 'mediawiki.special.watchlist' ); $this->getOutput()->addSubtitle( $this->msg( 'watchlistfor2', $user->getName() ) @@ -427,6 +429,11 @@ class SpecialWatchlist extends ChangesListSpecialPage { 'hidemyself' => 'rcshowhidemine', 'hidepatrolled' => 'rcshowhidepatr' ); + + if ( $this->getConfig()->get( 'RCWatchCategoryMembership' ) ) { + $filters['hidecategorization'] = 'rcshowhidecategorization'; + } + foreach ( $this->getCustomFilters() as $key => $params ) { $filters[$key] = $params['msg']; } @@ -452,34 +459,39 @@ class SpecialWatchlist extends ChangesListSpecialPage { $form .= $wlInfo; $form .= $cutofflinks; $form .= $lang->pipeList( $links ) . "\n"; - $form .= "
\n"; - $out->addHtml( $form ); - - $formDescriptor = array( - 'namespace' => array( - 'class' => 'HTMLAdvancedSelectNamespaceWithButton', - 'label-message' => 'namespace', - 'default' => $opts['namespace'], + $form .= "
\n

"; + $form .= Html::namespaceSelector( + array( + 'selected' => $opts['namespace'], + 'all' => '', + 'label' => $this->msg( 'namespace' )->text() + ), array( 'name' => 'namespace', 'id' => 'namespace', - 'invertdefault' => $opts['invert'], - 'invertname' => 'invert', - 'invertid' => 'nsinvert', - 'associateddefault' => $opts['associated'], - 'associatedname' => 'associated', - 'associatedid' => 'nsassociated', - 'buttondefault' => $this->msg( 'allpagessubmit' )->text(), - ), - ); - $htmlForm = HTMLForm::factory( 'ooui', $formDescriptor, $this->getContext() ); - $htmlForm->suppressDefaultSubmit(); - $htmlForm->addHiddenFields( $hiddenFields ); - $htmlForm->prepareForm()->displayForm( false ); - - $form = ''; + 'class' => 'namespaceselector', + ) + ) . ' '; + $form .= Xml::checkLabel( + $this->msg( 'invert' )->text(), + 'invert', + 'nsinvert', + $opts['invert'], + array( 'title' => $this->msg( 'tooltip-invert' )->text() ) + ) . ' '; + $form .= Xml::checkLabel( + $this->msg( 'namespace_association' )->text(), + 'associated', + 'nsassociated', + $opts['associated'], + array( 'title' => $this->msg( 'tooltip-namespace_association' )->text() ) + ) . ' '; + $form .= Xml::submitButton( $this->msg( 'allpagessubmit' )->text() ) . "

\n"; + foreach ( $hiddenFields as $key => $value ) { + $form .= Html::hidden( $key, $value ) . "\n"; + } $form .= Xml::closeElement( 'fieldset' ) . "\n"; $form .= Xml::closeElement( 'form' ) . "\n"; - $out->addHtml( $form ); + $this->getOutput()->addHTML( $form ); $this->setBottomText( $opts ); } @@ -488,7 +500,6 @@ class SpecialWatchlist extends ChangesListSpecialPage { $nondefaults = $opts->getChangedValues(); $form = ""; $user = $this->getUser(); - $out = $this->getOutput(); $dbr = $this->getDB(); $numItems = $this->countItems( $dbr ); @@ -511,25 +522,19 @@ class SpecialWatchlist extends ChangesListSpecialPage { } $form .= "

"; - $out->addHTML( $form ); - if ( $numItems > 0 && $showUpdatedMarker ) { - $formDescriptor = array( - 'resetbutton' => array( - 'type' => 'submit', - 'name' => 'dummy', - 'default' => $this->msg( 'enotif_reset' )->text(), - ), - ); - $htmlForm = HTMLForm::factory( 'ooui', $formDescriptor, $this->getContext() ); - $htmlForm->suppressDefaultSubmit(); - $htmlForm->setId( 'mw-watchlist-resetbutton' ); - $nondefaults['reset'] = 'all'; - $htmlForm->addHiddenFields( $nondefaults ); - $htmlForm->prepareForm()->displayForm( false ); + $form .= Xml::openElement( 'form', array( 'method' => 'post', + 'action' => $this->getPageTitle()->getLocalURL(), + 'id' => 'mw-watchlist-resetbutton' ) ) . "\n" . + Xml::submitButton( $this->msg( 'enotif_reset' )->text(), array( 'name' => 'dummy' ) ) . "\n" . + Html::hidden( 'reset', 'all' ) . "\n"; + foreach ( $nondefaults as $key => $value ) { + $form .= Html::hidden( $key, $value ) . "\n"; + } + $form .= Xml::closeElement( 'form' ) . "\n"; } - $form = Xml::openElement( 'form', array( + $form .= Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getPageTitle()->getLocalURL(), 'id' => 'mw-watchlist-form' @@ -542,7 +547,7 @@ class SpecialWatchlist extends ChangesListSpecialPage { $form .= SpecialRecentChanges::makeLegend( $this->getContext() ); - $out->addHTML( $form ); + $this->getOutput()->addHTML( $form ); } protected function showHideLink( $options, $message, $name, $value ) {