Index: trunk/extensions/SemanticResultFormats/iCalendar/SRF_iCalendar.php |
— | — | @@ -167,28 +167,27 @@ |
168 | 168 | $location = ''; |
169 | 169 | $description = ''; |
170 | 170 | |
171 | | - foreach ( $row as $field ) { |
| 171 | + foreach ( $row as /* SMWResultArray */ $field ) { |
172 | 172 | // later we may add more things like a generic |
173 | 173 | // mechanism to add whatever you want :) |
174 | 174 | // could include funny things like geo, description etc. though |
175 | 175 | $req = $field->getPrintRequest(); |
176 | | - if ( ( strtolower( $req->getLabel() ) == "start" ) && ( $req->getTypeID() == "_dat" ) ) { |
177 | | - $startdate = current( $field->getContent() ); // save only the first |
178 | | - } |
| 176 | + $label = strtolower( $req->getLabel() ); |
179 | 177 | |
180 | | - if ( ( strtolower( $req->getLabel() ) == 'end' ) && ( $req->getTypeID() == '_dat' ) ) { |
181 | | - $enddate = current( $field->getContent() ); // save only the first |
| 178 | + if ( $label == 'start' && $req->getTypeID() == '_dat' ) { |
| 179 | + $startdate = efSRFGetNextDV( $field ); // save only the first |
182 | 180 | } |
183 | | - |
184 | | - if ( strtolower( $req->getLabel() ) == 'location' ) { |
185 | | - $value = current( $field->getContent() ); // save only the first |
| 181 | + else if ( $label == 'end' && $req->getTypeID() == '_dat' ) { |
| 182 | + $enddate = efSRFGetNextDV( $field ); // save only the first |
| 183 | + } |
| 184 | + else if ( $label == 'location' ) { |
| 185 | + $value = efSRFGetNextDV( $field ); // save only the first |
186 | 186 | if ( $value !== false ) { |
187 | 187 | $location = $value->getShortWikiText(); |
188 | 188 | } |
189 | 189 | } |
190 | | - |
191 | | - if ( strtolower( $req->getLabel() ) == 'description' ) { |
192 | | - $value = current( $field->getContent() ); // save only the first |
| 190 | + else if ( $label == 'description' ) { |
| 191 | + $value = efSRFGetNextDV( $field ); // save only the first |
193 | 192 | if ( $value !== false ) { |
194 | 193 | $description = $value->getShortWikiText(); |
195 | 194 | } |