r28730 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r28729‎ | r28730 | r28731 >
Date:21:01, 20 December 2007
Author:yaron
Status:old
Tags:
Comment:
New 'time_period' field
Modified paths:
  • /trunk/extensions/SemanticDrilldown/includes/SD_Filter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticDrilldown/includes/SD_Filter.php
@@ -11,6 +11,7 @@
1212 var $property;
1313 var $is_relation;
1414 var $category;
 15+ var $time_period = NULL;
1516 var $allowed_values;
1617 var $possible_applied_filters = array();
1718
@@ -52,9 +53,13 @@
5354 }
5455 }
5556 $categories = sdfGetValuesForProperty($filter_name, SD_NS_FILTER, $sd_props[SD_SP_GETS_VALUES_FROM_CATEGORY], true, NS_CATEGORY);
 57+ $time_periods = sdfGetValuesForProperty($filter_name, SD_NS_FILTER, $sd_props[SD_SP_USES_TIME_PERIOD], false, NS_MAIN);
5658 if (count($categories) > 0) {
5759 $f->category = $categories[0];
5860 $f->allowed_values = sdfGetCategoryChildren($f->category, false, 5);
 61+ } elseif (count($time_periods) > 0) {
 62+ $f->time_period = $time_periods[0];
 63+ $f->allowed_values = array();
5964 } else {
6065 $values = sdfGetValuesForProperty($filter_name, SD_NS_FILTER, $sd_props[SD_SP_HAS_VALUE], false, NS_MAIN);
6166 if (count($values) > 0) {

Status & tagging log