From 9ab3d553844aba9f77713e6b0e0007e4be006d4a Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sun, 23 May 2010 19:25:07 +0000 Subject: [PATCH] Fixed some doxygen warnings and documented a bit --- includes/ProtectionForm.php | 38 +++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php index 28df01ac92..19dd523cbe 100644 --- a/includes/ProtectionForm.php +++ b/includes/ProtectionForm.php @@ -71,7 +71,9 @@ class ProtectionForm { $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; @@ -140,7 +142,8 @@ class ProtectionForm { /** * 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' ) { @@ -166,6 +169,9 @@ class ProtectionForm { return $time; } + /** + * Main entry point for action=protect and action=unprotect + */ function execute() { global $wgRequest, $wgOut; if( $wgRequest->wasPosted() ) { @@ -178,6 +184,11 @@ class ProtectionForm { } } + /** + * 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; @@ -228,8 +239,14 @@ class ProtectionForm { $this->showLogExtract( $wgOut ); } + /** + * Save submitted protection form + * + * @return Boolean: success + */ function save() { global $wgRequest, $wgUser; + # Permission check! if ( $this->disabled ) { $this->show(); @@ -306,7 +323,7 @@ class ProtectionForm { /** * Build the input form * - * @return $out string HTML form + * @return String: HTML form */ function buildForm() { global $wgUser, $wgLang; @@ -494,6 +511,13 @@ class ProtectionForm { 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; @@ -530,8 +554,8 @@ class ProtectionForm { /** * 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 == '' ) { @@ -575,7 +599,9 @@ class ProtectionForm { } /** - * @param OutputPage $out + * Show protection long extracts for this page + * + * @param $out OutputPage * @access private */ function showLogExtract( &$out ) { -- 2.20.1