r20840 - Code Review

From MediaWiki.org

Jump to: navigation, search
Repository:MediaWiki
Revision:r20839 | r20840 (on ViewVC) | r20841 >
Date:13:43, 30 March 2007
Author:daniel
Status:new
Tags:
Comment:added several comments for incomplete support for depth parameter in ajax mode (follow-up for changes to CategoryTree.php that accidentally slipped into the previous commit)
Modified paths:

Diff [purge]

Index: trunk/extensions/CategoryTree/CategoryTree.php
===================================================================
--- trunk/extensions/CategoryTree/CategoryTree.php	(revision 20839)
+++ trunk/extensions/CategoryTree/CategoryTree.php	(revision 20840)
@@ -106,7 +106,7 @@
 	global $wgCategoryTreeHTTPCache, $wgSquidMaxAge, $wgUseSquid;
 	
 	$ct = new CategoryTree;
-	$response = $ct->ajax( $category, $mode );
+	$response = $ct->ajax( $category, $mode ); //FIXME: would need to pass on depth parameter here.
 	
 	if ( $wgCategoryTreeHTTPCache && $wgSquidMaxAge && $wgUseSquid ) {
 		$response->setCacheDuration( $wgSquidMaxAge );
Index: trunk/extensions/CategoryTree/CategoryTreeFunctions.php
===================================================================
--- trunk/extensions/CategoryTree/CategoryTreeFunctions.php	(revision 20839)
+++ trunk/extensions/CategoryTree/CategoryTreeFunctions.php	(revision 20840)
@@ -86,7 +86,7 @@
 				'page_title' => $dbkey,
 			), __METHOD__ );
 			
-		$mckey = "$wgDBname:categorytree($mode):$dbkey";
+		$mckey = "$wgDBname:categorytree($mode):$dbkey"; //FIXME: would need to add depth parameter.
 		
 		$response = new AjaxResponse();
 		
@@ -98,7 +98,8 @@
 			return $response;
 		}
 		
-		$html = $this->renderChildren( $title, $mode );
+		$html = $this->renderChildren( $title, $mode ); //FIXME: would need to pass depth parameter.
+		
 		if ( $html == '' ) $html = ' ';   #HACK: Safari doesn't like empty responses. 
 						  #see Bug 7219 and http://bugzilla.opendarwin.org/show_bug.cgi?id=10716
 		
@@ -140,7 +141,7 @@
 		else {
 			if ( $display != 'hideroot' ) $html .= CategoryTree::renderNode( $title, $mode, $depth>0, $wgCategoryTreeDynamicTag, $depth-1 );
 			else if ( !$wgCategoryTreeDynamicTag ) $html .= $this->renderChildren( $title, $mode, $depth-1 );
-			else {
+			else { //FIXME: depth would need to be propagated here. this would imact the cache key, too
 				$uniq += 1;
 				$load = 'ct-' . $uniq . '-' . mt_rand( 1, 100000 );
 				
Views
Toolbox