Index: trunk/extensions/SemanticResultFormats/SRF_Settings.php |
— | — | @@ -27,7 +27,8 @@ |
28 | 28 | function srffSetup() { |
29 | 29 | global $srfgFormats, $wgExtensionCredits; |
30 | 30 | |
31 | | - foreach($srfgFormats as $fn) srffInitFormat($fn); |
| 31 | + foreach($srfgFormats as $fn) srffInitFormat( $fn ); |
| 32 | + |
32 | 33 | $formats_list = implode(', ', $srfgFormats); |
33 | 34 | $wgExtensionCredits['other'][]= array( |
34 | 35 | 'path' => __FILE__, |
— | — | @@ -65,11 +66,11 @@ |
66 | 67 | case 'calendar': |
67 | 68 | $class = 'SRFCalendar'; |
68 | 69 | $file = $srfgIP . '/Calendar/SRF_Calendar.php'; |
69 | | - breaK; |
| 70 | + break; |
70 | 71 | case 'outline': |
71 | 72 | $class = 'SRFOutline'; |
72 | 73 | $file = $srfgIP . '/Outline/SRF_Outline.php'; |
73 | | - breaK; |
| 74 | + break; |
74 | 75 | case 'sum': case 'average': case 'min': case 'max': |
75 | 76 | $class = 'SRFMath'; |
76 | 77 | $file = $srfgIP . '/Math/SRF_Math.php'; |
— | — | @@ -90,6 +91,10 @@ |
91 | 92 | $class = 'SRFGraph'; |
92 | 93 | $file = $srfgIP . '/GraphViz/SRF_Graph.php'; |
93 | 94 | break; |
| 95 | + case 'ploticusvbar': |
| 96 | + $class = 'SRFPloticusVBar'; |
| 97 | + $file = $srfgIP . '/Ploticus/SRF_PloticusVBar.php'; |
| 98 | + break; |
94 | 99 | } |
95 | 100 | if (($class) && ($file)) { |
96 | 101 | $smwgResultFormats[$format] = $class; |
Index: trunk/extensions/SemanticResultFormats/Ploticus/SRF_Ploticus.php |
— | — | @@ -21,7 +21,7 @@ |
22 | 22 | |
23 | 23 | class SRFPloticus extends SMWResultPrinter { |
24 | 24 | protected $m_ploticusparams = ''; |
25 | | - protected $m_imageformat = 'png'; |
| 25 | + protected $m_imageformat = 'gif'; |
26 | 26 | protected $m_titletext = ''; |
27 | 27 | protected $m_showcsv = false; |
28 | 28 | protected $m_ploticusmode = 'prefab'; |
— | — | @@ -165,7 +165,7 @@ |
166 | 166 | foreach ($row as $field) { |
167 | 167 | $growing = array(); |
168 | 168 | while (($object = $field->getNextObject()) !== false) { |
169 | | - $text = Sanitizer::decodeCharReferences($object->getWikiValue()); |
| 169 | + $text = Sanitizer::decodeCharReferences($object->getXSDValue()); |
170 | 170 | // decode: CSV knows nothing of possible HTML entities |
171 | 171 | $growing[] = $text; |
172 | 172 | } |
— | — | @@ -347,6 +347,7 @@ |
348 | 348 | |
349 | 349 | // if showrefresh is on, create link to force refresh |
350 | 350 | if ($this->m_showrefresh) { |
| 351 | + global $wgArticlePath; |
351 | 352 | $rtnstr .= ' <a href="' . $wgArticlePath . '?action=purge" title="Reload"><img src="'. |
352 | 353 | $srficonPath . 'reload_16.png" alt="Reload"></a>'; |
353 | 354 | } |
Index: trunk/extensions/SemanticResultFormats/Ploticus/SRF_PloticusVBar.php |
— | — | @@ -0,0 +1,41 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | + * A query printer using Ploticus drawing vertical bars.
|
| 5 | + * loosely based on the Ploticus Extension by Flavien Scheurer
|
| 6 | + * and CSV result printer
|
| 7 | + *
|
| 8 | + * @note AUTOLOADED
|
| 9 | + * @author Joel Natividad
|
| 10 | + * @author Denny Vrandecic
|
| 11 | + */
|
| 12 | +
|
| 13 | +/**
|
| 14 | + * Result printer using Ploticus to plot vertical bars.
|
| 15 | + * TODO: Create expanded doxygen comments
|
| 16 | + *
|
| 17 | + * @ingroup SMWQuery
|
| 18 | + */
|
| 19 | +
|
| 20 | +if( !defined( 'MEDIAWIKI' ) ) {
|
| 21 | + die( 'Not an entry point.' );
|
| 22 | +}
|
| 23 | +
|
| 24 | +include_once( "SRF_Ploticus.php" );
|
| 25 | +
|
| 26 | +/**
|
| 27 | + * This class only specifies the the SRFPloticus superclass. Since the
|
| 28 | + * current working of the SRFPloticus class is unsafe, this specialization
|
| 29 | + * filters out this unsecure parameter passing (and the power of Ploticus)
|
| 30 | + * and allows only for vertical bars.
|
| 31 | + */
|
| 32 | +class SRFPloticusVBar extends SRFPloticus {
|
| 33 | +
|
| 34 | + protected function readParameters($params, $outputmode) {
|
| 35 | + SRFPloticus::readParameters($params, $outputmode);
|
| 36 | +
|
| 37 | + // All other options will be simply ignored;
|
| 38 | + $this->m_ploticusmode === 'prefab';
|
| 39 | + $this->m_ploticusparams = "-prefab vbars x=1 y=2";
|
| 40 | + }
|
| 41 | +
|
| 42 | +} |
\ No newline at end of file |