r77775 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77774‎ | r77775 | r77776 >
Date:05:54, 5 December 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
making use of Html class
Modified paths:
  • /trunk/extensions/SemanticResultFormats/Timeline/SRF_Timeline.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticResultFormats/Timeline/SRF_Timeline.php
@@ -166,7 +166,11 @@
167167 // FIXME: Timeline scripts should support XSD format explicitly. They
168168 // currently seem to implement iso8601 which deviates from XSD in cases.
169169 // NOTE: We can assume $object to be an SMWDataValue in this case.
170 - $curmeta .= '<span class="smwtlstart">' . $object->getXMLSchemaDate() . '</span>';
 170+ $curmeta .= Html::element(
 171+ 'span',
 172+ array( 'class' => 'smwtlstart' ),
 173+ $object->getXMLSchemaDate()
 174+ );
171175 $positions[$object->getHash()] = $object->getXMLSchemaDate();
172176 $hastime = true;
173177 }
@@ -175,7 +179,11 @@
176180 if ( ( $pr->getMode() == SMWPrintRequest::PRINT_PROP ) &&
177181 ( $date_value == $this->m_tlend ) ) {
178182 // NOTE: We can assume $object to be an SMWDataValue in this case.
179 - $curmeta .= '<span class="smwtlend">' . $object->getXMLSchemaDate( false ) . '</span>';
 183+ $curmeta .= Html::element(
 184+ 'span',
 185+ array( 'class' => 'smwtlend' ),
 186+ $object->getXMLSchemaDate( false )
 187+ );
180188 }
181189
182190 // find title for displaying event
@@ -206,10 +214,18 @@
207215
208216 if ( $eventline && ( $pr->getMode() == SMWPrintRequest::PRINT_PROP ) && ( $pr->getTypeID() == '_dat' ) && ( '' != $pr->getLabel() ) && ( $date_value != $this->m_tlstart ) && ( $date_value != $this->m_tlend ) ) {
209217 if ( method_exists( $object, 'getValueKey' ) ) {
210 - $events[] = array( $object->getXMLSchemaDate(), $pr->getLabel(), $object->getValueKey() );
 218+ $events[] = array(
 219+ $object->getXMLSchemaDate(),
 220+ $pr->getLabel(),
 221+ $object->getValueKey()
 222+ );
211223 }
212224 else {
213 - $events[] = array( $object->getXMLSchemaDate(), $pr->getLabel(), $object->getNumericValue() );
 225+ $events[] = array(
 226+ $object->getXMLSchemaDate(),
 227+ $pr->getLabel(),
 228+ $object->getNumericValue()
 229+ );
214230 }
215231 }
216232 $first_value = false;
@@ -221,7 +237,15 @@
222238 }
223239
224240 if ( $hastime ) {
225 - $result .= '<span class="smwtlevent">' . $curmeta . '<span class="smwtlcoloricon">' . $curcolor . '</span>' . $curdata . '</span>';
 241+ $result .= Html::rawElement(
 242+ 'span',
 243+ array( 'class' => 'smwtlevent' ),
 244+ $curmeta . Html::element(
 245+ 'span',
 246+ array( 'class' => 'smwtlcoloricon' ),
 247+ $curcolor
 248+ ) . $curdata
 249+ );
226250 }
227251
228252 if ( $eventline ) {

Status & tagging log