From 6f25d469ed89e4d06f568342e86508112f82dfa9 Mon Sep 17 00:00:00 2001 From: Daniel Kraus Date: Tue, 3 Jun 2014 16:40:37 +0200 Subject: [PATCH] Show statistics when finished. --- SpecialLinkTitles.php | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/SpecialLinkTitles.php b/SpecialLinkTitles.php index c7a4deb..6b73169 100644 --- a/SpecialLinkTitles.php +++ b/SpecialLinkTitles.php @@ -96,13 +96,17 @@ class SpecialLinkTitles extends SpecialPage { // If we have not reached the last page yet, produce code to reload // the extension's special page. - if ( $start <= $end ) + if ( $start < $end ) { // Build a form with hidden values and output JavaScript code that // immediately submits the form in order to continue the process. $output->addHTML($this->getReloaderForm($request->getRequestURL(), $start, $end, $reloads)); } + else // Last page has been processed + { + $this->addCompletedInfo($output, $start, $end, $reloads); + } } /// Processes a single page, given a $title Title object. @@ -152,7 +156,7 @@ EOF } /// Produces informative output in WikiText format to show while working. - private function addProgressInfo($output, $curTitle, $start, $end) { + private function addProgressInfo(&$output, $curTitle, $start, $end) { $progress = $start / $end * 100; $percent = sprintf("%01.1f", $progress); @@ -160,7 +164,7 @@ EOF <<addWikiText( +<<select(