From 768b1eadaac8a5a5ab7c69fa30b65801ec88b437 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Tue, 5 Jun 2007 02:18:49 +0000 Subject: [PATCH] * (bug 9769) Provide "watch this page" toggle on protection form * Clean up protection form a little * Change default text for "protectcomment", "protectexpiry", "unprotectcomment" and "protect-cascade" messages --- RELEASE-NOTES | 1 + includes/ProtectionForm.php | 31 +++++++++++++++++++++++++------ languages/messages/MessagesEn.php | 8 ++++---- 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index e16b89ed50..40b3ab38f8 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -57,6 +57,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 9898) Allow viewing all namespaces in Special:Newpages * (bug 10139) Introduce 'EditSectionLink' and 'EditSectionLinkForOther' hooks; see docs/hooks.txt for details +* (bug 9769) Provide "watch this page" toggle on protection form == Bugfixes since 1.10 == diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php index 788b565dfb..02aa42147a 100644 --- a/includes/ProtectionForm.php +++ b/includes/ProtectionForm.php @@ -188,6 +188,13 @@ class ProtectionForm { if( !$ok ) { throw new FatalError( "Unknown error at restriction save time." ); } + + if( $wgRequest->getCheck( 'mwProtectWatch' ) ) { + $this->mArticle->doWatch(); + } elseif( $this->mTitle->userIsWatching() ) { + $this->mArticle->doUnwatch(); + } + return $ok; } @@ -232,14 +239,16 @@ class ProtectionForm { $out .= "\n"; $out .= "\n"; - global $wgEnableCascadingProtection; - - if ($wgEnableCascadingProtection) - $out .= $this->buildCascadeInput(); - $out .= "\n"; $out .= "\n"; + global $wgEnableCascadingProtection; + if( $wgEnableCascadingProtection ) + $out .= '\n"; + + if( !$this->disabled ) + $out .= '\n"; + $out .= $this->buildExpiryInput(); if( !$this->disabled ) { @@ -311,7 +320,7 @@ class ProtectionForm { function buildExpiryInput() { $id = 'mwProtect-expiry'; - $ci = "
' . $this->buildCascadeInput() . "
' . $this->buildWatchInput() . "
"; + $ci = "
"; $ci .= wfElement( 'label', array ( 'id' => "$id-label", 'for' => $id ), @@ -326,6 +335,16 @@ class ProtectionForm { return $ci; } + + function buildWatchInput() { + global $wgUser; + return Xml::checkLabel( + wfMsg( 'watchthis' ), + 'mwProtectWatch', + 'mwProtectWatch', + $this->mTitle->userIsWatching() || $wgUser->getOption( 'watchdefault' ) + ); + } function buildSubmit() { return wfElement( 'input', array( diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index d7cf94d80a..250dff452c 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1842,14 +1842,14 @@ Please hit "back" and reload the page you came from, then try again.', 'confirmprotecttext' => 'Do you really want to protect this page?', 'confirmprotect' => 'Confirm protection', 'protectmoveonly' => 'Protect from moves only', -'protectcomment' => 'Reason for protecting', -'protectexpiry' => 'Expiry', +'protectcomment' => 'Comment:', +'protectexpiry' => 'Expires:', 'protect_expiry_invalid' => 'Expiry time is invalid.', 'protect_expiry_old' => 'Expiry time is in the past.', 'unprotectsub' =>"(Unprotecting \"$1\")", 'confirmunprotecttext' => 'Do you really want to unprotect this page?', 'confirmunprotect' => 'Confirm unprotection', -'unprotectcomment' => 'Reason for unprotecting', +'unprotectcomment' => 'Comment:', 'protect-unchain' => 'Unlock move permissions', 'protect-text' => 'You may view and change the protection level here for the page $1.', 'protect-locked-blocked' => 'You cannot change protection levels while blocked. Here are the @@ -1864,7 +1864,7 @@ Here are the current settings for the page $1:', 'protect-level-sysop' => 'Sysops only', 'protect-summary-cascade' => 'cascading', 'protect-expiring' => 'expires $1 (UTC)', -'protect-cascade' => 'Cascading protection - protect any pages included in this page.', +'protect-cascade' => 'Protect pages included in this page', 'restriction-type' => 'Permission:', 'restriction-level' => 'Restriction level:', 'minimum-size' => 'Min size', -- 2.20.1