http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90203
Revision: 90203 Author: jeroendedauw Date: 2011-06-16 14:35:21 +0000 (Thu, 16 Jun 2011) Log Message: ----------- address bug 29431 Modified Paths: -------------- trunk/extensions/SemanticResultFormats/GraphViz/SRF_Graph.php trunk/extensions/SemanticResultFormats/GraphViz/SRF_Process.php Modified: trunk/extensions/SemanticResultFormats/GraphViz/SRF_Graph.php =================================================================== --- trunk/extensions/SemanticResultFormats/GraphViz/SRF_Graph.php 2011-06-16 14:29:57 UTC (rev 90202) +++ trunk/extensions/SemanticResultFormats/GraphViz/SRF_Graph.php 2011-06-16 14:35:21 UTC (rev 90203) @@ -107,11 +107,16 @@ } protected function getResultText( SMWQueryResult $res, $outputmode ) { + if ( !is_callable( 'renderGraphviz' ) ) { + wfWarn( 'The SRF Graph printer needs the GraphViz extension to be installed.' ); + return ''; + } + global $wgGraphVizSettings; $this->isHTML = true; $graphInput = "digraph $this->m_graphName {"; - if ( $this->m_graphSize != '' ) $graphInput .= "size=\"$this->m_graphSize\";"; // pack=true; layout=dot; + if ( $this->m_graphSize != '' ) $graphInput .= "size=\"$this->m_graphSize\";"; if ( $this->m_nodeShape ) $graphInput .= "node [shape=$this->m_nodeShape];"; $graphInput .= "rankdir=$this->m_rankdir;"; @@ -119,7 +124,7 @@ $graphInput .= $this->getGVForItem( $row, $outputmode ); } - $graphInput .= "}";//var_dump($graphInput);exit; + $graphInput .= "}"; // Calls renderGraphViz function from MediaWiki GraphViz extension $result = renderGraphviz( $graphInput ); Modified: trunk/extensions/SemanticResultFormats/GraphViz/SRF_Process.php =================================================================== --- trunk/extensions/SemanticResultFormats/GraphViz/SRF_Process.php 2011-06-16 14:29:57 UTC (rev 90202) +++ trunk/extensions/SemanticResultFormats/GraphViz/SRF_Process.php 2011-06-16 14:35:21 UTC (rev 90203) @@ -162,6 +162,11 @@ * */ protected function getResultText( SMWQueryResult $res, $outputmode ) { + if ( !is_callable( 'renderGraphviz' ) ) { + wfWarn( 'The SRF Graph printer needs the GraphViz extension to be installed.' ); + return ''; + } + global $wgContLang; // content language object // _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs