Index: trunk/extensions/SemanticDrilldown/specials/SD_CreateFilter.php |
— | — | @@ -24,12 +24,11 @@ |
25 | 25 | } |
26 | 26 | } |
27 | 27 | |
28 | | -function createFilterText($property_string, $values_source, $category_used, $time_period, $filter_values, $required_filter, $filter_label) { |
| 28 | +function createFilterText($property_string, $values_source, $category_used, $time_period, $filter_values, $input_type, $required_filter, $filter_label) { |
29 | 29 | global $sdgContLang; |
30 | 30 | |
31 | 31 | list($namespace, $property_name) = explode(",", $property_string, 2); |
32 | 32 | $sd_props = $sdgContLang->getSpecialPropertiesArray(); |
33 | | - $smw_version = SMW_VERSION; |
34 | 33 | $property_tag = "[[" . $sd_props[SD_SP_COVERS_PROPERTY] . |
35 | 34 | "::$namespace:$property_name|$property_name]]"; |
36 | 35 | $text = wfMsgForContent('sd_filter_coversproperty', $property_tag); |
— | — | @@ -62,6 +61,10 @@ |
63 | 62 | } |
64 | 63 | $text .= " " . wfMsgForContent('sd_filter_hasvalues', $filter_values_tag); |
65 | 64 | } |
| 65 | + if ($input_type != '') { |
| 66 | + $input_type_tag = "[[" . $sd_props[SD_SP_HAS_INPUT_TYPE] . "::$input_type]]"; |
| 67 | + $text .= " " . wfMsgForContent('sd_filter_hasinputtype', "\"$input_type_tag\""); |
| 68 | + } |
66 | 69 | if ($required_filter != '') { |
67 | 70 | $sd_namespace_labels = $sdgContLang->getNamespaces(); |
68 | 71 | $filter_namespace = $sd_namespace_labels[SD_NS_FILTER]; |
— | — | @@ -85,6 +88,7 @@ |
86 | 89 | $category_name = $wgRequest->getVal('category_name'); |
87 | 90 | $time_period = $wgRequest->getVal('time_period'); |
88 | 91 | $filter_values = $wgRequest->getVal('filter_values'); |
| 92 | + $input_type = $wgRequest->getVal('input_type'); |
89 | 93 | $required_filter = $wgRequest->getVal('required_filter'); |
90 | 94 | $filter_label = $wgRequest->getVal('filter_label'); |
91 | 95 | |
— | — | @@ -101,7 +105,7 @@ |
102 | 106 | # redirect to wiki interface |
103 | 107 | $namespace = SD_NS_FILTER; |
104 | 108 | $title = Title::newFromText($filter_name, $namespace); |
105 | | - $full_text = createFilterText($property_name, $values_source, $category_name, $time_period, $filter_values, $required_filter, $filter_label); |
| 109 | + $full_text = createFilterText($property_name, $values_source, $category_name, $time_period, $filter_values, $input_type, $required_filter, $filter_label); |
106 | 110 | // HTML-encode |
107 | 111 | $full_text = str_replace('"', '"', $full_text); |
108 | 112 | $text = sdfPrintRedirectForm($title, $full_text, "", $save_page, $preview_page, false, false, false); |
— | — | @@ -142,6 +146,13 @@ |
143 | 147 | $year_value = wfMsgForContent('sd_filter_year'); |
144 | 148 | $month_label = wfMsg('sd_filter_month'); |
145 | 149 | $month_value = wfMsgForContent('sd_filter_month'); |
| 150 | + $input_type_label = wfMsg('sd_createfilter_inputtype'); |
| 151 | + $values_list_label = wfMsg('sd_createfilter_listofvalues'); |
| 152 | + // same as for time values |
| 153 | + $free_text_label = wfMsg('sd_filter_freetext'); |
| 154 | + $free_text_value = wfMsgForContent('sd_filter_freetext'); |
| 155 | + $date_range_label = wfMsg('sd_filter_daterange'); |
| 156 | + $date_range_value = wfMsgForContent('sd_filter_daterange'); |
146 | 157 | $require_filter_label = wfMsg('sd_createfilter_requirefilter'); |
147 | 158 | $text .=<<<END |
148 | 159 | </select> |
— | — | @@ -172,6 +183,13 @@ |
173 | 184 | <p><input type="radio" name="values_source" value="manual"> |
174 | 185 | $enter_values_label <input size="40" name="filter_values" value=""> |
175 | 186 | </p> |
| 187 | + <p>$input_type_label |
| 188 | + <select id="input_type_dropdown" name="input_type"> |
| 189 | + <option value="">$values_list_label</option> |
| 190 | + <option value="$free_text_value">$free_text_label</option> |
| 191 | + <option value="$date_range_value">$date_range_label</option> |
| 192 | + </select> |
| 193 | + </p> |
176 | 194 | <p>$require_filter_label |
177 | 195 | <select id="required_filter_dropdown" name="required_filter"> |
178 | 196 | <option /> |