MediaWiki
REL1_24
|
Handles the page protection UI and backend. More...
Public Member Functions | |
__construct (Article $article) | |
buildForm () | |
Build the input form. | |
buildSelector ($action, $selected) | |
Build protection level selector. | |
execute () | |
Main entry point for action=protect and action=unprotect. | |
getExpiry ($action) | |
Get the expiry time for a given action, by combining the relevant inputs. | |
loadData () | |
Loads the current state of protection into the object. | |
save () | |
Save submitted protection form. | |
show ($err=null) | |
Show the input form with optional error message. | |
showLogExtract (&$out) | |
Show protection long extracts for this page. | |
Protected Attributes | |
array | $mApplicableTypes = array() |
Types (i.e. | |
bool | $mCascade = false |
True if the restrictions are cascading, from request or existing protection *. | |
array | $mExistingExpiry = array() |
Map of action to the expiry time of the existing protection *. | |
array | $mExpiry = array() |
Map of action to "other" expiry time. | |
array | $mExpirySelection = array() |
Map of action to value selected in expiry drop-down list. | |
array | $mPermErrors = array() |
Permissions errors for the protect action *. | |
$mReason = '' | |
$mReasonSelection = '' | |
array | $mRestrictions = array() |
A map of action to restriction level, from request or default *. | |
Private Member Functions | |
getOptionLabel ($permission) | |
Prepare the label for a protection selector option. | |
Private Attributes | |
IContextSource | $mContext |
* |
Handles the page protection UI and backend.
Definition at line 29 of file ProtectionForm.php.
ProtectionForm::__construct | ( | Article $ | article | ) |
Definition at line 55 of file ProtectionForm.php.
error also a ContextSource error or success ProtectionForm::buildForm | ( | ) |
ProtectionForm::buildSelector | ( | $ | action, |
$ | selected | ||
) |
Build protection level selector.
string | $action | Action to protect |
string | $selected | Current protection level |
Definition at line 565 of file ProtectionForm.php.
References $attribs, $key, $out, array(), as, Xml\closeElement(), getOptionLabel(), MWNamespace\getRestrictionLevels(), Xml\openElement(), and Xml\option().
Main entry point for action=protect and action=unprotect.
Definition at line 170 of file ProtectionForm.php.
ProtectionForm::getExpiry | ( | $ | action | ) |
Get the expiry time for a given action, by combining the relevant inputs.
string | $action |
Definition at line 143 of file ProtectionForm.php.
ProtectionForm::getOptionLabel | ( | $ | permission | ) | [private] |
Prepare the label for a protection selector option.
string | $permission | Permission required |
Definition at line 593 of file ProtectionForm.php.
Referenced by buildSelector().
Loads the current state of protection into the object.
Definition at line 81 of file ProtectionForm.php.
Save submitted protection form.
Definition at line 254 of file ProtectionForm.php.
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 190 of file ProtectionForm.php.
ProtectionForm::showLogExtract | ( | &$ | out | ) |
Show protection long extracts for this page.
OutputPage | $out | private |
Definition at line 612 of file ProtectionForm.php.
Types (i.e.
actions) for which levels can be selected *
Definition at line 49 of file ProtectionForm.php.
bool ProtectionForm::$mCascade = false [protected] |
True if the restrictions are cascading, from request or existing protection *.
Definition at line 38 of file ProtectionForm.php.
IContextSource ProtectionForm::$mContext [private] |
*
Definition at line 53 of file ProtectionForm.php.
Map of action to the expiry time of the existing protection *.
Definition at line 51 of file ProtectionForm.php.
Map of action to "other" expiry time.
Used in preference to mExpirySelection. *
Definition at line 40 of file ProtectionForm.php.
Map of action to value selected in expiry drop-down list.
Will be set to 'othertime' whenever mExpiry is set.
Definition at line 45 of file ProtectionForm.php.
Permissions errors for the protect action *.
Definition at line 47 of file ProtectionForm.php.
ProtectionForm::$mReason = '' [protected] |
Definition at line 33 of file ProtectionForm.php.
ProtectionForm::$mReasonSelection = '' [protected] |
Definition at line 36 of file ProtectionForm.php.
A map of action to restriction level, from request or default *.
Definition at line 30 of file ProtectionForm.php.