Ver código fonte

Merge branch 'master' of https://github.com/unaio/una

AntonLV 8 anos atrás
pai
commit
3ec9bd9515
64 arquivos alterados com 3034 adições e 31 exclusões
  1. 2 1
      inc/js/functions.js
  2. 5 2
      inc/utils.inc.php
  3. 5 0
      modules/base/groups/classes/BxBaseModGroupsModule.php
  4. 13 0
      modules/base/profile/classes/BxBaseModProfileConfig.php
  5. 7 14
      modules/boonex/organizations/classes/BxOrgsConfig.php
  6. 7 14
      modules/boonex/persons/classes/BxPersonsConfig.php
  7. 317 0
      modules/boonex/russian/data/langs/bx_spaces/ru.xml
  8. 21 0
      modules/boonex/spaces/classes/BxSpacesAlertsResponse.php
  9. 206 0
      modules/boonex/spaces/classes/BxSpacesConfig.php
  10. 75 0
      modules/boonex/spaces/classes/BxSpacesDb.php
  11. 68 0
      modules/boonex/spaces/classes/BxSpacesFormEntry.php
  12. 23 0
      modules/boonex/spaces/classes/BxSpacesFormsEntryHelper.php
  13. 36 0
      modules/boonex/spaces/classes/BxSpacesGridAdministration.php
  14. 36 0
      modules/boonex/spaces/classes/BxSpacesGridCommon.php
  15. 21 0
      modules/boonex/spaces/classes/BxSpacesGridConnections.php
  16. 24 0
      modules/boonex/spaces/classes/BxSpacesMenu.php
  17. 25 0
      modules/boonex/spaces/classes/BxSpacesMenuManageTools.php
  18. 25 0
      modules/boonex/spaces/classes/BxSpacesMenuSnippetMeta.php
  19. 25 0
      modules/boonex/spaces/classes/BxSpacesMenuView.php
  20. 86 0
      modules/boonex/spaces/classes/BxSpacesModule.php
  21. 24 0
      modules/boonex/spaces/classes/BxSpacesPageBrowse.php
  22. 24 0
      modules/boonex/spaces/classes/BxSpacesPageEntry.php
  23. 24 0
      modules/boonex/spaces/classes/BxSpacesPageJoinedEntries.php
  24. 22 0
      modules/boonex/spaces/classes/BxSpacesPrivacy.php
  25. 21 0
      modules/boonex/spaces/classes/BxSpacesPrivacyNotifications.php
  26. 209 0
      modules/boonex/spaces/classes/BxSpacesSearchResult.php
  27. 55 0
      modules/boonex/spaces/classes/BxSpacesTemplate.php
  28. 21 0
      modules/boonex/spaces/classes/BxSpacesUploaderCoverCrop.php
  29. 21 0
      modules/boonex/spaces/classes/BxSpacesUploaderPictureCrop.php
  30. 150 0
      modules/boonex/spaces/install/config.php
  31. 20 0
      modules/boonex/spaces/install/installer.php
  32. 315 0
      modules/boonex/spaces/install/langs/en.xml
  33. 78 0
      modules/boonex/spaces/install/sql/disable.sql
  34. 515 0
      modules/boonex/spaces/install/sql/enable.sql
  35. 337 0
      modules/boonex/spaces/install/sql/install.sql
  36. 44 0
      modules/boonex/spaces/install/sql/uninstall.sql
  37. 62 0
      modules/boonex/spaces/js/manage_tools.js
  38. 18 0
      modules/boonex/spaces/request.php
  39. 1 0
      modules/boonex/spaces/template/account_link.html
  40. 1 0
      modules/boonex/spaces/template/cover.html
  41. 1 0
      modules/boonex/spaces/template/css/forms.css
  42. 1 0
      modules/boonex/spaces/template/css/main.css
  43. 1 0
      modules/boonex/spaces/template/css/manage_tools.css
  44. 1 0
      modules/boonex/spaces/template/entry-childs.html
  45. 1 0
      modules/boonex/spaces/template/entry-parent.html
  46. 3 0
      modules/boonex/spaces/template/entry-share.html
  47. 1 0
      modules/boonex/spaces/template/entry-text.html
  48. 1 0
      modules/boonex/spaces/template/form_ghost_template.html
  49. 1 0
      modules/boonex/spaces/template/image_popup.html
  50. 24 0
      modules/boonex/spaces/template/images/icons/std-icon.svg
  51. BIN
      modules/boonex/spaces/template/images/no-pciture-big.png
  52. BIN
      modules/boonex/spaces/template/images/no-picture-icon.png
  53. BIN
      modules/boonex/spaces/template/images/no-picture-preview.png
  54. BIN
      modules/boonex/spaces/template/images/no-picture-thumb.png
  55. 1 0
      modules/boonex/spaces/template/name_link.html
  56. 1 0
      modules/boonex/spaces/template/picture_preview.html
  57. 1 0
      modules/boonex/spaces/template/search_extended_results.html
  58. 1 0
      modules/boonex/spaces/template/set_acl_popup.html
  59. 1 0
      modules/boonex/spaces/template/unit.html
  60. 1 0
      modules/boonex/spaces/template/unit_live_search.html
  61. 1 0
      modules/boonex/spaces/template/unit_meta_item.html
  62. 1 0
      modules/boonex/spaces/template/unit_with_cover_showcase.html
  63. 1 0
      modules/boonex/spaces/template/unit_wo_info.html
  64. 1 0
      modules/boonex/spaces/template/uploader_form_crop_cover.html

+ 2 - 1
inc/js/functions.js

@@ -922,7 +922,8 @@ function bx_autocomplete_fields(iId, sUrl, sName, bShowImg, bOnlyOnce, onSelect)
 			e.preventDefault();			
 		}
 	});
