Parcourir la source

Ticket #715 - Integration with Groups module.

AntonLV il y a 9 ans
Parent
commit
d7d44cd314

+ 6 - 5
modules/base/general/classes/BxBaseModGeneralModule.php

@@ -17,11 +17,16 @@ bx_import('BxDolAcl');
 class BxBaseModGeneralModule extends BxDolModule
 {
     protected $_iProfileId;
+    protected $_aSearchableNamesExcept;
 
     function __construct(&$aModule)
     {
         parent::__construct($aModule);
+
         $this->_iProfileId = bx_get_logged_profile_id();
+        $this->_aSearchableNamesExcept = array(
+            'allow_view_to'
+        );
     }
 
     // ====== ACTIONS METHODS
@@ -125,10 +130,6 @@ class BxBaseModGeneralModule extends BxDolModule
     public function serviceGetSearchableFieldsExtended()
     {
         $CNF = &$this->_oConfig->CNF;
-        $aSearchableNamesExcept = array(
-            'allow_view_to'
-        );
-
         if(empty($CNF['OBJECT_FORM_ENTRY']) || empty($CNF['OBJECT_FORM_ENTRY_DISPLAY_ADD']))
             return array();
 
@@ -145,7 +146,7 @@ class BxBaseModGeneralModule extends BxDolModule
             );
 
         foreach ($oForm->aInputs as $aInput)
-            if (in_array($aInput['type'], BxDolSearchExtended::$SEARCHABLE_TYPES) && !in_array($aInput['name'], $aSearchableNamesExcept))
+            if (in_array($aInput['type'], BxDolSearchExtended::$SEARCHABLE_TYPES) && !in_array($aInput['name'], $this->_aSearchableNamesExcept))
                 $aResult[$aInput['name']] = array(
                 	'type' => $aInput['type'], 
                 	'caption' => $aInput['caption_src'],

+ 2 - 0
modules/boonex/groups/classes/BxGroupsConfig.php

@@ -48,6 +48,7 @@ class BxGroupsConfig extends BxBaseModProfileConfig
             'FIELD_TEXT' => 'group_desc',
             'FIELD_PICTURE' => 'picture',
             'FIELD_COVER' => 'cover',
+            'FIELD_JOIN_CONFIRMATION' => 'join_confirmation',
             'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
             'FIELDS_QUICK_SEARCH' => array('group_name'),
             'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
@@ -146,6 +147,7 @@ class BxGroupsConfig extends BxBaseModProfileConfig
                 'txt_N_fans' => '_bx_groups_txt_N_fans',
                 'txt_ntfs_join_request' => '_bx_groups_txt_ntfs_join_request',
                 'txt_ntfs_fan_added' => '_bx_groups_txt_ntfs_fan_added',
+            	'form_field_author' => '_bx_groups_form_entry_input_author',
                 'menu_item_title_befriend_sent' => '_bx_groups_menu_item_title_befriend_sent',
                 'menu_item_title_unfriend_cancel_request' => '_bx_groups_menu_item_title_unfriend_cancel_request',
                 'menu_item_title_befriend_confirm' => '_bx_groups_menu_item_title_befriend_confirm',

+ 2 - 0
modules/boonex/groups/classes/BxGroupsModule.php

@@ -17,6 +17,8 @@ class BxGroupsModule extends BxBaseModGroupsModule
     function __construct(&$aModule)
     {
         parent::__construct($aModule);
+
+        $this->_aSearchableNamesExcept[] = $this->_oConfig->CNF['FIELD_JOIN_CONFIRMATION'];
     }
 }
 

+ 9 - 0
modules/boonex/groups/install/langs/en.xml

@@ -15,6 +15,7 @@
 	<string name="_bx_groups_form_profile_display_view"><![CDATA[View Group]]></string>
 	<string name="_bx_groups_form_profile_display_view_full"><![CDATA[Full View Group]]></string>
 	<string name="_bx_groups_form_profile_display_invite"><![CDATA[Invite to Group]]></string>
+	<string name="_bx_groups_form_entry_input_author"><![CDATA[Author]]></string>
 	<string name="_bx_groups_form_profile_input_sys_do_submit"><![CDATA[Submit]]></string>
     <string name="_bx_groups_form_profile_input_sys_join_confirm"><![CDATA[Join confirmation]]></string>
     <string name="_bx_groups_form_profile_input_join_confirm"><![CDATA[Join confirmation]]></string>
@@ -81,6 +82,8 @@
 	<string name="_bx_groups_page_title_top"><![CDATA[Top Groups]]></string>
 	<string name="_bx_groups_page_title_sys_invite_to_group"><![CDATA[Invite Members to the Group]]></string>
 	<string name="_bx_groups_page_title_invite_to_group"><![CDATA[Invite Members to the Group]]></string>
+	<string name="_bx_groups_page_title_sys_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_groups_page_title_entries_search"><![CDATA[Search]]></string>
 
 	<string name="_bx_groups_page_block_title_favorites_of_author"><![CDATA[Favorite Groups]]></string>
     <string name="_bx_groups_page_block_title_sys_favorites_of_author"><![CDATA[Favorite Groups]]></string>
@@ -111,6 +114,8 @@
     <string name="_bx_groups_page_block_title_entry_social_sharing"><![CDATA[Share]]></string>
     <string name="_bx_groups_page_block_title_categories"><![CDATA[Group categories]]></string>
     <string name="_bx_groups_page_block_title_invite_to_group"><![CDATA[Invite Members to the Group]]></string>
+    <string name="_bx_groups_page_block_title_search_form"><![CDATA[Search Form]]></string>
+    <string name="_bx_groups_page_block_title_search_results"><![CDATA[Search Results]]></string>
 
     <string name="_bx_groups_menu_title_submenu"><![CDATA[Groups Submenu]]></string>
     <string name="_bx_groups_menu_set_title_submenu"><![CDATA[Groups Submenu]]></string>
@@ -184,6 +189,8 @@
     <string name="_bx_groups_menu_item_title_manage_my_groups"><![CDATA[{addon} groups]]></string>
     <string name="_bx_groups_menu_item_title_system_entries_recent"><![CDATA[New]]></string>
     <string name="_bx_groups_menu_item_title_entries_recent"><![CDATA[New]]></string>
+    <string name="_bx_groups_menu_item_title_system_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_groups_menu_item_title_entries_search"><![CDATA[Search]]></string>
     <string name="_bx_groups_menu_item_title_system_entries_manage"><![CDATA[Manage]]></string>
     <string name="_bx_groups_menu_item_title_entries_manage"><![CDATA[Manage]]></string>
     <string name="_bx_groups_menu_item_title_system_entries_home"><![CDATA[Groups]]></string>
@@ -212,6 +219,8 @@
     <string name="_bx_groups_chart_growth"><![CDATA[Groups: Growth]]></string>
     <string name="_bx_groups_chart_growth_speed"><![CDATA[Groups: Growth Speed]]></string>
 
+    <string name="_bx_groups_search_extended"><![CDATA[Groups Search]]></string>
+
     <string name="_bx_groups_txt_account_pending"><![CDATA[This group is pending approval, please wait until it is activated.]]></string>
     <string name="_bx_groups_txt_account_suspended"><![CDATA[This group is suspended.]]></string>
     <string name="_bx_groups_txt_N_fans"><![CDATA[{0} members]]></string>

+ 4 - 1
modules/boonex/groups/install/sql/disable.sql

@@ -10,7 +10,7 @@ DELETE FROM `sys_options_types` WHERE `id` = @iTypeId;
 -- PAGES
 
 DELETE FROM `sys_objects_page` WHERE `module` = 'bx_groups';
-DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_groups' OR `object` IN('bx_groups_create_profile', 'bx_groups_delete_profile', 'bx_groups_edit_profile', 'bx_groups_edit_profile_cover', 'bx_groups_invite', 'bx_groups_view_profile', 'bx_groups_view_profile_closed', 'bx_groups_profile_info', 'bx_groups_home', 'bx_groups_fans', 'bx_groups_joined', 'bx_groups_top', 'bx_groups_manage', 'bx_groups_administration');
+DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_groups' OR `object` IN('bx_groups_create_profile', 'bx_groups_delete_profile', 'bx_groups_edit_profile', 'bx_groups_edit_profile_cover', 'bx_groups_invite', 'bx_groups_view_profile', 'bx_groups_view_profile_closed', 'bx_groups_profile_info', 'bx_groups_home', 'bx_groups_fans', 'bx_groups_joined', 'bx_groups_top', 'bx_groups_search', 'bx_groups_manage', 'bx_groups_administration');
 
 -- MENU
 
@@ -46,6 +46,9 @@ DELETE FROM `sys_objects_category` WHERE `object` = 'bx_groups_cats';
 -- SEARCH
 DELETE FROM `sys_objects_search` WHERE `ObjectName` = 'bx_groups';
 
+-- SEARCH EXTENDED
+DELETE FROM `sys_objects_search_extended` WHERE `module` = 'bx_groups';
+
 -- CONNECTIONS
 DELETE FROM `sys_objects_connection` WHERE `object` = 'bx_groups_fans';
 

+ 14 - 1
modules/boonex/groups/install/sql/enable.sql

@@ -112,6 +112,14 @@ INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `lay
 INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
 ('bx_groups_top', 1, 'bx_groups', '_bx_groups_page_block_title_top_profiles', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:9:\"bx_groups\";s:6:\"method\";s:19:\"browse_top_profiles\";s:6:"params";a:1:{i:0;b:1;}}', 0, 1, 0);
 
+-- PAGE: search for entries
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_groups_search', '_bx_groups_page_title_sys_entries_search', '_bx_groups_page_title_entries_search', 'bx_groups', 5, 2147483647, 1, 'groups-search', 'page.php?i=groups-search', '', '', '', 0, 1, 0, 'BxGroupsPageBrowse', 'modules/boonex/groups/classes/BxGroupsPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_groups_search', 1, 'bx_groups', '_bx_groups_page_block_title_search_form', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:8:"get_form";s:6:"params";a:1:{i:0;a:1:{s:6:"object";s:9:"bx_groups";}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 1, 1),
+('bx_groups_search', 1, 'bx_groups', '_bx_groups_page_block_title_search_results', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_results";s:6:"params";a:1:{i:0;a:2:{s:6:"object";s:9:"bx_groups";s:10:"show_empty";b:1;}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 1, 2);
+
 -- PAGE: module manage own
 INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
 ('bx_groups_manage', '_bx_groups_page_title_sys_manage', '_bx_groups_page_title_manage', 'bx_groups', 5, 2147483647, 1, 'groups-manage', 'page.php?i=groups-manage', '', '', '', 0, 1, 0, 'BxGroupsPageBrowse', 'modules/boonex/groups/classes/BxGroupsPageBrowse.php');
@@ -205,7 +213,8 @@ INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
 ('bx_groups_submenu', 'bx_groups', 'groups-home', '_bx_groups_menu_item_title_system_entries_recent', '_bx_groups_menu_item_title_entries_recent', 'page.php?i=groups-home', '', '', '', '', 2147483647, 1, 1, 1),
 ('bx_groups_submenu', 'bx_groups', 'groups-top', '_bx_groups_menu_item_title_system_entries_top', '_bx_groups_menu_item_title_entries_top', 'page.php?i=groups-top', '', '', '', '', 2147483647, 1, 1, 2),
-('bx_groups_submenu', 'bx_groups', 'groups-manage', '_bx_groups_menu_item_title_system_entries_manage', '_bx_groups_menu_item_title_entries_manage', 'page.php?i=groups-manage', '', '', '', '', 2147483646, 1, 1, 3);
+('bx_groups_submenu', 'bx_groups', 'groups-search', '_bx_groups_menu_item_title_system_entries_search', '_bx_groups_menu_item_title_entries_search', 'page.php?i=groups-search', '', '', '', '', 2147483647, 1, 1, 3),
+('bx_groups_submenu', 'bx_groups', 'groups-manage', '_bx_groups_menu_item_title_system_entries_manage', '_bx_groups_menu_item_title_entries_manage', 'page.php?i=groups-manage', '', '', '', '', 2147483646, 1, 1, 4);
 
 -- MENU: view submenu
 
@@ -342,6 +351,10 @@ SET @iSearchOrder = (SELECT IFNULL(MAX(`Order`), 0) FROM `sys_objects_search`);
 INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `Order`, `ClassName`, `ClassPath`) VALUES
 ('bx_groups', '_bx_groups', @iSearchOrder + 1, 'BxGroupsSearchResult', 'modules/boonex/groups/classes/BxGroupsSearchResult.php');
 
+-- SEARCH EXTENDED
+INSERT INTO `sys_objects_search_extended` (`object`, `object_content_info`, `module`, `title`, `active`, `class_name`, `class_file`) VALUES
+('bx_groups', 'bx_groups', 'bx_groups', '_bx_groups_search_extended', 1, '', '');
+
 -- CONNECTIONS
 INSERT INTO `sys_objects_connection` (`object`, `table`, `type`, `override_class_name`, `override_class_file`) VALUES
 ('bx_groups_fans', 'bx_groups_fans', 'mutual', '', '');

+ 9 - 0
modules/boonex/russian/data/langs/bx_groups/ru.xml

@@ -15,6 +15,7 @@
 	<string name="_bx_groups_form_profile_display_view"><![CDATA[Просмотр группы]]></string>
     <string name="_bx_groups_form_profile_display_view_full"><![CDATA[Полный просмотр группы]]></string>
     <string name="_bx_groups_form_profile_display_invite"><![CDATA[Приглашение в группу]]></string>
+    <string name="_bx_groups_form_entry_input_author"><![CDATA[Автор]]></string>
 	<string name="_bx_groups_form_profile_input_sys_do_submit"><![CDATA[Выполнить]]></string>
     <string name="_bx_groups_form_profile_input_sys_join_confirm"><![CDATA[Подтверждение регистрации]]></string>
     <string name="_bx_groups_form_profile_input_join_confirm"><![CDATA[Подтверждение регистрации]]></string>
@@ -81,6 +82,8 @@
     <string name="_bx_groups_page_title_top"><![CDATA[Популярные Группы]]></string>
     <string name="_bx_groups_page_title_sys_invite_to_group"><![CDATA[Пригласить участников в группу]]></string>
     <string name="_bx_groups_page_title_invite_to_group"><![CDATA[Пригласить участников в группу]]></string>
+    <string name="_bx_groups_page_title_sys_entries_search"><![CDATA[Поиск]]></string>
+    <string name="_bx_groups_page_title_entries_search"><![CDATA[Поиск]]></string>
 
 	<string name="_bx_groups_page_block_title_favorites_of_author"><![CDATA[Избранные группы]]></string>   
     <string name="_bx_groups_page_block_title_sys_favorites_of_author"><![CDATA[Избранные группы]]></string>
@@ -111,6 +114,8 @@
     <string name="_bx_groups_page_block_title_entry_social_sharing"><![CDATA[Поделиться]]></string>
     <string name="_bx_groups_page_block_title_categories"><![CDATA[Категории групп]]></string>
     <string name="_bx_groups_page_block_title_invite_to_group"><![CDATA[Пригласить участников в группу]]></string>
+    <string name="_bx_groups_page_block_title_search_form"><![CDATA[Форма поиска]]></string>
+    <string name="_bx_groups_page_block_title_search_results"><![CDATA[Результаты поиска]]></string>
 
     <string name="_bx_groups_menu_title_submenu"><![CDATA[Группы - Подменю]]></string>
     <string name="_bx_groups_menu_set_title_submenu"><![CDATA[Группы - Подменю]]></string>
@@ -184,6 +189,8 @@
     <string name="_bx_groups_menu_item_title_manage_my_groups"><![CDATA[{addon} групп]]></string>
     <string name="_bx_groups_menu_item_title_system_entries_recent"><![CDATA[Новые]]></string>
     <string name="_bx_groups_menu_item_title_entries_recent"><![CDATA[Новые]]></string>
+    <string name="_bx_groups_menu_item_title_system_entries_search"><![CDATA[Поиск]]></string>
+    <string name="_bx_groups_menu_item_title_entries_search"><![CDATA[Поиск]]></string>
     <string name="_bx_groups_menu_item_title_system_entries_manage"><![CDATA[Управление]]></string>
     <string name="_bx_groups_menu_item_title_entries_manage"><![CDATA[Управление]]></string>
     <string name="_bx_groups_menu_item_title_system_entries_home"><![CDATA[Группы]]></string>
@@ -212,6 +219,8 @@
     <string name="_bx_groups_chart_growth"><![CDATA[Группы: Развитие]]></string>
     <string name="_bx_groups_chart_growth_speed"><![CDATA[Группы: Скорость развития]]></string>
 
+    <string name="_bx_groups_search_extended"><![CDATA[Поиск групп]]></string>
+
     <string name="_bx_groups_txt_account_pending"><![CDATA[Эта группа ожидает одобрения. Пожалуйста, дождитесь ее активации.]]></string>
     <string name="_bx_groups_txt_account_suspended"><![CDATA[Эта группа заблокирована.]]></string>
     <string name="_bx_groups_txt_N_fans"><![CDATA[{0} участников]]></string>