r87084 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87083‎ | r87084 | r87085 >
Date:15:52, 28 April 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
follow up to r87076
Modified paths:
  • /trunk/extensions/SemanticResultFormats/Calendar/SRF_Calendar.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/Exhibit/SRF_Exhibit.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/Gallery/SRF_Gallery.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/GoogleCharts/SRF_GoogleBar.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/GoogleCharts/SRF_GooglePie.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/GraphViz/SRF_Graph.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/Outline/SRF_Outline.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/Ploticus/SRF_Ploticus.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/TagCloud/SRF_TagCloud.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/Timeline/SRF_Timeline.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/Outline/SRF_Outline.php
@@ -199,7 +199,7 @@
200200 $first = true;
201201 $field_name = $field->getPrintRequest()->getText( SMW_OUTPUT_HTML );
202202 if ( in_array( $field_name, $this->mOutlineProperties ) ) {
203 - while ( ( $object = $field->getNextObject() ) !== false ) {
 203+ while ( ( $object = efSRFGetNextDV( $field ) ) !== false ) {
204204 $field_val = $object->getLongWikiText( $this->mLinker );
205205 $item->addFieldValue( $field_name, $field_val );
206206 }
Index: trunk/extensions/SemanticResultFormats/GoogleCharts/SRF_GoogleBar.php
@@ -37,9 +37,9 @@
3838 $count = 0; // How many bars will they be? Needed to calculate the height of the image
3939 $max = 0; // the biggest value. needed for scaling
4040 while ( $row = $res->getNext() ) {
41 - $name = $row[0]->getNextObject()->getShortWikiText();
 41+ $name = efSRFGetNextDV( $row[0] )->getShortWikiText();
4242 foreach ( $row as $field ) {
43 - while ( ( $object = $field->getNextObject() ) !== false ) {
 43+ while ( ( $object = efSRFGetNextDV( $field ) ) !== false ) {
4444 if ( $object->isNumeric() ) { // use numeric sortkey
4545 if ( method_exists( $object, 'getValueKey' ) ) {
4646 $nr = $object->getValueKey();
Index: trunk/extensions/SemanticResultFormats/GoogleCharts/SRF_GooglePie.php
@@ -42,9 +42,9 @@
4343 $first = true;
4444 $max = 0; // the biggest value. needed for scaling
4545 while ( $row = $res->getNext() ) {
46 - $name = $row[0]->getNextObject()->getShortWikiText();
 46+ $name = efSRFGetNextDV( $row[0] )->getShortWikiText();
4747 foreach ( $row as $field ) {
48 - while ( ( $object = $field->getNextObject() ) !== false ) {
 48+ while ( ( $object = efSRFGetNextDV( $field ) ) !== false ) {
4949 if ( $object->isNumeric() ) { // use numeric sortkey
5050 if ( method_exists( $object, 'getValueKey' ) ) {
5151 $nr = $object->getValueKey();
Index: trunk/extensions/SemanticResultFormats/GraphViz/SRF_Graph.php
@@ -163,7 +163,7 @@
164164 foreach ( $row as $i => $resultArray ) {
165165
166166 // Loop throught all the parts of the field value.
167 - while ( ( $object = $resultArray->getNextObject() ) !== false ) {
 167+ while ( ( $object = efSRFGetNextDV( $resultArray ) ) !== false ) {
168168 $propName = $resultArray->getPrintRequest()->getLabel();
169169 $isName = $this->m_nameProperty ? ( $i != 0 && $this->m_nameProperty === $propName ) : $i == 0;
170170
Index: trunk/extensions/SemanticResultFormats/Exhibit/SRF_Exhibit.php
@@ -34,12 +34,13 @@
3535 $row = $res->getNext();
3636 if ( $row != null ) {
3737 $tmp = clone $row[0];
38 - $object = $tmp->getNextObject();
 38+ $object = efSRFGetNextDV( $tmp );
 39+
3940 if ( $object instanceof SMWWikiPageValue ) {
4041 $value = $object->getPrefixedText();
41 - if ( strpos( $value, ":" ) ) {
42 - $value = explode( ":", $value, 2 );
43 - return $value[0] . ":";
 42+ if ( strpos( $value, ':' ) ) {
 43+ $value = explode( ':', $value, 2 );
 44+ return $value[0] . ':';
4445 }
4546 }
4647 return "";
@@ -383,7 +384,7 @@
384385 foreach ( $row as $field ) {
385386 $result .= "\t\t<td>";
386387 $textstack = array();
387 - while ( ( $object = $field->getNextObject() ) !== false ) {
 388+ while ( ( $object = efSRFGetNextDV( $field ) ) !== false ) {
388389 switch( $object->getTypeID() ) {
389390 case '_wpg':
390391 $textstack[] = $object->getLongText( $outputmode, $this->getLinker( 0 ) );
Index: trunk/extensions/SemanticResultFormats/Gallery/SRF_Gallery.php
@@ -79,14 +79,14 @@
8080
8181 for ( $i = 0, $n = count( $row ); $i < $n; $i++ ) { // Properties
8282 if ( $row[$i]->getPrintRequest()->getLabel() == $imageProperty ) {
83 - while ( ( $obj = $row[$i]->getNextObject() ) !== false ) { // Property values
 83+ while ( ( $obj = efSRFGetNextDV( $row[$i] ) ) !== false ) { // Property values
8484 if ( $obj->getTypeID() == '_wpg' ) {
8585 $images[] = $obj->getTitle();
8686 }
8787 }
8888 }
8989 else if ( $row[$i]->getPrintRequest()->getLabel() == $captionProperty ) {
90 - while ( ( $obj = $row[$i]->getNextObject() ) !== false ) { // Property values
 90+ while ( ( $obj = efSRFGetNextDV( $row[$i] ) ) !== false ) { // Property values
9191 $captions[] = $obj->getShortText( SMW_OUTPUT_HTML, $this->getLinker( true ) );
9292 }
9393 }
@@ -115,7 +115,7 @@
116116 protected function addImagePages( SMWQueryResult $results, ImageGallery &$ig ) {
117117 while ( $row = $results->getNext() ) {
118118 $firstField = $row[0];
119 - $nextObject = $firstField->getNextObject();
 119+ $nextObject = efSRFGetNextDV( $firstField );
120120
121121 if ( $nextObject !== false ) {
122122 $imgTitle = $nextObject->getTitle();
@@ -123,7 +123,7 @@
124124
125125 // Is there a property queried for display with ?property
126126 if ( isset( $row[1] ) ) {
127 - $imgCaption = $row[1]->getNextObject();
 127+ $imgCaption = efSRFGetNextDV( $row[1] );
128128 if ( is_object( $imgCaption ) ) {
129129 $imgCaption = $imgCaption->getShortText( SMW_OUTPUT_HTML, $this->getLinker( true ) );
130130 }
Index: trunk/extensions/SemanticResultFormats/TagCloud/SRF_TagCloud.php
@@ -125,7 +125,7 @@
126126
127127 while ( /* array of SMWResultArray */ $row = $results->getNext() ) { // Objects (pages)
128128 for ( $i = 0, $n = count( $row ); $i < $n; $i++ ) { // Properties
129 - while ( ( $obj = $row[$i]->getNextObject() ) !== false ) { // Property values
 129+ while ( ( $obj = efSRFGetNextDV( $row[$i] ) ) !== false ) { // Property values
130130
131131 // If the main object should not be included, skip it.
132132 // The isMainObject method was added in SMW 1.5.6, so this can only be done correctly if it's available.
Index: trunk/extensions/SemanticResultFormats/Ploticus/SRF_Ploticus.php
@@ -145,7 +145,7 @@
146146 $row_items = array();
147147 foreach ( $row as $field ) {
148148 $growing = array();
149 - while ( ( $object = $field->getNextObject() ) !== false ) {
 149+ while ( ( $object = efSRFGetNextDV( $field ) ) !== false ) {
150150 $text = Sanitizer::decodeCharReferences( $object->getXSDValue() );
151151 // decode: CSV knows nothing of possible HTML entities
152152 $growing[] = $text;
Index: trunk/extensions/SemanticResultFormats/Timeline/SRF_Timeline.php
@@ -172,7 +172,7 @@
173173 $date_value = $pr->getData()->getXSDValue();
174174 }
175175
176 - while ( ( $object = $field->getNextObject() ) !== false ) { // Loop over property values
 176+ while ( ( $object = efSRFGetNextDV( $field ) ) !== false ) { // Loop over property values
177177 $event = $this->handlePropertyValue(
178178 $object, $outputmode, $pr, $first_col, $hastitle, $hastime,
179179 $first_value, $isEventline, $curmeta, $curdata, $date_value, $output
Index: trunk/extensions/SemanticResultFormats/Calendar/SRF_Calendar.php
@@ -76,7 +76,7 @@
7777 $pr = $field->getPrintRequest();
7878 $text .= '|' . ( $i + 1 ) . '=';
7979
80 - while ( ( $object = $field->getNextObject() ) !== false ) {
 80+ while ( ( $object = efSRFGetNextDV( $field ) ) !== false ) {
8181 if ( $object->getTypeID() == '_dat' ) {
8282 $text .= $object->getLongWikiText();
8383 } elseif ( $object->getTypeID() == '_wpg' ) { // use shorter "LongText" for wikipage
@@ -107,7 +107,7 @@
108108 // for this property
109109 $textForProperty = '';
110110
111 - while ( ( $object = $field->getNextObject() ) !== false ) {
 111+ while ( ( $object = efSRFGetNextDV( $field ) ) !== false ) {
112112 if ( $object->getTypeID() == '_dat' ) {
113113 // don't add date values to the display
114114 } elseif ( $object->getTypeID() == '_wpg' ) { // use shorter "LongText" for wikipage
Index: trunk/extensions/SemanticResultFormats/jqPlot/SRF_jqPlotPie.php
@@ -117,10 +117,10 @@
118118 $pie_data = array();
119119 // print all result rows
120120 while ( $row = $res->getNext() ) {
121 - $name = $row[0]->getNextObject()->getShortWikiText();
 121+ $name = efSRFGetNextDV( $row[0] )->getShortWikiText();
122122 $name = str_replace( "'", "\'", $name );
123123 foreach ( $row as $field ) {
124 - while ( ( $object = $field->getNextObject() ) !== false ) {
 124+ while ( ( $object = efSRFGetNextDV( $field ) ) !== false ) {
125125 if ( $object->isNumeric() ) { // use numeric sortkey
126126 if ( method_exists( $object, 'getValueKey' ) ) {
127127 $nr = $object->getValueKey();
Index: trunk/extensions/SemanticResultFormats/jqPlot/SRF_jqPlotBar.php
@@ -151,10 +151,10 @@
152152 $max_number = 0;
153153 $min_number = 0;
154154 while ( $row = $res->getNext() ) {
155 - $name = $row[0]->getNextObject()->getShortWikiText();
 155+ $name = efSRFGetNextDV( $row[0] )->getShortWikiText();
156156 $name = str_replace( "'", "\'", $name );
157157 foreach ( $row as $field ) {
158 - while ( ( $object = $field->getNextObject() ) !== false ) {
 158+ while ( ( $object = efSRFGetNextDV( $field ) ) !== false ) {
159159 if ( $object->isNumeric() ) { // use numeric sortkey
160160 if ( method_exists( $object, 'getValueKey' ) ) {
161161 $nr = $object->getValueKey();

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r87076adding compat methodjeroendedauw14:53, 28 April 2011

Status & tagging log