-
+	if ($('#' + iId + ' .val').length > 0 && bOnlyOnce)
+		$('#' + iId + ' input[type=text]').hide();
 	$('#' + iId + ' input[type=text]').on('superselect', function(e, item) {
 		$(this).hide();
 		if ('undefined' != typeof(item)) {

+ 5 - 2
inc/utils.inc.php

@@ -1170,11 +1170,14 @@ function bx_rtrim_str ($sString, $sPrefix, $sReplace = '')
     return $sString;
 }
 
+/**
+ * Strip all lines with no information for example: <p></p>, <br /><br />
+ */ 
 function bx_trim_nl_duplicates($s)
 {
     $sStrip = implode('', array_keys(get_html_translation_table(HTML_ENTITIES)));
-    return implode('', array_filter(explode("\r\n", $s), function($s) use ($sStrip) {
-        return trim(strip_tags($s), $sStrip) !== '';
+    return implode('', array_filter(mb_split("[\n\r]", $s), function($s) use ($sStrip) {
+        return trim(strip_tags($s, '<button><canvas><embed><hr><iframe><img><input><object><select><svg><video>'), $sStrip) !== '';
     }));
 }
 

+ 5 - 0
modules/base/groups/classes/BxBaseModGroupsModule.php

@@ -568,6 +568,11 @@ class BxBaseModGroupsModule extends BxBaseModProfileModule
         if (!$this->isFan($aDataEntry[$this->_oConfig->CNF['FIELD_ID']]))
             return _t('_sys_txt_access_denied');
 
+        return $this->_checkAllowedSubscribeAdd ($aDataEntry, $isPerformAction);
+    }
+    
+    public function _checkAllowedSubscribeAdd (&$aDataEntry, $isPerformAction = false)
+    {
         return parent::checkAllowedSubscribeAdd ($aDataEntry, $isPerformAction);
     }
 

+ 13 - 0
modules/base/profile/classes/BxBaseModProfileConfig.php

@@ -11,9 +11,22 @@
 
 class BxBaseModProfileConfig extends BxBaseModGeneralConfig
 {
+    protected $_aMenuItems2MethodsActions = array();
+    protected $_aMenuItems2MethodsSubmenu = array();
+    
     function __construct($aModule)
     {
         parent::__construct($aModule);
+
+        $this->_aMenuItems2MethodsActions = array (
+            'profile-friend-add' => 'checkAllowedFriendAdd',
+            'profile-friend-remove' => 'checkAllowedFriendRemove',
+            'profile-subscribe-add' => 'checkAllowedSubscribeAdd',
+            'profile-subscribe-remove' => 'checkAllowedSubscribeRemove',
+            'profile-actions-more' => 'checkAllowedViewMoreMenu',
+            'profile-set-acl-level' => 'checkAllowedSetMembership',
+            'convos-compose' => 'checkAllowedCompose',
+        );        
     }
 }
 

+ 7 - 14
modules/boonex/organizations/classes/BxOrgsConfig.php

@@ -15,11 +15,11 @@ class BxOrgsConfig extends BxBaseModProfileConfig
     {
         parent::__construct($aModule);
 
-        $aMenuItems2MethodsSubmenu = array (
+        $this->_aMenuItems2MethodsSubmenu = array_merge($this->_aMenuItems2MethodsSubmenu, array(
         	'organization-profile-subscriptions' => 'checkAllowedSubscriptionsView'
-        );
+        ));
 
-        $aMenuItems2MethodsActions = array (
+        $this->_aMenuItems2MethodsActions = array_merge($this->_aMenuItems2MethodsActions, array(
             'view-organization-profile' => 'checkAllowedView',
             'edit-organization-profile' => 'checkAllowedEdit',
             'edit-organization-cover' => 'checkAllowedChangeCover',
@@ -27,14 +27,7 @@ class BxOrgsConfig extends BxBaseModProfileConfig
             'delete-organization-profile' => 'checkAllowedDelete',
         	'profile-fan-add' => 'checkAllowedFanAdd',
             'profile-fan-remove' => 'checkAllowedFanRemove',
-            'profile-friend-add' => 'checkAllowedFriendAdd',
-            'profile-friend-remove' => 'checkAllowedFriendRemove',
-            'profile-subscribe-add' => 'checkAllowedSubscribeAdd',
-            'profile-subscribe-remove' => 'checkAllowedSubscribeRemove',
-            'profile-actions-more' => 'checkAllowedViewMoreMenu',
-            'profile-set-acl-level' => 'checkAllowedSetMembership',
-            'convos-compose' => 'checkAllowedCompose',
-        );
+        ));
 
         $this->CNF = array (
 
@@ -152,9 +145,9 @@ class BxOrgsConfig extends BxBaseModProfileConfig
 
             // menu items which visibility depends on custom visibility checking
             'MENU_ITEM_TO_METHOD' => array (
-        		'bx_organizations_view_submenu' => $aMenuItems2MethodsSubmenu,
-                'bx_organizations_view_actions' => $aMenuItems2MethodsActions,
-                'bx_organizations_view_actions_more' => $aMenuItems2MethodsActions,
+        		'bx_organizations_view_submenu' => $this->_aMenuItems2MethodsSubmenu,
+                'bx_organizations_view_actions' => $this->_aMenuItems2MethodsActions,
+                'bx_organizations_view_actions_more' => $this->_aMenuItems2MethodsActions,
             ),
 
             // informer messages

+ 7 - 14
modules/boonex/persons/classes/BxPersonsConfig.php

@@ -15,23 +15,16 @@ class BxPersonsConfig extends BxBaseModProfileConfig
     {
         parent::__construct($aModule);
 
-        $aMenuItems2MethodsSubmenu = array (
+        $this->_aMenuItems2MethodsSubmenu = array_merge($this->_aMenuItems2MethodsSubmenu, array(
         	'persons-profile-subscriptions' => 'checkAllowedSubscriptionsView'
-        );
+        ));
 
-        $aMenuItems2MethodsActions = array (
+        $this->_aMenuItems2MethodsActions = array_merge($this->_aMenuItems2MethodsActions, array(
             'view-persons-profile' => 'checkAllowedView',
             'edit-persons-profile' => 'checkAllowedEdit',
             'edit-persons-cover' => 'checkAllowedChangeCover',
             'delete-persons-profile' => 'checkAllowedDelete',
-            'profile-friend-add' => 'checkAllowedFriendAdd',
-            'profile-friend-remove' => 'checkAllowedFriendRemove',
-            'profile-subscribe-add' => 'checkAllowedSubscribeAdd',
-            'profile-subscribe-remove' => 'checkAllowedSubscribeRemove',
-            'profile-actions-more' => 'checkAllowedViewMoreMenu',
-            'profile-set-acl-level' => 'checkAllowedSetMembership',
-            'convos-compose' => 'checkAllowedCompose',
-        );
+        ));
 
         $this->CNF = array (
 
@@ -134,9 +127,9 @@ class BxPersonsConfig extends BxBaseModProfileConfig
 
             // menu items which visibility depends on custom visibility checking
             'MENU_ITEM_TO_METHOD' => array (
-                'bx_persons_view_submenu' => $aMenuItems2MethodsSubmenu,
-                'bx_persons_view_actions' => $aMenuItems2MethodsActions,
-                'bx_persons_view_actions_more' => $aMenuItems2MethodsActions,
+                'bx_persons_view_submenu' => $this->_aMenuItems2MethodsSubmenu,
+                'bx_persons_view_actions' => $this->_aMenuItems2MethodsActions,
+                'bx_persons_view_actions_more' => $this->_aMenuItems2MethodsActions,
             ),
 
             // informer messages

+ 317 - 0
modules/boonex/russian/data/langs/bx_spaces/ru.xml

@@ -0,0 +1,317 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="ru" flag="ru" title="Russian">
+
+	<string name="_bx_spaces"><![CDATA[Пространства]]></string>
+	<string name="_bx_spaces_cmts"><![CDATA[Пространства - Комментарии]]></string>
+
+	<string name="_bx_spaces_option_num_connections_quick"><![CDATA[Количество элементов в блоке друзей]]></string>
+	<string name="_bx_spaces_option_per_page_browse"><![CDATA[Количество элементов на странице]]></string>
+    <string name="_bx_spaces_option_num_rss"><![CDATA[Количество элементов в ленте RSS]]></string>
+    <string name="_bx_spaces_option_searchable_fields"><![CDATA[Поля для поиска]]></string>
+
+	<string name="_bx_spaces_form_profile"><![CDATA[Пространства]]></string>
+	<string name="_bx_spaces_form_profile_display_add"><![CDATA[Добавление пространства]]></string>
+	<string name="_bx_spaces_form_profile_display_edit"><![CDATA[Редактирование пространства]]></string>
+	<string name="_bx_spaces_form_profile_display_edit_cover"><![CDATA[Редактирование обложки]]></string>
+	<string name="_bx_spaces_form_profile_display_delete"><![CDATA[Удаление пространства]]></string>
+	<string name="_bx_spaces_form_profile_display_view"><![CDATA[Просмотр пространства]]></string>
+    <string name="_bx_spaces_form_profile_display_view_full"><![CDATA[Полный просмотр пространства]]></string>
+    <string name="_bx_spaces_form_profile_display_invite"><![CDATA[Приглашение в пространство]]></string>
+    <string name="_bx_spaces_form_entry_input_author"><![CDATA[Автор]]></string>
+	<string name="_bx_spaces_form_profile_input_sys_do_submit"><![CDATA[Выполнить]]></string>
+    <string name="_bx_spaces_form_profile_input_sys_join_confirm"><![CDATA[Подтверждение регистрации]]></string>
+    <string name="_bx_spaces_form_profile_input_join_confirm"><![CDATA[Подтверждение регистрации]]></string>
+    <string name="_bx_spaces_form_profile_input_sys_allow_view_to"><![CDATA[Конфиденциальность]]></string>
+    <string name="_bx_spaces_form_profile_input_allow_view_to"><![CDATA[Конфиденциальность]]></string>
+    <string name="_bx_spaces_form_profile_input_allow_view_to_desc"><![CDATA[Закрытая - все могут найти пространство и видеть кто в ней состоит, только участники могут видеть сообщения. Секретная - только участники могут найти пространство и видеть сообщения.]]></string>
+    <string name="_bx_spaces_form_profile_input_sys_initial_members"><![CDATA[Пригласить участников]]></string>
+	<string name="_bx_spaces_form_profile_input_sys_parent_space"><![CDATA[Родительское пространство]]></string>
+  	<string name="_bx_spaces_form_profile_input_parent_space"><![CDATA[Родительское пространство]]></string>
+    <string name="_bx_spaces_form_profile_input_initial_members"><![CDATA[Пригласить участников]]></string>
+    <string name="_bx_spaces_form_profile_input_sys_group_name"><![CDATA[Название пространства]]></string>
+    <string name="_bx_spaces_form_profile_input_group_name"><![CDATA[Название пространства]]></string>
+    <string name="_bx_spaces_form_profile_input_group_name_err"><![CDATA[Эта информация необходима. Пожалуйста, заполните это поле.]]></string>
+    <string name="_bx_spaces_form_profile_input_sys_group_desc"><![CDATA[Описание]]></string>
+    <string name="_bx_spaces_form_profile_input_group_desc"><![CDATA[Описание]]></string>
+    <string name="_bx_spaces_form_profile_input_sys_group_cat"><![CDATA[Категория]]></string>
+	<string name="_bx_spaces_form_profile_input_group_cat"><![CDATA[Категория]]></string>
+    <string name="_bx_spaces_form_profile_input_group_cat_err"><![CDATA[Поле категории необходимо]]></string>
+	<string name="_bx_spaces_form_profile_input_sys_picture"><![CDATA[Картинка пространства]]></string>
+	<string name="_bx_spaces_form_profile_input_picture"><![CDATA[Загрузить новую картинку пространства]]></string>
+	<string name="_bx_spaces_form_profile_input_picture_err"><![CDATA[Необходима картинка пространства.]]></string>
+	<string name="_bx_spaces_form_profile_input_sys_cover"><![CDATA[Картинка обложки]]></string>
+	<string name="_bx_spaces_form_profile_input_cover"><![CDATA[Загрузить новую картинку обложки]]></string>
+	<string name="_bx_spaces_form_profile_input_sys_delete_confirm"><![CDATA[Подтверждение на удаление]]></string>
+	<string name="_bx_spaces_form_profile_input_delete_confirm"><![CDATA[Я уверен, что хочу удалить эту пространство]]></string>
+	<string name="_bx_spaces_form_profile_input_delete_confirm_info"><![CDATA[Это действие не может быть отменено.]]></string>
+	<string name="_bx_spaces_form_profile_input_delete_confirm_error"><![CDATA[Пожалуйста, отметьте этот флажок, если действительно хотите удалить пространство.]]></string>
+
+	<string name="_bx_spaces_acl_action_create_profile"><![CDATA[Создать пространство]]></string>
+	<string name="_bx_spaces_acl_action_delete_profile"><![CDATA[Удалить пространство]]></string>
+	<string name="_bx_spaces_acl_action_view_profile"><![CDATA[Просмотреть пространство]]></string>
+	<string name="_bx_spaces_acl_action_edit_any_profile"><![CDATA[Редактировать любую пространство]]></string>
+
+	<string name="_bx_spaces_page_title_sys_joined_entries"><![CDATA[Пространства профиля]]></string>
+	<string name="_bx_spaces_page_title_joined_entries"><![CDATA[Пространства профиля]]></string>
+	<string name="_bx_spaces_page_title_sys_create_profile"><![CDATA[Создать пространство]]></string>
+	<string name="_bx_spaces_page_title_create_profile"><![CDATA[Создать пространство]]></string>
+	<string name="_bx_spaces_page_title_sys_edit_profile"><![CDATA[Редактировать пространство]]></string>
+	<string name="_bx_spaces_page_title_edit_profile"><![CDATA[Редактировать пространство]]></string>
+	<string name="_bx_spaces_page_title_sys_edit_profile_cover"><![CDATA[Редактировать обложку пространства]]></string>
+	<string name="_bx_spaces_page_title_edit_profile_cover"><![CDATA[Редактировать обложку]]></string>
+	<string name="_bx_spaces_page_title_sys_delete_profile"><![CDATA[Удалить пространство]]></string>
+	<string name="_bx_spaces_page_title_delete_profile"><![CDATA[Удалить пространство]]></string>
+	<string name="_bx_spaces_page_title_sys_view_profile_closed"><![CDATA[Просмотр закрытой пространства]]></string>
+	<string name="_bx_spaces_page_title_sys_view_profile"><![CDATA[Просмотр пространства]]></string>
+	<string name="_bx_spaces_page_title_view_profile"><![CDATA[{display_name}]]></string>
+	<string name="_bx_spaces_page_title_browse"><![CDATA[Пространства]]></string>
+	<string name="_bx_spaces_page_title_browse_by_author"><![CDATA[Пространства {display_name}]]></string>
+	<string name="_bx_spaces_page_title_browse_featured"><![CDATA[Продвинутые пространства]]></string>
+    <string name="_bx_spaces_page_title_browse_top"><![CDATA[Популярные пространства]]></string>
+	<string name="_bx_spaces_page_title_browse_recent"><![CDATA[Новые пространства]]></string>
+	<string name="_bx_spaces_page_title_browse_connections"><![CDATA[{0} связей]]></string>
+	<string name="_bx_spaces_page_title_browse_connections_mutual"><![CDATA[{0} и {1} обоюдных связей]]></string>
+	<string name="_bx_spaces_page_title_sys_profile_friends"><![CDATA[Друзья]]></string>
+	<string name="_bx_spaces_page_title_profile_friends"><![CDATA[Друзья]]></string>
+	<string name="_bx_spaces_page_title_sys_group_fans"><![CDATA[Участники]]></string>
+	<string name="_bx_spaces_page_title_group_fans"><![CDATA[Участники]]></string>
+	<string name="_bx_spaces_page_title_sys_profile_comments"><![CDATA[Комментарии]]></string>
+    <string name="_bx_spaces_page_title_profile_comments"><![CDATA[Комментарии]]></string>
+	<string name="_bx_spaces_page_title_sys_profile_info"><![CDATA[Инфо пространства]]></string>
+	<string name="_bx_spaces_page_title_profile_info"><![CDATA[Инфо о {display_name}]]></string>
+	<string name="_bx_spaces_page_title_sys_recent"><![CDATA[Новые пространства]]></string>
+	<string name="_bx_spaces_page_title_recent"><![CDATA[Новые пространства]]></string>
+	<string name="_bx_spaces_page_title_sys_manage"><![CDATA[Управление собственными пространствами]]></string>
+	<string name="_bx_spaces_page_title_sys_manage_administration"><![CDATA[Управление всеми пространствами]]></string>
+	<string name="_bx_spaces_page_title_manage"><![CDATA[Управление]]></string>
+	<string name="_bx_spaces_page_title_sys_top"><![CDATA[Популярные пространства]]></string>
+    <string name="_bx_spaces_page_title_top"><![CDATA[Популярные пространства]]></string>
+    <string name="_bx_spaces_page_title_sys_invite_to_group"><![CDATA[Пригласить участников в пространство]]></string>
+    <string name="_bx_spaces_page_title_invite_to_group"><![CDATA[Пригласить участников в пространство]]></string>
+    <string name="_bx_spaces_page_title_sys_entries_search"><![CDATA[Поиск]]></string>
+    <string name="_bx_spaces_page_title_entries_search"><![CDATA[Поиск]]></string>
+
+    <string name="_bx_spaces_page_block_title_sys_entries_actions"><![CDATA[Пространства - Действия]]></string>
+    <string name="_bx_spaces_page_block_title_entries_actions"><![CDATA[Пространства - Действия]]></string>
+    <string name="_bx_spaces_page_block_title_sys_entries_of_author"><![CDATA[Пространства автора]]></string>
+    <string name="_bx_spaces_page_block_title_entries_of_author"><![CDATA[{display_name} - Пространства]]></string>
+	<string name="_bx_spaces_page_block_title_favorites_of_author"><![CDATA[Избранные пространства]]></string>   
+    <string name="_bx_spaces_page_block_title_sys_favorites_of_author"><![CDATA[Избранные пространства]]></string>
+	<string name="_bx_spaces_page_block_title_sys_joined_entries"><![CDATA[Участие в пространствах]]></string>
+	<string name="_bx_spaces_page_block_title_joined_entries"><![CDATA[Участие в пространствах]]></string>
+	<string name="_bx_spaces_page_block_title_parent"><![CDATA[Родительское пространство]]></string>
+  	<string name="_bx_spaces_page_block_title_childs"><![CDATA[Дочерние пространства]]></string>
+	<string name="_bx_spaces_page_block_title_create_profile"><![CDATA[Создать пространство]]></string>
+	<string name="_bx_spaces_page_block_title_edit_profile"><![CDATA[Редактировать пространство]]></string>
+	<string name="_bx_spaces_page_block_title_edit_profile_cover"><![CDATA[Редактировать обложку]]></string>
+	<string name="_bx_spaces_page_block_title_delete_profile"><![CDATA[Удалить пространство]]></string>
+	<string name="_bx_spaces_page_block_title_profile_info_link"><![CDATA[<a href="{profile_link}">{display_name}</a> - Инфо]]></string>
+	<string name="_bx_spaces_page_block_title_profile_info"><![CDATA[Инфо]]></string>
+	<string name="_bx_spaces_page_block_title_system_profile_info"><![CDATA[Инфо]]></string>
+	<string name="_bx_spaces_page_block_title_profile_description"><![CDATA[Описание]]></string>
+	<string name="_bx_spaces_page_block_title_profile_friends_link"><![CDATA[<a href="{profile_link}">{display_name}</a> - Друзья]]></string>
+	<string name="_bx_spaces_page_block_title_profile_friends"><![CDATA[Друзья]]></string>
+	<string name="_bx_spaces_page_block_title_system_profile_friends"><![CDATA[Друзья]]></string>
+	<string name="_bx_spaces_page_block_title_admins"><![CDATA[Администраторы]]></string>
+	<string name="_bx_spaces_page_block_title_fans_link"><![CDATA[Участники пространства: <a href="{profile_link}">{display_name}</a>]]></string>
+	<string name="_bx_spaces_page_block_title_fans"><![CDATA[Участники]]></string>
+	<string name="_bx_spaces_page_block_title_system_fans"><![CDATA[Участники]]></string>
+	<string name="_bx_spaces_page_block_title_profile_comments"><![CDATA[Комментарии]]></string>
+    <string name="_bx_spaces_page_block_title_profile_comments_link"><![CDATA[Комментарии к <a href="{entry_link}">{title}</a>]]></string>
+	<string name="_bx_spaces_page_block_title_profile_actions"><![CDATA[Действия]]></string>
+	<string name="_bx_spaces_page_block_title_featured_profiles"><![CDATA[Продвинутые пространства]]></string>
+	<string name="_bx_spaces_page_block_title_latest_profiles"><![CDATA[Новые пространства]]></string>
+	<string name="_bx_spaces_page_block_title_system_manage"><![CDATA[Управление собственными пространствами]]></string>
+	<string name="_bx_spaces_page_block_title_system_manage_administration"><![CDATA[Управление всеми пространствами]]></string>
+	<string name="_bx_spaces_page_block_title_manage"><![CDATA[Управление]]></string>
+    <string name="_bx_spaces_page_block_title_top_profiles"><![CDATA[Популярные пространства]]></string>
+    <string name="_bx_spaces_page_block_title_entry_social_sharing"><![CDATA[Поделиться]]></string>
+    <string name="_bx_spaces_page_block_title_categories"><![CDATA[Категории пространств]]></string>
+    <string name="_bx_spaces_page_block_title_invite_to_group"><![CDATA[Пригласить участников в пространство]]></string>
+    <string name="_bx_spaces_page_block_title_search_form"><![CDATA[Форма поиска]]></string>
+    <string name="_bx_spaces_page_block_title_search_results"><![CDATA[Результаты поиска]]></string>
+    <string name="_bx_spaces_page_block_title_search_form_cmts"><![CDATA[Форма поиска комментариев]]></string>
+    <string name="_bx_spaces_page_block_title_search_results_cmts"><![CDATA[Результаты поиска комментариев]]></string>
+    <string name="_bx_spaces_page_block_title_sys_featured_entries_view_showcase"><![CDATA[Продвинутые пространства]]></string>
+    <string name="_bx_spaces_page_block_title_featured_entries_view_showcase"><![CDATA[Продвинутые пространства (Витринный просмотр)]]></string>
+    <string name="_bx_spaces_page_block_title_sys_recommended_entries_view_showcase"><![CDATA[Рекомендованные пространства (Витринный просмотр)]]></string>
+    <string name="_bx_spaces_page_block_title_recommended_entries_view_showcase"><![CDATA[Рекомендованные пространства]]></string>
+
+
+  <string name="_bx_spaces_menu_title_submenu"><![CDATA[Пространства - Подменю]]></string>
+    <string name="_bx_spaces_menu_set_title_submenu"><![CDATA[Пространства - Подменю]]></string>
+    <string name="_bx_spaces_menu_set_title_view_profile_actions"><![CDATA[Группа - Действия]]></string>
+    <string name="_bx_spaces_menu_title_view_profile_actions"><![CDATA[Группа - Действия]]></string>
+    <string name="_bx_spaces_menu_set_title_view_profile_actions_more"><![CDATA[Группа - Дополнительные действия]]></string>
+    <string name="_bx_spaces_menu_title_view_profile_actions_more"><![CDATA[Группа - Дополнительные действия]]></string>
+    <string name="_bx_spaces_menu_set_title_view_profile_submenu"><![CDATA[Подменю просмотра пространства]]></string>
+    <string name="_bx_spaces_menu_title_view_profile_submenu"><![CDATA[Подменю просмотра пространства]]></string>
+    <string name="_bx_spaces_menu_title_view_profile_submenu_cover"><![CDATA[Подменю пространства на обложке]]></string>
+    <string name="_bx_spaces_menu_title_entries_my"><![CDATA[Пространства профиля - Меню действий]]></string>
+    <string name="_bx_spaces_menu_set_title_entries_my"><![CDATA[Пространства профиля - Меню]]></string>
+	<string name="_bx_spaces_menu_set_title_manage_tools"><![CDATA[Инструменты управления - Подменю]]></string>
+    <string name="_bx_spaces_menu_title_manage_tools"><![CDATA[Инструменты управления - Подменю]]></string>
+    <string name="_bx_spaces_menu_item_title_system_delete"><![CDATA[Удалить]]></string>
+    <string name="_bx_spaces_menu_item_title_delete"><![CDATA[Удалить]]></string>
+    <string name="_bx_spaces_menu_item_title_system_delete_with_content"><![CDATA[Удалить вместе с содержимым]]></string>
+    <string name="_bx_spaces_menu_item_title_delete_with_content"><![CDATA[Удалить вместе с содержимым]]></string>
+    <string name="_bx_spaces_menu_item_title_system_edit_cover"><![CDATA[Редактировать обложку]]></string>
+    <string name="_bx_spaces_menu_item_title_edit_cover"><![CDATA[Редактировать обложку]]></string>
+    <string name="_bx_spaces_menu_item_title_system_edit_profile"><![CDATA[Редактировать пространство]]></string>
+    <string name="_bx_spaces_menu_item_title_edit_profile"><![CDATA[Редактировать пространство]]></string>
+    <string name="_bx_spaces_menu_item_title_system_delete_profile"><![CDATA[Удалить пространство]]></string>
+    <string name="_bx_spaces_menu_item_title_delete_profile"><![CDATA[Удалить пространство]]></string>
+    <string name="_bx_spaces_menu_item_title_system_delete_account"><![CDATA[Удалить аккаунт]]></string>
+    <string name="_bx_spaces_menu_item_title_delete_account"><![CDATA[Удалить аккаунт]]></string>
+    <string name="_bx_spaces_menu_item_title_system_profile_type"><![CDATA[Группа]]></string>
+    <string name="_bx_spaces_menu_item_title_profile_type"><![CDATA[Группа]]></string>
+    <string name="_bx_spaces_menu_item_title_system_create_profile"><![CDATA[Создать пространство]]></string>
+    <string name="_bx_spaces_menu_item_title_create_profile"><![CDATA[Создать пространство]]></string>
+    <string name="_bx_spaces_menu_item_title_system_view_profile_friends"><![CDATA[Друзья]]></string>
+    <string name="_bx_spaces_menu_item_title_view_profile_friends"><![CDATA[Друзья]]></string>
+    <string name="_bx_spaces_menu_item_title_system_view_joined_groups"><![CDATA[Пространства]]></string>
+    <string name="_bx_spaces_menu_item_title_view_joined_groups"><![CDATA[Пространства]]></string>
+    <string name="_bx_spaces_menu_item_title_system_view_fans"><![CDATA[Участники]]></string>
+    <string name="_bx_spaces_menu_item_title_view_fans"><![CDATA[Участники]]></string>
+    <string name="_bx_spaces_menu_item_title_system_view_profile_comments"><![CDATA[Комментарии]]></string>
+    <string name="_bx_spaces_menu_item_title_view_profile_comments"><![CDATA[Комментарии]]></string>
+    <string name="_bx_spaces_menu_item_title_system_view_profile_info"><![CDATA[Инфо]]></string>
+    <string name="_bx_spaces_menu_item_title_view_profile_info"><![CDATA[Инфо]]></string>
+    <string name="_bx_spaces_menu_item_title_system_view_profile_view"><![CDATA[Группа]]></string>
+    <string name="_bx_spaces_menu_item_title_view_profile_view"><![CDATA[Группа]]></string>
+    <string name="_bx_spaces_menu_item_title_system_invite"><![CDATA[Пригласить]]></string>
+    <string name="_bx_spaces_menu_item_title_invite"><![CDATA[Пригласить]]></string>
+    
+    <string name="_bx_spaces_menu_item_title_system_befriend"><![CDATA[Добавить друга]]></string>
+    <string name="_bx_spaces_menu_item_title_befriend"><![CDATA[Добавить друга]]></string>
+    <string name="_bx_spaces_menu_item_title_befriend_sent"><![CDATA[Добавить друга (запрошено)]]></string>
+    <string name="_bx_spaces_menu_item_title_befriend_confirm"><![CDATA[Принять запрос о дружбе]]></string>
+    <string name="_bx_spaces_menu_item_title_system_unfriend"><![CDATA[Перестать дружить]]></string>
+    <string name="_bx_spaces_menu_item_title_unfriend"><![CDATA[Перестать дружить]]></string>
+    <string name="_bx_spaces_menu_item_title_unfriend_cancel_request"><![CDATA[Отменить запрос о дружбе]]></string>
+    <string name="_bx_spaces_menu_item_title_unfriend_reject_request"><![CDATA[Отвергнуть запрос о дружбе]]></string>
+
+    <string name="_bx_spaces_menu_item_title_system_become_fan"><![CDATA[Присоединиться]]></string>
+    <string name="_bx_spaces_menu_item_title_become_fan"><![CDATA[Присоединиться]]></string>
+    <string name="_bx_spaces_menu_item_title_become_fan_sent"><![CDATA[Присоединение запрошено]]></string>
+    <string name="_bx_spaces_menu_item_title_become_fan_confirm"><![CDATA[Одобрить присоединение]]></string>
+    <string name="_bx_spaces_menu_item_title_system_leave_group"><![CDATA[Покинуть пространство]]></string>
+    <string name="_bx_spaces_menu_item_title_leave_group"><![CDATA[Покинуть пространство]]></string>
+    <string name="_bx_spaces_menu_item_title_leave_group_cancel_request"><![CDATA[Отменить присоединение]]></string>
+    <string name="_bx_spaces_menu_item_title_leave_group_reject_request"><![CDATA[Отвергнуть присоединение]]></string>
+
+    <string name="_bx_spaces_menu_item_title_system_subscribe"><![CDATA[Получать уведомления]]></string>
+    <string name="_bx_spaces_menu_item_title_subscribe"><![CDATA[Получать уведомления]]></string>
+    <string name="_bx_spaces_menu_item_title_system_unsubscribe"><![CDATA[Отключить уведомления]]></string>
+    <string name="_bx_spaces_menu_item_title_unsubscribe"><![CDATA[Отключить уведомления]]></string>
+    <string name="_bx_spaces_menu_item_title_system_more_actions"><![CDATA[Дополнительные действия]]></string>
+    <string name="_bx_spaces_menu_item_title_more_actions"><![CDATA[]]></string>
+    <string name="_bx_spaces_menu_item_title_system_friends"><![CDATA[Друзья]]></string>
+    <string name="_bx_spaces_menu_item_title_friends"><![CDATA[Друзья]]></string>
+    <string name="_bx_spaces_menu_item_title_system_friend_requests"><![CDATA[Число запросов дружбы]]></string>
+    <string name="_bx_spaces_menu_item_title_friend_requests"><![CDATA[{addon} запросов дружбы]]></string>
+    <string name="_bx_spaces_menu_item_title_system_manage_my_groups"><![CDATA[Мои пространства]]></string>
+    <string name="_bx_spaces_menu_item_title_manage_my_groups"><![CDATA[{addon} пространств]]></string>
+    <string name="_bx_spaces_menu_item_title_system_entries_recent"><![CDATA[Новые]]></string>
+    <string name="_bx_spaces_menu_item_title_entries_recent"><![CDATA[Новые]]></string>
+    <string name="_bx_spaces_menu_item_title_system_entries_search"><![CDATA[Поиск]]></string>
+    <string name="_bx_spaces_menu_item_title_entries_search"><![CDATA[Поиск]]></string>
+    <string name="_bx_spaces_menu_item_title_system_entries_manage"><![CDATA[Управление]]></string>
+    <string name="_bx_spaces_menu_item_title_entries_manage"><![CDATA[Управление]]></string>
+    <string name="_bx_spaces_menu_item_title_system_entries_home"><![CDATA[Пространства]]></string>
+    <string name="_bx_spaces_menu_item_title_entries_home"><![CDATA[Пространства]]></string>
+    <string name="_bx_spaces_menu_item_title_system_admt_groups"><![CDATA[Пространства]]></string>
+	<string name="_bx_spaces_menu_item_title_admt_groups"><![CDATA[Пространства - {addon} неодобрено]]></string>
+	<string name="_bx_spaces_menu_item_title_manage_my"><![CDATA[Мои пространства]]></string>
+	<string name="_bx_spaces_menu_item_title_manage_all"><![CDATA[Все пространства]]></string>
+	<string name="_bx_spaces_menu_item_title_system_entries_top"><![CDATA[Популярные]]></string>
+	<string name="_bx_spaces_menu_item_title_entries_top"><![CDATA[Популярные]]></string>
+
+	<string name="_bx_spaces_grid_filter_item_title_adm_select_one_filter1"><![CDATA[Все статусы]]></string>
+	<string name="_bx_spaces_grid_filter_item_title_adm_active"><![CDATA[Активные]]></string>
+	<string name="_bx_spaces_grid_filter_item_title_adm_pending"><![CDATA[В ожидании]]></string>
+	<string name="_bx_spaces_grid_filter_item_title_adm_suspended"><![CDATA[Заблокированные]]></string>
+	<string name="_bx_spaces_grid_column_title_adm_active"><![CDATA[Активные]]></string>
+    <string name="_bx_spaces_grid_column_title_adm_name"><![CDATA[Название]]></string>
+    <string name="_bx_spaces_grid_column_title_adm_added"><![CDATA[Создание]]></string>
+    <string name="_bx_spaces_grid_column_title_adm_account"><![CDATA[Аккаунт]]></string>
+    <string name="_bx_spaces_grid_action_title_adm_delete"><![CDATA[Удалить]]></string>
+    <string name="_bx_spaces_grid_action_title_adm_delete_with_content"><![CDATA[Удалить вместе с содержимым]]></string>
+    <string name="_bx_spaces_grid_action_title_adm_more_actions"><![CDATA[Дополнительные действия]]></string>
+	<string name="_bx_spaces_grid_action_err_delete"><![CDATA[Невозможно удалить выбранную(ные) пространство(ы).]]></string>
+	<string name="_bx_spaces_grid_txt_account_manager"><![CDATA[Перенаправить в управление аккаунтом.]]></string>
+
+    <string name="_bx_spaces_chart_growth"><![CDATA[Пространства: Развитие]]></string>
+    <string name="_bx_spaces_chart_growth_speed"><![CDATA[Пространства: Скорость развития]]></string>
+
+    <string name="_bx_spaces_search_extended"><![CDATA[Поиск пространств]]></string>
+    <string name="_bx_spaces_search_extended_cmts"><![CDATA[Поиск комментариев к пространством]]></string>
+
+	<string name="_bx_spaces_err_delete_child_presend"><![CDATA[Невозможно удалить пространство, т.к. оно используется другими в качестве родительского.]]></string>
+    <string name="_bx_spaces_txt_account_pending"><![CDATA[Эта пространство ожидает одобрения. Пожалуйста, дождитесь ее активации.]]></string>
+    <string name="_bx_spaces_txt_account_suspended"><![CDATA[Эта пространство заблокирована.]]></string>
+    <string name="_bx_spaces_txt_N_fans"><![CDATA[{0} участников]]></string>
+    <string name="_bx_spaces_txt_sample_single"><![CDATA[пространство]]></string>
+    <string name="_bx_spaces_txt_sample_single_with_article"><![CDATA[пространство]]></string>
+    <string name="_bx_spaces_txt_sample_comment_single"><![CDATA[комментарий к пространству]]></string>
+    <string name="_bx_spaces_txt_sample_vote_single"><![CDATA[голос за пространство]]></string>
+    <string name="_bx_spaces_txt_to_admins"><![CDATA[В админы]]></string>
+    <string name="_bx_spaces_txt_from_admins"><![CDATA[Из админов]]></string>
+    <string name="_bx_spaces_txt_private_group"><![CDATA[Приватная пространство]]></string>
+
+	<string name="_bx_spaces_alert_action_fan_added"><![CDATA[присоединение нового участника]]></string>
+    <string name="_bx_spaces_txt_ntfs_fan_added"><![CDATA[В пространство <b class="bx-ntfs-content-profile">{owner_name}</b> вступил <b class="bx-ntfs-content-entry">{subentry_sample}</b>]]></string>
+    <string name="_bx_spaces_alert_action_join_request"><![CDATA[запрос на присоединение к пространству]]></string>
+    <string name="_bx_spaces_txt_ntfs_join_request"><![CDATA[В пространство <b class="bx-ntfs-content-profile">{owner_name}</b> хочет вступить <b class="bx-ntfs-content-entry">{subentry_sample}</b>]]></string>
+    <string name="_bx_spaces_txt_ntfs_timeline_post_common"><![CDATA[В пространству <b class="bx-ntfs-content-profile">{owner_name}</b> новая публикация <b class="bx-ntfs-content-entry">{subentry_sample}</b>]]></string>
+
+    <string name="_bx_spaces_pre_lists_cats"><![CDATA[Категории пространств]]></string>
+    <string name="_bx_spaces_cat_General"><![CDATA[Обобщение]]></string>
+    <string name="_bx_spaces_cat_Business"><![CDATA[Бизнес]]></string>
+    <string name="_bx_spaces_cat_Interests"><![CDATA[Увлечение]]></string>
+    <string name="_bx_spaces_cat_Causes"><![CDATA[Движение]]></string>
+    <string name="_bx_spaces_cat_Fun"><![CDATA[Юмор]]></string>
+    <string name="_bx_spaces_cat_Uncategorised"><![CDATA[Без категории]]></string>
+
+    <string name="_bx_spaces_email_join_request"><![CDATA[Запрос на присоединение к пространству]]></string>
+    <string name="_bx_spaces_email_join_request_subject"><![CDATA[Запрос на присоединение к пространству]]></string>
+    <string name="_bx_spaces_email_join_request_body"><![CDATA[{email_header}
+<p>Получен запрос на присоединение к пространству <a href="{EntryUrl}">{EntryTitle}</a> от <a href="{NewMemberUrl}">{NewMemberDisplayName}</a></p>
+{email_footer}]]></string>
+
+    <string name="_bx_spaces_email_join_reject"><![CDATA[Отклонение запроса на присоединение к пространству]]></string>
+    <string name="_bx_spaces_email_join_reject_subject"><![CDATA[Ваш запрос на присоединение к пространству был отклонен]]></string>
+    <string name="_bx_spaces_email_join_reject_body"><![CDATA[{email_header}
+<p>Ваш запрос на присоединение к пространству <a href="{EntryUrl}">{EntryTitle}</a> был отклонен администратором пространства.</p>
+{email_footer}]]></string>
+
+    <string name="_bx_spaces_email_join_confirm"><![CDATA[Одобрение запроса на присоединение к пространству]]></string>
+    <string name="_bx_spaces_email_join_confirm_subject"><![CDATA[Ваш запрос на присоединение к пространству был одобрен]]></string>
+    <string name="_bx_spaces_email_join_confirm_body"><![CDATA[{email_header}
+<p>Ваш запрос на присоединение к пространству <a href="{EntryUrl}">{EntryTitle}</a> был одобрен.</p>
+{email_footer}]]></string>
+
+    <string name="_bx_spaces_email_fan_remove"><![CDATA[Удаление из пространства]]></string>
+    <string name="_bx_spaces_email_fan_remove_subject"><![CDATA[Вы были удалены из пространства]]></string>
+    <string name="_bx_spaces_email_fan_remove_body"><![CDATA[{email_header}
+<p>Ваш профиль был удален из пространства <a href="{EntryUrl}">{EntryTitle}</a> администратором пространства.</p>
+{email_footer}]]></string>
+
+    <string name="_bx_spaces_email_fan_become_admin"><![CDATA[Получение статуса администратора пространства]]></string>
+    <string name="_bx_spaces_email_fan_become_admin_subject"><![CDATA[Вы стали администратором пространства]]></string>
+    <string name="_bx_spaces_email_fan_become_admin_body"><![CDATA[{email_header}
+<p>Вы получили статус администратора пространства <a href="{EntryUrl}">{EntryTitle}</a>.</p>
+{email_footer}]]></string>
+
+    <string name="_bx_spaces_email_admin_become_fan"><![CDATA[Лишение статуса администратора пространства]]></string>
+    <string name="_bx_spaces_email_admin_become_fan_subject"><![CDATA[Вы были лишены статуса администратора пространства]]></string>
+    <string name="_bx_spaces_email_admin_become_fan_body"><![CDATA[{email_header}
+<p>Вы были лишены статуса администратора пространства <a href="{EntryUrl}">{EntryTitle}</a></p>
+{email_footer}]]></string>
+
+    <string name="_bx_spaces_email_invitation"><![CDATA[Приглашение в пространство]]></string>
+    <string name="_bx_spaces_email_invitation_subject"><![CDATA[Приглашение в пространство "{EntryTitle}"]]></string>
+    <string name="_bx_spaces_email_invitation_body"><![CDATA[{email_header}
+<p><a href="{InviterUrl}">{InviterDisplayName}</a> пригласил Вас в пространство <a href="{EntryUrl}">{EntryTitle}</a>.</p>
+{email_footer}]]></string>
+</resources>

+ 21 - 0
modules/boonex/spaces/classes/BxSpacesAlertsResponse.php

@@ -0,0 +1,21 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defdroup    Spaces Spaces
+ * @indroup     UnaModules
+ *
+ * @{
+ */
+
+class BxSpacesAlertsResponse extends BxBaseModGroupsAlertsResponse
+{
+    public function __construct()
+    {
+        $this->MODULE = 'bx_spaces';
+        parent::__construct();
+    }
+}
+
+/** @} */

+ 206 - 0
modules/boonex/spaces/classes/BxSpacesConfig.php

@@ -0,0 +1,206 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defdroup    Spaces Spaces
+ * @indroup     UnaModules
+ *
+ * @{
+ */
+
+class BxSpacesConfig extends BxBaseModProfileConfig
+{
+    function __construct($aModule)
+    {
+        parent::__construct($aModule);
+
+        $aMenuItems2Methods = array (
+            'view-space-profile' => 'checkAllowedView',
+            'edit-space-profile' => 'checkAllowedEdit',
+            'edit-space-cover' => 'checkAllowedChangeCover',
+            'invite-to-space' => 'checkAllowedInvite',
+            'delete-space-profile' => 'checkAllowedDelete',
+            'profile-fan-add' => 'checkAllowedFanAdd',
+            'profile-fan-remove' => 'checkAllowedFanRemove',
+            'profile-subscribe-add' => 'checkAllowedSubscribeAdd',
+            'profile-subscribe-remove' => 'checkAllowedSubscribeRemove',
+            'profile-actions-more' => 'checkAllowedViewMoreMenu',
+            'convos-compose' => 'checkAllowedCompose',
+        );
+
+        $this->CNF = array (
+
+            // module icon
+            'ICON' => 'hubspot col-red2',
+
+            // database tables
+            'TABLE_ENTRIES' => $aModule['db_prefix'] . 'data',
+            'TABLE_ENTRIES_FULLTEXT' => 'search_fields',
+            'TABLE_ADMINS' => $aModule['db_prefix'] . 'admins',
+
+            // database fields
+            'FIELD_ID' => 'id',
+            'FIELD_AUTHOR' => 'author',
+            'FIELD_ADDED' => 'added',
+            'FIELD_CHANGED' => 'changed',
+            'FIELD_NAME' => 'space_name',
+            'FIELD_PARENT' => 'parent_space',
+            'FIELD_LEVEL' => 'level',
+            'FIELD_TITLE' => 'space_name',
+            'FIELD_TEXT' => 'space_desc',
+            'FIELD_PICTURE' => 'picture',
+            'FIELD_COVER' => 'cover',
+            'FIELD_JOIN_CONFIRMATION' => 'join_confirmation',
+            'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
+            'FIELD_VIEWS' => 'views',
+            'FIELD_COMMENTS' => 'comments',
+            'FIELDS_QUICK_SEARCH' => array('space_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
+
+            // page URIs
+            'URI_VIEW_ENTRY' => 'view-space-profile',
+            'URI_EDIT_ENTRY' => 'edit-space-profile',
+            'URI_EDIT_COVER' => 'edit-space-cover',
+            'URI_JOINED_ENTRIES' => 'joined-spaces',
+            'URI_MANAGE_COMMON' => 'spaces-manage',
+
+            'URL_HOME' => 'page.php?i=spaces-home',
+            'URL_MANAGE_COMMON' => 'page.php?i=spaces-manage',
+            'URL_MANAGE_ADMINISTRATION' => 'page.php?i=spaces-administration',
+
+            'PARAM_NUM_RSS' => 'bx_spaces_num_rss',
+            'PARAM_NUM_CONNECTIONS_QUICK' => 'bx_spaces_num_connections_quick',
+
+            'PARAM_SEARCHABLE_FIELDS' => 'bx_spaces_searchable_fields',
+            'PARAM_PER_PAGE_BROWSE_SHOWCASE' => 'bx_spaces_per_page_browse_showcase',
+            'PARAM_PER_PAGE_BROWSE_RECOMMENDED' => 'bx_spaces_per_page_browse_recommended',
+
+            // objects
+            'OBJECT_STORAGE' => 'bx_spaces_pics',
+            'OBJECT_STORAGE_COVER' => 'bx_spaces_pics',
+            'OBJECT_IMAGES_TRANSCODER_THUMB' => 'bx_spaces_thumb',
+            'OBJECT_IMAGES_TRANSCODER_ICON' => 'bx_spaces_icon',
+            'OBJECT_IMAGES_TRANSCODER_AVATAR' => 'bx_spaces_avatar',
+            'OBJECT_IMAGES_TRANSCODER_PICTURE' => 'bx_spaces_picture',
+            'OBJECT_IMAGES_TRANSCODER_COVER' => 'bx_spaces_cover',
+            'OBJECT_IMAGES_TRANSCODER_COVER_THUMB' => 'bx_spaces_cover_thumb',
+            'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_spaces_gallery',
+            'OBJECT_VIEWS' => 'bx_spaces',
+            'OBJECT_VOTES' => 'bx_spaces',
+            'OBJECT_SCORES' => 'bx_spaces',
+            'OBJECT_FAVORITES' => 'bx_spaces',
+            'OBJECT_FEATURED' => 'bx_spaces',
+            'OBJECT_COMMENTS' => 'bx_spaces',
+            'OBJECT_REPORTS' => 'bx_spaces',
+            'OBJECT_METATAGS' => 'bx_spaces',
+            'OBJECT_FORM_ENTRY' => 'bx_space',
+            'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_space_view',
+            'OBJECT_FORM_ENTRY_DISPLAY_VIEW_FULL' => 'bx_space_view_full', // for "info" tab on view space page
+            'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_space_add',
+            'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_space_edit',
+            'OBJECT_FORM_ENTRY_DISPLAY_EDIT_COVER' => 'bx_space_edit_cover',
+            'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_space_delete',
+            'OBJECT_FORM_ENTRY_DISPLAY_INVITE' => 'bx_space_invite',
+            'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_spaces_view_actions', // actions menu on view entry page
+            'OBJECT_MENU_ACTIONS_VIEW_ENTRY_MORE' => 'bx_spaces_view_actions_more', // actions menu on view entry page for "more" popup
+            'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_spaces_my', // actions menu on profile entries page
+            'OBJECT_MENU_SUBMENU' => 'bx_spaces_submenu', // main module submenu
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_spaces_view_submenu',  // view entry submenu
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY_COVER' => 'bx_spaces_view_submenu_cover',  // view entry submenu displayed in cover
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'spaces-home', // first item in view entry submenu from main module submenu
+            'OBJECT_MENU_SNIPPET_META' => 'bx_spaces_snippet_meta', // menu for snippet meta info
+            'OBJECT_MENU_MANAGE_TOOLS' => 'bx_spaces_menu_manage_tools', //manage menu in content administration tools
+            'OBJECT_PAGE_VIEW_ENTRY' => 'bx_spaces_view_profile',
+            'OBJECT_PAGE_VIEW_ENTRY_CLOSED' => 'bx_spaces_view_profile_closed',
+            'OBJECT_PRIVACY_VIEW' => 'bx_spaces_allow_view_to',
+            'OBJECT_PRIVACY_VIEW_NOTIFICATION_EVENT' => 'bx_spaces_allow_view_notification_to',
+            'OBJECT_GRID_ADMINISTRATION' => 'bx_spaces_administration',
+            'OBJECT_GRID_COMMON' => 'bx_spaces_common',
+            'OBJECT_GRID_CONNECTIONS' => 'bx_spaces_fans',
+            'OBJECT_CONNECTIONS' => 'bx_spaces_fans',
+            'OBJECT_UPLOADERS_COVER' => array('bx_spaces_cover_crop'),
+            'OBJECT_UPLOADERS_PICTURE' => array('bx_spaces_picture_crop'),
+
+            'EMAIL_INVITATION' => 'bx_spaces_invitation',
+            'EMAIL_JOIN_REQUEST' => 'bx_spaces_join_request',
+            'EMAIL_JOIN_CONFIRM' => 'bx_spaces_join_confirm',
+            'EMAIL_FAN_BECOME_ADMIN' => 'bx_spaces_fan_become_admin',
+            'EMAIL_ADMIN_BECOME_FAN' => 'bx_spaces_admin_become_fan',
+            'EMAIL_FAN_REMOVE' => 'bx_spaces_fan_remove',
+            'EMAIL_JOIN_REJECT' => 'bx_spaces_join_reject',
+
+            'TRIGGER_MENU_PROFILE_VIEW_SUBMENU' => 'trigger_space_view_submenu',
+            'TRIGGER_MENU_PROFILE_VIEW_ACTIONS' => 'trigger_space_view_actions',
+            'TRIGGER_PAGE_VIEW_ENTRY' => 'trigger_page_space_view_entry',
+
+            // menu items which visibility depends on custom visibility checking
+            'MENU_ITEM_TO_METHOD' => array (
+                'bx_spaces_view_actions' => $aMenuItems2Methods,
+                'bx_spaces_view_actions_more' => $aMenuItems2Methods,
+            ),
+
+            // informer messages
+            'INFORMERS' => array (
+                'status' => array (
+                    'name' => 'bx-spaces-status-not-active',
+                    'map' => array (
+                        BX_PROFILE_STATUS_PENDING => '_bx_spaces_txt_account_pending',
+                        BX_PROFILE_STATUS_SUSPENDED => '_bx_spaces_txt_account_suspended',
+                    ),
+                ),
+            ),
+
+            // some language keys
+            'T' => array (
+                'txt_sample_single' => '_bx_spaces_txt_sample_single',
+                'txt_sample_single_with_article' => '_bx_spaces_txt_sample_single_with_article',
+                'txt_sample_comment_single' => '_bx_spaces_txt_sample_comment_single',
+                'txt_sample_vote_single' => '_bx_spaces_txt_sample_vote_single',
+                'txt_private_group' => '_bx_spaces_txt_private_space',
+                'txt_N_fans' => '_bx_spaces_txt_N_fans',
+                'txt_ntfs_join_request' => '_bx_spaces_txt_ntfs_join_request',
+                'txt_ntfs_fan_added' => '_bx_spaces_txt_ntfs_fan_added',
+                'txt_ntfs_timeline_post_common' => '_bx_spaces_txt_ntfs_timeline_post_common',
+                'form_field_author' => '_bx_spaces_form_entry_input_author',
+                'menu_item_title_befriend_sent' => '_bx_spaces_menu_item_title_befriend_sent',
+                'menu_item_title_unfriend_cancel_request' => '_bx_spaces_menu_item_title_unfriend_cancel_request',
+                'menu_item_title_befriend_confirm' => '_bx_spaces_menu_item_title_befriend_confirm',
+                'menu_item_title_unfriend_reject_request' => '_bx_spaces_menu_item_title_unfriend_reject_request',
+                'menu_item_title_befriend' => '_bx_spaces_menu_item_title_befriend',
+                'menu_item_title_unfriend' => '_bx_spaces_menu_item_title_unfriend',
+                'grid_action_err_delete' => '_bx_spaces_grid_action_err_delete',
+                'grid_txt_account_manager' => '_bx_spaces_grid_txt_account_manager',
+                'filter_item_active' => '_bx_spaces_grid_filter_item_title_adm_active',
+                'filter_item_pending' => '_bx_spacess_grid_filter_item_title_adm_pending',
+                'filter_item_suspended' => '_bx_spaces_grid_filter_item_title_adm_suspended',
+                'filter_item_select_one_filter1' => '_bx_spaces_grid_filter_item_title_adm_select_one_filter1',
+                'menu_item_manage_my' => '_bx_spaces_menu_item_title_manage_my',
+                'menu_item_manage_all' => '_bx_spaces_menu_item_title_manage_all',
+                'menu_item_title_become_fan_sent' => '_bx_spaces_menu_item_title_become_fan_sent',
+                'menu_item_title_leave_group_cancel_request' => '_bx_spaces_menu_item_title_leave_space_cancel_request',
+                'menu_item_title_become_fan' => '_bx_spaces_menu_item_title_become_fan',
+                'menu_item_title_leave_group' => '_bx_spaces_menu_item_title_leave_space',
+                'txt_all_entries_by_author' => '_bx_spaces_page_title_browse_by_author'
+            ),
+
+        );
+
+        $this->_aJsClasses = array(
+            'manage_tools' => 'BxSpacesManageTools'
+        );
+
+        $this->_aJsObjects = array(
+            'manage_tools' => 'oBxSpacesManageTools'
+        );
+
+        $this->_aGridObjects = array(
+            'common' => $this->CNF['OBJECT_GRID_COMMON'],
+            'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
+            
+        );
+    }
+
+}
+
+/** @} */

+ 75 - 0
modules/boonex/spaces/classes/BxSpacesDb.php

@@ -0,0 +1,75 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defdroup    Spaces Spaces
+ * @indroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Spaces module database queries
+ */
+class BxSpacesDb extends BxBaseModGroupsDb
+{
+    public function __construct(&$oConfig)
+    {
+        parent::__construct($oConfig);
+    }
+    
+    public function searchByTermForParentSpace($iProfileId, $iContentId, $iLevelsLimit, $sTerm, $iLimit)
+    {
+        if (!$this->_oConfig->CNF['FIELDS_QUICK_SEARCH'])
+            return array();
+
+        $aBindings = array(
+            'type' => $this->_oConfig->getName(),
+            'status' => BX_PROFILE_STATUS_ACTIVE,
+            'ProfileId' => $iProfileId,
+            'ContentId' => $iContentId,
+            'LevelsLimit' => $iLevelsLimit
+        );
+
+        $sWhere = '';
+        foreach ($this->_oConfig->CNF['FIELDS_QUICK_SEARCH'] as $sField) {
+            $aBindings[$sField] = '%' . $sTerm . '%';
+
+            $sWhere .= " OR `c`.`$sField` LIKE :" . $sField;
+        }
+
+        $sOrderBy = $this->prepareAsString(" ORDER BY `added` DESC LIMIT ?", (int)$iLimit);
+
+        $sQuery = "SELECT `c`.`id` AS `content_id`, `p`.`account_id`, `p`.`id` AS `profile_id`, `p`.`status` AS `profile_status` FROM `" . $this->_oConfig->CNF['TABLE_ENTRIES'] . "` AS `c` INNER JOIN `sys_profiles` AS `p` ON (`p`.`content_id` = `c`.`id` AND `p`.`type` = :type) WHERE `p`.`status` = :status AND (`c`." . $this->_oConfig->CNF['FIELD_ALLOW_VIEW_TO'] . " = 3 OR `c`." . $this->_oConfig->CNF['FIELD_AUTHOR'] . " = :ProfileId) AND `c`." . $this->_oConfig->CNF['FIELD_ID'] . " <> :ContentId AND `c`." . $this->_oConfig->CNF['FIELD_LEVEL'] . " < :LevelsLimit AND (0 $sWhere)" . $sOrderBy;
+        return $this->getAll($sQuery, $aBindings);
+    }
+    
+    public function getCountEntriesByParent ($iParent)
+    {
+        $aBindings = array(
+            'content_id' => $iParent,
+            'type' => $this->_oConfig->getName()
+        );
+        $sQuery = "SELECT COUNT(*) FROM `" . $this->_oConfig->CNF['TABLE_ENTRIES'] . "` WHERE `" . $this->_oConfig->CNF['FIELD_PARENT'] . "` IN (SELECT `id` FROM `sys_profiles` WHERE `content_id` = :content_id  AND `type` = :type)";
+        return $this->getOne($sQuery, $aBindings);
+    }
+    
+    public function getLevelById ($iId)
+    {
+        $sQuery = $this->prepare ("SELECT `" . $this->_oConfig->CNF['FIELD_LEVEL'] . "` FROM `" . $this->_oConfig->CNF['TABLE_ENTRIES'] . "` WHERE `" . $this->_oConfig->CNF['FIELD_ID'] . "` = ? ", $iId);
+        return $this->getOne($sQuery);
+    }
+    
+    public function getChildEntriesIdByProfileId ($iParent)
+    {
+        $aBindings = array(
+            'content_id' => $iParent,
+            'type' => $this->_oConfig->getName()
+        );
+        $sQuery = "SELECT `id` FROM `sys_profiles` WHERE `content_id` IN (SELECT `" . $this->_oConfig->CNF['FIELD_ID'] . "` FROM `" . $this->_oConfig->CNF['TABLE_ENTRIES'] . "` WHERE `" . $this->_oConfig->CNF['FIELD_PARENT'] . "` IN (SELECT `id` FROM `sys_profiles` WHERE `content_id` = :content_id AND `type` = :type)) AND `type` = :type";
+        return $this->getColumn($sQuery, $aBindings);
+    }
+}
+
+/** @} */

+ 68 - 0
modules/boonex/spaces/classes/BxSpacesFormEntry.php

@@ -0,0 +1,68 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defdroup    Spaces Spaces
+ * @indroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Create/Edit Space Form.
+ */
+class BxSpacesFormEntry extends BxBaseModGroupsFormEntry
+{
+    public function __construct($aInfo, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_spaces';
+        parent::__construct($aInfo, $oTemplate);
+    }
+    
+    protected function genCustomInputParentSpace($aInput)
+    {
+        $iCurrent = bx_get('id');
+        if ($iCurrent === false)
+            $iCurrent = - 1;
+        $aInput['ajax_get_suggestions'] = BX_DOL_URL_ROOT . "modules/?r=" . $this->_oModule->_oConfig->getUri() . "/ajax_get_parent_space&id=" . $iCurrent;
+        $aInput['custom']['only_once'] = 1;
+        if (isset($aInput['value']) && !is_array($aInput['value']))
+            $aInput['value'] = array($aInput['value']);
+        return $this->genCustomInputUsernamesSuggestions($aInput);
+    }
+    
+    public function insert ($aValsToAdd = array(), $isIgnore = false)
+    {
+        $this->defineLevelById($aValsToAdd);
+        return parent::insert ($aValsToAdd, $isIgnore);
+    }
+
+    function update ($iContentId, $aValsToAdd = array(), &$aTrackTextFieldsChanges = null)
+    {
+        $this->defineLevelById($aValsToAdd);
+        return parent::update ($iContentId, $aValsToAdd, $aTrackTextFieldsChanges);
+    }
+    
+    function defineLevelById(&$aValsToAdd)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+        $mixedParentId = "";
+        $iLevel = 0;
+        if (isset($this->aInputs[$CNF['FIELD_PARENT']])){
+            if (is_array($this->aInputs[$CNF['FIELD_PARENT']]['value'])){
+                $mixedParentId = $this->aInputs[$CNF['FIELD_PARENT']]['value'][0];
+            }
+            else{
+                $mixedParentId = $this->aInputs[$CNF['FIELD_PARENT']]['value'];
+            }
+        }
+        if ($mixedParentId != "")
+            $iLevel = $this->_oModule->_oDb->getLevelById($mixedParentId) + 1;
+        if (isset($CNF['FIELD_LEVEL']) && empty($aValsToAdd[$CNF['FIELD_LEVEL']]))
+            $aValsToAdd[$CNF['FIELD_LEVEL']] = $iLevel;
+        $aValsToAdd[$CNF['FIELD_PARENT']] = $mixedParentId;
+    }
+}
+
+/** @} */

+ 23 - 0
modules/boonex/spaces/classes/BxSpacesFormsEntryHelper.php

@@ -0,0 +1,23 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defdroup    Spaces Spaces
+ * @indroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Spaces profile forms functions
+ */
+class BxSpacesFormsEntryHelper extends BxBaseModGroupsFormsEntryHelper
+{
+    public function __construct($oModule)
+    {
+        parent::__construct($oModule);
+    }
+}
+
+/** @} */

+ 36 - 0
modules/boonex/spaces/classes/BxSpacesGridAdministration.php

@@ -0,0 +1,36 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defdroup    Spaces Spaces
+ * @indroup     UnaModules
+ * 
+ * @{
+ */
+
+class BxSpacesGridAdministration extends BxBaseModGroupsGridAdministration
+{
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+      
+        $this->MODULE = 'bx_spaces';
+        parent::__construct ($aOptions, $oTemplate);
+    }
+    
+    protected function _getActionSettings($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
+    {
+        if ($this->_oModule->_oDb->getCountEntriesByParent($aRow["id"]))
+            return '';
+        return parent::_getActionSettings($sType, $sKey, $a, $isSmall, $isDisabled, $aRow);
+    }
+    
+    protected function _isCheckboxDisabled($aRow)
+    {
+        if ($this->_oModule->_oDb->getCountEntriesByParent($aRow["id"]))
+            return true;
+        return parent::_isCheckboxDisabled($aRow);
+    }
+}
+
+/** @} */

+ 36 - 0
modules/boonex/spaces/classes/BxSpacesGridCommon.php

@@ -0,0 +1,36 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defdroup    Spaces Spaces
+ * @indroup     UnaModules
+ * 
+ * @{
+ */
+
+class BxSpacesGridCommon extends BxBaseModGroupsGridCommon
+{
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_spaces';
+        parent::__construct ($aOptions, $oTemplate);
+    }
+    
+    protected function _getActionSettings($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
+    {
+        if ($this->_oModule->_oDb->getCountEntriesByParent($aRow["id"]))
+            return '';
+        return parent::_getActionSettings($sType, $sKey, $a, $isSmall, $isDisabled, $aRow);
+    }
+       
+    protected function _isCheckboxDisabled($aRow)
+    {
+        if ($this->_oModule->_oDb->getCountEntriesByParent($aRow["id"]))
+            return true;
+        return parent::_isCheckboxDisabled($aRow);
+    }
+
+}
+
+/** @} */

+ 21 - 0
modules/boonex/spaces/classes/BxSpacesGridConnections.php

@@ -0,0 +1,21 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defdroup    Spaces Spaces
+ * @indroup     UnaModules
+ * 
+ * @{
+ */
+
+class BxSpacesGridConnections extends BxBaseModGroupsGridConnections
+{
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+        $this->_sContentModule = 'bx_spaces';
+        parent::__construct ($aOptions, $oTemplate);
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/spaces/classes/BxSpacesMenu.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defdroup    Spaces Spaces
+ * @indroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * General class for module menu.
+ */
+class BxSpacesMenu extends BxBaseModGeneralMenuView
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_spaces';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 25 - 0
modules/boonex/spaces/classes/BxSpacesMenuManageTools.php

@@ -0,0 +1,25 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defdroup    Spaces Spaces
+ * @indroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * 'Spaces manage tools' menu.
+ */
+class BxSpacesMenuManageTools extends BxBaseModGroupsMenuManageTools
+{
+
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_spaces';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 25 - 0
modules/boonex/spaces/classes/BxSpacesMenuSnippetMeta.php

@@ -0,0 +1,25 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defdroup    Spaces Spaces
+ * @indroup     UnaModules
+ *
+ * @{
+ */
+
+class BxSpacesMenuSnippetMeta extends BxBaseModGroupsMenuSnippetMeta
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->_sModule = 'bx_spaces';
+
+        parent::__construct($aObject, $oTemplate);
+
+        unset($this->_aConnectionToFunctionCheck['sys_profiles_friends']);
+        unset($this->_aConnectionToFunctionTitle['sys_profiles_friends']);
+    }
+}
+
+/** @} */

+ 25 - 0
modules/boonex/spaces/classes/BxSpacesMenuView.php

@@ -0,0 +1,25 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defdroup    Spaces Spaces
+ * @indroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * 'View space' menu.
+ */
+class BxSpacesMenuView extends BxBaseModGroupsMenuView
+{
+
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_spaces';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 86 - 0
modules/boonex/spaces/classes/BxSpacesModule.php

@@ -0,0 +1,86 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defdroup    Spaces Spaces
+ * @indroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Spaces profiles module.
+ */
+define('BX_SPS_LEVELS_LIMIT', 1);
+
+class BxSpacesModule extends BxBaseModGroupsModule
+{
+    function __construct(&$aModule)
+    {
+        parent::__construct($aModule);
+       
+        $this->_aSearchableNamesExcept[] = $this->_oConfig->CNF['FIELD_JOIN_CONFIRMATION'];
+    }
+    
+    public function serviceEntityDelete ($iContentId = 0)
+    {
+        $iContentId = $this->_getContent($iContentId, false);
+        if($iContentId === false)
+            return false;
+        $iCount = $this->_oDb->getCountEntriesByParent($iContentId);
+        if ($iCount > 0)
+            return MsgBox(_t('_bx_spaces_err_delete_child_presend'));
+        return $this->_serviceEntityForm ('deleteDataForm', $iContentId);
+    }
+    
+    public function serviceEntityParent ($iContentId = 0)
+    {
+        return $this->_serviceTemplateFunc ('entryParent', $iContentId);
+    }
+    
+    public function serviceEntityChilds ($iContentId = 0)
+    {
+        return $this->_serviceTemplateFunc ('entryChilds', $iContentId);
+    }
+    
+    /**
+     * Get possible recipients for start conversation form
+     */
+    public function actionAjaxGetParentSpace ()
+    {
+        $sTerm = bx_get('term');
+        $iContentId = bx_get('id');
+        $a = $this->getListSpacesForParent($sTerm, $iContentId, 10);
+        header('Content-Type:text/javascript; charset=utf-8');
+        echo(json_encode($a));
+    }
+     
+    public function checkAllowedSubscribeAdd (&$aDataEntry, $isPerformAction = false)
+    {
+        return parent::_checkAllowedSubscribeAdd ($aDataEntry, $isPerformAction);
+    }
+    
+    public function getListSpacesForParent ($sTerm, $iContentId, $iLimit)
+    {
+        if (!isLogged())
+            return false;
+        
+        $aRv = array();
+        $aTmp = $this->_oDb->searchByTermForParentSpace(bx_get_logged_profile_id(), $iContentId, BX_SPS_LEVELS_LIMIT, $sTerm, $iLimit);
+        foreach ($aTmp as $aSpace) {
+            $oProfile = BxDolProfile::getInstance($aSpace['profile_id']);
+
+            $aRv[] = array (
+                'label' => $this->serviceProfileName($aSpace['content_id']),
+                'value' => $aSpace['profile_id'],
+                'url' => $oProfile->getUrl(),
+                'thumb' => $oProfile->getThumb(),
+                'unit' => $oProfile->getUnit(0, array('template' => 'unit_wo_info'))
+            );
+        }
+        return $aRv;
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/spaces/classes/BxSpacesPageBrowse.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defdroup    Spaces Spaces
+ * @indroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Browse entries pages.
+ */
+class BxSpacesPageBrowse extends BxBaseModGroupsPageBrowse
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_spaces';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/spaces/classes/BxSpacesPageEntry.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defdroup    Spaces Spaces
+ * @indroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Profile create/edit/delete pages.
+ */
+class BxSpacesPageEntry extends BxBaseModGroupsPageEntry
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_spaces';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/spaces/classes/BxSpacesPageJoinedEntries.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defdroup    Spaces Spaces
+ * @indroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Entries user joined to.
+ */
+class BxSpacesPageJoinedEntries extends BxBaseModGroupsPageJoinedEntries
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        parent::__construct($aObject, $oTemplate);
+    }
+
+}
+
+/** @} */

+ 22 - 0
modules/boonex/spaces/classes/BxSpacesPrivacy.php

@@ -0,0 +1,22 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defdroup    Spaces Spaces
+ * @indroup     UnaModules
+ *
+ * @{
+ */
+
+class BxSpacesPrivacy extends BxBaseModGroupsPrivacy
+{
+    public function __construct($aOptions, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_spaces';
+
+        parent::__construct($aOptions, $oTemplate);
+    }
+}
+
+/** @} */

+ 21 - 0
modules/boonex/spaces/classes/BxSpacesPrivacyNotifications.php

@@ -0,0 +1,21 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defdroup    Spaces Spaces
+ * @indroup     UnaModules
+ *
+ * @{
+ */
+
+class BxSpacesPrivacyNotifications extends BxBaseModGroupsPrivacyNotifications
+{
+    function __construct($aOptions, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_spaces';
+        parent::__construct($aOptions, $oTemplate);
+    }
+}
+
+/** @} */

+ 209 - 0
modules/boonex/spaces/classes/BxSpacesSearchResult.php

@@ -0,0 +1,209 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defdroup    Spaces Spaces
+ * @indroup     UnaModules
+ *
+ * @{
+ */
+
+class BxSpacesSearchResult extends BxBaseModGroupsSearchResult
+{
+    function __construct($sMode = '', $aParams = false)
+    {
+        parent::__construct($sMode, $aParams);
+
+        $this->aCurrent = array(
+            'name' => 'bx_spaces',
+            'module_name' => 'bx_spaces',
+            'object_metatags' => 'bx_spaces',
+            'title' => _t('_bx_spaces_page_title_browse'),
+            'table' => 'sys_profiles',
+            'tableSearch' => 'bx_spaces_data',
+            'ownFields' => array(),
+            'searchFields' => array(),
+            'restriction' => array(
+                'account_id' => array('value' => '', 'field' => 'account_id', 'operator' => '='),
+                'perofileStatus' => array('value' => 'active', 'field' => 'status', 'operator' => '='),
+                'perofileType' => array('value' => 'bx_spaces', 'field' => 'type', 'operator' => '='),
+                'owner' => array('value' => '', 'field' => 'author', 'operator' => '=', 'table' => 'bx_spaces_data'),
+                'featured' => array('value' => '', 'field' => 'featured', 'operator' => '<>', 'table' => 'bx_spaces_data'),
+            ),
+            'join' => array (
+                'profile' => array(
+                    'type' => 'INNER',
+                    'table' => 'bx_spaces_data',
+                    'mainField' => 'content_id',
+                    'onField' => 'id',
+                    'joinFields' => array('id', 'space_name', 'picture', 'cover', 'added', 'author', 'allow_view_to'),
+                ),
+                'account' => array(
+                    'type' => 'INNER',
+                    'table' => 'sys_accounts',
+                    'mainField' => 'account_id',
+                    'onField' => 'id',
+                    'joinFields' => array(),
+                ),
+            ),
+            'paginate' => array('perPage' => getParam('bx_spaces_per_page_browse'), 'start' => 0),
+            'sorting' => 'none',
+            'rss' => array(
+                'title' => '',
+                'link' => '',
+                'image' => '',
+                'profile' => 0,
+                'fields' => array (
+                    'Guid' => 'link',
+                    'Link' => 'link',
+                    'Title' => 'space_name',
+                    'DateTimeUTS' => 'added',
+                    'Desc' => 'space_name',
+                    'Image' => 'picture',
+                ),
+            ),
+            'ident' => 'id'
+        );
+
+        $this->sFilterName = 'bx_spaces_data_filter';
+        $this->oModule = $this->getMain();
+
+        $CNF = &$this->oModule->_oConfig->CNF;
+
+        $sSearchFields = getParam($CNF['PARAM_SEARCHABLE_FIELDS']);
+        $this->aCurrent['searchFields'] = !empty($sSearchFields) ? explode(',', $sSearchFields) : '';
+
+        $oJoinedProfile = null;
+        $bProcessConditionsForPrivateContent = true;
+        switch ($sMode) {
+            case 'created_entries':
+                if(!$this->_setAuthorConditions($sMode, $aParams, $oJoinedProfile)) {
+                    $this->isError = true;
+                    break;
+                }
+                break;
+
+            case 'joined_entries':
+                $oJoinedProfile = BxDolProfile::getInstance((int)$aParams['joined_profile']);
+                if (!$oJoinedProfile) {
+                    $this->isError = true;
+                    break;
+                }
+
+                $bProcessConditionsForPrivateContent = false;
+
+                $this->aCurrent['join']['fans'] = array(
+                    'type' => 'INNER',
+                    'table' => 'bx_spaces_fans',
+                    'mainField' => 'id',
+                    'onField' => 'content',
+                    'joinFields' => array('initiator'),
+                );
+
+                $this->aCurrent['restriction']['fans'] = array('value' => $oJoinedProfile->id(), 'field' => 'initiator', 'operator' => '=', 'table' => 'bx_spaces_fans');
+
+                $this->sBrowseUrl = 'page.php?i=' . $CNF['URI_JOINED_ENTRIES'] . '&profile_id={profile_id}';
+                $this->aCurrent['title'] = _t('_bx_spaces_page_title_joined_entries');
+                $this->aCurrent['rss']['link'] = 'modules/?r=spaces/rss/' . $sMode . '/' . $oJoinedProfile->id();
+                break;
+
+            case 'connections':
+                if ($this->_setConnectionsConditions($aParams)) {
+                    $bProcessConditionsForPrivateContent = false;
+                    $oProfile = BxDolProfile::getInstance($aParams['profile']);
+                    $oProfile2 = isset($aParams['profile2']) ? BxDolProfile::getInstance($aParams['profile2']) : null;
+
+                    if (isset($aParams['type']) && $aParams['type'] == 'common' && $oProfile && $oProfile2)
+                        $this->aCurrent['title'] = _t('_bx_spaces_page_title_browse_connections_mutual', $oProfile->getDisplayName(), $oProfile2->getDisplayName());
+                    elseif ((!isset($aParams['type']) || $aParams['type'] != 'common') && $oProfile)
+                        $this->aCurrent['title'] = _t('_bx_spaces_page_title_browse_connections', $oProfile->getDisplayName());
+
+                    $this->aCurrent['rss']['link'] = 'modules/?r=spaces/rss/' . $sMode . '/' . $aParams['object'] . '/' . $aParams['type'] . '/' . (int)$aParams['profile'] . '/' . (int)$aParams['profile2'] . '/' . (int)$aParams['mutual'];
+                }
+                break;
+
+            case 'favorite':
+                if(!$this->_setFavoriteConditions($sMode, $aParams, $oJoinedProfile)) {
+                    $this->isError = true;
+                    break;
+                }
+                break;
+
+            case 'recent':
+                $this->aCurrent['rss']['link'] = 'modules/?r=spaces/rss/' . $sMode;
+                $this->aCurrent['title'] = _t('_bx_spaces_page_title_browse_recent');
+                $this->aCurrent['sorting'] = 'last';
+                $this->sBrowseUrl = 'page.php?i=spaces-home';
+                break;
+
+            case 'featured':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME']);
+                $this->aCurrent['title'] = _t('_bx_spaces_page_title_browse_featured');
+                $this->aCurrent['restriction']['featured']['value'] = '0';
+                $this->aCurrent['rss']['link'] = 'modules/?r=spaces/rss/' . $sMode;
+                $this->aCurrent['sorting'] = 'featured';
+                break;
+
+            case 'recommended':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME']);
+                $this->aCurrent['title'] = _t('_bx_spaces_page_title_browse_recommended');
+                $this->aCurrent['restriction']['featured']['value'] = '0';
+                $this->aCurrent['rss']['link'] = 'modules/?r=spaces/rss/' . $sMode;
+                $this->aCurrent['sorting'] = 'recommended';
+                $this->_setConditionsForRecommended();
+                break;
+                
+            case 'top':
+                $this->aCurrent['rss']['link'] = 'modules/?r=spaces/rss/' . $sMode;
+                $this->aCurrent['title'] = _t('_bx_spaces_page_title_browse_top');
+                $this->aCurrent['sorting'] = 'top';
+                $this->sBrowseUrl = 'page.php?i=spaces-top';
+                break;
+
+            case '': // search results
+                $this->sBrowseUrl = BX_DOL_SEARCH_KEYWORD_PAGE;
+                $this->aCurrent['title'] = _t('_bx_spaces');
+                unset($this->aCurrent['paginate']['perPage'], $this->aCurrent['rss']);
+                break;
+
+            default:
+                $this->isError = true;
+        }
+
+        if ($bProcessConditionsForPrivateContent)
+            $this->addConditionsForPrivateContent($CNF, $oJoinedProfile);
+
+        $this->sCenterContentUnitSelector = false;
+    }
+
+    function getAlterOrder()
+    {
+        switch ($this->aCurrent['sorting']) {
+        case 'featured':
+            return array('order' => ' ORDER BY `bx_spaces_data`.`featured` DESC ');
+        case 'recommended':
+            return array('order' => ' ORDER BY RAND() ');
+        case 'none':
+            return array('order' => ' ORDER BY `sys_accounts`.`logged` DESC ');
+        case 'top':
+            return array('order' => ' ORDER BY `bx_spaces_data`.`views` DESC ');
+        case 'last':
+        default:
+            return array('order' => ' ORDER BY `bx_spaces_data`.`added` DESC ');
+        }
+    }
+
+    function _getPseud ()
+    {
+        return array(
+            'id' => 'id',
+            'space_name' => 'space_name',
+            'added' => 'added',
+            'author' => 'author',
+            'picture' => 'picture',
+        );
+    }
+}
+
+/** @} */

+ 55 - 0
modules/boonex/spaces/classes/BxSpacesTemplate.php

@@ -0,0 +1,55 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defdroup    Spaces Spaces
+ * @indroup     UnaModules
+ *
+ * @{
+ */
+
+/*
+ * Spaces module representation.
+ */
+class BxSpacesTemplate extends BxBaseModGroupsTemplate
+{
+    function __construct(&$oConfig, &$oDb)
+    {
+        $this->MODULE = 'bx_spaces';
+        parent::__construct($oConfig, $oDb);
+    }
+    
+    public function entryChilds($aData)
+    {
+        $CNF = $this->_oConfig->CNF;
+        $aChild = $this->_oModule->_oDb->getChildEntriesIdByProfileId($aData[$CNF['FIELD_ID']]);
+        
+        if (count($aChild) == 0)
+            return false;
+
+        return $this->parseHtmlByName('entry-childs.html', array('content' => $this->getBrowseQuick($aChild)));
+    }
+    
+    public function entryParent($aData)
+    {
+        $CNF = $this->_oConfig->CNF;
+        if ($aData[$CNF['FIELD_PARENT']] == 0)
+            return false;
+        return $this->parseHtmlByName('entry-parent.html', array('content' => $this->getBrowseQuick(array($aData[$CNF['FIELD_PARENT']]))));
+    }
+    
+    private function getBrowseQuick($aProfiles)
+    {
+        $sRv = '';
+        foreach ($aProfiles as $iProfileId) {
+            $oProfile = BxDolProfile::getInstance($iProfileId);
+            if(!$oProfile)
+                continue;
+            $sRv .= $oProfile->getUnit(false, array('template' => 'unit_live_search'));
+        }
+        return $sRv;
+    }
+}
+
+/** @} */

+ 21 - 0
modules/boonex/spaces/classes/BxSpacesUploaderCoverCrop.php

@@ -0,0 +1,21 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defdroup    Spaces Spaces
+ * @indroup     UnaModules
+ *
+ * @{
+ */
+
+class BxSpacesUploaderCoverCrop extends BxBaseModGroupsUploaderCoverCrop
+{
+    public function __construct ($aObject, $sStorageObject, $sUniqId, $oTemplate)
+    {
+        $this->_oModule = BxDolModule::getInstance('bx_spaces');
+        parent::__construct($aObject, $sStorageObject, $sUniqId, $oTemplate);
+    }
+}
+
+/** @} */

+ 21 - 0
modules/boonex/spaces/classes/BxSpacesUploaderPictureCrop.php

@@ -0,0 +1,21 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defdroup    Spaces Spaces
+ * @indroup     UnaModules
+ *
+ * @{
+ */
+
+class BxSpacesUploaderPictureCrop extends BxBaseModGroupsUploaderPictureCrop
+{
+    public function __construct ($aObject, $sStorageObject, $sUniqId, $oTemplate)
+    {
+        $this->_oModule = BxDolModule::getInstance('bx_spaces');
+        parent::__construct($aObject, $sStorageObject, $sUniqId, $oTemplate);
+    }
+}
+
+/** @} */

+ 150 - 0
modules/boonex/spaces/install/config.php

@@ -0,0 +1,150 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defdroup    Spaces Spaces
+ * @indroup     UnaModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_spaces',
+    'title' => 'Spaces',
+    'note' => 'Spaces functionality.',
+    'version' => '9.0.1.DEV',
+    'vendor' => 'BoonEx',
+    'help_url' => 'http://feed.una.io/?section={module_name}',
+
+    'compatible_with' => array(
+        '9.0.x'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/spaces/',
+    'home_uri' => 'spaces',
+
+    'db_prefix' => 'bx_spaces_',
+    'class_prefix' => 'BxSpaces',
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => 'Spaces',
+
+    /**
+     * Connections.
+     */
+    'connections' => array(
+        'sys_profiles_friends' => array ('type' => 'profiles'),
+        'sys_profiles_subscriptions' => array ('type' => 'profiles'),
+    ),
+
+    /**
+     * Menu triggers.
+     */
+    'menu_triggers' => array(
+        'trigger_profile_view_submenu',
+        'trigger_space_view_submenu',
+        'trigger_space_view_actions',
+    ),
+
+    /**
+     * Page triggers.
+     */
+    'page_triggers' => array (
+        'trigger_page_space_view_entry',
+    ),
+
+    /**
+     * Storage objects to automatically delete files from upon module uninstallation.
+     * Note. Don't add storage objects used in transcoder objects.
+     */
+    'storages' => array(
+        'bx_spaces_pics'
+    ),
+
+    /**
+     * Transcoders.
+     */
+    'transcoders' => array(
+        'bx_spaces_icon',
+        'bx_spaces_thumb',
+        'bx_spaces_avatar',
+        'bx_spaces_picture',
+        'bx_spaces_cover',
+        'bx_spaces_cover_thumb',
+        'bx_spaces_gallery'
+    ),
+
+    /**
+     * Extended Search Forms.
+     */
+    'esearches' => array(
+        'bx_spaces',
+        'bx_spaces_cmts',
+    ),
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+        'execute_sql' => 1,
+        'update_languages' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'uninstall' => array (
+        'process_esearches' => 1,
+        'execute_sql' => 1,
+        'update_languages' => 1,
+        'process_connections' => 1,
+        'process_deleted_profiles' => 1,
+        'update_relations' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'enable' => array(
+        'execute_sql' => 1,
+        'update_relations' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'enable_success' => array(
+        'process_menu_triggers' => 1,
+        'process_page_triggers' => 1,
+        'process_esearches' => 1,
+        'register_transcoders' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'disable' => array (
+        'execute_sql' => 1,
+        'unregister_transcoders' => 1,
+        'update_relations' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'disable_failed' => array (
+        'register_transcoders' => 1,
+        'clear_db_cache' => 1,
+    ),
+
+    /**
+     * Dependencies Section
+     */
+    'dependencies' => array(),
+
+    /**
+     * Connections Section
+     */
+    'relations' => array(
+        'bx_timeline',
+        'bx_notifications',
+    ),
+);
+
+/** @} */

+ 20 - 0
modules/boonex/spaces/install/installer.php

@@ -0,0 +1,20 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defdroup    Spaces Spaces
+ * @indroup     UnaModules
+ *
+ * @{
+ */
+
+class BxSpacesInstaller extends BxBaseModProfileInstaller
+{
+    function __construct($aConfig)
+    {
+        parent::__construct($aConfig);
+    }
+}
+
+/** @} */

+ 315 - 0
modules/boonex/spaces/install/langs/en.xml

@@ -0,0 +1,315 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+	<string name="_bx_spaces"><![CDATA[Spaces]]></string>
+	<string name="_bx_spaces_cmts"><![CDATA[Spaces' Comments]]></string>
+	
+	<string name="_bx_spaces_option_num_connections_quick"><![CDATA[Number of items in friends block]]></string>
+	<string name="_bx_spaces_option_per_page_browse"><![CDATA[Number of items per page]]></string>
+	<string name="_bx_spaces_option_num_rss"><![CDATA[Number of items in RSS feed]]></string>
+	<string name="_bx_spaces_option_searchable_fields"><![CDATA[Searchable fields]]></string>
+	
+	<string name="_bx_spaces_form_profile"><![CDATA[Spaces]]></string>
+	<string name="_bx_spaces_form_profile_display_add"><![CDATA[Add Space]]></string>
+	<string name="_bx_spaces_form_profile_display_edit"><![CDATA[Edit Space]]></string>
+	<string name="_bx_spaces_form_profile_display_edit_cover"><![CDATA[Edit Cover]]></string>
+	<string name="_bx_spaces_form_profile_display_delete"><![CDATA[Delete Space]]></string>
+	<string name="_bx_spaces_form_profile_display_view"><![CDATA[View Space]]></string>
+	<string name="_bx_spaces_form_profile_display_view_full"><![CDATA[Full View Space]]></string>
+	<string name="_bx_spaces_form_profile_display_invite"><![CDATA[Invite to Space]]></string>
+	<string name="_bx_spaces_form_entry_input_author"><![CDATA[Author]]></string>
+	<string name="_bx_spaces_form_profile_input_sys_do_submit"><![CDATA[Submit]]></string>
+	<string name="_bx_spaces_form_profile_input_sys_join_confirm"><![CDATA[Join confirmation]]></string>
+	<string name="_bx_spaces_form_profile_input_join_confirm"><![CDATA[Join confirmation]]></string>
+	<string name="_bx_spaces_form_profile_input_sys_allow_view_to"><![CDATA[Privacy]]></string>
+	<string name="_bx_spaces_form_profile_input_allow_view_to"><![CDATA[Privacy]]></string>
+	<string name="_bx_spaces_form_profile_input_allow_view_to_desc"><![CDATA[Closed - anyone can find the space and see who's in it, only members can see posts. Secret - only members can find the space and see posts.]]></string>
+	<string name="_bx_spaces_form_profile_input_sys_initial_members"><![CDATA[Invite Members]]></string>
+	<string name="_bx_spaces_form_profile_input_initial_members"><![CDATA[Invite Members]]></string>
+  <string name="_bx_spaces_form_profile_input_sys_parent_space"><![CDATA[Parent Space]]></string>
+  <string name="_bx_spaces_form_profile_input_parent_space"><![CDATA[Parent Space]]></string>
+  <string name="_bx_spaces_form_profile_input_sys_space_name"><![CDATA[Space Name]]></string>
+	<string name="_bx_spaces_form_profile_input_space_name"><![CDATA[Space Name]]></string>
+	<string name="_bx_spaces_form_profile_input_space_name_err"><![CDATA[This information is essential. Please, fill in this field.]]></string>
+	<string name="_bx_spaces_form_profile_input_sys_space_desc"><![CDATA[Description]]></string>
+	<string name="_bx_spaces_form_profile_input_space_desc"><![CDATA[Description]]></string>
+	<string name="_bx_spaces_form_profile_input_sys_space_cat"><![CDATA[Category]]></string>
+	<string name="_bx_spaces_form_profile_input_space_cat"><![CDATA[Category]]></string>
+	<string name="_bx_spaces_form_profile_input_space_cat_err"><![CDATA[Category field is mandatory]]></string>
+	<string name="_bx_spaces_form_profile_input_sys_picture"><![CDATA[Space Picture]]></string>
+	<string name="_bx_spaces_form_profile_input_picture"><![CDATA[Upload New Space Picture]]></string>
+	<string name="_bx_spaces_form_profile_input_picture_err"><![CDATA[Space picture is mandatory.]]></string>
+	<string name="_bx_spaces_form_profile_input_sys_cover"><![CDATA[Cover Picture]]></string>
+	<string name="_bx_spaces_form_profile_input_cover"><![CDATA[Upload New Cover Picture]]></string>
+	<string name="_bx_spaces_form_profile_input_sys_delete_confirm"><![CDATA[Delete confirmation]]></string>
+	<string name="_bx_spaces_form_profile_input_delete_confirm"><![CDATA[I am sure I want to delete this space]]></string>
+	<string name="_bx_spaces_form_profile_input_delete_confirm_info"><![CDATA[This action can not be undone.]]></string>
+	<string name="_bx_spaces_form_profile_input_delete_confirm_error"><![CDATA[Please check this checkbox if you really want to delete space.]]></string>
+	
+	<string name="_bx_spaces_acl_action_create_profile"><![CDATA[Create Space]]></string>
+	<string name="_bx_spaces_acl_action_delete_profile"><![CDATA[Delete Space]]></string>
+	<string name="_bx_spaces_acl_action_view_profile"><![CDATA[View Space]]></string>
+	<string name="_bx_spaces_acl_action_edit_any_profile"><![CDATA[Edit Any Space]]></string>
+	
+	<string name="_bx_spaces_page_title_sys_joined_entries"><![CDATA[Profile Spaces]]></string>
+	<string name="_bx_spaces_page_title_joined_entries"><![CDATA[Profile Spaces]]></string>
+	<string name="_bx_spaces_page_title_sys_create_profile"><![CDATA[Create Space]]></string>
+	<string name="_bx_spaces_page_title_create_profile"><![CDATA[Create Space]]></string>
+	<string name="_bx_spaces_page_title_sys_edit_profile"><![CDATA[Edit Space]]></string>
+	<string name="_bx_spaces_page_title_edit_profile"><![CDATA[Edit Space]]></string>
+	<string name="_bx_spaces_page_title_sys_edit_profile_cover"><![CDATA[Edit Space Cover]]></string>
+	<string name="_bx_spaces_page_title_edit_profile_cover"><![CDATA[Edit Cover]]></string>
+	<string name="_bx_spaces_page_title_sys_delete_profile"><![CDATA[Delete Space]]></string>
+	<string name="_bx_spaces_page_title_delete_profile"><![CDATA[Delete Space]]></string>
+	<string name="_bx_spaces_page_title_sys_view_profile_closed"><![CDATA[View Closed Space]]></string>
+	<string name="_bx_spaces_page_title_sys_view_profile"><![CDATA[View Space]]></string>
+	<string name="_bx_spaces_page_title_view_profile"><![CDATA[{display_name}]]></string>
+	<string name="_bx_spaces_page_title_browse"><![CDATA[Spaces]]></string>
+	<string name="_bx_spaces_page_title_browse_by_author"><![CDATA[Spaces of {display_name}]]></string>
+	<string name="_bx_spaces_page_title_browse_featured"><![CDATA[Featured Spaces]]></string>
+	<string name="_bx_spaces_page_title_browse_top"><![CDATA[Top Spaces]]></string>
+	<string name="_bx_spaces_page_title_browse_recent"><![CDATA[New Spaces]]></string>
+	<string name="_bx_spaces_page_title_browse_connections"><![CDATA[{0} connections]]></string>
+	<string name="_bx_spaces_page_title_browse_connections_mutual"><![CDATA[{0} and {1} mutual connections]]></string>
+	<string name="_bx_spaces_page_title_sys_profile_friends"><![CDATA[Friends]]></string>
+	<string name="_bx_spaces_page_title_profile_friends"><![CDATA[Friends]]></string>
+	<string name="_bx_spaces_page_title_sys_space_fans"><![CDATA[Members]]></string>
+	<string name="_bx_spaces_page_title_space_fans"><![CDATA[Members]]></string>
+	<string name="_bx_spaces_page_title_sys_profile_comments"><![CDATA[Comments]]></string>
+	<string name="_bx_spaces_page_title_profile_comments"><![CDATA[Comments]]></string>
+	<string name="_bx_spaces_page_title_sys_profile_info"><![CDATA[Space Info]]></string>
+	<string name="_bx_spaces_page_title_profile_info"><![CDATA[Info about {display_name}]]></string>
+	<string name="_bx_spaces_page_title_sys_recent"><![CDATA[New Spaces]]></string>
+	<string name="_bx_spaces_page_title_recent"><![CDATA[New Spaces]]></string>
+	<string name="_bx_spaces_page_title_sys_manage"><![CDATA[Manage Own Spaces]]></string>
+	<string name="_bx_spaces_page_title_sys_manage_administration"><![CDATA[Manage All Spaces]]></string>
+	<string name="_bx_spaces_page_title_manage"><![CDATA[Manage Spaces]]></string>
+	<string name="_bx_spaces_page_title_sys_top"><![CDATA[Top Spaces]]></string>
+	<string name="_bx_spaces_page_title_top"><![CDATA[Top Spaces]]></string>
+	<string name="_bx_spaces_page_title_sys_invite_to_space"><![CDATA[Invite Members to the Space]]></string>
+	<string name="_bx_spaces_page_title_invite_to_space"><![CDATA[Invite Members to the Space]]></string>
+	<string name="_bx_spaces_page_title_sys_entries_search"><![CDATA[Search]]></string>
+	<string name="_bx_spaces_page_title_entries_search"><![CDATA[Search]]></string>
+	
+	<string name="_bx_spaces_page_block_title_sys_entries_actions"><![CDATA[Spaces actions]]></string>
+	<string name="_bx_spaces_page_block_title_entries_actions"><![CDATA[Spaces actions]]></string>
+	<string name="_bx_spaces_page_block_title_sys_entries_of_author"><![CDATA[Spaces of author]]></string>
+	<string name="_bx_spaces_page_block_title_entries_of_author"><![CDATA[Spaces by {display_name}]]></string>
+	<string name="_bx_spaces_page_block_title_favorites_of_author"><![CDATA[Favorite Spaces]]></string>
+	<string name="_bx_spaces_page_block_title_sys_favorites_of_author"><![CDATA[Favorite Spaces]]></string>
+	<string name="_bx_spaces_page_block_title_sys_joined_entries"><![CDATA[Joined Spaces]]></string>
+	<string name="_bx_spaces_page_block_title_joined_entries"><![CDATA[Joined Spaces]]></string>
+  <string name="_bx_spaces_page_block_title_parent"><![CDATA[Parent Space]]></string>
+  <string name="_bx_spaces_page_block_title_childs"><![CDATA[Child Spaces]]></string>
+  <string name="_bx_spaces_page_block_title_create_profile"><![CDATA[Create Space]]></string>
+	<string name="_bx_spaces_page_block_title_edit_profile"><![CDATA[Edit Space]]></string>
+	<string name="_bx_spaces_page_block_title_edit_profile_cover"><![CDATA[Edit Cover]]></string>
+	<string name="_bx_spaces_page_block_title_delete_profile"><![CDATA[Delete Space]]></string>
+	<string name="_bx_spaces_page_block_title_profile_info_link"><![CDATA[About <a href="{profile_link}">{display_name}</a>]]></string>
+	<string name="_bx_spaces_page_block_title_profile_info"><![CDATA[Info]]></string>
+	<string name="_bx_spaces_page_block_title_system_profile_info"><![CDATA[Info]]></string>
+	<string name="_bx_spaces_page_block_title_profile_description"><![CDATA[Description]]></string>
+	<string name="_bx_spaces_page_block_title_profile_friends_link"><![CDATA[Friends of <a href="{profile_link}">{display_name}</a>]]></string>
+	<string name="_bx_spaces_page_block_title_profile_friends"><![CDATA[Friends]]></string>
+	<string name="_bx_spaces_page_block_title_system_profile_friends"><![CDATA[Friends]]></string>
+	<string name="_bx_spaces_page_block_title_admins"><![CDATA[Administrators]]></string>
+	<string name="_bx_spaces_page_block_title_fans_link"><![CDATA[Members of <a href="{profile_link}">{display_name}</a>]]></string>
+	<string name="_bx_spaces_page_block_title_fans"><![CDATA[Members]]></string>
+	<string name="_bx_spaces_page_block_title_system_fans"><![CDATA[Members]]></string>
+	<string name="_bx_spaces_page_block_title_profile_comments"><![CDATA[Comments]]></string>
+	<string name="_bx_spaces_page_block_title_profile_comments_link"><![CDATA[Comments to <a href="{entry_link}">{title}</a>]]></string>
+	<string name="_bx_spaces_page_block_title_profile_actions"><![CDATA[Actions]]></string>
+	<string name="_bx_spaces_page_block_title_featured_profiles"><![CDATA[Featured Spaces]]></string>
+	<string name="_bx_spaces_page_block_title_latest_profiles"><![CDATA[New Spaces]]></string>
+	<string name="_bx_spaces_page_block_title_system_manage"><![CDATA[Manage Own Spaces]]></string>
+	<string name="_bx_spaces_page_block_title_system_manage_administration"><![CDATA[Manage All Spaces]]></string>
+	<string name="_bx_spaces_page_block_title_manage"><![CDATA[Manage Spaces]]></string>
+	<string name="_bx_spaces_page_block_title_top_profiles"><![CDATA[Top Spaces]]></string>
+	<string name="_bx_spaces_page_block_title_entry_social_sharing"><![CDATA[Share]]></string>
+	<string name="_bx_spaces_page_block_title_categories"><![CDATA[Spaces Categories]]></string>
+	<string name="_bx_spaces_page_block_title_invite_to_space"><![CDATA[Invite Members to the Space]]></string>
+	<string name="_bx_spaces_page_block_title_search_form"><![CDATA[Search Form]]></string>
+	<string name="_bx_spaces_page_block_title_search_results"><![CDATA[Search Results]]></string>
+	<string name="_bx_spaces_page_block_title_search_form_cmts"><![CDATA[Comments Search Form]]></string>
+	<string name="_bx_spaces_page_block_title_search_results_cmts"><![CDATA[Comments Search Results]]></string>
+	<string name="_bx_spaces_page_block_title_sys_featured_entries_view_showcase"><![CDATA[Featured Spaces (Showcase View)]]></string>
+	<string name="_bx_spaces_page_block_title_featured_entries_view_showcase"><![CDATA[Featured Spaces]]></string>
+	<string name="_bx_spaces_page_block_title_sys_recommended_entries_view_showcase"><![CDATA[Recommended Spaces (Showcase View)]]></string>
+	<string name="_bx_spaces_page_block_title_recommended_entries_view_showcase"><![CDATA[Recommended Spaces]]></string>
+	
+	<string name="_bx_spaces_menu_title_submenu"><![CDATA[Spaces Submenu]]></string>
+	<string name="_bx_spaces_menu_set_title_submenu"><![CDATA[Spaces Submenu]]></string>
+	<string name="_bx_spaces_menu_set_title_view_profile_actions"><![CDATA[Space Actions]]></string>
+	<string name="_bx_spaces_menu_title_view_profile_actions"><![CDATA[Space Actions]]></string>
+	<string name="_bx_spaces_menu_set_title_view_profile_actions_more"><![CDATA[Space More Actions]]></string>
+	<string name="_bx_spaces_menu_title_view_profile_actions_more"><![CDATA[Space More Actions]]></string>
+	<string name="_bx_spaces_menu_set_title_view_profile_submenu"><![CDATA[View Space Submenu]]></string>
+	<string name="_bx_spaces_menu_title_view_profile_submenu"><![CDATA[View Space Submenu]]></string>
+	<string name="_bx_spaces_menu_title_view_profile_submenu_cover"><![CDATA[Space Cover Submenu]]></string>
+	<string name="_bx_spaces_menu_title_entries_my"><![CDATA[Profile Spaces Action Menu]]></string>
+	<string name="_bx_spaces_menu_set_title_entries_my"><![CDATA[Profile Spaces Menu]]></string>
+	<string name="_bx_spaces_menu_set_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string>
+	<string name="_bx_spaces_menu_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string>
+	<string name="_bx_spaces_menu_item_title_system_delete"><![CDATA[Delete]]></string>
+	<string name="_bx_spaces_menu_item_title_delete"><![CDATA[Delete]]></string>
+	<string name="_bx_spaces_menu_item_title_system_delete_with_content"><![CDATA[Delete With Content]]></string>
+	<string name="_bx_spaces_menu_item_title_delete_with_content"><![CDATA[Delete With Content]]></string>
+	<string name="_bx_spaces_menu_item_title_system_edit_cover"><![CDATA[Edit Cover]]></string>
+	<string name="_bx_spaces_menu_item_title_edit_cover"><![CDATA[Edit Cover]]></string>
+	<string name="_bx_spaces_menu_item_title_system_edit_profile"><![CDATA[Edit Space]]></string>
+	<string name="_bx_spaces_menu_item_title_edit_profile"><![CDATA[Edit Space]]></string>
+	<string name="_bx_spaces_menu_item_title_system_delete_profile"><![CDATA[Delete Space]]></string>
+	<string name="_bx_spaces_menu_item_title_delete_profile"><![CDATA[Delete Space]]></string>
+	<string name="_bx_spaces_menu_item_title_system_delete_account"><![CDATA[Delete Account]]></string>
+	<string name="_bx_spaces_menu_item_title_delete_account"><![CDATA[Delete Account]]></string>
+	<string name="_bx_spaces_menu_item_title_system_profile_type"><![CDATA[Space]]></string>
+	<string name="_bx_spaces_menu_item_title_profile_type"><![CDATA[Space]]></string>
+	<string name="_bx_spaces_menu_item_title_system_create_profile"><![CDATA[New Space]]></string>
+	<string name="_bx_spaces_menu_item_title_create_profile"><![CDATA[New Space]]></string>
+	<string name="_bx_spaces_menu_item_title_system_view_profile_friends"><![CDATA[Friends]]></string>
+	<string name="_bx_spaces_menu_item_title_view_profile_friends"><![CDATA[Friends]]></string>
+	<string name="_bx_spaces_menu_item_title_system_view_joined_spaces"><![CDATA[Spaces]]></string>
+	<string name="_bx_spaces_menu_item_title_view_joined_spaces"><![CDATA[Spaces]]></string>
+	<string name="_bx_spaces_menu_item_title_system_view_fans"><![CDATA[Members]]></string>
+	<string name="_bx_spaces_menu_item_title_view_fans"><![CDATA[Members]]></string>
+	<string name="_bx_spaces_menu_item_title_system_view_profile_comments"><![CDATA[Comments]]></string>
+	<string name="_bx_spaces_menu_item_title_view_profile_comments"><![CDATA[Comments]]></string>
+	<string name="_bx_spaces_menu_item_title_system_view_profile_info"><![CDATA[Info]]></string>
+	<string name="_bx_spaces_menu_item_title_view_profile_info"><![CDATA[Info]]></string>
+	<string name="_bx_spaces_menu_item_title_system_view_profile_view"><![CDATA[Space]]></string>
+	<string name="_bx_spaces_menu_item_title_view_profile_view"><![CDATA[Space]]></string>
+	<string name="_bx_spaces_menu_item_title_system_invite"><![CDATA[Invite]]></string>
+	<string name="_bx_spaces_menu_item_title_invite"><![CDATA[Invite]]></string>
+	
+	<string name="_bx_spaces_menu_item_title_system_befriend"><![CDATA[Add friend]]></string>
+	<string name="_bx_spaces_menu_item_title_befriend"><![CDATA[Add friend]]></string>
+	<string name="_bx_spaces_menu_item_title_befriend_sent"><![CDATA[Add friend (requested)]]></string>
+	<string name="_bx_spaces_menu_item_title_befriend_confirm"><![CDATA[Accept friend request]]></string>
+	<string name="_bx_spaces_menu_item_title_system_unfriend"><![CDATA[Unfriend]]></string>
+	<string name="_bx_spaces_menu_item_title_unfriend"><![CDATA[Unfriend]]></string>
+	<string name="_bx_spaces_menu_item_title_unfriend_cancel_request"><![CDATA[Cancel friend request]]></string>
+	<string name="_bx_spaces_menu_item_title_unfriend_reject_request"><![CDATA[Reject friend request]]></string>
+	
+	<string name="_bx_spaces_menu_item_title_system_become_fan"><![CDATA[Join Space]]></string>
+	<string name="_bx_spaces_menu_item_title_become_fan"><![CDATA[Join Space]]></string>
+	<string name="_bx_spaces_menu_item_title_become_fan_sent"><![CDATA[Join Space (requested)]]></string>
+	<string name="_bx_spaces_menu_item_title_become_fan_confirm"><![CDATA[Accept Request]]></string>
+	<string name="_bx_spaces_menu_item_title_system_leave_space"><![CDATA[Leave Space]]></string>
+	<string name="_bx_spaces_menu_item_title_leave_space"><![CDATA[Leave Space]]></string>
+	<string name="_bx_spaces_menu_item_title_leave_space_cancel_request"><![CDATA[Cancel Request]]></string>
+	<string name="_bx_spaces_menu_item_title_leave_space_reject_request"><![CDATA[Reject Request]]></string>
+	
+	<string name="_bx_spaces_menu_item_title_system_subscribe"><![CDATA[Follow]]></string>
+	<string name="_bx_spaces_menu_item_title_subscribe"><![CDATA[Follow]]></string>
+	<string name="_bx_spaces_menu_item_title_system_unsubscribe"><![CDATA[Unfollow]]></string>
+	<string name="_bx_spaces_menu_item_title_unsubscribe"><![CDATA[Unfollow]]></string>
+	<string name="_bx_spaces_menu_item_title_system_more_actions"><![CDATA[More Actions]]></string>
+	<string name="_bx_spaces_menu_item_title_more_actions"><![CDATA[]]></string>
+	<string name="_bx_spaces_menu_item_title_system_friends"><![CDATA[Friends]]></string>
+	<string name="_bx_spaces_menu_item_title_friends"><![CDATA[Friends]]></string>
+	<string name="_bx_spaces_menu_item_title_system_friend_requests"><![CDATA[Friend requests number]]></string>
+	<string name="_bx_spaces_menu_item_title_friend_requests"><![CDATA[{addon} friend requests]]></string>
+	<string name="_bx_spaces_menu_item_title_system_manage_my_spaces"><![CDATA[My spaces]]></string>
+	<string name="_bx_spaces_menu_item_title_manage_my_spaces"><![CDATA[{addon} spaces]]></string>
+	<string name="_bx_spaces_menu_item_title_system_entries_recent"><![CDATA[New]]></string>
+	<string name="_bx_spaces_menu_item_title_entries_recent"><![CDATA[New]]></string>
+	<string name="_bx_spaces_menu_item_title_system_entries_search"><![CDATA[Search]]></string>
+	<string name="_bx_spaces_menu_item_title_entries_search"><![CDATA[Search]]></string>
+	<string name="_bx_spaces_menu_item_title_system_entries_manage"><![CDATA[Manage]]></string>
+	<string name="_bx_spaces_menu_item_title_entries_manage"><![CDATA[Manage]]></string>
+	<string name="_bx_spaces_menu_item_title_system_entries_home"><![CDATA[Spaces]]></string>
+	<string name="_bx_spaces_menu_item_title_entries_home"><![CDATA[Spaces]]></string>
+	<string name="_bx_spaces_menu_item_title_system_admt_spaces"><![CDATA[Spaces]]></string>
+	<string name="_bx_spaces_menu_item_title_admt_spaces"><![CDATA[Spaces - {addon} unapproved]]></string>
+	<string name="_bx_spaces_menu_item_title_manage_my"><![CDATA[My Spaces]]></string>
+	<string name="_bx_spaces_menu_item_title_manage_all"><![CDATA[All Spaces]]></string>
+	<string name="_bx_spaces_menu_item_title_system_entries_top"><![CDATA[Top]]></string>
+	<string name="_bx_spaces_menu_item_title_entries_top"><![CDATA[Top]]></string>
+	
+	<string name="_bx_spaces_grid_filter_item_title_adm_select_one_filter1"><![CDATA[All Statuses]]></string>
+	<string name="_bx_spaces_grid_filter_item_title_adm_active"><![CDATA[Active]]></string>
+	<string name="_bx_spaces_grid_filter_item_title_adm_pending"><![CDATA[Pending]]></string>
+	<string name="_bx_spaces_grid_filter_item_title_adm_suspended"><![CDATA[Suspended]]></string>
+	<string name="_bx_spaces_grid_column_title_adm_active"><![CDATA[Active]]></string>
+	<string name="_bx_spaces_grid_column_title_adm_name"><![CDATA[Name]]></string>
+	<string name="_bx_spaces_grid_column_title_adm_added"><![CDATA[Created]]></string>
+	<string name="_bx_spaces_grid_column_title_adm_account"><![CDATA[Account]]></string>
+	<string name="_bx_spaces_grid_action_title_adm_delete"><![CDATA[Delete]]></string>
+	<string name="_bx_spaces_grid_action_title_adm_delete_with_content"><![CDATA[Delete With Content]]></string>
+	<string name="_bx_spaces_grid_action_title_adm_more_actions"><![CDATA[More Actions]]></string>
+	<string name="_bx_spaces_grid_action_err_delete"><![CDATA[Cannot delete the selected space(s).]]></string>
+	<string name="_bx_spaces_grid_txt_account_manager"><![CDATA[Redirect to manage account.]]></string>
+	
+	<string name="_bx_spaces_chart_growth"><![CDATA[Spaces: Growth]]></string>
+	<string name="_bx_spaces_chart_growth_speed"><![CDATA[Spaces: Growth Speed]]></string>
+	
+	<string name="_bx_spaces_search_extended"><![CDATA[Spaces Search]]></string>
+	<string name="_bx_spaces_search_extended_cmts"><![CDATA[Spaces Comments Search]]></string>
+
+  <string name="_bx_spaces_err_delete_child_presend"><![CDATA[Cannot delete this space because there are child elements.]]></string>
+	<string name="_bx_spaces_txt_account_pending"><![CDATA[This space is pending approval, please wait until it is activated.]]></string>
+	<string name="_bx_spaces_txt_account_suspended"><![CDATA[This space is suspended.]]></string>
+	<string name="_bx_spaces_txt_N_fans"><![CDATA[{0} members]]></string>
+	<string name="_bx_spaces_txt_sample_single"><![CDATA[space]]></string>
+	<string name="_bx_spaces_txt_sample_single_with_article"><![CDATA[a space]]></string>
+	<string name="_bx_spaces_txt_sample_comment_single"><![CDATA[comment to space]]></string>
+	<string name="_bx_spaces_txt_sample_vote_single"><![CDATA[vote to space]]></string>
+	<string name="_bx_spaces_txt_to_admins"><![CDATA[To Admins]]></string>
+	<string name="_bx_spaces_txt_from_admins"><![CDATA[From Admins]]></string>
+	<string name="_bx_spaces_txt_private_space"><![CDATA[Private space]]></string>
+	
+	<string name="_bx_spaces_alert_action_fan_added"><![CDATA[member joined]]></string>
+	<string name="_bx_spaces_txt_ntfs_fan_added"><![CDATA[Space <b class="bx-ntfs-content-profile">{owner_name}</b> has got a member <b class="bx-ntfs-content-entry">{subentry_sample}</b>]]></string>
+	<string name="_bx_spaces_alert_action_join_request"><![CDATA[join request]]></string>
+	<string name="_bx_spaces_txt_ntfs_join_request"><![CDATA[Space <b class="bx-ntfs-content-profile">{owner_name}</b> has a join request from <b class="bx-ntfs-content-entry">{subentry_sample}</b>]]></string>
+	<string name="_bx_spaces_txt_ntfs_timeline_post_common"><![CDATA[New post <b class="bx-ntfs-content-entry">{subentry_sample}</b> in <b class="bx-ntfs-content-profile">{owner_name}</b> space timeline]]></string>
+	
+	<string name="_bx_spaces_pre_lists_cats"><![CDATA[Space categories]]></string>
+	<string name="_bx_spaces_cat_General"><![CDATA[General]]></string>
+	<string name="_bx_spaces_cat_Business"><![CDATA[Business]]></string>
+	<string name="_bx_spaces_cat_Interests"><![CDATA[Interests]]></string>
+	<string name="_bx_spaces_cat_Causes"><![CDATA[Causes]]></string>
+	<string name="_bx_spaces_cat_Fun"><![CDATA[Fun]]></string>
+	<string name="_bx_spaces_cat_Uncategorised"><![CDATA[Uncategorised]]></string>
+	
+	<string name="_bx_spaces_email_join_request"><![CDATA[Space join request]]></string>
+	<string name="_bx_spaces_email_join_request_subject"><![CDATA[Request to join your space]]></string>
+	<string name="_bx_spaces_email_join_request_body"><![CDATA[{email_header}
+	<p>New request to join <a href="{EntryUrl}">{EntryTitle}</a> space from <a href="{NewMemberUrl}">{NewMemberDisplayName}</a></p>
+	{email_footer}]]></string>
+	
+	<string name="_bx_spaces_email_join_reject"><![CDATA[Space join request was rejected]]></string>
+	<string name="_bx_spaces_email_join_reject_subject"><![CDATA[Request to join a space was rejected]]></string>
+	<string name="_bx_spaces_email_join_reject_body"><![CDATA[{email_header}
+	<p>Your request to join <a href="{EntryUrl}">{EntryTitle}</a> space was rejected by space admin.</p>
+	{email_footer}]]></string>
+	
+	<string name="_bx_spaces_email_join_confirm"><![CDATA[Space join request was confirmed]]></string>
+	<string name="_bx_spaces_email_join_confirm_subject"><![CDATA[Your request to join a space was confirmed]]></string>
+	<string name="_bx_spaces_email_join_confirm_body"><![CDATA[{email_header}
+	<p>Your request to join <a href="{EntryUrl}">{EntryTitle}</a> space was confirmed by the space admin.</p>
+	{email_footer}]]></string>
+	
+	<string name="_bx_spaces_email_fan_remove"><![CDATA[Profile was removed from space fans]]></string>
+	<string name="_bx_spaces_email_fan_remove_subject"><![CDATA[Your profile was removed from the space]]></string>
+	<string name="_bx_spaces_email_fan_remove_body"><![CDATA[{email_header}
+	<p>Your profile was removed from <a href="{EntryUrl}">{EntryTitle}</a> space by the space admin.</p>
+	{email_footer}]]></string>
+	
+	<string name="_bx_spaces_email_fan_become_admin"><![CDATA[Space admin status was granted]]></string>
+	<string name="_bx_spaces_email_fan_become_admin_subject"><![CDATA[You are a space admin now]]></string>
+	<string name="_bx_spaces_email_fan_become_admin_body"><![CDATA[{email_header}
+	<p>You are an admin of <a href="{EntryUrl}">{EntryTitle}</a> space now.</p>
+	{email_footer}]]></string>
+	
+	<string name="_bx_spaces_email_admin_become_fan"><![CDATA[Space admin status was revoked]]></string>
+	<string name="_bx_spaces_email_admin_become_fan_subject"><![CDATA[Your space admin status was revoked]]></string>
+	<string name="_bx_spaces_email_admin_become_fan_body"><![CDATA[{email_header}
+	<p>Your admin status was revoked from <a href="{EntryUrl}">{EntryTitle}</a> space.</p>
+	{email_footer}]]></string>
+	
+	<string name="_bx_spaces_email_invitation"><![CDATA[Invitation to space]]></string>
+	<string name="_bx_spaces_email_invitation_subject"><![CDATA[Invitation to "{EntryTitle}" space]]></string>
+	<string name="_bx_spaces_email_invitation_body"><![CDATA[{email_header}
+	<p><a href="{InviterUrl}">{InviterDisplayName}</a> invited you to <a href="{EntryUrl}">{EntryTitle} space</a>.</p>
+	{email_footer}]]></string>
+</resources>

+ 78 - 0
modules/boonex/spaces/install/sql/disable.sql

@@ -0,0 +1,78 @@
+
+-- SETTINGS
+SET @iTypeId = (SELECT `ID` FROM `sys_options_types` WHERE `name` = 'bx_spaces' LIMIT 1);
+SET @iCategId = (SELECT `ID` FROM `sys_options_categories` WHERE `type_id` = @iTypeId LIMIT 1);
+DELETE FROM `sys_options` WHERE `category_id` = @iCategId;
+DELETE FROM `sys_options_categories` WHERE `type_id` = @iTypeId;
+DELETE FROM `sys_options_types` WHERE `id` = @iTypeId;
+
+-- PAGES
+DELETE FROM `sys_objects_page` WHERE `module` = 'bx_spaces';
+DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_spaces' OR `object` IN('bx_spaces_create_profile', 'bx_spaces_delete_profile', 'bx_spaces_edit_profile', 'bx_spaces_edit_profile_cover', 'bx_spaces_invite', 'bx_spaces_view_profile', 'bx_spaces_view_profile_closed', 'bx_spaces_profile_info', 'bx_spaces_profile_comments', 'bx_spaces_home', 'bx_spaces_fans', 'bx_spaces_joined', 'bx_spaces_top', 'bx_spaces_search', 'bx_spaces_manage', 'bx_spaces_administration');
+
+-- MENU
+DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_spaces';
+DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_spaces';
+DELETE FROM `sys_menu_items` WHERE `module` = 'bx_spaces' OR `set_name` IN('bx_spaces_view_submenu', 'bx_spaces_submenu', 'bx_spaces_view_actions', 'bx_spaces_view_actions_more', 'bx_spaces_my', 'bx_spaces_snippet_meta', 'bx_spaces_menu_manage_tools');
+
+-- ACL
+DELETE `sys_acl_actions`, `sys_acl_matrix` FROM `sys_acl_actions`, `sys_acl_matrix` WHERE `sys_acl_matrix`.`IDAction` = `sys_acl_actions`.`ID` AND `sys_acl_actions`.`Module` = 'bx_spaces';
+DELETE FROM `sys_acl_actions` WHERE `Module` = 'bx_spaces';
+
+-- COMMENTS
+DELETE FROM `sys_objects_cmts` WHERE `Name` = 'bx_spaces';
+
+-- VIEWS
+DELETE FROM `sys_objects_view` WHERE `name` = 'bx_spaces';
+
+-- VOTES
+DELETE FROM `sys_objects_vote` WHERE `Name` = 'bx_spaces';
+
+-- SCORES
+DELETE FROM `sys_objects_score` WHERE `name` = 'bx_spaces';
+
+-- REPORTS
+DELETE FROM `sys_objects_report` WHERE `name` = 'bx_spaces';
+
+-- FAFORITES
+DELETE FROM `sys_objects_favorite` WHERE `name` = 'bx_spaces';
+
+-- FEATURED
+DELETE FROM `sys_objects_feature` WHERE `name` = 'bx_spaces';
+
+-- METATAGS
+DELETE FROM `sys_objects_metatags` WHERE `object` = 'bx_spaces';
+
+-- CATEGORY
+DELETE FROM `sys_objects_category` WHERE `object` = 'bx_spaces_cats';
+
+-- SEARCH
+DELETE FROM `sys_objects_search` WHERE `ObjectName` = 'bx_spaces';
+
+-- CONNECTIONS
+DELETE FROM `sys_objects_connection` WHERE `object` = 'bx_spaces_fans';
+
+-- STATS
+DELETE FROM `sys_statistics` WHERE `name` LIKE 'bx_spaces%';
+
+-- CHARTS
+DELETE FROM `sys_objects_chart` WHERE `object` LIKE 'bx_spaces%';
+
+-- GRIDS
+DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_spaces_administration', 'bx_spaces_moderation', 'bx_spaces_common', 'bx_spaces_fans');
+DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_spaces_administration', 'bx_spaces_moderation', 'bx_spaces_common', 'bx_spaces_fans');
+DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_spaces_administration', 'bx_spaces_moderation', 'bx_spaces_common', 'bx_spaces_fans');
+
+-- ALERTS
+SET @iHandler := (SELECT `id` FROM `sys_alerts_handlers` WHERE `name` = 'bx_spaces' LIMIT 1);
+DELETE FROM `sys_alerts` WHERE `handler_id` = @iHandler;
+DELETE FROM `sys_alerts_handlers` WHERE `id` = @iHandler;
+
+-- PRIVACY 
+DELETE FROM `sys_objects_privacy` WHERE `object` IN('bx_spaces_allow_view_to', 'bx_spaces_allow_view_notification_to');
+
+-- EMAIL TEMPLATES
+DELETE FROM `sys_email_templates` WHERE `Module` = 'bx_spaces';
+
+-- UPLOADERS
+DELETE FROM `sys_objects_uploader` WHERE `object` IN('bx_spaces_cover_crop', 'bx_spaces_picture_crop');

+ 515 - 0
modules/boonex/spaces/install/sql/enable.sql

@@ -0,0 +1,515 @@
+
+-- SETTINGS
+
+SET @iTypeOrder = (SELECT MAX(`order`) FROM `sys_options_types` WHERE `group` = 'modules');
+INSERT INTO `sys_options_types`(`group`, `name`, `caption`, `icon`, `order`) VALUES 
+('modules', 'bx_spaces', '_bx_spaces', 'bx_spaces@modules/boonex/spaces/|std-icon.svg', IF(ISNULL(@iTypeOrder), 1, @iTypeOrder + 1));
+SET @iTypeId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order`)
+VALUES (@iTypeId, 'bx_spaces', '_bx_spaces', 1);
+SET @iCategId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
+('bx_spaces_num_connections_quick', '6', @iCategId, '_bx_spaces_option_num_connections_quick', 'digit', '', '', '', 10),
+('bx_spaces_per_page_browse', '24', @iCategId, '_bx_spaces_option_per_page_browse', 'digit', '', '', '', 11),
+('bx_spaces_num_rss', '10', @iCategId, '_bx_spaces_option_num_rss', 'digit', '', '', '', 12),
+('bx_spaces_per_page_browse_showcase', '32', @iCategId, '_sys_option_per_page_browse_showcase', 'digit', '', '', '', 15),
+('bx_spaces_per_page_browse_recommended', '10', @iCategId, '_sys_option_per_page_browse_recommended', 'digit', '', '', '', 16),
+('bx_spaces_searchable_fields', 'space_name,space_desc', @iCategId, '_bx_spaces_option_searchable_fields', 'list', 'a:2:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:21:"get_searchable_fields";}', '', '', 30);
+
+
+-- PAGES
+
+-- PAGE: create profile
+
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_create_profile', 'create-space-profile', '_bx_spaces_page_title_sys_create_profile', '_bx_spaces_page_title_create_profile', 'bx_spaces', 5, 2147483647, 1, 'page.php?i=create-space-profile', '', '', '', 0, 1, 0, '', '');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_spaces_create_profile', 1, 'bx_spaces', '_bx_spaces_page_block_title_create_profile', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:13:\"entity_create\";}', 0, 1, 1);
+
+-- PAGE: view profile
+
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_view_profile', 'view-space-profile', '_bx_spaces_page_title_sys_view_profile', '_bx_spaces_page_title_view_profile', 'bx_spaces', 10, 2147483647, 1, 'page.php?i=view-space-profile', '', '', '', 0, 1, 0, 'BxSpacesPageEntry', 'modules/boonex/spaces/classes/BxSpacesPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES
+('bx_spaces_view_profile', 1, 'bx_spaces', '', '_bx_spaces_page_block_title_entry_social_sharing', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:21:\"entity_social_sharing\";}', 0, 0, 1, 0),
+('bx_spaces_view_profile', 2, 'bx_spaces', '', '_bx_spaces_page_block_title_profile_info', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:11:\"entity_info\";}', 0, 0, 1, 0),
+('bx_spaces_view_profile', 2, 'bx_spaces', '', '_bx_spaces_page_block_title_parent', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:13:\"entity_parent\";}', 0, 0, 1, 1),
+('bx_spaces_view_profile', 2, 'bx_spaces', '', '_bx_spaces_page_block_title_childs', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:13:\"entity_childs\";}', 0, 0, 1, 2),
+('bx_spaces_view_profile', 3, 'bx_spaces', '', '_bx_spaces_page_block_title_fans', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:4:\"fans\";}', 0, 0, 1, 0),
+('bx_spaces_view_profile', 3, 'bx_spaces', '', '_bx_spaces_page_block_title_admins', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:6:\"admins\";}', 0, 0, 1, 1),
+('bx_spaces_view_profile', 4, 'bx_spaces', '', '_bx_spaces_page_block_title_profile_description', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:17:\"entity_text_block\";}', 0, 0, 1, 0),
+('bx_spaces_view_profile', 4, 'bx_spaces', '', '_bx_spaces_page_block_title_profile_comments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 0, 0);
+
+-- PAGE: view closed profile 
+
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_view_profile_closed', 'view-space-profile-closed', '_bx_spaces_page_title_sys_view_profile_closed', '_bx_spaces_page_title_view_profile', 'bx_spaces', 10, 2147483647, 1, 'page.php?i=view-space-profile', '', '', '', 0, 1, 0, 'BxSpacesPageEntry', 'modules/boonex/spaces/classes/BxSpacesPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_spaces_view_profile_closed', 2, 'bx_spaces', '', '_bx_spaces_page_block_title_profile_info', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:11:\"entity_info\";}', 0, 0, 1, 0),
+('bx_spaces_view_profile_closed', 3, 'bx_spaces', '', '_bx_spaces_page_block_title_fans', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:4:\"fans\";}', 0, 0, 1, 0);
+
+-- PAGE: edit profile
+
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_edit_profile', 'edit-space-profile', '_bx_spaces_page_title_sys_edit_profile', '_bx_spaces_page_title_edit_profile', 'bx_spaces', 5, 2147483647, 1, 'page.php?i=edit-space-profile', '', '', '', 0, 1, 0, 'BxSpacesPageEntry', 'modules/boonex/spaces/classes/BxSpacesPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_spaces_edit_profile', 1, 'bx_spaces', '_bx_spaces_page_block_title_edit_profile', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:11:\"entity_edit\";}', 0, 0, 0);
+
+-- PAGE: edit profile cover
+
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_edit_profile_cover', 'edit-space-cover', '_bx_spaces_page_title_sys_edit_profile_cover', '_bx_spaces_page_title_edit_profile_cover', 'bx_spaces', 5, 2147483647, 1, 'page.php?i=edit-space-cover', '', '', '', 0, 1, 0, 'BxSpacesPageEntry', 'modules/boonex/spaces/classes/BxSpacesPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_spaces_edit_profile_cover', 1, 'bx_spaces', '_bx_spaces_page_block_title_edit_profile_cover', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:17:\"entity_edit_cover\";}', 0, 0, 0);
+
+-- PAGE: invite members
+
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_invite', 'invite-to-space', '_bx_spaces_page_title_sys_invite_to_space', '_bx_spaces_page_title_invite_to_space', 'bx_spaces', 5, 2147483647, 1, 'page.php?i=invite-to-space', '', '', '', 0, 1, 0, 'BxSpacesPageEntry', 'modules/boonex/spaces/classes/BxSpacesPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_spaces_invite', 1, 'bx_spaces', '_bx_spaces_page_block_title_invite_to_space', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:13:\"entity_invite\";}', 0, 0, 0);
+
+-- PAGE: delete profile
+
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_delete_profile', 'delete-space-profile', '_bx_spaces_page_title_sys_delete_profile', '_bx_spaces_page_title_delete_profile', 'bx_spaces', 5, 2147483647, 1, 'page.php?i=delete-space-profile', '', '', '', 0, 1, 0, 'BxSpacesPageEntry', 'modules/boonex/spaces/classes/BxSpacesPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_spaces_delete_profile', 1, 'bx_spaces', '_bx_spaces_page_block_title_delete_profile', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:13:\"entity_delete\";}', 0, 0, 0);
+
+-- PAGE: profile info
+
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_profile_info', 'space-profile-info', '_bx_spaces_page_title_sys_profile_info', '_bx_spaces_page_title_profile_info', 'bx_spaces', 5, 2147483647, 1, 'page.php?i=space-profile-info', '', '', '', 0, 1, 0, 'BxSpacesPageEntry', 'modules/boonex/spaces/classes/BxSpacesPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_spaces_profile_info', 1, 'bx_spaces', '_bx_spaces_page_block_title_system_profile_info', '_bx_spaces_page_block_title_profile_info_link', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:16:\"entity_info_full\";}', 0, 0, 1, 1),
+('bx_spaces_profile_info', 1, 'bx_spaces', '', '_bx_spaces_page_block_title_profile_description', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:17:\"entity_text_block\";}', 0, 0, 1, 2);
+
+-- PAGE: space fans
+
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_fans', 'space-fans', '_bx_spaces_page_title_sys_space_fans', '_bx_spaces_page_title_space_fans', 'bx_spaces', 5, 2147483647, 1, 'page.php?i=space-fans', '', '', '', 0, 1, 0, 'BxSpacesPageEntry', 'modules/boonex/spaces/classes/BxSpacesPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_spaces_fans', 1, 'bx_spaces', '_bx_spaces_page_block_title_system_fans', '_bx_spaces_page_block_title_fans_link', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:10:"fans_table";}', 0, 0, 1, 1);
+
+-- PAGE: view entry comments
+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_spaces_profile_comments', '_bx_spaces_page_title_sys_profile_comments', '_bx_spaces_page_title_profile_comments', 'bx_spaces', 5, 2147483647, 1, 'space-profile-comments', '', '', '', '', 0, 1, 0, 'BxSpacesPageEntry', 'modules/boonex/spaces/classes/BxSpacesPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_spaces_profile_comments', 1, 'bx_spaces', '_bx_spaces_page_block_title_profile_comments', '_bx_spaces_page_block_title_profile_comments_link', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 0, 1);
+
+-- PAGE: module home
+
+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_spaces_home', '_bx_spaces_page_title_sys_recent', '_bx_spaces_page_title_recent', 'bx_spaces', 5, 2147483647, 1, 'spaces-home', 'page.php?i=spaces-home', '', '', '', 0, 1, 0, 'BxSpacesPageBrowse', 'modules/boonex/spaces/classes/BxSpacesPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_spaces_home', 1, 'bx_spaces', '_bx_spaces_page_block_title_featured_profiles', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:15:"browse_featured";s:6:"params";a:1:{i:0;s:7:"gallery";}}', 0, 1, 0),
+('bx_spaces_home', 1, 'bx_spaces', '_bx_spaces_page_block_title_latest_profiles', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:22:\"browse_recent_profiles\";s:6:"params";a:1:{i:0;b:1;}}', 0, 1, 1);
+
+-- PAGE: top profiles
+
+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_spaces_top', '_bx_spaces_page_title_sys_top', '_bx_spaces_page_title_top', 'bx_spaces', 5, 2147483647, 1, 'spaces-top', 'page.php?i=spaces-top', '', '', '', 0, 1, 0, 'BxSpacesPageBrowse', 'modules/boonex/spaces/classes/BxSpacesPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_spaces_top', 1, 'bx_spaces', '_bx_spaces_page_block_title_top_profiles', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:9:\"bx_spaces\";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_spaces_search', '_bx_spaces_page_title_sys_entries_search', '_bx_spaces_page_title_entries_search', 'bx_spaces', 5, 2147483647, 1, 'spaces-search', 'page.php?i=spaces-search', '', '', '', 0, 1, 0, 'BxSpacesPageBrowse', 'modules/boonex/spaces/classes/BxSpacesPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_spaces_search', 1, 'bx_spaces', '_bx_spaces_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_spaces";}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 1, 1),
+('bx_spaces_search', 1, 'bx_spaces', '_bx_spaces_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_spaces";s:10:"show_empty";b:1;}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 1, 2),
+('bx_spaces_search', 1, 'bx_spaces', '_bx_spaces_page_block_title_search_form_cmts', 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:14:"bx_spaces_cmts";}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 0, 3),
+('bx_spaces_search', 1, 'bx_spaces', '_bx_spaces_page_block_title_search_results_cmts', 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:14:"bx_spaces_cmts";s:10:"show_empty";b:1;}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 0, 4);
+
+-- 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_spaces_manage', '_bx_spaces_page_title_sys_manage', '_bx_spaces_page_title_manage', 'bx_spaces', 5, 2147483647, 1, 'spaces-manage', 'page.php?i=spaces-manage', '', '', '', 0, 1, 0, 'BxSpacesPageBrowse', 'modules/boonex/spaces/classes/BxSpacesPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_spaces_manage', 1, 'bx_spaces', '_bx_spaces_page_block_title_system_manage', '_bx_spaces_page_block_title_manage', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:12:\"manage_tools\";}}', 0, 1, 0);
+
+-- PAGE: module manage all
+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_spaces_administration', '_bx_spaces_page_title_sys_manage_administration', '_bx_spaces_page_title_manage', 'bx_spaces', 5, 192, 1, 'spaces-administration', 'page.php?i=spaces-administration', '', '', '', 0, 1, 0, 'BxSpacesPageBrowse', 'modules/boonex/spaces/classes/BxSpacesPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_spaces_administration', 1, 'bx_spaces', '_bx_spaces_page_block_title_system_manage_administration', '_bx_spaces_page_block_title_manage', 11, 192, 'service', 'a:3:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:12:\"manage_tools\";s:6:\"params\";a:1:{i:0;s:14:\"administration\";}}', 0, 1, 0);
+
+-- PAGE: user's spaces
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_joined', 'joined-spaces', '_bx_spaces_page_title_sys_joined_entries', '_bx_spaces_page_title_joined_entries', 'bx_spaces', 5, 2147483647, 1, '', '', '', '', 0, 1, 0, 'BxSpacesPageJoinedEntries', 'modules/boonex/spaces/classes/BxSpacesPageJoinedEntries.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES
+('bx_spaces_joined', 1, 'bx_spaces', '_bx_spaces_page_block_title_sys_entries_actions', '_bx_spaces_page_block_title_entries_actions', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:18:"my_entries_actions";}', 0, 0, 1, 1),
+('bx_spaces_joined', 1, 'bx_spaces', '_bx_spaces_page_block_title_sys_entries_of_author', '_bx_spaces_page_block_title_entries_of_author', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:22:"browse_created_entries";}', 0, 0, 0, 2),
+('bx_spaces_joined', 1, 'bx_spaces', '_bx_spaces_page_block_title_sys_favorites_of_author', '_bx_spaces_page_block_title_favorites_of_author', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:15:"browse_favorite";s:6:"params";a:1:{i:0;s:12:"{profile_id}";}}', 0, 1, 1, 3),
+('bx_spaces_joined', 1, 'bx_spaces', '_bx_spaces_page_block_title_sys_joined_entries', '_bx_spaces_page_block_title_joined_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:21:"browse_joined_entries";s:6:"params";a:2:{i:0;i:0;i:1;b:1;}}', 0, 0, 1, 4);
+
+-- PAGE: add block to homepage
+SET @iBlockOrder = (SELECT `order` FROM `sys_pages_blocks` WHERE `object` = 'sys_home' AND `cell_id` = 1 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES
+('sys_home', 1, 'bx_spaces', '', '_bx_spaces_page_block_title_latest_profiles', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:22:"browse_recent_profiles";}', 1, 0, 0, IFNULL(@iBlockOrder, 0) + 1),
+('sys_home', 1, 'bx_spaces', '_bx_spaces_page_block_title_sys_recommended_entries_view_showcase', '_bx_spaces_page_block_title_recommended_entries_view_showcase', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:18:"browse_recommended";}', 1, 0, 0, IFNULL(@iBlockOrder, 0) + 2);
+-- PAGE: service blocks
+SET @iBlockOrder = (SELECT `order` FROM `sys_pages_blocks` WHERE `object` = '' AND `cell_id` = 0 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES
+('', 0, 'bx_spaces', '', '_bx_spaces_page_block_title_categories', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:15:"categories_list";s:6:"params";a:2:{i:0;s:14:"bx_spaces_cats";i:1;a:2:{s:10:\"show_empty\";b:1;s:21:\"show_empty_categories\";b:1;}}s:5:"class";s:20:"TemplServiceCategory";}', 1, 1, 1, IFNULL(@iBlockOrder, 0) + 1),
+('', 0, 'bx_spaces', '_bx_spaces_page_block_title_sys_featured_entries_view_showcase', '_bx_spaces_page_block_title_featured_entries_view_showcase', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:15:\"browse_featured\";s:6:\"params\";a:3:{s:9:\"unit_view\";s:8:\"showcase\";s:13:\"empty_message\";b:0;s:13:\"ajax_paginate\";b:0;}}', 0, 1, 1, IFNULL(@iBlockOrder, 0) + 2),
+('', 0, 'bx_spaces', '_bx_spaces_page_block_title_sys_recommended_entries_view_showcase', '_bx_spaces_page_block_title_recommended_entries_view_showcase', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:18:\"browse_recommended\";s:6:\"params\";a:3:{s:9:\"unit_view\";s:8:\"showcase\";s:13:\"empty_message\";b:0;s:13:\"ajax_paginate\";b:0;}}', 0, 1, 1, IFNULL(@iBlockOrder, 0) + 3);
+
+-- MENU
+
+-- MENU: add to site menu
+
+SET @iSiteMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_site' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
+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 
+('sys_site', 'bx_spaces', 'spaces-home', '_bx_spaces_menu_item_title_system_entries_home', '_bx_spaces_menu_item_title_entries_home', 'page.php?i=spaces-home', '', '', 'object-group col-red2', 'bx_spaces_submenu', 2147483647, 1, 1, IFNULL(@iSiteMenuOrder, 0) + 1);
+
+-- MENU: add to homepage menu
+
+SET @iHomepageMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_homepage' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
+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 
+('sys_homepage', 'bx_spaces', 'spaces-home', '_bx_spaces_menu_item_title_system_entries_home', '_bx_spaces_menu_item_title_entries_home', 'page.php?i=spaces-home', '', '', 'object-group col-red2', 'bx_spaces_submenu', 2147483647, 1, 1, IFNULL(@iHomepageMenuOrder, 0) + 1);
+
+-- MENU: add to "add content" menu
+
+SET @iAddMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_add_content_links' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
+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 
+('sys_add_content_links', 'bx_spaces', 'create-space-profile', '_bx_spaces_menu_item_title_system_create_profile', '_bx_spaces_menu_item_title_create_profile', 'page.php?i=create-space-profile', '', '', 'object-group col-red2', '', 2147483647, 1, 1, IFNULL(@iAddMenuOrder, 0) + 1);
+
+-- MENU: view actions
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_view_actions', '_bx_spaces_menu_title_view_profile_actions', 'bx_spaces_view_actions', 'bx_spaces', 9, 0, 1, 'BxSpacesMenuView', 'modules/boonex/spaces/classes/BxSpacesMenuView.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_spaces_view_actions', 'bx_spaces', '_bx_spaces_menu_set_title_view_profile_actions', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `submenu_popup`, `visible_for_levels`, `active`, `copyable`, `editable`, `order`) VALUES 
+('bx_spaces_view_actions', 'bx_spaces', 'profile-fan-add', '_bx_spaces_menu_item_title_system_become_fan', '{title_add_fan}', 'javascript:void(0)', 'bx_conn_action(this, \'bx_spaces_fans\', \'add\', \'{profile_id}\')', '', 'user-plus', '', 0, 2147483647, 1, 0, 0, 5),
+('bx_spaces_view_actions', 'bx_spaces', 'profile-subscribe-add', '_bx_spaces_menu_item_title_system_subscribe', '_bx_spaces_menu_item_title_subscribe', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_subscriptions\', \'add\', \'{profile_id}\')', '', 'check', '', 0, 2147483647, 1, 0, 1, 20),
+('bx_spaces_view_actions', 'bx_spaces', 'profile-actions-more', '_bx_spaces_menu_item_title_system_more_actions', '_bx_spaces_menu_item_title_more_actions', 'javascript:void(0)', 'bx_menu_popup(''bx_spaces_view_actions_more'', this, {}, {profile_id:{profile_id}});', '', 'cog', 'bx_spaces_view_actions_more', 1, 2147483647, 1, 0, 1, 9999);
+
+-- MENU: view actions more
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_view_actions_more', '_bx_spaces_menu_title_view_profile_actions_more', 'bx_spaces_view_actions_more', 'bx_spaces', 6, 0, 1, 'BxSpacesMenuView', 'modules/boonex/spaces/classes/BxSpacesMenuView.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_spaces_view_actions_more', 'bx_spaces', '_bx_spaces_menu_set_title_view_profile_actions_more', 0);
+
+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_spaces_view_actions_more', 'bx_spaces', 'profile-fan-remove', '_bx_spaces_menu_item_title_system_leave_space', '{title_remove_fan}', 'javascript:void(0)', 'bx_conn_action(this, \'bx_spaces_fans\', \'remove\', \'{profile_id}\')', '', 'user-times', '', 2147483647, 1, 0, 10),
+('bx_spaces_view_actions_more', 'bx_spaces', 'profile-subscribe-remove', '_bx_spaces_menu_item_title_system_unsubscribe', '_bx_spaces_menu_item_title_unsubscribe', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_subscriptions\', \'remove\', \'{profile_id}\')', '', 'check', '', 2147483647, 1, 0, 20),
+('bx_spaces_view_actions_more', 'bx_spaces', 'edit-space-cover', '_bx_spaces_menu_item_title_system_edit_cover', '_bx_spaces_menu_item_title_edit_cover', 'page.php?i=edit-space-cover&id={content_id}', '', '', 'pencil', '', 2147483647, 1, 0, 30),
+('bx_spaces_view_actions_more', 'bx_spaces', 'edit-space-profile', '_bx_spaces_menu_item_title_system_edit_profile', '_bx_spaces_menu_item_title_edit_profile', 'page.php?i=edit-space-profile&id={content_id}', '', '', 'pencil', '', 2147483647, 1, 0, 40),
+('bx_spaces_view_actions_more', 'bx_spaces', 'invite-to-space', '_bx_spaces_menu_item_title_system_invite', '_bx_spaces_menu_item_title_invite', 'page.php?i=invite-to-space&id={content_id}', '', '', 'user-plus', '', 2147483647, 1, 0, 42),
+('bx_spaces_view_actions_more', 'bx_spaces', 'delete-space-profile', '_bx_spaces_menu_item_title_system_delete_profile', '_bx_spaces_menu_item_title_delete_profile', 'page.php?i=delete-space-profile&id={content_id}', '', '', 'remove', '', 2147483647, 1, 0, 50);
+
+-- MENU: actions menu for my entries
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_my', '_bx_spaces_menu_title_entries_my', 'bx_spaces_my', 'bx_spaces', 9, 0, 1, 'BxSpacesMenu', 'modules/boonex/spaces/classes/BxSpacesMenu.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_spaces_my', 'bx_spaces', '_bx_spaces_menu_set_title_entries_my', 0);
+
+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_spaces_my', 'bx_spaces', 'create-space-profile', '_bx_spaces_menu_item_title_system_create_profile', '_bx_spaces_menu_item_title_create_profile', 'page.php?i=create-space-profile', '', '', 'plus', '', 2147483647, 1, 0, 0);
+
+-- MENU: module sub-menu
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_submenu', '_bx_spaces_menu_title_submenu', 'bx_spaces_submenu', 'bx_spaces', 8, 0, 1, '', '');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_spaces_submenu', 'bx_spaces', '_bx_spaces_menu_set_title_submenu', 0);
+
+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_spaces_submenu', 'bx_spaces', 'spaces-home', '_bx_spaces_menu_item_title_system_entries_recent', '_bx_spaces_menu_item_title_entries_recent', 'page.php?i=spaces-home', '', '', '', '', 2147483647, 1, 1, 1),
+('bx_spaces_submenu', 'bx_spaces', 'spaces-top', '_bx_spaces_menu_item_title_system_entries_top', '_bx_spaces_menu_item_title_entries_top', 'page.php?i=spaces-top', '', '', '', '', 2147483647, 1, 1, 2),
+('bx_spaces_submenu', 'bx_spaces', 'spaces-search', '_bx_spaces_menu_item_title_system_entries_search', '_bx_spaces_menu_item_title_entries_search', 'page.php?i=spaces-search', '', '', '', '', 2147483647, 1, 1, 3),
+('bx_spaces_submenu', 'bx_spaces', 'spaces-manage', '_bx_spaces_menu_item_title_system_entries_manage', '_bx_spaces_menu_item_title_entries_manage', 'page.php?i=spaces-manage', '', '', '', '', 2147483646, 1, 1, 4);
+
+-- MENU: view submenu
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_view_submenu', '_bx_spaces_menu_title_view_profile_submenu', 'bx_spaces_view_submenu', 'bx_spaces', 8, 0, 1, 'BxSpacesMenuView', 'modules/boonex/spaces/classes/BxSpacesMenuView.php'),
+('bx_spaces_view_submenu_cover', '_bx_spaces_menu_title_view_profile_submenu_cover', 'bx_spaces_view_submenu', 'bx_spaces', 7, 0, 1, 'BxSpacesMenuView', 'modules/boonex/spaces/classes/BxSpacesMenuView.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_spaces_view_submenu', 'bx_spaces', '_bx_spaces_menu_set_title_view_profile_submenu', 0);
+
+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_spaces_view_submenu', 'bx_spaces', 'view-space-profile', '_bx_spaces_menu_item_title_system_view_profile_view', '_bx_spaces_menu_item_title_view_profile_view', 'page.php?i=view-space-profile&id={content_id}', '', '', 'object-group col-red2', '', 2147483647, 1, 0, 1),
+('bx_spaces_view_submenu', 'bx_spaces', 'space-profile-info', '_bx_spaces_menu_item_title_system_view_profile_info', '_bx_spaces_menu_item_title_view_profile_info', 'page.php?i=space-profile-info&id={content_id}', '', '', 'info-circle col-gray', '', 2147483647, 1, 0, 2),
+('bx_spaces_view_submenu', 'bx_spaces', 'space-profile-comments', '_bx_spaces_menu_item_title_system_view_profile_comments', '_bx_spaces_menu_item_title_view_profile_comments', 'page.php?i=space-profile-comments&id={content_id}', '', '', '', '', 2147483647, 0, 0, 3),
+('bx_spaces_view_submenu', 'bx_spaces', 'space-fans', '_bx_spaces_menu_item_title_system_view_fans', '_bx_spaces_menu_item_title_view_fans', 'page.php?i=space-fans&profile_id={profile_id}', '', '', 'object-group col-blue3', '', 2147483647, 1, 0, 4);
+
+-- MENU: custom menu for snippet meta info
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_snippet_meta', '_sys_menu_title_snippet_meta', 'bx_spaces_snippet_meta', 'bx_spaces', 15, 0, 1, 'BxSpacesMenuSnippetMeta', 'modules/boonex/spaces/classes/BxSpacesMenuSnippetMeta.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_spaces_snippet_meta', 'bx_spaces', '_sys_menu_set_title_snippet_meta', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `editable`, `order`) VALUES
+('bx_spaces_snippet_meta', 'bx_spaces', 'join', '_sys_menu_item_title_system_sm_join', '_sys_menu_item_title_sm_join', '', '', '', '', '', 2147483647, 1, 0, 1, 1),
+('bx_spaces_snippet_meta', 'bx_spaces', 'leave', '_sys_menu_item_title_system_sm_leave', '_sys_menu_item_title_sm_leave', '', '', '', '', '', 2147483647, 0, 0, 1, 2),
+('bx_spaces_snippet_meta', 'bx_spaces', 'subscribe', '_sys_menu_item_title_system_sm_subscribe', '_sys_menu_item_title_sm_subscribe', '', '', '', '', '', 2147483647, 0, 0, 1, 3),
+('bx_spaces_snippet_meta', 'bx_spaces', 'unsubscribe', '_sys_menu_item_title_system_sm_unsubscribe', '_sys_menu_item_title_sm_unsubscribe', '', '', '', '', '', 2147483647, 0, 0, 1, 4),
+('bx_spaces_snippet_meta', 'bx_spaces', 'date', '_sys_menu_item_title_system_sm_date', '_sys_menu_item_title_sm_date', '', '', '', '', '', 2147483647, 0, 0, 1, 5),
+('bx_spaces_snippet_meta', 'bx_spaces', 'tags', '_sys_menu_item_title_system_sm_tags', '_sys_menu_item_title_sm_tags', '', '', '', '', '', 2147483647, 0, 0, 1, 6),
+('bx_spaces_snippet_meta', 'bx_spaces', 'views', '_sys_menu_item_title_system_sm_views', '_sys_menu_item_title_sm_views', '', '', '', '', '', 2147483647, 0, 0, 1, 7),
+('bx_spaces_snippet_meta', 'bx_spaces', 'comments', '_sys_menu_item_title_system_sm_comments', '_sys_menu_item_title_sm_comments', '', '', '', '', '', 2147483647, 0, 0, 1, 8),
+('bx_spaces_snippet_meta', 'bx_spaces', 'members', '_sys_menu_item_title_system_sm_members', '_sys_menu_item_title_sm_members', '', '', '', '', '', 2147483647, 1, 0, 1, 9),
+('bx_spaces_snippet_meta', 'bx_spaces', 'subscribers', '_sys_menu_item_title_system_sm_subscribers', '_sys_menu_item_title_sm_subscribers', '', '', '', '', '', 2147483647, 0, 0, 1, 10);
+
+-- MENU: profile stats
+SET @iNotifMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name` = 'sys_profile_stats' AND `active` = 1 LIMIT 1);
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
+('sys_profile_stats', 'bx_spaces', 'profile-stats-manage-spaces', '_bx_spaces_menu_item_title_system_manage_my_spaces', '_bx_spaces_menu_item_title_manage_my_spaces', 'page.php?i=spaces-manage', '', '_self', 'object-group col-red2', 'a:2:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:41:"get_menu_addon_manage_tools_profile_stats";}', '', 2147483646, 1, 0, @iNotifMenuOrder + 2);
+
+-- MENU: manage tools submenu
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_menu_manage_tools', '_bx_spaces_menu_title_manage_tools', 'bx_spaces_menu_manage_tools', 'bx_spaces', 6, 0, 1, 'BxSpacesMenuManageTools', 'modules/boonex/spaces/classes/BxSpacesMenuManageTools.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_spaces_menu_manage_tools', 'bx_spaces', '_bx_spaces_menu_set_title_manage_tools', 0);
+
+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_spaces_menu_manage_tools', 'bx_spaces', 'delete', '_bx_spaces_menu_item_title_system_delete', '_bx_spaces_menu_item_title_delete', 'javascript:void(0)', 'javascript:{js_object}.onClickDelete({content_id});', '_self', 'trash-o', '', 2147483647, 1, 0, 1),
+('bx_spaces_menu_manage_tools', 'bx_spaces', 'delete-with-content', '_bx_spaces_menu_item_title_system_delete_with_content', '_bx_spaces_menu_item_title_delete_with_content', 'javascript:void(0)', 'javascript:{js_object}.onClickDeleteWithContent({content_id});', '_self', 'trash-o', '', 2147483647, 1, 0, 2);
+
+-- MENU: dashboard manage tools
+SET @iManageMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name`='sys_account_dashboard_manage_tools' LIMIT 1);
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('sys_account_dashboard_manage_tools', 'bx_spaces', 'spaces-administration', '_bx_spaces_menu_item_title_system_admt_spaces', '_bx_spaces_menu_item_title_admt_spaces', 'page.php?i=spaces-administration', '', '_self', '', 'a:2:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:27:"get_menu_addon_manage_tools";}', '', 192, 1, 0, @iManageMenuOrder + 1);
+
+-- MENU: add menu item to profiles modules (trigger* menu sets are processed separately upon modules enable/disable)
+
+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 
+('trigger_profile_view_submenu', 'bx_spaces', 'joined-spaces', '_bx_spaces_menu_item_title_system_view_joined_spaces', '_bx_spaces_menu_item_title_view_joined_spaces', 'page.php?i=joined-spaces&profile_id={profile_id}', '', '', 'object-group col-red2', '', 2147483647, 1, 0, 0);
+
+-- ACL
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_spaces', 'create entry', NULL, '_bx_spaces_acl_action_create_profile', '', 1, 1);
+SET @iIdActionProfileCreate = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_spaces', 'delete entry', NULL, '_bx_spaces_acl_action_delete_profile', '', 1, 1);
+SET @iIdActionProfileDelete = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_spaces', 'view entry', NULL, '_bx_spaces_acl_action_view_profile', '', 1, 0);
+SET @iIdActionProfileView = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_spaces', 'edit any entry', NULL, '_bx_spaces_acl_action_edit_any_profile', '', 1, 3);
+SET @iIdActionProfileEditAny = LAST_INSERT_ID();
+
+SET @iUnauthenticated = 1;
+SET @iAccount = 2;
+SET @iStandard = 3;
+SET @iUnconfirmed = 4;
+SET @iPending = 5;
+SET @iSuspended = 6;
+SET @iModerator = 7;
+SET @iAdministrator = 8;
+SET @iPremium = 9;
+
+INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
+
+-- profile create
+(@iAccount, @iIdActionProfileCreate),
+(@iStandard, @iIdActionProfileCreate),
+(@iUnconfirmed, @iIdActionProfileCreate),
+(@iPending, @iIdActionProfileCreate),
+(@iModerator, @iIdActionProfileCreate),
+(@iAdministrator, @iIdActionProfileCreate),
+(@iPremium, @iIdActionProfileCreate),
+
+-- profile delete
+(@iAccount, @iIdActionProfileDelete),
+(@iStandard, @iIdActionProfileDelete),
+(@iUnconfirmed, @iIdActionProfileDelete),
+(@iPending, @iIdActionProfileDelete),
+(@iModerator, @iIdActionProfileDelete),
+(@iAdministrator, @iIdActionProfileDelete),
+(@iPremium, @iIdActionProfileDelete),
+
+-- profile view
+(@iUnauthenticated, @iIdActionProfileView),
+(@iAccount, @iIdActionProfileView),
+(@iStandard, @iIdActionProfileView),
+(@iUnconfirmed, @iIdActionProfileView),
+(@iPending, @iIdActionProfileView),
+(@iModerator, @iIdActionProfileView),
+(@iAdministrator, @iIdActionProfileView),
+(@iPremium, @iIdActionProfileView),
+
+-- any profile edit
+(@iModerator, @iIdActionProfileEditAny),
+(@iAdministrator, @iIdActionProfileEditAny);
+
+
+-- COMMENTS
+INSERT INTO `sys_objects_cmts` (`Name`, `Module`, `Table`, `CharsPostMin`, `CharsPostMax`, `CharsDisplayMax`, `Html`, `PerView`, `PerViewReplies`, `BrowseType`, `IsBrowseSwitch`, `PostFormPosition`, `NumberOfLevels`, `IsDisplaySwitch`, `IsRatable`, `ViewingThreshold`, `IsOn`, `RootStylePrefix`, `BaseUrl`, `ObjectVote`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldTitle`, `TriggerFieldComments`, `ClassName`, `ClassFile`) VALUES
+('bx_spaces', 'bx_spaces', 'bx_spaces_cmts', 1, 5000, 1000, 3, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-space-profile&id={object_id}', '', 'bx_spaces_data', 'id', 'author', 'space_name', 'comments', '', '');
+
+-- VIEWS
+INSERT INTO `sys_objects_view` (`name`, `table_track`, `period`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_spaces', 'bx_spaces_views_track', '86400', '1', 'bx_spaces_data', 'id', 'author', 'views', '', '');
+
+-- VOTES
+INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES 
+('bx_spaces', 'bx_spaces_votes', 'bx_spaces_votes_track', '604800', '1', '1', '0', '1', 'bx_spaces_data', 'id', 'author', 'rate', 'votes', '', '');
+
+-- SCORES
+INSERT INTO `sys_objects_score` (`name`, `module`, `table_main`, `table_track`, `post_timeout`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_score`, `trigger_field_cup`, `trigger_field_cdown`, `class_name`, `class_file`) VALUES 
+('bx_spaces', 'bx_spaces', 'bx_spaces_scores', 'bx_spaces_scores_track', '604800', '0', 'bx_spaces_data', 'id', 'author', 'score', 'sc_up', 'sc_down', '', '');
+
+-- REPORTS
+INSERT INTO `sys_objects_report` (`name`, `table_main`, `table_track`, `is_on`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_spaces', 'bx_spaces_reports', 'bx_spaces_reports_track', '1', 'page.php?i=view-space-profile&id={object_id}', 'bx_spaces_data', 'id', 'author', 'reports', '', '');
+
+-- FAFORITES
+INSERT INTO `sys_objects_favorite` (`name`, `table_track`, `is_on`, `is_undo`, `is_public`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_spaces', 'bx_spaces_favorites_track', '1', '1', '1', 'page.php?i=view-space-profile&id={object_id}', 'bx_spaces_data', 'id', 'author', 'favorites', '', '');
+
+-- FEATURED
+INSERT INTO `sys_objects_feature` (`name`, `is_on`, `is_undo`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_flag`, `class_name`, `class_file`) VALUES 
+('bx_spaces', '1', '1', 'page.php?i=view-space-profile&id={object_id}', 'bx_spaces_data', 'id', 'author', 'featured', '', '');
+
+-- METATAGS
+INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_spaces', 'bx_spaces_meta_keywords', '', 'bx_spaces_meta_mentions', '', '');
+
+-- CATEGORY
+INSERT INTO `sys_objects_category` (`object`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
+('bx_spaces_cats', 'bx_spaces', 'bx_space', 'bx_spaces_cats', 'bx_spaces_data', 'space_cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`content_id` = `bx_spaces_data`.`id` AND `sys_profiles`.`type` = ''bx_spaces'')', 'AND `sys_profiles`.`status` = ''active''', '', '');
+
+-- SEARCH
+SET @iSearchOrder = (SELECT IFNULL(MAX(`Order`), 0) FROM `sys_objects_search`);
+INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `Order`, `ClassName`, `ClassPath`) VALUES
+('bx_spaces', '_bx_spaces', @iSearchOrder + 1, 'BxSpacesSearchResult', 'modules/boonex/spaces/classes/BxSpacesSearchResult.php');
+
+-- CONNECTIONS
+INSERT INTO `sys_objects_connection` (`object`, `table`, `type`, `override_class_name`, `override_class_file`) VALUES
+('bx_spaces_fans', 'bx_spaces_fans', 'mutual', '', '');
+
+-- STATS
+SET @iMaxOrderStats = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_statistics`);
+INSERT INTO `sys_statistics` (`module`, `name`, `title`, `link`, `icon`, `query`, `order`) VALUES 
+('bx_spaces', 'bx_spaces', '_bx_spaces', 'page.php?i=spaces-home', 'object-group col-red2', 'SELECT COUNT(*) FROM `bx_spaces_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id` = `tp`.`content_id` AND `tp`.`type`=''bx_spaces'' WHERE 1 AND `tp`.`status`=''active''', @iMaxOrderStats + 1);
+
+-- CHARTS
+SET @iMaxOrderCharts = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_objects_chart`);
+INSERT INTO `sys_objects_chart` (`object`, `title`, `table`, `field_date_ts`, `field_date_dt`, `field_status`, `query`, `active`, `order`, `class_name`, `class_file`) VALUES
+('bx_spaces_growth', '_bx_spaces_chart_growth', 'bx_spaces_data', 'added', '', '', 'SELECT {field_date_formatted} AS `period`, COUNT(*) AS {object} FROM {table} LEFT JOIN `sys_profiles` AS `tp` ON {table}.`id` = `tp`.`content_id` AND `tp`.`type`=''bx_spaces'' WHERE 1 AND `tp`.`status`=''active'' {where_inteval} GROUP BY `period` ORDER BY {table}.{field_date} ASC', 1, @iMaxOrderCharts + 1, 'BxDolChartGrowth', ''),
+('bx_spaces_growth_speed', '_bx_spaces_chart_growth_speed', 'bx_spaces_data', 'added', '', '', 'SELECT {field_date_formatted} AS `period`, COUNT(*) AS {object} FROM {table} LEFT JOIN `sys_profiles` AS `tp` ON {table}.`id` = `tp`.`content_id` AND `tp`.`type`=''bx_spaces'' WHERE 1 AND `tp`.`status`=''active'' {where_inteval} GROUP BY `period` ORDER BY {table}.{field_date} ASC', 1, @iMaxOrderCharts + 2, 'BxDolChartGrowthSpeed', '');
+
+-- GRID: connections
+INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
+('bx_spaces_fans', 'Sql', 'SELECT `p`.`id`, `c`.`added`, `c`.`mutual` FROM `sys_profiles` AS `p` INNER JOIN `sys_accounts` AS `a` ON (`a`.`id` = `p`.`account_id`) {join_connections}', 'sys_profiles', 'id', 'c`.`added', '', '', 10, NULL, 'start', '', 'name,email', '', 'auto', '', '', 2147483647, 'BxSpacesGridConnections', 'modules/boonex/spaces/classes/BxSpacesGridConnections.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `params`, `order`) VALUES
+('bx_spaces_fans', 'name', '_sys_name', '50%', '', 10),
+('bx_spaces_fans', 'actions', '', '50%', '', 20);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `confirm`, `order`) VALUES
+('bx_spaces_fans', 'single', 'accept', '_sys_accept', '', 0, 10),
+('bx_spaces_fans', 'single', 'to_admins', '_bx_spaces_txt_to_admins', '', 0, 20),
+('bx_spaces_fans', 'single', 'from_admins', '_bx_spaces_txt_from_admins', '', 0, 30),
+('bx_spaces_fans', 'single', 'delete', '', 'remove', 1, 40);
+
+-- GRIDS: administration
+
+INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
+('bx_spaces_administration', 'Sql', 'SELECT `td`.*, `td`.`space_name` AS `name`, `ta`.`email` AS `account`, `td`.`added` AS `added_ts`, `tp`.`status` AS `status` FROM `bx_spaces_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id`=`tp`.`content_id` AND `tp`.`type`=''bx_spaces'' LEFT JOIN `sys_accounts` AS `ta` ON `tp`.`account_id`=`ta`.`id` WHERE 1 ', 'bx_spaces_data', 'id', 'added', 'status', '', 20, NULL, 'start', '', 'space_name', '', 'like', '', '', 192, 'BxSpacesGridAdministration', 'modules/boonex/spaces/classes/BxSpacesGridAdministration.php'),
+('bx_spaces_common', 'Sql', 'SELECT `td`.*, `td`.`space_name` AS `name`, `ta`.`email` AS `account`, `td`.`added` AS `added_ts`, `tp`.`status` AS `status` FROM `bx_spaces_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id`=`tp`.`content_id` AND `tp`.`type`=''bx_spaces'' LEFT JOIN `sys_accounts` AS `ta` ON `tp`.`account_id`=`ta`.`id` WHERE 1 ', 'bx_spaces_data', 'id', 'added', 'status', '', 20, NULL, 'start', '', 'space_name', '', 'like', '', '', 2147483647, 'BxSpacesGridCommon', 'modules/boonex/spaces/classes/BxSpacesGridCommon.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('bx_spaces_administration', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
+('bx_spaces_administration', 'switcher', '_bx_spaces_grid_column_title_adm_active', '8%', 0, '', '', 2),
+('bx_spaces_administration', 'name', '_bx_spaces_grid_column_title_adm_name', '25%', 0, '', '', 3),
+('bx_spaces_administration', 'added_ts', '_bx_spaces_grid_column_title_adm_added', '20%', 1, '25', '', 4),
+('bx_spaces_administration', 'account', '_bx_spaces_grid_column_title_adm_account', '25%', 0, '25', '', 5),
+('bx_spaces_administration', 'actions', '', '20%', 0, '', '', 6),
+('bx_spaces_common', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
+('bx_spaces_common', 'name', '_bx_spaces_grid_column_title_adm_name', '48%', 0, '', '', 2),
+('bx_spaces_common', 'added_ts', '_bx_spaces_grid_column_title_adm_added', '30%', 1, '25', '', 3),
+('bx_spaces_common', 'actions', '', '20%', 0, '', '', 4);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon_only`, `confirm`, `order`) VALUES
+('bx_spaces_administration', 'bulk', 'delete', '_bx_spaces_grid_action_title_adm_delete', '', 0, 1, 2),
+('bx_spaces_administration', 'bulk', 'delete_with_content', '_bx_spaces_grid_action_title_adm_delete_with_content', '', 0, 1, 3),
+('bx_spaces_administration', 'single', 'settings', '_bx_spaces_grid_action_title_adm_more_actions', 'cog', 1, 0, 2),
+('bx_spaces_common', 'bulk', 'delete', '_bx_spaces_grid_action_title_adm_delete', '', 0, 1, 1),
+('bx_spaces_common', 'bulk', 'delete_with_content', '_bx_spaces_grid_action_title_adm_delete_with_content', '', 0, 1, 2),
+('bx_spaces_common', 'single', 'settings', '_bx_spaces_grid_action_title_adm_more_actions', 'cog', 1, 0, 1);
+
+
+-- ALERTS
+
+INSERT INTO `sys_alerts_handlers` (`name`, `class`, `file`, `service_call`) VALUES 
+('bx_spaces', 'BxSpacesAlertsResponse', 'modules/boonex/spaces/classes/BxSpacesAlertsResponse.php', '');
+SET @iHandler := LAST_INSERT_ID();
+
+INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
+('system', 'save_setting', @iHandler),
+('bx_timeline', 'post_common', @iHandler),
+('bx_spaces_pics', 'file_deleted', @iHandler),
+('bx_spaces_fans', 'connection_added', @iHandler),
+('bx_spaces_fans', 'connection_removed', @iHandler),
+('profile', 'delete', @iHandler),
+('bx_spaces', 'fan_added', @iHandler),
+('bx_spaces', 'join_invitation', @iHandler),
+('bx_spaces', 'join_request', @iHandler),
+('bx_spaces', 'join_request_accepted', @iHandler),
+('bx_spaces', 'timeline_view', @iHandler),
+('bx_spaces', 'timeline_post', @iHandler),
+('bx_spaces', 'timeline_delete', @iHandler),
+('bx_spaces', 'timeline_comment', @iHandler),
+('bx_spaces', 'timeline_vote', @iHandler),
+('bx_spaces', 'timeline_report', @iHandler),
+('bx_spaces', 'timeline_repost', @iHandler);
+
+-- PRIVACY 
+
+INSERT INTO `sys_objects_privacy` (`object`, `module`, `action`, `title`, `default_group`, `spaces`, `table`, `table_field_id`, `table_field_author`, `override_class_name`, `override_class_file`) VALUES
+('bx_spaces_allow_view_to', 'bx_spaces', 'view', '_bx_spaces_form_profile_input_allow_view_to', '3', '', 'bx_spaces_data', 'id', 'author', 'BxSpacesPrivacy', 'modules/boonex/spaces/classes/BxSpacesPrivacy.php'),
+('bx_spaces_allow_view_notification_to', 'bx_spaces', 'view_event', '_bx_spaces_form_profile_input_allow_view_notification_to', '3', '', 'bx_notifications_events', 'id', 'object_owner_id', 'BxSpacesPrivacyNotifications', 'modules/boonex/spaces/classes/BxSpacesPrivacyNotifications.php');
+
+-- EMAIL TEMPLATES
+
+INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `Body`) VALUES
+('bx_spaces', '_bx_spaces_email_join_request', 'bx_spaces_join_request', '_bx_spaces_email_join_request_subject', '_bx_spaces_email_join_request_body'),
+('bx_spaces', '_bx_spaces_email_join_reject', 'bx_spaces_join_reject', '_bx_spaces_email_join_reject_subject', '_bx_spaces_email_join_reject_body'),
+('bx_spaces', '_bx_spaces_email_join_confirm', 'bx_spaces_join_confirm', '_bx_spaces_email_join_confirm_subject', '_bx_spaces_email_join_confirm_body'),
+('bx_spaces', '_bx_spaces_email_fan_remove', 'bx_spaces_fan_remove', '_bx_spaces_email_fan_remove_subject', '_bx_spaces_email_fan_remove_body'),
+('bx_spaces', '_bx_spaces_email_fan_become_admin', 'bx_spaces_fan_become_admin', '_bx_spaces_email_fan_become_admin_subject', '_bx_spaces_email_fan_become_admin_body'),
+('bx_spaces', '_bx_spaces_email_admin_become_fan', 'bx_spaces_admin_become_fan', '_bx_spaces_email_admin_become_fan_subject', '_bx_spaces_email_admin_become_fan_body'),
+('bx_spaces', '_bx_spaces_email_invitation', 'bx_spaces_invitation', '_bx_spaces_email_invitation_subject', '_bx_spaces_email_invitation_body');
+
+-- UPLOADERS
+
+INSERT INTO `sys_objects_uploader` (`object`, `active`, `override_class_name`, `override_class_file`) VALUES
+('bx_spaces_cover_crop', 1, 'BxSpacesUploaderCoverCrop', 'modules/boonex/spaces/classes/BxSpacesUploaderCoverCrop.php'),
+('bx_spaces_picture_crop', 1, 'BxSpacesUploaderPictureCrop', 'modules/boonex/spaces/classes/BxSpacesUploaderPictureCrop.php');
+

+ 337 - 0
modules/boonex/spaces/install/sql/install.sql

@@ -0,0 +1,337 @@
+SET @sStorageEngine = (SELECT `value` FROM `sys_options` WHERE `name` = 'sys_storage_default');
+
+-- TABLE: PROFILES
+CREATE TABLE IF NOT EXISTS `bx_spaces_data` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `author` int(10) unsigned NOT NULL,
+  `parent_space` int(10) unsigned NOT NULL  default '0',
+  `level` int(10) unsigned NOT NULL  default '0',
+  `added` int(11) NOT NULL,
+  `changed` int(11) NOT NULL,
+  `picture` int(11) NOT NULL,
+  `cover` int(11) NOT NULL,
+  `space_name` varchar(255) NOT NULL,
+  `space_cat` int(11) NOT NULL,
+  `space_desc` text NOT NULL,
+  `views` int(11) NOT NULL default '0',
+  `rate` float NOT NULL default '0',
+  `votes` int(11) NOT NULL default '0',
+  `score` int(11) NOT NULL default '0',
+  `sc_up` int(11) NOT NULL default '0',
+  `sc_down` int(11) NOT NULL default '0',
+  `favorites` int(11) NOT NULL default '0',
+  `comments` int(11) NOT NULL default '0',
+  `reports` int(11) NOT NULL default '0',
+  `featured` int(11) NOT NULL default '0',
+  `join_confirmation` tinyint(4) NOT NULL DEFAULT '1',
+  `allow_view_to` varchar(255) DEFAULT NULL,
+  PRIMARY KEY (`id`),
+  FULLTEXT KEY `search_fields` (`space_name`, `space_desc`)
+);
+
+-- TABLE: STORAGES & TRANSCODERS
+CREATE TABLE `bx_spaces_pics` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `profile_id` int(10) unsigned NOT NULL,
+  `remote_id` varchar(128) NOT NULL,
+  `path` varchar(255) NOT NULL,
+  `file_name` varchar(255) NOT NULL,
+  `mime_type` varchar(128) NOT NULL,
+  `ext` varchar(32) NOT NULL,
+  `size` int(11) NOT NULL,
+  `added` int(11) NOT NULL,
+  `modified` int(11) NOT NULL,
+  `private` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `remote_id` (`remote_id`)
+);
+
+CREATE TABLE `bx_spaces_pics_resized` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `profile_id` int(10) unsigned NOT NULL,
+  `remote_id` varchar(128) NOT NULL,
+  `path` varchar(255) NOT NULL,
+  `file_name` varchar(255) NOT NULL,
+  `mime_type` varchar(128) NOT NULL,
+  `ext` varchar(32) NOT NULL,
+  `size` int(11) NOT NULL,
+  `added` int(11) NOT NULL,
+  `modified` int(11) NOT NULL,
+  `private` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `remote_id` (`remote_id`)
+);
+
+-- TABLE: comments
+CREATE TABLE IF NOT EXISTS `bx_spaces_cmts` (
+  `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
+  `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_object_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_author_id` int(10) unsigned NOT NULL DEFAULT '0',
+  `cmt_level` int(11) NOT NULL DEFAULT '0',
+  `cmt_text` text NOT NULL,
+  `cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
+  `cmt_rate` int(11) NOT NULL DEFAULT '0',
+  `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
+  `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
+  `cmt_replies` int(11) NOT NULL DEFAULT '0',
+  PRIMARY KEY (`cmt_id`),
+  KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
+  FULLTEXT KEY `search_fields` (`cmt_text`)
+);
+
+-- TABLE: VIEWS
+CREATE TABLE `bx_spaces_views_track` (
+  `object_id` int(11) NOT NULL default '0',
+  `viewer_id` int(11) NOT NULL default '0',
+  `viewer_nip` int(11) unsigned NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
+);
+
+-- TABLE: VOTES
+CREATE TABLE IF NOT EXISTS `bx_spaces_votes` (
+  `object_id` int(11) NOT NULL default '0',
+  `count` int(11) NOT NULL default '0',
+  `sum` int(11) NOT NULL default '0',
+  UNIQUE KEY `object_id` (`object_id`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_spaces_votes_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `author_nip` int(11) unsigned NOT NULL default '0',
+  `value` tinyint(4) NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `vote` (`object_id`, `author_nip`)
+);
+
+-- TABLE: REPORTS
+CREATE TABLE IF NOT EXISTS `bx_spaces_reports` (
+  `object_id` int(11) NOT NULL default '0',
+  `count` int(11) NOT NULL default '0',
+  UNIQUE KEY `object_id` (`object_id`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_spaces_reports_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `author_nip` int(11) unsigned NOT NULL default '0',
+  `type` varchar(32) NOT NULL default '',
+  `text` text NOT NULL default '',
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `report` (`object_id`, `author_nip`)
+);
+
+-- TABLE: metas
+CREATE TABLE `bx_spaces_meta_keywords` (
+  `object_id` int(10) unsigned NOT NULL,
+  `keyword` varchar(255) NOT NULL,
+  KEY `object_id` (`object_id`),
+  KEY `keyword` (`keyword`)
+);
+
+CREATE TABLE `bx_spaces_meta_mentions` (
+  `object_id` int(10) unsigned NOT NULL,
+  `profile_id` int(10) unsigned NOT NULL,
+  KEY `object_id` (`object_id`),
+  KEY `profile_id` (`profile_id`)
+);
+
+-- TABLE: fans
+CREATE TABLE IF NOT EXISTS `bx_spaces_fans` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `initiator` int(11) NOT NULL,
+  `content` int(11) NOT NULL,
+  `mutual` tinyint(4) NOT NULL,
+  `added` int(10) unsigned NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `initiator` (`initiator`,`content`),
+  KEY `content` (`content`)
+);
+
+-- TABLE: admins
+CREATE TABLE IF NOT EXISTS `bx_spaces_admins` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `group_profile_id` int(10) unsigned NOT NULL,
+  `fan_id` int(10) unsigned NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `admin` (`group_profile_id`,`fan_id`)
+);
+
+-- TABLE: favorites
+CREATE TABLE `bx_spaces_favorites_track` (
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  KEY `id` (`object_id`,`author_id`)
+);
+
+-- TABLE: scores
+CREATE TABLE IF NOT EXISTS `bx_spaces_scores` (
+  `object_id` int(11) NOT NULL default '0',
+  `count_up` int(11) NOT NULL default '0',
+  `count_down` int(11) NOT NULL default '0',
+  UNIQUE KEY `object_id` (`object_id`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_spaces_scores_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `author_nip` int(11) unsigned NOT NULL default '0',
+  `type` varchar(8) NOT NULL default '',
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `vote` (`object_id`, `author_nip`)
+);
+
+
+-- STORAGES & TRANSCODERS
+INSERT INTO `sys_objects_storage` (`object`, `engine`, `params`, `token_life`, `cache_control`, `levels`, `table_files`, `ext_mode`, `ext_allow`, `ext_deny`, `quota_size`, `current_size`, `quota_number`, `current_number`, `max_file_size`, `ts`) VALUES
+('bx_spaces_pics', @sStorageEngine, '', 360, 2592000, 3, 'bx_spaces_pics', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
+('bx_spaces_pics_resized', @sStorageEngine, '', 360, 2592000, 3, 'bx_spaces_pics_resized', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0);
+
+INSERT INTO `sys_objects_transcoder` (`object`, `storage_object`, `source_type`, `source_params`, `private`, `atime_tracking`, `atime_pruning`, `ts`) VALUES 
+('bx_spaces_icon', 'bx_spaces_pics_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_spaces_pics";}', 'no', '1', '2592000', '0'),
+('bx_spaces_thumb', 'bx_spaces_pics_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_spaces_pics";}', 'no', '1', '2592000', '0'),
+('bx_spaces_avatar', 'bx_spaces_pics_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_spaces_pics";}', 'no', '1', '2592000', '0'),
+('bx_spaces_picture', 'bx_spaces_pics_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_spaces_pics";}', 'no', '1', '2592000', '0'),
+('bx_spaces_cover', 'bx_spaces_pics_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_spaces_pics";}', 'no', '1', '2592000', '0'),
+('bx_spaces_cover_thumb', 'bx_spaces_pics_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_spaces_pics";}', 'no', '1', '2592000', '0'),
+('bx_spaces_gallery', 'bx_spaces_pics_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_spaces_pics";}', 'no', '1', '2592000', '0');
+
+INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES 
+('bx_spaces_icon', 'Resize', 'a:3:{s:1:"w";s:2:"32";s:1:"h";s:2:"32";s:13:"square_resize";s:1:"1";}', '0'),
+('bx_spaces_thumb', 'Resize', 'a:3:{s:1:"w";s:2:"48";s:1:"h";s:2:"48";s:13:"square_resize";s:1:"1";}', '0'),
+('bx_spaces_avatar', 'Resize', 'a:3:{s:1:"w";s:2:"96";s:1:"h";s:2:"96";s:13:"square_resize";s:1:"1";}', '0'),
+('bx_spaces_picture', 'Resize', 'a:3:{s:1:"w";s:4:"1024";s:1:"h";s:4:"1024";s:13:"square_resize";s:1:"0";}', '0'),
+('bx_spaces_cover', 'Resize', 'a:1:{s:1:"w";s:4:"2000";}', '0'),
+('bx_spaces_cover_thumb', 'Resize', 'a:3:{s:1:"w";s:2:"48";s:1:"h";s:2:"48";s:13:"square_resize";s:1:"1";}', '0'),
+('bx_spaces_gallery', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0');
+
+-- FORMS
+INSERT INTO `sys_objects_form`(`object`, `module`, `title`, `action`, `form_attrs`, `table`, `key`, `uri`, `uri_title`, `submit_name`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_space', 'bx_spaces', '_bx_spaces_form_profile', '', 'a:1:{s:7:\"enctype\";s:19:\"multipart/form-data\";}', 'bx_spaces_data', 'id', '', '', 'do_submit', '', 0, 1, 'BxSpacesFormEntry', 'modules/boonex/spaces/classes/BxSpacesFormEntry.php');
+
+INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES 
+('bx_space', 'bx_space_add', 'bx_spaces', 0, '_bx_spaces_form_profile_display_add'),
+('bx_space', 'bx_space_delete', 'bx_spaces', 0, '_bx_spaces_form_profile_display_delete'),
+('bx_space', 'bx_space_edit', 'bx_spaces', 0, '_bx_spaces_form_profile_display_edit'),
+('bx_space', 'bx_space_edit_cover', 'bx_spaces', 0, '_bx_spaces_form_profile_display_edit_cover'),
+('bx_space', 'bx_space_view', 'bx_spaces', 1, '_bx_spaces_form_profile_display_view'),
+('bx_space', 'bx_space_view_full', 'bx_spaces', 1, '_bx_spaces_form_profile_display_view_full'),
+('bx_space', 'bx_space_invite', 'bx_spaces', 0, '_bx_spaces_form_profile_display_invite');
+
+INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES 
+('bx_space', 'bx_spaces', 'allow_view_to', 3, '', 0, 'custom', '_bx_spaces_form_profile_input_sys_allow_view_to', '_bx_spaces_form_profile_input_allow_view_to', '_bx_spaces_form_profile_input_allow_view_to_desc', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_space', 'bx_spaces', 'delete_confirm', 1, '', 0, 'checkbox', '_bx_spaces_form_profile_input_sys_delete_confirm', '_bx_spaces_form_profile_input_delete_confirm', '_bx_spaces_form_profile_input_delete_confirm_info', 1, 0, 0, '', '', '', 'avail', '', '_bx_spaces_form_profile_input_delete_confirm_error', '', '', 1, 0),
+('bx_space', 'bx_spaces', 'do_submit', '_sys_form_account_input_submit', '', 0, 'submit', '_bx_spaces_form_profile_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_space', 'bx_spaces', 'space_desc', '', '', 0, 'textarea', '_bx_spaces_form_profile_input_sys_space_desc', '_bx_spaces_form_profile_input_space_desc', '', 0, 0, 2, '', '', '', '', '', '', 'XssHtml', '', 1, 1),
+('bx_space', 'bx_spaces', 'space_cat', '', '#!bx_spaces_cats', 0, 'select', '_bx_spaces_form_profile_input_sys_space_cat', '_bx_spaces_form_profile_input_space_cat', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_spaces_form_profile_input_space_cat_err', 'Xss', '', 1, 1),
+('bx_space', 'bx_spaces', 'space_name', '', '', 0, 'text', '_bx_spaces_form_profile_input_sys_space_name', '_bx_spaces_form_profile_input_space_name', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_spaces_form_profile_input_space_name_err', 'Xss', '', 1, 0),
+('bx_space', 'bx_spaces', 'parent_space', '', '', 0, 'custom', '_bx_spaces_form_profile_input_sys_parent_space', '_bx_spaces_form_profile_input_parent_space', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 1),
+('bx_space', 'bx_spaces', 'initial_members', '', '', 0, 'custom', '_bx_spaces_form_profile_input_sys_initial_members', '_bx_spaces_form_profile_input_initial_members', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 1),
+('bx_space', 'bx_spaces', 'join_confirmation', 1, '', 1, 'switcher', '_bx_spaces_form_profile_input_sys_join_confirm', '_bx_spaces_form_profile_input_join_confirm', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
+('bx_space', 'bx_spaces', 'cover', 'a:1:{i:0;s:20:"bx_spaces_cover_crop";}', 'a:1:{s:20:"bx_spaces_cover_crop";s:24:"_sys_uploader_crop_title";}', 0, 'files', '_bx_spaces_form_profile_input_sys_cover', '_bx_spaces_form_profile_input_cover', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_space', 'bx_spaces', 'picture', 'a:1:{i:0;s:22:"bx_spaces_picture_crop";}', 'a:1:{s:22:"bx_spaces_picture_crop";s:24:"_sys_uploader_crop_title";}', 0, 'files', '_bx_spaces_form_profile_input_sys_picture', '_bx_spaces_form_profile_input_picture', '', 0, 0, 0, '', '', '', '', '', '_bx_spaces_form_profile_input_picture_err', '', '', 1, 0);
+
+INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES 
+('bx_space_add', 'delete_confirm', 2147483647, 0, 3),
+('bx_space_add', 'cover', 2147483647, 0, 4),
+('bx_space_add', 'initial_members', 2147483647, 1, 5),
+('bx_space_add', 'picture', 2147483647, 1, 6),
+('bx_space_add', 'space_name', 2147483647, 1, 7),
+('bx_space_add', 'parent_space', 2147483647, 1, 8),
+('bx_space_add', 'space_cat', 2147483647, 1, 9),
+('bx_space_add', 'space_desc', 2147483647, 1, 10),
+('bx_space_add', 'join_confirmation', 2147483647, 1, 11),
+('bx_space_add', 'allow_view_to', 2147483647, 1, 12),
+('bx_space_add', 'do_submit', 2147483647, 1, 13),
+
+('bx_space_invite', 'initial_members', 2147483647, 1, 1),
+('bx_space_invite', 'do_submit', 2147483647, 1, 2),
+
+('bx_space_delete', 'delete_confirm', 2147483647, 1, 0),
+('bx_space_delete', 'cover', 2147483647, 0, 0),
+('bx_space_delete', 'picture', 2147483647, 0, 0),
+('bx_space_delete', 'do_submit', 2147483647, 1, 1),
+('bx_space_delete', 'space_name', 2147483647, 0, 2),
+('bx_space_delete', 'space_cat', 2147483647, 0, 3),
+
+('bx_space_edit', 'delete_confirm', 2147483647, 0, 2),
+('bx_space_edit', 'cover', 2147483647, 0, 3),
+('bx_space_edit', 'picture', 2147483647, 1, 5),
+('bx_space_edit', 'space_name', 2147483647, 1, 6),
+('bx_space_edit', 'parent_space', 2147483647, 1, 7),
+('bx_space_edit', 'space_cat', 2147483647, 1, 8),
+('bx_space_edit', 'space_desc', 2147483647, 1, 9),
+('bx_space_edit', 'join_confirmation', 2147483647, 1, 10),
+('bx_space_edit', 'allow_view_to', 2147483647, 1, 11),
+('bx_space_edit', 'do_submit', 2147483647, 1, 12),
+
+('bx_space_edit_cover', 'join_confirmation', 2147483647, 0, 0),
+('bx_space_edit_cover', 'space_desc', 2147483647, 0, 0),
+('bx_space_edit_cover', 'delete_confirm', 2147483647, 0, 1),
+('bx_space_edit_cover', 'space_name', 2147483647, 0, 2),
+('bx_space_edit_cover', 'picture', 2147483647, 0, 3),
+('bx_space_edit_cover', 'space_cat', 2147483647, 0, 5),
+('bx_space_edit_cover', 'cover', 2147483647, 1, 7),
+('bx_space_edit_cover', 'do_submit', 2147483647, 1, 8),
+
+('bx_space_view', 'delete_confirm', 2147483647, 0, 3),
+('bx_space_view', 'picture', 2147483647, 0, 4),
+('bx_space_view', 'cover', 2147483647, 0, 5),
+('bx_space_view', 'do_submit', 2147483647, 0, 6),
+('bx_space_view', 'space_name', 2147483647, 1, 7),
+('bx_space_view', 'space_cat', 2147483647, 1, 8),
+('bx_space_view', 'space_desc', 2147483647, 0, 9),
+
+('bx_space_view_full', 'space_name', 2147483647, 1, 1),
+('bx_space_view_full', 'space_cat', 2147483647, 1, 2),
+('bx_space_view_full', 'space_desc', 2147483647, 1, 3);
+
+-- PRE-VALUES
+INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
+('bx_spaces_cats', '_bx_spaces_pre_lists_cats', 'bx_spaces', '0');
+
+INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES
+('bx_spaces_cats', '', 0, '_sys_please_select', ''),
+('bx_spaces_cats', '1', 1, '_bx_spaces_cat_General', ''),
+('bx_spaces_cats', '2', 2, '_bx_spaces_cat_Business', ''),
+('bx_spaces_cats', '3', 3, '_bx_spaces_cat_Interests', ''),
+('bx_spaces_cats', '4', 4, '_bx_spaces_cat_Causes', ''),
+('bx_spaces_cats', '5', 5, '_bx_spaces_cat_Fun', ''),
+('bx_spaces_cats', '6', 6, '_bx_spaces_cat_Uncategorised', '');
+
+-- CONTENT INFO
+INSERT INTO `sys_objects_content_info` (`name`, `title`, `alert_unit`, `alert_action_add`, `alert_action_update`, `alert_action_delete`, `class_name`, `class_file`) VALUES
+('bx_spaces', '_bx_spaces', 'bx_spaces', 'added', 'edited', 'deleted', '', ''),
+('bx_spaces_cmts', '_bx_spaces_cmts', 'bx_spaces', 'commentPost', 'commentUpdated', 'commentRemoved', 'BxDolContentInfoCmts', '');
+
+INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`, `condition`, `selection`) VALUES
+('bx_spaces', 'bx_spaces_administration', 'td`.`id', '', ''),
+('bx_spaces', 'bx_spaces_common', 'td`.`id', '', '');
+
+-- SEARCH EXTENDED
+INSERT INTO `sys_objects_search_extended` (`object`, `object_content_info`, `module`, `title`, `active`, `class_name`, `class_file`) VALUES
+('bx_spaces', 'bx_spaces', 'bx_spaces', '_bx_spaces_search_extended', 1, '', ''),
+('bx_spaces_cmts', 'bx_spaces_cmts', 'bx_spaces', '_bx_spaces_search_extended_cmts', 1, 'BxTemplSearchExtendedCmts', '');
+
+-- STUDIO PAGE & WIDGET
+INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
+(3, 'bx_spaces', '_bx_spaces', '_bx_spaces', 'bx_spaces@modules/boonex/spaces/|std-icon.svg');
+SET @iPageId = LAST_INSERT_ID();
+
+SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
+SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
+INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
+(@iPageId, 'bx_spaces', '{url_studio}module.php?name=bx_spaces', '', 'bx_spaces@modules/boonex/spaces/|std-icon.svg', '_bx_spaces', '', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:18:"TemplStudioModules";}');
+INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
+(@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));
+

+ 44 - 0
modules/boonex/spaces/install/sql/uninstall.sql

@@ -0,0 +1,44 @@
+
+-- TABLES
+
+DROP TABLE IF EXISTS `bx_spaces_data`, `bx_spaces_pics`, `bx_spaces_pics_resized`, `bx_spaces_cmts`, `bx_spaces_views_track`, `bx_spaces_meta_keywords`, `bx_spaces_meta_mentions`, `bx_spaces_fans`, `bx_spaces_admins`, `bx_spaces_votes`, `bx_spaces_votes_track`, `bx_spaces_reports`, `bx_spaces_reports_track`, `bx_spaces_favorites_track`, `bx_spaces_scores`, `bx_spaces_scores_track`;
+
+-- PROFILES
+
+DELETE FROM sys_profiles WHERE `type` = 'bx_spaces';
+
+-- STORAGES & TRANSCODERS
+
+DELETE FROM `sys_objects_storage` WHERE `object` IN('bx_spaces_pics', 'bx_spaces_pics_resized');
+DELETE FROM `sys_storage_tokens` WHERE `object` IN('bx_spaces_pics', 'bx_spaces_pics_resized');
+
+DELETE FROM `sys_objects_transcoder` WHERE `object` IN('bx_spaces_icon', 'bx_spaces_thumb', 'bx_spaces_avatar', 'bx_spaces_picture', 'bx_spaces_cover', 'bx_spaces_cover_thumb', 'bx_spaces_gallery');
+DELETE FROM `sys_transcoder_filters` WHERE `transcoder_object` IN('bx_spaces_icon', 'bx_spaces_thumb', 'bx_spaces_avatar', 'bx_spaces_picture', 'bx_spaces_cover', 'bx_spaces_cover_thumb', 'bx_spaces_gallery');
+DELETE FROM `sys_transcoder_images_files` WHERE `transcoder_object` IN('bx_spaces_icon', 'bx_spaces_thumb', 'bx_spaces_avatar', 'bx_spaces_picture', 'bx_spaces_cover', 'bx_spaces_cover_thumb', 'bx_spaces_gallery');
+
+-- FORMS
+
+DELETE FROM `sys_objects_form` WHERE `module` = 'bx_spaces';
+DELETE FROM `sys_form_displays` WHERE `module` = 'bx_spaces';
+DELETE FROM `sys_form_inputs` WHERE `module` = 'bx_spaces';
+DELETE FROM `sys_form_display_inputs` WHERE `display_name` IN('bx_space_add', 'bx_space_delete', 'bx_space_edit', 'bx_space_edit_cover', 'bx_space_view', 'bx_space_view_full', 'bx_space_invite');
+
+-- PRE-VALUES
+
+DELETE FROM `sys_form_pre_lists` WHERE `module` = 'bx_spaces';
+
+DELETE FROM `sys_form_pre_values` WHERE `Key` IN('bx_spaces_cats');
+
+-- CONTENT INFO
+DELETE FROM `sys_objects_content_info` WHERE `name` IN ('bx_spaces', 'bx_spaces_cmts');
+
+DELETE FROM `sys_content_info_grids` WHERE `object` IN ('bx_spaces');
+
+-- SEARCH EXTENDED
+DELETE FROM `sys_objects_search_extended` WHERE `module` = 'bx_spaces';
+
+-- STUDIO PAGE & WIDGET
+DELETE FROM `tp`, `tw`, `tpw`
+USING `sys_std_pages` AS `tp`, `sys_std_widgets` AS `tw`, `sys_std_pages_widgets` AS `tpw`
+WHERE `tp`.`id` = `tw`.`page_id` AND `tw`.`id` = `tpw`.`widget_id` AND `tp`.`name` = 'bx_spaces';
+

+ 62 - 0
modules/boonex/spaces/js/manage_tools.js

@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defdroup    Spaces Spaces
+ * @indroup     UnaModules
+ *
+ * @{
+ */
+
+function BxSpacesManageTools(oOptions) {
+	this._iSearchTimeoutId = false;
+	this._sActionsUrl = oOptions.sActionUrl;
+	this._sObjNameGrid = oOptions.sObjNameGrid;
+	this._sObjName = oOptions.sObjName == undefined ? 'oBxSpacesManageTools' : oOptions.sObjName;
+
+    this._sAnimationEffect = oOptions.sAnimationEffect == undefined ? 'fade' : oOptions.sAnimationEffect;
+    this._iAnimationSpeed = oOptions.iAnimationSpeed == undefined ? 'slow' : oOptions.iAnimationSpeed;
+    this._sParamsDivider = oOptions.sParamsDivider == undefined ? '#-#' : oOptions.sParamsDivider;
+
+    this._aHtmlIds = oOptions.aHtmlIds == undefined ? {} : oOptions.aHtmlIds;
+    this._oRequestParams = oOptions.oRequestParams == undefined ? {} : oOptions.oRequestParams;
+}
+
+BxSpacesManageTools.prototype.onChangeFilter = function (oFilter) {
+	var $this = this;
+	var oFilter1 = $('#bx-grid-filter1-' + this._sObjNameGrid);
+	var sValueFilter1 = oFilter1.length > 0 ? oFilter1.val() : '';
+
+	var oSearch = $('#bx-grid-search-' + this._sObjNameGrid);
+	var sValueSearch = oSearch.length > 0 ? oSearch.val() : '';
+	if(sValueSearch == _t('_sys_grid_search'))
+		sValueSearch = '';
+
+	clearTimeout($this._iSearchTimeoutId);
+    $this._iSearchTimeoutId = setTimeout(function () {
+        glGrids[$this._sObjNameGrid].setFilter(sValueFilter1 + $this._sParamsDivider + sValueSearch, true);
+    }, 500);
+};
+
+BxSpacesManageTools.prototype.onClickSettings = function (sMenuObject, oButton) {
+	if($(oButton).hasClass('bx-btn-disabled'))
+		return false;
+
+	bx_menu_popup(sMenuObject, oButton, {}, {
+		content_id: $(oButton).attr('bx_grid_action_data')
+	});
+};
+
+BxSpacesManageTools.prototype.onClickDelete = function (iContentId) {
+	$('.bx-popup-applied:visible').dolPopupHide();
+
+	glGrids[this._sObjNameGrid].actionWithId(iContentId, 'delete', {}, '', false, 1);
+};
+
+BxSpacesManageTools.prototype.onClickDeleteWithContent = function (iContentId) {
+	$('.bx-popup-applied:visible').dolPopupHide();
+
+	glGrids[this._sObjNameGrid].actionWithId(iContentId, 'delete_with_content', {}, '', false, 1);
+};
+
+/** @} */

+ 18 - 0
modules/boonex/spaces/request.php

@@ -0,0 +1,18 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defdroup    Spaces Spaces
+ * @indroup     UnaModules
+ *
+ * @{
+ */
+
+require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
+
+check_logged();
+
+BxBaseModProfileRequest::processAsAction($GLOBALS['aModule'], $GLOBALS['aRequest']);
+
+/** @} */

+ 1 - 0
modules/boonex/spaces/template/account_link.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/groups/template/account_link.html />

+ 1 - 0
modules/boonex/spaces/template/cover.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/groups/template/cover.html />

+ 1 - 0
modules/boonex/spaces/template/css/forms.css

@@ -0,0 +1 @@
+@import url(../../../../base/profile/template/css/forms.css);

+ 1 - 0
modules/boonex/spaces/template/css/main.css

@@ -0,0 +1 @@
+@import url(../../../../base/groups/template/css/main.css);

+ 1 - 0
modules/boonex/spaces/template/css/manage_tools.css

@@ -0,0 +1 @@
+@import url(../../../../base/general/template/css/manage_tools.css);

+ 1 - 0
modules/boonex/spaces/template/entry-childs.html

@@ -0,0 +1 @@
+__content__

+ 1 - 0
modules/boonex/spaces/template/entry-parent.html

@@ -0,0 +1 @@
+__content__

+ 3 - 0
modules/boonex/spaces/template/entry-share.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/groups/template/entry-share.html />
+

+ 1 - 0
modules/boonex/spaces/template/entry-text.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/profile/template/entry-text.html />

+ 1 - 0
modules/boonex/spaces/template/form_ghost_template.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/profile/template/form_ghost_template.html />

+ 1 - 0
modules/boonex/spaces/template/image_popup.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/groups/template/image_popup.html />

+ 24 - 0
modules/boonex/spaces/template/images/icons/std-icon.svg

@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<svg width="600" height="600" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
+ <!-- Generator: Sketch 40.3 (33839) - http://www.bohemiancoding.com/sketch -->
+ <title>Group 2 Copy 19</title>
+ <desc>Created with Sketch.</desc>
+ <defs>
+  <linearGradient id="linearGradient-1" y2="100%" x2="50%" y1="0%" x1="50%">
+   <stop offset="0%" stop-opacity="0.2" stop-color="#FFFFFF"/>
+   <stop offset="100%" stop-opacity="0.13887" stop-color="#000000"/>
+  </linearGradient>
+  <path id="path-3" d="m296.71269,208.4098c-12.62806,-4.39644 -26.28507,-4.67706 -38.91314,-9.0735c-3.83519,-1.30957 -11.41202,-2.89977 -13.00222,-7.29621c-1.49666,-4.3029 -1.49666,-9.35412 -1.77728,-13.8441c-0.18709,-3.55457 -0.28063,-7.10913 -0.28063,-10.6637c0,-2.33853 5.98664,-7.29621 7.29622,-9.44766c5.05122,-8.41871 5.51893,-19.73719 6.45434,-29.27839c8.13808,2.24498 9.16704,-12.81515 10.57015,-17.39867c1.02896,-3.1804 7.29622,-25.06904 -2.43207,-22.07572c2.33853,-4.11581 3.27394,-9.16704 3.92873,-13.75056c1.87083,-11.97327 2.61916,-25.06904 -1.02895,-36.76169c-7.57684,-24.32071 -30.8686,-37.97773 -55.46993,-38.72606c-24.97551,-0.84187 -50.04455,11.1314 -59.39867,35.35858c-4.48998,11.78619 -4.11581,24.60133 -2.61915,36.94877c0.65479,5.61247 1.5902,11.87973 4.39644,16.93096c-9.0735,-2.7127 -4.20936,16.55679 -3.18041,19.92427c1.49666,4.77061 2.80624,21.88865 11.31849,19.55012c0.74833,7.57683 1.5902,15.34075 3.64811,22.73051c1.40311,4.95768 4.30289,9.16704 7.67038,13.00223c1.68374,1.87082 2.52561,2.0579 2.43207,4.48997c-0.09354,7.29622 0.09354,15.15368 -1.77729,22.26281c-1.87082,7.10913 -17.4922,10.10245 -23.75946,11.41203c-16.83742,3.46102 -32.36526,5.05122 -46.39644,15.52784c-16.36971,12.06681 -24.88196,30.86859 -24.88196,51.16703l233.75947,0l26.28508,0c0,-27.59465 -16.65034,-51.91536 -42.84188,-60.98886l0,0z"/>
+  <path id="path-5" d="m104.11136,196.90423c-3.1804,1.5902 -7.01559,3.55457 0.74833,-0.37416c2.80623,-1.40312 2.24499,-1.1225 0.74833,-0.37417c6.3608,-2.99332 13.18931,-3.74165 20.01781,-4.39643c2.61916,-0.28063 3.83519,-2.05791 1.87083,-4.58352c-3.74165,-4.7706 -16.65034,-5.70602 -22.07572,-7.85746c-3.36749,-1.30958 -4.3029,-2.52562 -4.58352,-6.26727c-0.09354,-1.68374 -1.02896,-9.16703 0.28062,-10.38307c0.93541,-0.93541 6.82851,-0.56125 8.13808,-0.74833c5.33185,-0.65479 10.75724,-1.77728 15.80847,-3.74165c2.15145,-0.84187 4.20935,-1.87082 6.08018,-3.1804c2.24499,-1.68374 -1.68375,-5.79955 -2.7127,-8.04454c-3.1804,-7.01559 -4.58352,-14.68597 -5.05122,-22.35635c-0.93542,-15.06013 1.40311,-30.21381 -1.40312,-45.1804c-4.20936,-22.91759 -21.88864,-34.42316 -44.43207,-34.42316c-13.93764,0 -27.6882,4.7706 -35.45212,16.93096c-8.60579,13.37639 -8.13808,30.02672 -7.67038,45.27394c0.28063,8.69933 0.65479,17.4922 -0.56124,26.19154c-0.56125,3.74164 -1.40312,7.38975 -2.7127,10.94432c-1.02895,2.71269 -6.26726,9.44766 -4.20935,10.85077c7.76392,5.51894 20.85968,7.38976 30.2138,6.64143c0.28063,4.58352 1.1225,10.47662 -0.56124,14.77951c-2.61916,6.73497 -22.16927,8.51225 -28.06236,10.47661c-16.36971,5.42539 -28.53007,18.70825 -28.53007,37.41649l51.26058,0l23.10468,0c1.21603,0 5.89309,-8.69934 7.20267,-10.10245c6.3608,-7.01559 14.12472,-13.09577 22.54343,-17.49221l0,0z"/>
+  <path id="path-7" d="m390.34744,186.98886c-7.57684,-2.43207 -22.16927,-3.1804 -27.59466,-9.72828c-2.71269,-3.27394 -1.21603,-11.59911 -0.93541,-15.52784c4.11581,0.37416 8.60579,-0.28062 12.81515,-0.84187c3.83519,-0.56125 7.57683,-1.30958 11.22494,-2.61915c1.68374,-0.65479 3.36748,-1.30958 4.95768,-2.24499c3.64811,-2.15145 1.96437,-2.52562 0.09355,-5.70602c-10.196,-17.11804 -5.61248,-38.8196 -6.08018,-57.62138c-0.37417,-15.62138 -4.48998,-32.73942 -18.70824,-41.53229c-12.81515,-7.951 -31.80401,-8.23163 -45.55457,-2.61916c-39.66147,15.90201 -16.27617,68.47216 -29.83964,98.59243c-2.33853,5.05123 -5.70602,6.82851 0.18708,9.82183c3.27394,1.68374 6.82851,2.80623 10.38307,3.6481c5.42539,1.30958 11.03787,2.05791 16.65034,2.24499c0.93541,0 0.28062,11.78619 0,13.00223c-1.02895,4.58352 -11.03786,5.8931 -14.77951,6.92205c-3.83519,1.02895 -10.19599,1.30958 -12.06682,5.33185c-2.80623,5.98664 9.26058,4.48998 12.2539,5.05122c9.63474,1.77729 18.14699,7.10914 25.63029,13.18931c5.61247,4.58352 13.18931,10.75724 15.24722,18.24054l75.02004,0c-0.18708,-18.80178 -12.44098,-32.17818 -28.90423,-37.60357l0,0z"/>
+ </defs>
+ <g class="layer">
+  <title>Layer 1</title>
+  <path fill="#2BAF92" id="path" d="m552.26896,552.26896c47.73104,-47.73115 47.73104,-120.81063 47.73104,-252.26896c0,-131.45833 0,-204.53781 -47.73104,-252.26896c-47.73115,-47.73104 -120.81063,-47.73104 -252.26896,-47.73104c-131.45833,0 -204.53781,0 -252.26896,47.73104c-47.73104,47.73115 -47.73104,120.81063 -47.73104,252.26896c0,131.45833 0,204.53781 47.73104,252.26896c47.73115,47.73104 120.81063,47.73104 252.26896,47.73104c131.45833,0 204.53781,0 252.26896,-47.73104l0,0z"/>
+  <path fill="url(#linearGradient-1)" id="path-copy" d="m552.26896,552.26896c47.73104,-47.73115 47.73104,-120.81063 47.73104,-252.26896c0,-131.45833 0,-204.53781 -47.73104,-252.26896c-47.73115,-47.73104 -120.81063,-47.73104 -252.26896,-47.73104c-131.45833,0 -204.53781,0 -252.26896,47.73104c-47.73104,47.73115 -47.73104,120.81063 -47.73104,252.26896c0,131.45833 0,204.53781 47.73104,252.26896c47.73115,47.73104 120.81063,47.73104 252.26896,47.73104c131.45833,0 204.53781,0 252.26896,-47.73104l0,0z"/>
+  <g id="svg_9"/>
+  <g transform="matrix(1.8695367368156468,0,0,2.093171738466615,-51.56975864520307,-72.23986828892671) " id="svg_11">
+   <path id="svg_12" fill="#fff" d="m286.534893,126.666157l-12.5,0l0,100l12.5,0l0,37.5l-37.5,0l0,-12.5l-125,0l0,12.5l-37.5,0l0,-37.5l12.5,0l0,-100l-12.5,0l0,-37.5l37.5,0l0,12.5l125,0l0,-12.5l37.5,0l0,37.5zm-25,-25l0,12.5l12.5,0l0,-12.5l-12.5,0zm-162.5,0l0,12.5l12.5,0l0,-12.5l-12.5,0zm12.5,150l0,-12.5l-12.5,0l0,12.5l12.5,0zm137.5,-12.5l0,-12.5l12.5,0l0,-100l-12.5,0l0,-12.5l-125,0l0,12.5l-12.5,0l0,100l12.5,0l0,12.5l125,0zm25,12.5l0,-12.5l-12.5,0l0,12.5l12.5,0zm-62.5,-100l37.5,0l0,75l-87.5,0l0,-25l-37.5,0l0,-75l87.5,0l0,25zm-75,37.5l62.5,0l0,-50l-62.5,0l0,50zm100,25l0,-50l-25,0l0,37.5l-37.5,0l0,12.5l62.5,0z"/>
+  </g>
+ </g>
+</svg>

BIN
modules/boonex/spaces/template/images/no-pciture-big.png


BIN
modules/boonex/spaces/template/images/no-picture-icon.png


BIN
modules/boonex/spaces/template/images/no-picture-preview.png


BIN
modules/boonex/spaces/template/images/no-picture-thumb.png


+ 1 - 0
modules/boonex/spaces/template/name_link.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/groups/template/name_link.html />

+ 1 - 0
modules/boonex/spaces/template/picture_preview.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/groups/template/picture_preview.html />

+ 1 - 0
modules/boonex/spaces/template/search_extended_results.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/profile/template/search_extended_results.html />

+ 1 - 0
modules/boonex/spaces/template/set_acl_popup.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/groups/template/set_acl_popup.html />

+ 1 - 0
modules/boonex/spaces/template/unit.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/groups/template/unit.html />

+ 1 - 0
modules/boonex/spaces/template/unit_live_search.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/groups/template/unit_live_search.html />

+ 1 - 0
modules/boonex/spaces/template/unit_meta_item.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/profile/template/unit_meta_item.html />

+ 1 - 0
modules/boonex/spaces/template/unit_with_cover_showcase.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/groups/template/unit_with_cover_showcase.html />

+ 1 - 0
modules/boonex/spaces/template/unit_wo_info.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/groups/template/unit_wo_info.html />

+ 1 - 0
modules/boonex/spaces/template/uploader_form_crop_cover.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/profile/template/uploader_form_crop_cover.html />