Index: trunk/extensions/SemanticResultFormats/Calendar/SRF_Calendar.php |
— | — | @@ -108,7 +108,12 @@ |
109 | 109 | if (count($dates) > 0) { |
110 | 110 | // handle the 'color=' value, whether it came |
111 | 111 | // from a compound query or a regular one |
112 | | - if (property_exists($row[0], 'display_options')) { |
| 112 | + // handling is different for SMW 1.5+ |
| 113 | + if (method_exists('SMWQueryResult', 'getResults')) { |
| 114 | + $res_subject = $field->getResultSubject(); |
| 115 | + if (is_array($res_subject->display_options) && array_key_exists('color', $res_subject->display_options)) |
| 116 | + $color = $res_subject->display_options['color']; |
| 117 | + } elseif (property_exists($row[0], 'display_options')) { |
113 | 118 | if (is_array($row[0]->display_options) && array_key_exists('color', $row[0]->display_options)) |
114 | 119 | $color = $row[0]->display_options['color']; |
115 | 120 | } elseif (array_key_exists('color', $this->m_params)) |
— | — | @@ -341,7 +346,7 @@ |
342 | 347 | list($event_title, $other_text, $event_date, $color) = $event; |
343 | 348 | if ($event_date == $date_str) { |
344 | 349 | if ($this->mTemplate != '') { |
345 | | - $templatetext = '{{' . $this->mTemplate . $other_text .'|thisdate=' . $date_str . '}}'; |
| 350 | + $templatetext = '{{' . $this->mTemplate . $other_text . '|thisdate=' . $date_str . '}}'; |
346 | 351 | $templatetext = $wgParser->replaceVariables($templatetext); |
347 | 352 | $templatetext = $wgParser->recursiveTagParse($templatetext); |
348 | 353 | $text .= $templatetext; |