http://www.mediawiki.org/wiki/Special:Code/MediaWiki/73896

Revision: 73896
Author:   platonides
Date:     2010-09-28 15:21:05 +0000 (Tue, 28 Sep 2010)

Log Message:
-----------
Import of ArticleComments v0.2.1 by Jim R. Wilson from 
http://jimbojw.com/wiki/index.php?title=ArticleComments&oldid=1600

Modified Paths:
--------------
    trunk/extensions/ArticleComments/ArticleComments.php

Modified: trunk/extensions/ArticleComments/ArticleComments.php
===================================================================
--- trunk/extensions/ArticleComments/ArticleComments.php        2010-09-28 
15:20:05 UTC (rev 73895)
+++ trunk/extensions/ArticleComments/ArticleComments.php        2010-09-28 
15:21:05 UTC (rev 73896)
@@ -93,9 +93,9 @@
  * @param Title $title The title of the article on which the form will appear.
  * @param Array $params A hash of parameters containing rendering options.
  */
-function displayArticleCommentForm( $nsList = null, $title = null, $params = 
array() ) {
+function displayArticleCommentForm( $title = null, $params = array() ) {
 
-    global $wgRequest;
+    global $wgRequest, $wgArticleCommentsNSDisplayList;
     
     # Short circuit for anything other than action=view or action=purge
     if ($wgRequest->getVal('action') && 
@@ -103,20 +103,17 @@
         $wgRequest->getVal('action')!='purge'
     ) return;
     
+    # Short-circuit if displayl ist is undefined or null
+    if ($wgArticleCommentsNSDisplayList==null) return;
+
     # Use wgTitle if title is not specified
     if ($title==null) {
         global $wgTitle;
         $title = $wgTitle;
     }
 
-    # Use wgArticleCommentsNSDisplayList if nsList is not specified
-    if ($nsList==null) {
-        global $wgArticleCommentsNSDisplayList;
-        $nsList = $wgArticleCommentsNSDisplayList;
-        $nsList = ($nsList==null?array(NS_MAIN):$nsList);
-    }
-
     # Ensure that the namespace list is an actual list
+    $nsList = $wgArticleCommentsNSDisplayList;
     if (!is_array($nsList)) $nsList = array($nsList);
     
     # Display the form
@@ -355,11 +352,12 @@
     }
     
     
-    # Check if talk NS is in the Namespace whitelist
-    global $wgArticleCommentsNSWhitelist;
+    # Check if talk NS is in the Namespace display list
+    # Note: if so, then there's no need to confirm that <comments /> appears 
in the article or talk page.
+    global $wgArticleCommentsNSDisplayList;
     $skipCheck = (
-        is_array($wgArticleCommentsNSWhitelist) ?
-        in_array($talkTitle->getNamespace(),$wgArticleCommentsNSWhitelist):
+        is_array($wgArticleCommentsNSDisplayList) ?
+        in_array($talkTitle->getNamespace(),$wgArticleCommentsNSDisplayList):
         false
     );
 



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to