Index: trunk/extensions/SemanticResultFormats/GraphViz/SRF_Graph.php |
— | — | @@ -107,11 +107,16 @@ |
108 | 108 | } |
109 | 109 | |
110 | 110 | protected function getResultText( SMWQueryResult $res, $outputmode ) { |
| 111 | + if ( !is_callable( 'renderGraphviz' ) ) { |
| 112 | + wfWarn( 'The SRF Graph printer needs the GraphViz extension to be installed.' ); |
| 113 | + return ''; |
| 114 | + } |
| 115 | + |
111 | 116 | global $wgGraphVizSettings; |
112 | 117 | $this->isHTML = true; |
113 | 118 | |
114 | 119 | $graphInput = "digraph $this->m_graphName {"; |
115 | | - if ( $this->m_graphSize != '' ) $graphInput .= "size=\"$this->m_graphSize\";"; // pack=true; layout=dot; |
| 120 | + if ( $this->m_graphSize != '' ) $graphInput .= "size=\"$this->m_graphSize\";"; |
116 | 121 | if ( $this->m_nodeShape ) $graphInput .= "node [shape=$this->m_nodeShape];"; |
117 | 122 | $graphInput .= "rankdir=$this->m_rankdir;"; |
118 | 123 | |
— | — | @@ -119,7 +124,7 @@ |
120 | 125 | $graphInput .= $this->getGVForItem( $row, $outputmode ); |
121 | 126 | } |
122 | 127 | |
123 | | - $graphInput .= "}";//var_dump($graphInput);exit; |
| 128 | + $graphInput .= "}"; |
124 | 129 | |
125 | 130 | // Calls renderGraphViz function from MediaWiki GraphViz extension |
126 | 131 | $result = renderGraphviz( $graphInput ); |
Index: trunk/extensions/SemanticResultFormats/GraphViz/SRF_Process.php |
— | — | @@ -162,6 +162,11 @@ |
163 | 163 | * |
164 | 164 | */ |
165 | 165 | protected function getResultText( SMWQueryResult $res, $outputmode ) { |
| 166 | + if ( !is_callable( 'renderGraphviz' ) ) { |
| 167 | + wfWarn( 'The SRF Graph printer needs the GraphViz extension to be installed.' ); |
| 168 | + return ''; |
| 169 | + } |
| 170 | + |
166 | 171 | global $wgContLang; // content language object |
167 | 172 | |
168 | 173 | // |