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;
}
$out .= "</tbody>\n";
$out .= "</table>\n";
- global $wgEnableCascadingProtection;
-
- if ($wgEnableCascadingProtection)
- $out .= $this->buildCascadeInput();
-
$out .= "<table>\n";
$out .= "<tbody>\n";
+ global $wgEnableCascadingProtection;
+ if( $wgEnableCascadingProtection )
+ $out .= '<tr><td></td><td>' . $this->buildCascadeInput() . "</td></tr>\n";
+
+ if( !$this->disabled )
+ $out .= '<tr><td></td><td>' . $this->buildWatchInput() . "</td></tr>\n";
+
$out .= $this->buildExpiryInput();
if( !$this->disabled ) {
function buildExpiryInput() {
$id = 'mwProtect-expiry';
- $ci = "<tr> <td align=\"right\">";
+ $ci = "<tr><td align=\"right\">";
$ci .= wfElement( 'label', array (
'id' => "$id-label",
'for' => $id ),
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(
'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 <strong>$1</strong>.',
'protect-locked-blocked' => 'You cannot change protection levels while blocked. Here are the
'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',