MediaWiki
1.23.2
|
Handles the page protection UI and backend. More...
Public Member Functions | |
__construct (Page $article) | |
buildCleanupScript () | |
buildForm () | |
Build the input form. More... | |
buildSelector ( $action, $selected) | |
Build protection level selector. More... | |
execute () | |
Main entry point for action=protect and action=unprotect. More... | |
getExpiry ( $action) | |
Get the expiry time for a given action, by combining the relevant inputs. More... | |
loadData () | |
Loads the current state of protection into the object. More... | |
save () | |
Save submitted protection form. More... | |
show ( $err=null) | |
Show the input form with optional error message. More... | |
showLogExtract (&$out) | |
Show protection long extracts for this page. More... | |
Public Attributes | |
$mApplicableTypes = array() | |
Types (i.e. More... | |
$mCascade = false | |
True if the restrictions are cascading, from request or existing protection. More... | |
$mExistingExpiry = array() | |
Map of action to the expiry time of the existing protection. More... | |
$mExpiry = array() | |
Map of action to "other" expiry time. More... | |
$mExpirySelection = array() | |
Map of action to value selected in expiry drop-down list. More... | |
$mPermErrors = array() | |
Permissions errors for the protect action. More... | |
$mReason = '' | |
The custom/additional protection reason. More... | |
$mReasonSelection = '' | |
The reason selected from the list, blank for other/additional. More... | |
$mRestrictions = array() | |
A map of action to restriction level, from request or default. More... | |
Private Member Functions | |
getOptionLabel ( $permission) | |
Prepare the label for a protection selector option. More... | |
Handles the page protection UI and backend.
Definition at line 29 of file ProtectionForm.php.
ProtectionForm::__construct | ( | Page | $article | ) |
Definition at line 60 of file ProtectionForm.php.
References $article, $wgUser, array(), global, loadData(), wfReadOnly(), and wfReadOnlyReason().
ProtectionForm::buildCleanupScript | ( | ) |
Definition at line 588 of file ProtectionForm.php.
References $options, $wgOut, array(), Xml\encodeJsCall(), global, Html\inlineScript(), ResourceLoader\makeLoaderConditionalScript(), and wfMessage().
Referenced by buildForm().
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled also a ContextSource error or success ProtectionForm::buildForm | ( | ) |
Build the input form.
Definition at line 327 of file ProtectionForm.php.
References $attribs, $link, $out, $t, $timestamp, $title, $value, $wgLang, $wgOut, $wgUser, array(), as, buildCleanupScript(), buildSelector(), Xml\checkLabel(), Xml\closeElement(), Xml\element(), global, Html\hidden(), Xml\input(), Xml\label(), Linker\link(), list, Xml\listDropDown(), Title\makeTitle(), NS_MEDIAWIKI, Xml\openElement(), Xml\option(), Xml\submitButton(), Xml\tags(), text, wfMessage(), and wfRunHooks().
Referenced by show().
ProtectionForm::buildSelector | ( | $action, | |
$selected | |||
) |
Build protection level selector.
string | $action | action to protect |
string | $selected | current protection level |
Definition at line 544 of file ProtectionForm.php.
References $attribs, $out, $wgUser, array(), as, Xml\closeElement(), getOptionLabel(), MWNamespace\getRestrictionLevels(), global, Xml\openElement(), and Xml\option().
Referenced by buildForm().
ProtectionForm::execute | ( | ) |
Main entry point for action=protect and action=unprotect.
Definition at line 175 of file ProtectionForm.php.
References $wgOut, array(), MWNamespace\getRestrictionLevels(), global, save(), and show().
ProtectionForm::getExpiry | ( | $action | ) |
Get the expiry time for a given action, by combining the relevant inputs.
$action | string |
Definition at line 148 of file ProtectionForm.php.
References $time, $value, DB_SLAVE, TS_MW, wfGetDB(), and wfTimestamp().
Referenced by save().
|
private |
Prepare the label for a protection selector option.
string | $permission | permission required |
Definition at line 575 of file ProtectionForm.php.
References wfMessage().
Referenced by buildSelector().
ProtectionForm::loadData | ( | ) |
Loads the current state of protection into the object.
Definition at line 84 of file ProtectionForm.php.
References $wgUser, as, MWNamespace\getRestrictionLevels(), and global.
Referenced by __construct().
ProtectionForm::save | ( | ) |
Save submitted protection form.
Definition at line 252 of file ProtectionForm.php.
References $mReason, $mReasonSelection, $wgOut, $wgUser, array(), as, WatchAction\doWatchOrUnwatch(), getExpiry(), global, show(), wfMessage(), wfRunHooks(), and wfTimestampNow().
Referenced by execute().
ProtectionForm::show | ( | $err = null | ) |
Show the input form with optional error message.
string | $err | error message or null if there's no error |
Definition at line 197 of file ProtectionForm.php.
References $title, $titles, $wgOut, array(), as, buildForm(), global, list, showLogExtract(), text, wfEscapeWikiText(), and wfMessage().
ProtectionForm::showLogExtract | ( | & | $out | ) |
Show protection long extracts for this page.
$out | OutputPage @access private |
Definition at line 610 of file ProtectionForm.php.
References $out, array(), Xml\element(), LogEventsList\showLogExtract(), and wfRunHooks().
Referenced by show().
ProtectionForm::$mApplicableTypes = array() |
Types (i.e.
actions) for which levels can be selected
Definition at line 55 of file ProtectionForm.php.
ProtectionForm::$mCascade = false |
True if the restrictions are cascading, from request or existing protection.
Definition at line 40 of file ProtectionForm.php.
ProtectionForm::$mExistingExpiry = array() |
Map of action to the expiry time of the existing protection.
Definition at line 58 of file ProtectionForm.php.
ProtectionForm::$mExpiry = array() |
Map of action to "other" expiry time.
Used in preference to mExpirySelection.
Definition at line 43 of file ProtectionForm.php.
ProtectionForm::$mExpirySelection = array() |
Map of action to value selected in expiry drop-down list.
Will be set to 'othertime' whenever mExpiry is set.
Definition at line 49 of file ProtectionForm.php.
ProtectionForm::$mPermErrors = array() |
Permissions errors for the protect action.
Definition at line 52 of file ProtectionForm.php.
ProtectionForm::$mReason = '' |
The custom/additional protection reason.
Definition at line 34 of file ProtectionForm.php.
Referenced by save().
ProtectionForm::$mReasonSelection = '' |
The reason selected from the list, blank for other/additional.
Definition at line 37 of file ProtectionForm.php.
Referenced by save().
ProtectionForm::$mRestrictions = array() |
A map of action to restriction level, from request or default.
Definition at line 31 of file ProtectionForm.php.