Follow-up to r58633 and r58628 (lqt): Rename Title::getProtectionTypes to Title:...
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Mon, 9 Nov 2009 12:05:30 +0000 (12:05 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Mon, 9 Nov 2009 12:05:30 +0000 (12:05 +0000)
docs/hooks.txt
includes/Article.php
includes/ProtectionForm.php
includes/Title.php
includes/api/ApiProtect.php

index f184b47..45757b0 100644 (file)
@@ -1260,11 +1260,6 @@ $errorMsg: an html message string of an error
 $article: the page the form is shown for
 $out: OutputPage object
 
-'ProtectionFormGetApplicableTypes': Allows extensions to modify the types of protection
-  that can be applied.
-$title: The title in question.
-&$types: The types of protection available.
-
 'RawPageViewBeforeOutput': Right before the text is blown out in action=raw
 &$obj: RawPage object
 &$text: The text that's going to be the output
@@ -1503,6 +1498,11 @@ database result
 &$titleArray: set this to an object to override the default object returned
 $res: database result used to create the object
 
+'TitleGetRestrictionTypes': Allows extensions to modify the types of protection
+  that can be applied.
+$title: The title in question.
+&$types: The types of protection available.
+
 'TitleMoveComplete': after moving an article (title)
 $old: old title
 $nt: new title
index ca134a5..3e34405 100644 (file)
@@ -2258,7 +2258,7 @@ class Article {
        public function updateRestrictions( $limit = array(), $reason = '', &$cascade = 0, $expiry = array() ) {
                global $wgUser, $wgContLang;
                
-               $restrictionTypes = $this->mTitle->getProtectionTypes();
+               $restrictionTypes = $this->mTitle->getRestrictionTypes();
 
                $id = $this->mTitle->getArticleID();
                if ( $id <= 0 ) {
index f457e9a..658bab0 100644 (file)
@@ -58,7 +58,7 @@ class ProtectionForm {
                // Set instance variables.
                $this->mArticle = $article;
                $this->mTitle = $article->mTitle;
-               $this->mApplicableTypes = $this->mTitle->getProtectionTypes();
+               $this->mApplicableTypes = $this->mTitle->getRestrictionTypes();
                
                // Check if the form should be disabled.
                // If it is, the form will be available in read-only to show levels.
index 5594c08..be871f3 100644 (file)
@@ -971,7 +971,7 @@ class Title {
        public function isProtected( $action = '' ) {
                global $wgRestrictionLevels;
                
-               $restrictionTypes = $this->getProtectionTypes();
+               $restrictionTypes = $this->getRestrictionTypes();
 
                # Special pages have inherent protection
                if( $this->getNamespace() == NS_SPECIAL )
@@ -1885,7 +1885,7 @@ class Title {
        public function loadRestrictionsFromRows( $rows, $oldFashionedRestrictions = NULL ) {
                $dbr = wfGetDB( DB_SLAVE );
                
-               $restrictionTypes = $this->getProtectionTypes();
+               $restrictionTypes = $this->getRestrictionTypes();
 
                foreach( $restrictionTypes as $type ){
                        $this->mRestrictions[$type] = array();
@@ -3768,7 +3768,7 @@ class Title {
 
        }
        
-       public function getProtectionTypes() {
+       public function getRestrictionTypes() {
                global $wgRestrictionTypes;
                $types = $this->exists() ? $wgRestrictionTypes : array('create');
                
@@ -3776,8 +3776,7 @@ class Title {
                        $types[] = 'upload';
                }
                
-               wfRunHooks( 'ProtectionFormGetApplicableTypes',
-                               array( $this, &$types ) );
+               wfRunHooks( 'TitleGetRestrictionTypes', array( $this, &$types ) );
                                
                return $types;
        }
index d0fa3f2..221dc02 100644 (file)
@@ -69,7 +69,7 @@ class ApiProtect extends ApiBase {
                                $this->dieUsageMsg(array('toofewexpiries', count($expiry), count($params['protections'])));
                }
                
-               $restrictionTypes = $titleObj->getProtectionTypes();
+               $restrictionTypes = $titleObj->getRestrictionTypes();
                        
                $protections = array();
                $expiryarray = array();