r24872 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24871‎ | r24872 | r24873 >
Date:14:15, 17 August 2007
Author:mkroetzsch
Status:old
Tags:
Comment:
Support links in HTML printout
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_DV_Types.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DV_Types.php
@@ -102,8 +102,22 @@
103103 }
104104
105105 public function getLongHTMLText($linker = NULL) {
106 - /// TODO: support linking
107 - return implode(', ', $this->getTypeLabels());
 106+ if ( ($linker === NULL) || ($linker === false) ) {
 107+ return str_replace('_',' ',implode(', ', $this->getTypeLabels()));
 108+ } else {
 109+ $result = '';
 110+ $first = true;
 111+ foreach ($this->getTypeLabels() as $type) {
 112+ if ($first) {
 113+ $first = false;
 114+ } else {
 115+ $result .= ', ';
 116+ }
 117+ $title = Title::newFromText($type, SMW_NS_TYPE);
 118+ $result .= $linker->makeLinkObj( $title, $type);
 119+ }
 120+ return $result;
 121+ }
108122 }
109123
110124 public function getXSDValue() {

Status & tagging log