Permalink
Browse files

MINOR Use SolrTypeConfiguration data to display additional types to b…

…e searched on via normal search pages
  • Loading branch information...
1 parent 24fa40e commit 1913402ae364ca3c1e38202f12c448f5eaadedf4 Marcus Nyeholt committed Mar 23, 2012
Showing with 19 additions and 2 deletions.
  1. +7 −0 CHANGELOG
  2. +1 −1 VERSION
  3. +11 −1 code/pages/SolrSearchPage.php
View
@@ -1,3 +1,10 @@
+2012-03-23 v0.7.1
+-----------------
+
+* Use the SolrTypeConfiguration in the list of types a page can search
+ on
+
+
2012-01-27 v0.7.0
-----------------
View
@@ -1 +1 @@
-0.7.0
+0.7.1
@@ -88,9 +88,19 @@ public function getCMSFields() {
asort($source);
$source = array_merge(array('' => 'Any'), $source);
+ // add in any explicitly configured
+ $objects = DataObject::get('SolrTypeConfiguration');
+ if ($objects) {
+ foreach ($objects as $obj) {
+ $source[$obj->Title] = $obj->Title;
+ }
+ }
+
+ ksort($source);
+
$source = array_merge($source, self::$additional_search_types);
- $optionsetField = new DropdownField('SearchType', _t('SolrSearchPage.PAGE_TYPE', 'Search pages of type'), $source, 'Any');
+ $optionsetField = new DropdownField('SearchType', _t('SolrSearchPage.SEARCH_ITEM_TYPE', 'Search items of type'), $source, 'Any');
$fields->addFieldToTab('Root.Content.Main', $optionsetField, 'Content');
$fields->addFieldToTab('Root.Content.Main', new MultiValueDropdownField('SearchOnFields', _t('SolrSearchPage.INCLUDE_FIELDS', 'Search On Fields'), $objFields), 'Content');

0 comments on commit 1913402

Please sign in to comment.