$this->loadData();
}
- // Loads the current state of protection into the object.
+ /**
+ * Loads the current state of protection into the object.
+ */
function loadData() {
global $wgRequest, $wgUser;
global $wgRestrictionLevels;
/**
* Get the expiry time for a given action, by combining the relevant inputs.
- * Returns a 14-char timestamp or "infinity", or false if the input was invalid
+ *
+ * @return 14-char timestamp or "infinity", or false if the input was invalid
*/
function getExpiry( $action ) {
if ( $this->mExpirySelection[$action] == 'existing' ) {
return $time;
}
+ /**
+ * Main entry point for action=protect and action=unprotect
+ */
function execute() {
global $wgRequest, $wgOut;
if( $wgRequest->wasPosted() ) {
}
}
+ /**
+ * Show the input form with optional error message
+ *
+ * @param $err String: error message or null if there's no error
+ */
function show( $err = null ) {
global $wgOut, $wgUser;
$this->showLogExtract( $wgOut );
}
+ /**
+ * Save submitted protection form
+ *
+ * @return Boolean: success
+ */
function save() {
global $wgRequest, $wgUser;
+
# Permission check!
if ( $this->disabled ) {
$this->show();
/**
* Build the input form
*
- * @return $out string HTML form
+ * @return String: HTML form
*/
function buildForm() {
global $wgUser, $wgLang;
return $out;
}
+ /**
+ * Build protection level selector
+ *
+ * @param $action String: action to protect
+ * @param $selected String: current protection level
+ * @return String: HTML fragment
+ */
function buildSelector( $action, $selected ) {
global $wgRestrictionLevels, $wgUser;
/**
* Prepare the label for a protection selector option
*
- * @param string $permission Permission required
- * @return string
+ * @param $permission String: permission required
+ * @return String
*/
private function getOptionLabel( $permission ) {
if( $permission == '' ) {
}
/**
- * @param OutputPage $out
+ * Show protection long extracts for this page
+ *
+ * @param $out OutputPage
* @access private
*/
function showLogExtract( &$out ) {