Do the checks for template existence in a batch
authorTim Starling <tstarling@users.mediawiki.org>
Wed, 11 Jan 2006 06:33:48 +0000 (06:33 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Wed, 11 Jan 2006 06:33:48 +0000 (06:33 +0000)
includes/EditPage.php

index c174a28..fbb89a8 100644 (file)
@@ -997,6 +997,14 @@ END
                $outText = '';
                $templates = $this->mArticle->getUsedTemplates();
                if ( count( $templates ) > 0 ) {
+                       # Do a batch existence check
+                       $batch = new LinkBatch;
+                       foreach( $templates as $title ) {
+                               $batch->addObj( $title );
+                       }
+                       $batch->execute();
+
+                       # Construct the HTML
                        $outText = '<br />'. wfMsg( 'templatesused' ) . '<ul>';
                        foreach ( $templates as $titleObj ) {
                                $outText .= '<li>' . $sk->makeLinkObj( $titleObj ) . '</li>';