r101000 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100999‎ | r101000 | r101001 >
Date:16:48, 27 October 2011
Author:jeroendedauw
Status:ok
Tags:
Comment:
kill obsolete bc code
Modified paths:
  • /trunk/extensions/SemanticResultFormats/Timeline/SRF_Timeline.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/iCalendar/SRF_iCalendar.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/jqPlot/SRF_jqPlotBar.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/jqPlot/SRF_jqPlotPie.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticResultFormats/iCalendar/SRF_iCalendar.php
@@ -146,12 +146,8 @@
147147 $result = '';
148148
149149 $wikipage = $row[0]->getResultSubject(); // get the object
 150+ $wikipage = SMWDataValueFactory::newDataItemValue( $wikipage, null );
150151
151 - // As of SMW 1.6, a SMWDiWikiPage object will be provided instead of a SMWWikiPageValue.
152 - if ( class_exists( 'SMWDiWikiPage' ) && $wikipage instanceof SMWDiWikiPage ) {
153 - $wikipage = SMWDataValueFactory::newDataItemValue( $wikipage, null );
154 - }
155 -
156152 $startdate = false;
157153 $enddate = false;
158154 $location = '';
Index: trunk/extensions/SemanticResultFormats/Timeline/SRF_Timeline.php
@@ -162,15 +162,9 @@
163163
164164 if ( $dataValue == '' ) {
165165 $date_value = null;
166 - } // SMW >= 1.6
167 - elseif ( method_exists ( $dataValue, 'getDataItem' ) ) {
168 - $date_value = $dataValue->getDataItem()->getLabel();
169 - } // SMW 1.5.x
170 - elseif ( method_exists ( $dataValue, 'getValueKey' ) ) {
171 - $date_value = $dataValue->getValueKey();
172 - } // SMW < 1.5
 166+ }
173167 else {
174 - $date_value = $dataValue->getXSDValue();
 168+ $date_value = $dataValue->getDataItem()->getLabel();
175169 }
176170
177171 while ( ( $object = efSRFGetNextDV( $field ) ) !== false ) { // Loop over property values
@@ -344,21 +338,10 @@
345339 }
346340
347341 if ( $isEventline && ( $pr->getMode() == SMWPrintRequest::PRINT_PROP ) && ( $pr->getTypeID() == '_dat' ) && ( '' != $pr->getLabel() ) && ( $date_value != $this->m_tlstart ) && ( $date_value != $this->m_tlend ) ) {
348 - // SMW >= 1.6
349 - if ( method_exists ( $object, 'getDataItem' ) ) {
350 - $numericValue = $object->getDataItem()->getSortKey();
351 - } // SMW 1.5.x
352 - elseif ( method_exists ( $object, 'getValueKey' ) ) {
353 - $numericValue = $object->getValueKey();
354 - } // SMW < 1.5
355 - else {
356 - $numericValue = $object->getNumericValue();
357 - }
358 -
359342 $event = array(
360343 $object->getXMLSchemaDate(),
361344 $pr->getLabel(),
362 - $numericValue,
 345+ $object->getDataItem()->getSortKey(),
363346 );
364347 }
365348
Index: trunk/extensions/SemanticResultFormats/jqPlot/SRF_jqPlotPie.php
@@ -118,14 +118,7 @@
119119 foreach ( $row as $field ) {
120120 while ( ( $object = efSRFGetNextDV( $field ) ) !== false ) {
121121 if ( $object->isNumeric() ) { // use numeric sortkey
122 -
123 - // getDataItem was introduced in SMW 1.6, getValueKey was deprecated in the same version.
124 - if ( method_exists( $object, 'getDataItem' ) ) {
125 - $nr = $object->getDataItem()->getSortKey();
126 - } else {
127 - $nr = $object->getValueKey();
128 - }
129 -
 122+ $nr = $object->getDataItem()->getSortKey();
130123 $pie_data[] .= "['$name', $nr]";
131124 }
132125 }
Index: trunk/extensions/SemanticResultFormats/jqPlot/SRF_jqPlotBar.php
@@ -140,13 +140,7 @@
141141 foreach ( $row as $field ) {
142142 while ( ( $object = efSRFGetNextDV( $field ) ) !== false ) {
143143 if ( $object->isNumeric() ) {
144 - // getDataItem was introduced in SMW 1.6, getValueKey was deprecated in the same version.
145 - if ( method_exists( $object, 'getDataItem' ) ) {
146 - $numbers[] = $object->getDataItem()->getSortKey();
147 - } else {
148 - $numbers[] = $object->getValueKey();
149 - }
150 -
 144+ $numbers[] = $object->getDataItem()->getSortKey();
151145 $labels[] = "'$name'";
152146 }
153147 }

Status & tagging log