r65702 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65701‎ | r65702 | r65703 >
Date:17:19, 30 April 2010
Author:yaron
Status:deferred
Tags:
Comment:
Added handling for "link=", "headers=" parameters
Modified paths:
  • /trunk/extensions/SemanticResultFormats/Calendar/SRF_Calendar.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticResultFormats/Calendar/SRF_Calendar.php
@@ -69,7 +69,12 @@
7070 if ( $object->getTypeID() == '_dat' ) {
7171 $text .= SRFCalendar::formatDateStr( $object );
7272 } elseif ( $object->getTypeID() == '_wpg' ) { // use shorter "LongText" for wikipage
73 - $text .= $object->getLongText( $outputmode, null );
 73+ // handling of "link=" param
 74+ if ( $this->mLinkOthers ) {
 75+ $text .= $object->getLongText( $outputmode, null );
 76+ } else {
 77+ $text .= $object->getWikiValue();
 78+ }
7479 } else {
7580 $text .= $object->getShortText( $outputmode, null );
7681 }
@@ -86,13 +91,25 @@
8792 elseif ( $i > 2 )
8893 $text .= ", ";
8994 while ( ( $object = $field->getNextObject() ) !== false ) {
90 - if ( $object->getTypeID() == '_dat' ) { // use shorter "LongText" for wikipage
 95+ if ( $object->getTypeID() == '_dat' ) {
9196 // don't add date values to the display
9297 } elseif ( $object->getTypeID() == '_wpg' ) { // use shorter "LongText" for wikipage
9398 if ( $i == 0 ) {
9499 $title = Title::newFromText( $object->getShortWikiText( false ) );
95100 } else {
96 - $text .= $pr->getHTMLText( $skin ) . " " . $object->getLongText( $outputmode, $skin );
 101+ // handling of "headers=" param
 102+ if ( $this->mShowHeaders == SMW_HEADERS_SHOW ) {
 103+ $text .= $pr->getHTMLText( $skin ) . " ";
 104+ } elseif ( $this->mShowHeaders == SMW_HEADERS_PLAIN ) {
 105+ $text .= $pr->getLabel() . " ";
 106+ }
 107+ // if $this->mShowHeaders == SMW_HEADERS_HIDE, print nothing
 108+ // handling of "link=" param
 109+ if ( $this->mLinkOthers ) {
 110+ $text .= $object->getLongText( $outputmode, $skin );
 111+ } else {
 112+ $text .= $object->getWikiValue();
 113+ }
97114 }
98115 } else {
99116 $text .= $pr->getHTMLText( $skin ) . " " . $object->getShortText( $outputmode, $skin );

Status & tagging log