Index: install/english.lang
===================================================================
--- install/english.lang (revision 14707)
+++ install/english.lang (working copy)
@@ -179,6 +179,7 @@
UmVxdWlyZSBTU0wgZm9yIGxvZ2luICYgY2hlY2tvdXQ=
RnJhbWVzIGluIGFkbWluaXN0cmF0aXZlIGNvbnNvbGUgYXJlIHJlc2l6YWJsZQ==
TWluaW1hbCBTZWFyY2ggS2V5d29yZCBMZW5ndGg=
+ U2VhcmNoIFJlcXVpcmUgQWxsIEtleXdvcmRz
U2Vzc2lvbiBTZWN1cml0eSBDaGVjayBiYXNlZCBvbiBCcm93c2VyIFNpZ25hdHVyZQ==
U2Vzc2lvbiBDb29raWUgRG9tYWlucyAoc2luZ2xlIGRvbWFpbiBwZXIgbGluZSk=
U2Vzc2lvbiBTZWN1cml0eSBDaGVjayBiYXNlZCBvbiBJUA==
Index: install/install_data.sql
===================================================================
--- install/install_data.sql (revision 14707)
+++ install/install_data.sql (working copy)
@@ -132,6 +132,8 @@
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'CategoriesRebuildSerial', '0', 'In-Portal', '', '', '', '', NULL, NULL, 0, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRequireAllKeywords', '1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_SearchRequireAllKeywords', 'checkbox', '', '', '10.10', '0', '0', NULL);
+
INSERT INTO ItemTypes VALUES (1, 'In-Portal', 'c', 'Category', 'Name', 'CreatedById', NULL, NULL, 'la_ItemTab_Categories', 1, 'admin/category/addcategory.php', 'clsCategory', 'Category');
INSERT INTO ItemTypes VALUES (6, 'In-Portal', 'u', 'PortalUser', 'Login', 'PortalUserId', NULL, NULL, '', 0, '', 'clsPortalUser', 'User');
Index: install/upgrades.sql
===================================================================
--- install/upgrades.sql (revision 14707)
+++ install/upgrades.sql (working copy)
@@ -2193,3 +2193,5 @@
UPDATE ConfigurationValues
SET DisplayOrder = DisplayOrder + 0.01
WHERE `Section` = 'in-portal:configure_advanced' AND Heading = 'la_section_SettingsWebsite';
+
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRequireAllKeywords', '1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_SearchRequireAllKeywords', 'checkbox', '', '', '10.10', '0', '0', NULL);
\ No newline at end of file
Index: units/categories/categories_event_handler.php
===================================================================
--- units/categories/categories_event_handler.php (revision 14707)
+++ units/categories/categories_event_handler.php (working copy)
@@ -256,6 +256,26 @@
$event->SetRedirectParam('opener', 'u');
}
+ protected function _ensureAllKeywords()
+ {
+ $keywords = $this->Application->GetVar('keywords');
+
+ if (!$keywords) {
+ return;
+ }
+ $a_keywords = explode(' ', $keywords);
+ foreach ($a_keywords AS $key => $keyword) {
+ $keyword = trim($keyword);
+
+ if (!in_array(substr($keyword, 1, 0), Array('+', '-'))) {
+ $keyword = '+'.$keyword;
+ }
+ $a_keywords[$key] = $keyword;
+ }
+ $this->Application->SetVar('keywords', join(' ', $a_keywords));
+ }
+
+
/**
* Apply system filter to categories list
*
@@ -524,6 +544,13 @@
$type = 'simple';
}
+ if (
+ $this->Application->GetVar('search_scope') == 'category'
+ && $this->Application->ConfigValue('SearchRequireAllKeywords')
+ ) {
+ $this->_ensureAllKeywords();
+ }
+
$search_event = $event_mapping[$type];
$this->$search_event($event);