Index: trunk/extensions/SemanticDrilldown/specials/SD_CreateFilter.php |
— | — | @@ -117,13 +117,13 @@ |
118 | 118 | $full_text = createFilterText($property_name, $values_source, $category_name, $time_period, $filter_values, $input_type, $required_filter, $filter_label); |
119 | 119 | // HTML-encode |
120 | 120 | $full_text = str_replace('"', '"', $full_text); |
121 | | - $text = sdfPrintRedirectForm($title, $full_text, "", $save_page, $preview_page, false, false, false); |
| 121 | + $text = SDUtils::printRedirectForm($title, $full_text, "", $save_page, $preview_page, false, false, false); |
122 | 122 | $wgOut->addHTML($text); |
123 | 123 | return; |
124 | 124 | } |
125 | 125 | } |
126 | 126 | |
127 | | - $all_properties = sdfGetSemanticProperties(); |
| 127 | + $all_properties = SDUtils::getSemanticProperties(); |
128 | 128 | |
129 | 129 | // set 'title' as hidden field, in case there's no URL niceness |
130 | 130 | global $wgContLang; |
— | — | @@ -174,7 +174,7 @@ |
175 | 175 | <select id="category_dropdown" name="category_name"> |
176 | 176 | |
177 | 177 | END; |
178 | | - $categories = sdfGetTopLevelCategories(); |
| 178 | + $categories = SDUtils::getTopLevelCategories(); |
179 | 179 | foreach ($categories as $category) { |
180 | 180 | $category = str_replace('_', ' ', $category); |
181 | 181 | $text .= " <option>$category</option>\n"; |
— | — | @@ -204,7 +204,7 @@ |
205 | 205 | <option /> |
206 | 206 | |
207 | 207 | END; |
208 | | - $filters = sdfGetFilters(); |
| 208 | + $filters = SDUtils::getFilters(); |
209 | 209 | foreach ($filters as $filter) { |
210 | 210 | $filter = str_replace('_', ' ', $filter); |
211 | 211 | $text .= " <option>$filter</option>\n"; |
Index: trunk/extensions/SemanticDrilldown/specials/SD_BrowseData.php |
— | — | @@ -56,8 +56,8 @@ |
57 | 57 | // get the two arrays for subcategories - one for only the |
58 | 58 | // immediate subcategories, for display, and the other for |
59 | 59 | // all subcategories, sub-subcategories, etc., for querying |
60 | | - $this->next_level_subcategories = sdfGetCategoryChildren($actual_cat, true, 1); |
61 | | - $this->all_subcategories = sdfGetCategoryChildren($actual_cat, true, 10); |
| 60 | + $this->next_level_subcategories = SDUtils::getCategoryChildren($actual_cat, true, 1); |
| 61 | + $this->all_subcategories = SDUtils::getCategoryChildren($actual_cat, true, 10); |
62 | 62 | } |
63 | 63 | |
64 | 64 | function makeBrowseURL($category, $applied_filters = array(), $subcategory = null) { |
— | — | @@ -398,7 +398,7 @@ |
399 | 399 | |
400 | 400 | END; |
401 | 401 | foreach ($categories as $i => $category) { |
402 | | - $category_children = sdfGetCategoryChildren($category, false, 5); |
| 402 | + $category_children = SDUtils::getCategoryChildren($category, false, 5); |
403 | 403 | $category_str = $category . " (" . count($category_children) . ")"; |
404 | 404 | if (str_replace('_', ' ', $this->category) == $category) { |
405 | 405 | $text .= ' <div class="drilldown-category selected-category">'; |
— | — | @@ -419,7 +419,7 @@ |
420 | 420 | } |
421 | 421 | |
422 | 422 | function printFilterLabel($filter_name) { |
423 | | - $labels_for_filter = sdfGetValuesForProperty($filter_name, SD_NS_FILTER, '_SD_L', SD_SP_HAS_LABEL, NS_MAIN); |
| 423 | + $labels_for_filter = SDUtils::getValuesForProperty($filter_name, SD_NS_FILTER, '_SD_L', SD_SP_HAS_LABEL, NS_MAIN); |
424 | 424 | if (count($labels_for_filter) > 0) { |
425 | 425 | $filter_label = $labels_for_filter[0]; |
426 | 426 | } else { |
— | — | @@ -472,7 +472,7 @@ |
473 | 473 | elseif ($value === ' none') |
474 | 474 | $filter_text = wfMsg('sd_browsedata_none'); |
475 | 475 | elseif ($af->filter->is_boolean) |
476 | | - $filter_text = sdfBooleanToString($value); |
| 476 | + $filter_text = SDUtils::booleanToString($value); |
477 | 477 | else |
478 | 478 | $filter_text = $value; |
479 | 479 | $applied_filters = $this->applied_filters; |
— | — | @@ -540,7 +540,7 @@ |
541 | 541 | elseif ($value_str === '_none') |
542 | 542 | $filter_text = wfMsg('sd_browsedata_none'); |
543 | 543 | elseif ($f->is_boolean) |
544 | | - $filter_text = sdfBooleanToString($value_str); |
| 544 | + $filter_text = SDUtils::booleanToString($value_str); |
545 | 545 | else |
546 | 546 | $filter_text = str_replace('_', ' ', $value_str); |
547 | 547 | $filter_text .= " ($num_results)"; |
— | — | @@ -759,7 +759,7 @@ |
760 | 760 | |
761 | 761 | $skin = $wgUser->getSkin(); |
762 | 762 | $browse_data_title = Title::newFromText('BrowseData', NS_SPECIAL); |
763 | | - $categories = sdfGetTopLevelCategories(); |
| 763 | + $categories = SDUtils::getTopLevelCategories(); |
764 | 764 | // if there are no categories, escape quickly |
765 | 765 | if (count($categories) == 0) { |
766 | 766 | return ""; |
— | — | @@ -805,7 +805,7 @@ |
806 | 806 | elseif ($fv->text == ' none') |
807 | 807 | $filter_text = wfMsg('sd_browsedata_none'); |
808 | 808 | elseif ($af->filter->is_boolean) |
809 | | - $filter_text = sdfBooleanToString($fv->text); |
| 809 | + $filter_text = SDUtils::booleanToString($fv->text); |
810 | 810 | else |
811 | 811 | $filter_text = $fv->text; |
812 | 812 | $temp_filters_array = $this->applied_filters; |
— | — | @@ -840,7 +840,7 @@ |
841 | 841 | if (count($this->next_level_subcategories) > 0) { |
842 | 842 | $results_line = ""; |
843 | 843 | foreach ($this->next_level_subcategories as $i => $subcat) { |
844 | | - $further_subcats = sdfGetCategoryChildren($subcat, true, 10); |
| 844 | + $further_subcats = SDUtils::getCategoryChildren($subcat, true, 10); |
845 | 845 | $num_results = $this->getNumResults($subcat, $further_subcats); |
846 | 846 | if ($num_results > 0) { |
847 | 847 | if ($num_printed_values++ > 0) { $results_line .= " · "; } |
— | — | @@ -853,7 +853,7 @@ |
854 | 854 | $header .= " <p><strong>$subcategory_text:</strong> $results_line</p>\n"; |
855 | 855 | } |
856 | 856 | } |
857 | | - $filters = sdfLoadFiltersForCategory($this->category); |
| 857 | + $filters = SDUtils::loadFiltersForCategory($this->category); |
858 | 858 | foreach ($filters as $f) { |
859 | 859 | foreach ($this->applied_filters as $af) { |
860 | 860 | if ($af->filter->name == $f->name) |
— | — | @@ -1078,7 +1078,7 @@ |
1079 | 1079 | if (! $category) { |
1080 | 1080 | $category_title = wfMsg('browsedata'); |
1081 | 1081 | } else { |
1082 | | - $titles_for_category = sdfGetValuesForProperty($category, NS_CATEGORY, '_SD_DT', SD_SP_HAS_DRILLDOWN_TITLE, NS_MAIN); |
| 1082 | + $titles_for_category = SDUtils::getValuesForProperty($category, NS_CATEGORY, '_SD_DT', SD_SP_HAS_DRILLDOWN_TITLE, NS_MAIN); |
1083 | 1083 | if (count($titles_for_category) > 0) { |
1084 | 1084 | $category_title = str_replace('_', ' ', $titles_for_category[0]); |
1085 | 1085 | } else { |
— | — | @@ -1088,7 +1088,7 @@ |
1089 | 1089 | // if no category was specified, go with the first |
1090 | 1090 | // category on the site, alphabetically |
1091 | 1091 | if (! $category) { |
1092 | | - $categories = sdfGetTopLevelCategories(); |
| 1092 | + $categories = SDUtils::getTopLevelCategories(); |
1093 | 1093 | if (count($categories) > 0) { |
1094 | 1094 | $category = $categories[0]; |
1095 | 1095 | } |
— | — | @@ -1097,7 +1097,7 @@ |
1098 | 1098 | $wgOut->setPageTitle($category_title); |
1099 | 1099 | $subcategory = $wgRequest->getVal('_subcat'); |
1100 | 1100 | |
1101 | | - $filters = sdfLoadFiltersForCategory($category); |
| 1101 | + $filters = SDUtils::loadFiltersForCategory($category); |
1102 | 1102 | |
1103 | 1103 | $filters_used = array(); |
1104 | 1104 | foreach ($filters as $i => $filter) |
— | — | @@ -1126,7 +1126,7 @@ |
1127 | 1127 | // add every unused filter to the $remaining_filters array, unless |
1128 | 1128 | // it requires some other filter that hasn't been applied |
1129 | 1129 | foreach ($filters as $i => $filter) { |
1130 | | - $required_filters = sdfGetValuesForProperty($filter->name, SD_NS_FILTER, '_SD_RF', SD_SP_REQUIRES_FILTER, SD_NS_FILTER); |
| 1130 | + $required_filters = SDUtils::getValuesForProperty($filter->name, SD_NS_FILTER, '_SD_RF', SD_SP_REQUIRES_FILTER, SD_NS_FILTER); |
1131 | 1131 | $matched_all_required_filters = true; |
1132 | 1132 | foreach ($required_filters as $required_filter) { |
1133 | 1133 | $found_match = false; |