r84958 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84957‎ | r84958 | r84959 >
Date:14:24, 29 March 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
follow up to r84957; added param to reverse the relation
Modified paths:
  • /trunk/extensions/SemanticResultFormats/GraphViz/SRF_Graph.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticResultFormats/GraphViz/SRF_Graph.php
@@ -24,6 +24,7 @@
2525 protected $m_labelArray = array();
2626 protected $m_graphColors = array( 'black', 'red', 'green', 'blue', 'darkviolet', 'gold', 'deeppink', 'brown', 'bisque', 'darkgreen', 'yellow', 'darkblue', 'magenta', 'steelblue2' );
2727 protected $m_nameProperty = false;
 28+ protected $m_parentRelation;
2829
2930 protected function readParameters( $params, $outputmode ) {
3031 SMWResultPrinter::readParameters( $params, $outputmode );
@@ -49,6 +50,8 @@
5051 if ( array_key_exists( 'nameproperty', $params ) ) {
5152 $this->m_nameProperty = trim( $params['nameproperty'] );
5253 }
 54+
 55+ $this->m_parentRelation = array_key_exists( 'relation', $params ) && strtolower( trim( $params['relation'] ) ) == 'parent';
5356 }
5457
5558 protected function getResultText( /* SMWQueryResult */ $res, $outputmode ) {
@@ -153,7 +156,7 @@
154157 }
155158
156159 if ( !$isName ) {
157 - $graphInput .= " \"$name\" -> \"$text\" ";
 160+ $graphInput .= $this->m_parentRelation ? " \"$text\" -> \"$name\" " : " \"$name\" -> \"$text\" ";
158161
159162 if ( $this->m_graphLabel && $this->m_graphColor ) {
160163 $graphInput .= ' [';

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r84957added name property parameterjeroendedauw14:18, 29 March 2011

Status & tagging log