Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Wikipedia: Mediawiki-CVS

SVN: [37949] trunk/extensions/FlaggedRevs

 

 

Wikipedia mediawiki-cvs RSS feed   Index | Next | Previous | View Threaded


aaron at svn

Jul 23, 2008, 4:43 AM

Post #1 of 1 (53 views)
Permalink
SVN: [37949] trunk/extensions/FlaggedRevs

Revision: 37949
Author: aaron
Date: 2008-07-23 11:43:39 +0000 (Wed, 23 Jul 2008)

Log Message:
-----------
* Remove debug line
* Improve UI

Modified Paths:
--------------
trunk/extensions/FlaggedRevs/language/RatingHistory.i18n.php
trunk/extensions/FlaggedRevs/specialpages/RatingHistory_body.php

Modified: trunk/extensions/FlaggedRevs/language/RatingHistory.i18n.php
===================================================================
--- trunk/extensions/FlaggedRevs/language/RatingHistory.i18n.php 2008-07-23 11:36:59 UTC (rev 37948)
+++ trunk/extensions/FlaggedRevs/language/RatingHistory.i18n.php 2008-07-23 11:43:39 UTC (rev 37949)
@@ -16,6 +16,7 @@
'ratinghistory-month' => 'last month',
'ratinghistory-year' => 'last year',
'ratinghistory-3years' => 'last 3 years',
+ 'ratinghistory-none' => 'There is no reader feedback data available at this time.',
'ratinghistory-legend' => 'The daily average <font color="blue">\'\'(blue)\'\'</font> and selected interval
average <font color="green">\'\'(green)\'\'</font> rating will be graphed below, by date. The number of reviews is shown in the
upper right-hand corner of the graphs; higher values tend to indicated better sample data. The rating values are to be interpreted as follows:

Modified: trunk/extensions/FlaggedRevs/specialpages/RatingHistory_body.php
===================================================================
--- trunk/extensions/FlaggedRevs/specialpages/RatingHistory_body.php 2008-07-23 11:36:59 UTC (rev 37948)
+++ trunk/extensions/FlaggedRevs/specialpages/RatingHistory_body.php 2008-07-23 11:43:39 UTC (rev 37949)
@@ -82,24 +82,32 @@

protected function showGraphs() {
global $wgOut;
+ $data = false;
// Do each graphs for said time period
foreach( FlaggedRevs::getFeedbackTags() as $tag => $weight ) {
- // Show title
- $wgOut->addHTML( '<h2>' . wfMsgHtml("readerfeedback-$tag") . '</h2>' );
// Check if cached version is available.
// If not, then generate a new one.
$filePath = $this->getFilePath( $tag );
$url = $this->getUrlPath( $tag );
- if( 1 || !file_exists($filePath) || $this->fileExpired($tag,$filePath) ) {
- $this->makeTagGraph( $tag, $filePath );
+ if( !file_exists($filePath) || $this->fileExpired($tag,$filePath) ) {
+ $ok = $this->makeTagGraph( $tag, $filePath );
+ } else {
+ $ok = true;
}
// Output the image
- $wgOut->addHTML(
- Xml::openElement( 'div', array('class' => 'reader_feedback_graph') ) .
- Xml::openElement( 'img', array('src' => $url,'alt' => $tag) ) . Xml::closeElement( 'img' ) .
- Xml::closeElement( 'div' )
- );
+ if( $ok ) {
+ $wgOut->addHTML( '<h2>' . wfMsgHtml("readerfeedback-$tag") . '</h2>' );
+ $wgOut->addHTML(
+ Xml::openElement( 'div', array('class' => 'reader_feedback_graph') ) .
+ Xml::openElement( 'img', array('src' => $url,'alt' => $tag) ) . Xml::closeElement( 'img' ) .
+ Xml::closeElement( 'div' )
+ );
+ $data = true;
+ }
}
+ if( !$data ) {
+ $wgOut->addHTML( wfMsg('ratinghistory-none') );
+ }
}

/**
@@ -157,6 +165,9 @@
$data[] = array("{$month}/{$day}",$dayAve,$cumAve);
$lastDay = $day;
}
+ if( empty($data) ) {
+ return false;
+ }
// Flip order
$plot->SetDataValues($data);
// Turn off X axis ticks and labels because they get in the way:



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

Wikipedia mediawiki-cvs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.