Просмотр исходного кода

Ticket #3367 - Usage in Spaces. Related changes.

AntonLV 5 лет назад
Родитель
Сommit
9f96f612d8
34 измененных файлов с 563 добавлено и 166 удалено
  1. 1 1
      modules/boonex/courses/install/langs/en.xml
  2. 1 1
      modules/boonex/courses/install/sql/disable.sql
  3. 1 1
      modules/boonex/courses/install/sql/enable.sql
  4. 1 17
      modules/boonex/courses/template/css/prices.css
  5. 1 1
      modules/boonex/events/install/langs/en.xml
  6. 1 1
      modules/boonex/events/install/sql/disable.sql
  7. 1 1
      modules/boonex/events/install/sql/enable.sql
  8. 1 17
      modules/boonex/events/template/css/prices.css
  9. 1 1
      modules/boonex/groups/install/langs/en.xml
  10. 1 1
      modules/boonex/groups/install/sql/disable.sql
  11. 1 1
      modules/boonex/groups/install/sql/enable.sql
  12. 1 17
      modules/boonex/groups/template/css/prices.css
  13. 1 1
      modules/boonex/russian/data/langs/bx_courses/ru.xml
  14. 1 70
      modules/boonex/russian/data/langs/bx_events/ru.xml
  15. 1 1
      modules/boonex/russian/data/langs/bx_groups/ru.xml
  16. 1 0
      modules/boonex/russian/data/langs/bx_payment/ru.xml
  17. 75 1
      modules/boonex/russian/data/langs/bx_spaces/ru.xml
  18. 25 2
      modules/boonex/spaces/classes/BxSpacesConfig.php
  19. 22 0
      modules/boonex/spaces/classes/BxSpacesCronPruning.php
  20. 22 0
      modules/boonex/spaces/classes/BxSpacesFormPrice.php
  21. 22 0
      modules/boonex/spaces/classes/BxSpacesGridPricesManage.php
  22. 22 0
      modules/boonex/spaces/classes/BxSpacesGridPricesView.php
  23. 10 0
      modules/boonex/spaces/classes/BxSpacesMenuViewActionsAll.php
  24. 24 0
      modules/boonex/spaces/classes/BxSpacesPageListEntry.php
  25. 75 1
      modules/boonex/spaces/install/langs/en.xml
  26. 8 5
      modules/boonex/spaces/install/sql/disable.sql
  27. 96 21
      modules/boonex/spaces/install/sql/enable.sql
  28. 81 2
      modules/boonex/spaces/install/sql/install.sql
  29. 2 2
      modules/boonex/spaces/install/sql/uninstall.sql
  30. 59 0
      modules/boonex/spaces/js/prices.js
  31. 1 0
      modules/boonex/spaces/template/css/prices.css
  32. 1 0
      modules/boonex/spaces/template/favorite-list-info.html
  33. 1 0
      modules/boonex/spaces/template/favorite-lists.html
  34. 1 0
      modules/boonex/spaces/template/popup_price.html

+ 1 - 1
modules/boonex/courses/install/langs/en.xml

@@ -26,7 +26,7 @@
     <string name="_bx_courses_form_profile_input_join_confirm"><![CDATA[Join confirmation]]></string>
     <string name="_bx_courses_form_profile_input_sys_allow_view_to"><![CDATA[Visible to]]></string>
     <string name="_bx_courses_form_profile_input_allow_view_to"><![CDATA[Visible to]]></string>
-    <string name="_bx_courses_form_entry_input_allow_view_favorite_list"><![CDATA[Visibility]]></string>
+    <string name="_bx_courses_form_profile_input_allow_view_favorite_list"><![CDATA[Visibility]]></string>
     <string name="_bx_courses_form_profile_input_allow_view_to_desc"><![CDATA[Closed - anyone can find the course and see who's in it, only students can see posts. Secret - only students can find the course and see posts.]]></string>
     <string name="_bx_courses_form_profile_input_sys_allow_post_to"><![CDATA[Who can post]]></string>
     <string name="_bx_courses_form_profile_input_allow_post_to"><![CDATA[Who can post]]></string>

+ 1 - 1
modules/boonex/courses/install/sql/disable.sql

@@ -8,7 +8,7 @@ DELETE FROM `sys_options_types` WHERE `id` = @iTypeId;
 
 -- PAGES
 DELETE FROM `sys_objects_page` WHERE `module` = 'bx_courses';
-DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_courses' OR `object` IN('bx_courses_create_profile', 'bx_courses_delete_profile', 'bx_courses_join_profile', 'bx_courses_edit_profile', 'bx_courses_edit_profile_cover', 'bx_courses_invite', 'bx_courses_view_profile', 'bx_courses_view_profile_closed', 'bx_courses_profile_info', 'bx_courses_profile_pricing', 'bx_courses_profile_comments', 'bx_courses_home', 'bx_courses_fans', 'bx_courses_joined', 'bx_courses_top', 'bx_courses_search', 'bx_courses_manage', 'bx_courses_administration');
+DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_courses' OR `object` IN('bx_courses_create_profile', 'bx_courses_delete_profile', 'bx_courses_join_profile', 'bx_courses_edit_profile', 'bx_courses_edit_profile_cover', 'bx_courses_invite', 'bx_courses_view_profile', 'bx_courses_view_profile_closed', 'bx_courses_profile_info', 'bx_courses_profile_pricing', 'bx_courses_profile_comments', 'bx_courses_home', 'bx_courses_fans', 'bx_courses_joined', 'bx_courses_favorites', 'bx_courses_top', 'bx_courses_search', 'bx_courses_manage', 'bx_courses_administration');
 
 -- MENU
 DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_courses';

+ 1 - 1
modules/boonex/courses/install/sql/enable.sql

@@ -629,7 +629,7 @@ INSERT INTO `sys_objects_privacy` (`object`, `module`, `action`, `title`, `defau
 ('bx_courses_allow_view_to', 'bx_courses', 'view', '_bx_courses_form_profile_input_allow_view_to', '3', '', 'bx_courses_data', 'id', 'author', 'BxCoursesPrivacy', 'modules/boonex/courses/classes/BxCoursesPrivacy.php'),
 ('bx_courses_allow_view_notification_to', 'bx_courses', 'view_event', '_bx_courses_form_profile_input_allow_view_notification_to', '3', '', 'bx_notifications_events', 'id', 'object_owner_id', 'BxCoursesPrivacyNotifications', 'modules/boonex/courses/classes/BxCoursesPrivacyNotifications.php'),
 ('bx_courses_allow_post_to', 'bx_courses', 'post', '_bx_courses_form_profile_input_allow_post_to', 'p', '', 'bx_courses_data', 'id', 'author', 'BxCoursesPrivacyPost', 'modules/boonex/courses/classes/BxCoursesPrivacyPost.php'),
-('bx_courses_allow_view_favorite_list', 'bx_courses', 'view_favorite_list', '_bx_courses_form_entry_input_allow_view_favorite_list', '3', '', 'bx_courses_favorites_lists', 'id', 'author_id', 'BxCoursesPrivacy', 'modules/boonex/courses/classes/BxCoursesPrivacy.php');
+('bx_courses_allow_view_favorite_list', 'bx_courses', 'view_favorite_list', '_bx_courses_form_profile_input_allow_view_favorite_list', '3', '', 'bx_courses_favorites_lists', 'id', 'author_id', 'BxCoursesPrivacy', 'modules/boonex/courses/classes/BxCoursesPrivacy.php');
 
 -- EMAIL TEMPLATES
 

+ 1 - 17
modules/boonex/courses/template/css/prices.css

@@ -1,17 +1 @@
-/*--- Top Controls ---*/
-div.bx-grid-header div.bx-form-element-wrapper {
-    position: relative;
-    float: left;
-}
-
-div.bx-grid-header div#bx-form-element-role {
-    margin-right: 20px;
-}
-div.bx-grid-header div#bx-form-element-role,
-div.bx-grid-header div#bx-form-element-keyword {
-    margin-top: 0px;
-}
-
-/*--- Add Price Popup ---*/
-div.bx-courses-pricing-form {}
-div.bx-courses-pricing-form-cnt {}
+@import url(../../../../base/groups/template/css/prices.css);

+ 1 - 1
modules/boonex/events/install/langs/en.xml

@@ -31,7 +31,7 @@
     <string name="_bx_events_form_profile_input_join_confirm"><![CDATA[Join confirmation]]></string>
     <string name="_bx_events_form_profile_input_sys_allow_view_to"><![CDATA[Visible to]]></string>
     <string name="_bx_events_form_profile_input_allow_view_to"><![CDATA[Visible to]]></string>
-    <string name="_bx_events_form_entry_input_allow_view_favorite_list"><![CDATA[Visibility]]></string>
+    <string name="_bx_events_form_profile_input_allow_view_favorite_list"><![CDATA[Visibility]]></string>
     <string name="_bx_events_form_profile_input_allow_view_to_desc"><![CDATA[Closed - anyone can find the event and see who's in it, only members can see posts. Secret - only members can find the event and see posts.]]></string>
     <string name="_bx_events_form_profile_input_sys_allow_post_to"><![CDATA[Who can post]]></string>
     <string name="_bx_events_form_profile_input_allow_post_to"><![CDATA[Who can post]]></string>

+ 1 - 1
modules/boonex/events/install/sql/disable.sql

@@ -8,7 +8,7 @@ DELETE FROM `sys_options_types` WHERE `id` = @iTypeId;
 
 -- PAGES
 DELETE FROM `sys_objects_page` WHERE `module` = 'bx_events';
-DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_events' OR `object` IN('bx_events_create_profile', 'bx_events_delete_profile', 'bx_events_join_profile', 'bx_events_edit_profile', 'bx_events_edit_profile_cover', 'bx_events_invite', 'bx_events_view_profile', 'bx_events_view_profile_closed', 'bx_events_profile_info', 'bx_events_profile_pricing', 'bx_events_profile_comments', 'bx_events_home', 'bx_events_fans', 'bx_events_joined', 'bx_events_top', 'bx_events_upcoming', 'bx_events_past', 'bx_events_search', 'bx_events_manage', 'bx_events_administration');
+DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_events' OR `object` IN('bx_events_create_profile', 'bx_events_delete_profile', 'bx_events_join_profile', 'bx_events_edit_profile', 'bx_events_edit_profile_cover', 'bx_events_invite', 'bx_events_view_profile', 'bx_events_view_profile_closed', 'bx_events_profile_info', 'bx_events_profile_pricing', 'bx_events_profile_comments', 'bx_events_home', 'bx_events_fans', 'bx_events_joined', 'bx_events_favorites', 'bx_events_top', 'bx_events_upcoming', 'bx_events_past', 'bx_events_search', 'bx_events_manage', 'bx_events_administration');
 
 -- MENU
 DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_events';

+ 1 - 1
modules/boonex/events/install/sql/enable.sql

@@ -678,7 +678,7 @@ INSERT INTO `sys_objects_privacy` (`object`, `module`, `action`, `title`, `defau
 ('bx_events_allow_view_to', 'bx_events', 'view', '_bx_events_form_profile_input_allow_view_to', '3', 'bx_groups,bx_spaces', 'bx_events_data', 'id', 'author', 'BxEventsPrivacy', 'modules/boonex/events/classes/BxEventsPrivacy.php'),
 ('bx_events_allow_view_notification_to', 'bx_events', 'view_event', '_bx_events_form_profile_input_allow_view_notification_to', '3', '', 'bx_notifications_events', 'id', 'object_owner_id', 'BxEventsPrivacyNotifications', 'modules/boonex/events/classes/BxEventsPrivacyNotifications.php'),
 ('bx_events_allow_post_to', 'bx_events', 'post', '_bx_events_form_profile_input_allow_post_to', 'p', '', 'bx_events_data', 'id', 'author', 'BxEventsPrivacyPost', 'modules/boonex/events/classes/BxEventsPrivacyPost.php'),
-('bx_events_allow_view_favorite_list', 'bx_events', 'view_favorite_list', '_bx_events_form_entry_input_allow_view_favorite_list', '3', '', 'bx_events_favorites_lists', 'id', 'author_id', 'BxEventsPrivacy', 'modules/boonex/events/classes/BxEventsPrivacy.php');
+('bx_events_allow_view_favorite_list', 'bx_events', 'view_favorite_list', '_bx_events_form_profile_input_allow_view_favorite_list', '3', '', 'bx_events_favorites_lists', 'id', 'author_id', 'BxEventsPrivacy', 'modules/boonex/events/classes/BxEventsPrivacy.php');
 
 
 -- EMAIL TEMPLATES

+ 1 - 17
modules/boonex/events/template/css/prices.css

@@ -1,17 +1 @@
-/*--- Top Controls ---*/
-div.bx-grid-header div.bx-form-element-wrapper {
-    position: relative;
-    float: left;
-}
-
-div.bx-grid-header div#bx-form-element-role {
-    margin-right: 20px;
-}
-div.bx-grid-header div#bx-form-element-role,
-div.bx-grid-header div#bx-form-element-keyword {
-    margin-top: 0px;
-}
-
-/*--- Add Price Popup ---*/
-div.bx-events-pricing-form {}
-div.bx-events-pricing-form-cnt {}
+@import url(../../../../base/groups/template/css/prices.css);

+ 1 - 1
modules/boonex/groups/install/langs/en.xml

@@ -26,7 +26,7 @@
     <string name="_bx_groups_form_profile_input_join_confirm"><![CDATA[Join confirmation]]></string>
     <string name="_bx_groups_form_profile_input_sys_allow_view_to"><![CDATA[Visible to]]></string>
     <string name="_bx_groups_form_profile_input_allow_view_to"><![CDATA[Visible to]]></string>
-    <string name="_bx_groups_form_entry_input_allow_view_favorite_list"><![CDATA[Visibility]]></string>
+    <string name="_bx_groups_form_profile_input_allow_view_favorite_list"><![CDATA[Visibility]]></string>
     <string name="_bx_groups_form_profile_input_allow_view_to_desc"><![CDATA[Closed - anyone can find the group and see who's in it, only members can see posts. Secret - only members can find the group and see posts.]]></string>
     <string name="_bx_groups_form_profile_input_sys_allow_post_to"><![CDATA[Who can post]]></string>
     <string name="_bx_groups_form_profile_input_allow_post_to"><![CDATA[Who can post]]></string>

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

@@ -8,7 +8,7 @@ DELETE FROM `sys_options_types` WHERE `id` = @iTypeId;
 
 -- PAGES
 DELETE FROM `sys_objects_page` WHERE `module` = 'bx_groups';
-DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_groups' OR `object` IN('bx_groups_create_profile', 'bx_groups_delete_profile', 'bx_groups_context', 'bx_groups_join_profile', 'bx_groups_edit_profile', 'bx_groups_edit_profile_cover', 'bx_groups_invite', 'bx_groups_view_profile', 'bx_groups_view_profile_closed', 'bx_groups_profile_info', 'bx_groups_profile_pricing', 'bx_groups_profile_comments', 'bx_groups_home', 'bx_groups_fans', 'bx_groups_joined', 'bx_groups_top', 'bx_groups_search', 'bx_groups_manage', 'bx_groups_administration');
+DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_groups' OR `object` IN('bx_groups_create_profile', 'bx_groups_delete_profile', 'bx_groups_context', 'bx_groups_join_profile', 'bx_groups_edit_profile', 'bx_groups_edit_profile_cover', 'bx_groups_invite', 'bx_groups_view_profile', 'bx_groups_view_profile_closed', 'bx_groups_profile_info', 'bx_groups_profile_pricing', 'bx_groups_profile_comments', 'bx_groups_home', 'bx_groups_fans', 'bx_groups_joined', 'bx_groups_favorites', 'bx_groups_top', 'bx_groups_search', 'bx_groups_manage', 'bx_groups_administration');
 
 -- MENU
 DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_groups';

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

@@ -645,7 +645,7 @@ INSERT INTO `sys_objects_privacy` (`object`, `module`, `action`, `title`, `defau
 ('bx_groups_allow_view_to', 'bx_groups', 'view', '_bx_groups_form_profile_input_allow_view_to', '3', 'bx_events,bx_spaces', 'bx_groups_data', 'id', 'author', 'BxGroupsPrivacy', 'modules/boonex/groups/classes/BxGroupsPrivacy.php'),
 ('bx_groups_allow_view_notification_to', 'bx_groups', 'view_event', '_bx_groups_form_profile_input_allow_view_notification_to', '3', '', 'bx_notifications_events', 'id', 'object_owner_id', 'BxGroupsPrivacyNotifications', 'modules/boonex/groups/classes/BxGroupsPrivacyNotifications.php'),
 ('bx_groups_allow_post_to', 'bx_groups', 'post', '_bx_groups_form_profile_input_allow_post_to', 'p', '', 'bx_groups_data', 'id', 'author', 'BxGroupsPrivacyPost', 'modules/boonex/groups/classes/BxGroupsPrivacyPost.php'),
-('bx_groups_allow_view_favorite_list', 'bx_groups', 'view_favorite_list', '_bx_groups_form_entry_input_allow_view_favorite_list', '3', '', 'bx_groups_favorites_lists', 'id', 'author_id', 'BxGroupsPrivacy', 'modules/boonex/groups/classes/BxGroupsPrivacy.php');
+('bx_groups_allow_view_favorite_list', 'bx_groups', 'view_favorite_list', '_bx_groups_form_profile_input_allow_view_favorite_list', '3', '', 'bx_groups_favorites_lists', 'id', 'author_id', 'BxGroupsPrivacy', 'modules/boonex/groups/classes/BxGroupsPrivacy.php');
 -- EMAIL TEMPLATES
 
 INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `Body`) VALUES

+ 1 - 17
modules/boonex/groups/template/css/prices.css

@@ -1,17 +1 @@
-/*--- Top Controls ---*/
-div.bx-grid-header div.bx-form-element-wrapper {
-    position: relative;
-    float: left;
-}
-
-div.bx-grid-header div#bx-form-element-role {
-    margin-right: 20px;
-}
-div.bx-grid-header div#bx-form-element-role,
-div.bx-grid-header div#bx-form-element-keyword {
-    margin-top: 0px;
-}
-
-/*--- Add Price Popup ---*/
-div.bx-groups-pricing-form {}
-div.bx-groups-pricing-form-cnt {}
+@import url(../../../../base/groups/template/css/prices.css);

+ 1 - 1
modules/boonex/russian/data/langs/bx_courses/ru.xml

@@ -26,7 +26,7 @@
     <string name="_bx_courses_form_profile_input_join_confirm"><![CDATA[Подтверждение регистрации]]></string>
     <string name="_bx_courses_form_profile_input_sys_allow_view_to"><![CDATA[Доступена для]]></string>
     <string name="_bx_courses_form_profile_input_allow_view_to"><![CDATA[Доступена для]]></string>
-    <string name="_bx_courses_form_entry_input_allow_view_favorite_list"><![CDATA[Видимость]]></string>
+    <string name="_bx_courses_form_profile_input_allow_view_favorite_list"><![CDATA[Видимость]]></string>
     <string name="_bx_courses_form_profile_input_allow_view_to_desc"><![CDATA[Закрытый - все могут найти курс и видеть кто в нем состоит, только студенты могут видеть сообщения. Секретный - только студенты могут найти курс и видеть сообщения.]]></string>
     <string name="_bx_courses_form_profile_input_sys_allow_post_to"><![CDATA[Оставлять сообщения в профиле могут]]></string>
     <string name="_bx_courses_form_profile_input_allow_post_to"><![CDATA[Оставлять сообщения в профиле могут]]></string>

+ 1 - 70
modules/boonex/russian/data/langs/bx_events/ru.xml

@@ -69,7 +69,7 @@
     <string name="_bx_events_form_profile_input_time"><![CDATA[Время]]></string>
     <string name="_bx_events_form_profile_input_sys_reminder"><![CDATA[Напоминание]]></string>
     <string name="_bx_events_form_profile_input_reminder"><![CDATA[Напоминание]]></string>
-    <string name="_bx_events_form_entry_input_allow_view_favorite_list"><![CDATA[Видимость]]></string>
+    <string name="_bx_events_form_profile_input_allow_view_favorite_list"><![CDATA[Видимость]]></string>
     
     <string name="_bx_events_form_input_repeat_year"><![CDATA[Повторять: год]]></string>
     <string name="_bx_events_form_input_repeat_month"><![CDATA[Повторять: месяц]]></string>
@@ -78,32 +78,7 @@
     <string name="_bx_events_form_input_repeat_day_of_week"><![CDATA[Повторять: день недели]]></string>
     <string name="_bx_events_form_input_stop_repeating"><![CDATA[Отстановить повтор]]></string>
 
-    <string name="_bx_events_form_price"><![CDATA[Цена]]></string>
-    <string name="_bx_events_form_price_display_add"><![CDATA[Добавление]]></string>
-    <string name="_bx_events_form_price_display_edit"><![CDATA[Редактирование]]></string>
-    <string name="_bx_events_form_price_input_sys_id"><![CDATA[ID]]></string>
-    <string name="_bx_events_form_price_input_sys_role_id"><![CDATA[ID роли]]></string>
-    <string name="_bx_events_form_price_input_sys_name"><![CDATA[Имя]]></string>
-    <string name="_bx_events_form_price_input_name"><![CDATA[Имя]]></string>
-    <string name="_bx_events_form_price_input_inf_name"><![CDATA[Уникальное значение, которое будет использоваться в серверной части и API запросах]]></string>
-    <string name="_bx_events_form_price_input_err_name"><![CDATA[Введите уникальное значение]]></string>
-    <string name="_bx_events_form_price_input_sys_period"><![CDATA[Период]]></string>
-    <string name="_bx_events_form_price_input_period"><![CDATA[Период]]></string>
-    <string name="_bx_events_form_price_input_inf_period"><![CDATA[Используйте 0 для пожизненного]]></string>
-    <string name="_bx_events_form_price_input_sys_period_unit"><![CDATA[Единица измерения периода]]></string>
-    <string name="_bx_events_form_price_input_period_unit"><![CDATA[Единица измерения периода]]></string>
-    <string name="_bx_events_form_price_input_inf_period_unit"><![CDATA[Оставьте пустым для пожизненного уровня.]]></string>
-    <string name="_bx_events_form_price_input_err_period_unit"><![CDATA[Здесь Вам необходимо выбрать единицу измерения периода.]]></string>
-    <string name="_bx_events_form_price_input_sys_price"><![CDATA[Цена]]></string>
-    <string name="_bx_events_form_price_input_price"><![CDATA[Цена]]></string>
-    <string name="_bx_events_form_price_input_inf_price"><![CDATA[Введите 0 или оставьте пустым для создания бесплатного уровня.]]></string>
-    <string name="_bx_events_form_price_input_sys_do_submit"><![CDATA[Выполнить]]></string>
-    <string name="_bx_events_form_price_input_do_submit"><![CDATA[Выполнить]]></string>
-    <string name="_bx_events_form_price_input_sys_do_cancel"><![CDATA[Отменить]]></string>
-    <string name="_bx_events_form_price_input_do_cancel"><![CDATA[Отменить]]></string>
-
 	<string name="_bx_events_acl_action_create_profile"><![CDATA[Создать событие]]></string>
-        <string name="_bx_events_acl_action_use_paid_join"><![CDATA[Использовать платное участие в событии]]></string>
 	<string name="_bx_events_acl_action_delete_profile"><![CDATA[Удалить событие]]></string>
 	<string name="_bx_events_acl_action_view_profile"><![CDATA[Просмотреть событие]]></string>
 	<string name="_bx_events_acl_action_edit_any_profile"><![CDATA[Редактировать любое событие]]></string>
@@ -122,8 +97,6 @@
 	<string name="_bx_events_page_title_edit_profile_cover"><![CDATA[Редактировать обложку]]></string>
 	<string name="_bx_events_page_title_sys_delete_profile"><![CDATA[Удалить событие]]></string>
 	<string name="_bx_events_page_title_delete_profile"><![CDATA[Удалить событие]]></string>
-        <string name="_bx_events_page_title_sys_join_profile"><![CDATA[Участвовать в событии]]></string>
-	<string name="_bx_events_page_title_join_profile"><![CDATA[Участвовать в событии]]></string>
 	<string name="_bx_events_page_title_sys_view_profile_closed"><![CDATA[Просмотр закрытого события]]></string>
 	<string name="_bx_events_page_title_sys_view_profile"><![CDATA[Просмотр события]]></string>
 	<string name="_bx_events_page_title_view_profile"><![CDATA[{display_name}]]></string>
@@ -144,8 +117,6 @@
     <string name="_bx_events_page_title_profile_comments"><![CDATA[Комментарии]]></string>
 	<string name="_bx_events_page_title_sys_profile_info"><![CDATA[Инфо события]]></string>
 	<string name="_bx_events_page_title_profile_info"><![CDATA[Информация о событии "{display_name}"]]></string>
-        <string name="_bx_events_page_title_sys_profile_pricing"><![CDATA[Цены]]></string>
-	<string name="_bx_events_page_title_profile_pricing"><![CDATA[Цены]]></string>
 	<string name="_bx_events_page_title_sys_recent"><![CDATA[Новые события]]></string>
 	<string name="_bx_events_page_title_recent"><![CDATA[Новые события]]></string>
 	<string name="_bx_events_page_title_sys_manage"><![CDATA[Управление своими событиями]]></string>
@@ -185,13 +156,9 @@
     <string name="_bx_events_page_block_title_edit_profile"><![CDATA[Редактировать событие]]></string>
     <string name="_bx_events_page_block_title_edit_profile_cover"><![CDATA[Редактировать обложку]]></string>
     <string name="_bx_events_page_block_title_delete_profile"><![CDATA[Удалить событие]]></string>
-    <string name="_bx_events_page_block_title_join_profile"><![CDATA[Участвовать в событии]]></string>
     <string name="_bx_events_page_block_title_profile_info_link"><![CDATA["<a href="{profile_link}">{display_name}</a>" - инфо]]></string>
     <string name="_bx_events_page_block_title_profile_info"><![CDATA[Инфо]]></string>
     <string name="_bx_events_page_block_title_system_profile_info"><![CDATA[Инфо]]></string>
-    <string name="_bx_events_page_block_title_system_profile_pricing"><![CDATA[Цены]]></string>
-    <string name="_bx_events_page_block_title_profile_pricing"><![CDATA[Цены]]></string>
-    <string name="_bx_events_page_block_title_profile_pricing_link"><![CDATA[Расценки события: <a href="{profile_link}">{display_name}</a>]]></string>
     <string name="_bx_events_page_block_title_profile_description"><![CDATA[Описание]]></string>
     <string name="_bx_events_page_block_title_profile_friends_link"><![CDATA[<a href="{profile_link}">{display_name}</a> - друзья]]></string>
     <string name="_bx_events_page_block_title_profile_friends"><![CDATA[Друзья]]></string>
@@ -237,7 +204,6 @@
     <string name="_bx_events_page_block_title_recommended_entries_view_showcase"><![CDATA[Рекомендованные события]]></string>
     <string name="_bx_events_page_block_title_favorites_entries"><![CDATA[Список "{title}"]]></string>
     <string name="_bx_events_page_block_title_favorites_entries_info"><![CDATA[Информация]]></string>
-    <string name="_bx_events_page_block_title_favorites_entries_actions"><![CDATA[Действия]]></string>
 
     <string name="_bx_events_menu_title_submenu"><![CDATA[Под-меню событий]]></string>
     <string name="_bx_events_menu_set_title_submenu"><![CDATA[Под-меню событий]]></string>
@@ -260,8 +226,6 @@
     <string name="_bx_events_menu_item_title_clear_reports"><![CDATA[Очистить жалобы]]></string>
     <string name="_bx_events_menu_item_title_system_edit_cover"><![CDATA[Редактировать обложку]]></string>
     <string name="_bx_events_menu_item_title_edit_cover"><![CDATA[Редактировать обложку]]></string>
-    <string name="_bx_events_menu_item_title_system_edit_pricing"><![CDATA[Редактировать цены]]></string>
-    <string name="_bx_events_menu_item_title_edit_pricing"><![CDATA[Редактировать цены]]></string>
     <string name="_bx_events_menu_item_title_system_edit_profile"><![CDATA[Редактировать событие]]></string>
     <string name="_bx_events_menu_item_title_edit_profile"><![CDATA[Редактировать событие]]></string>
     <string name="_bx_events_menu_item_title_system_delete_profile"><![CDATA[Удалить событие]]></string>
@@ -307,9 +271,6 @@
     <string name="_bx_events_menu_item_title_leave_group_cancel_request"><![CDATA[Отменить]]></string>
     <string name="_bx_events_menu_item_title_leave_group_reject_request"><![CDATA[Отклонить]]></string>
 
-    <string name="_bx_events_menu_item_title_system_pay_and_join"><![CDATA[Оплатить и участвовать]]></string>
-    <string name="_bx_events_menu_item_title_pay_and_join"><![CDATA[Оплатить и участвовать]]></string>
-
     <string name="_bx_events_menu_item_title_system_subscribe"><![CDATA[Получать уведомления]]></string>
     <string name="_bx_events_menu_item_title_subscribe"><![CDATA[Заинтересован]]></string>
     <string name="_bx_events_menu_item_title_system_view_entries_in_context"><![CDATA[События]]></string>
@@ -367,22 +328,6 @@
     <string name="_bx_events_grid_action_err_delete"><![CDATA[Невозможно удалить выбранные события.]]></string>
     <string name="_bx_events_grid_txt_account_manager"><![CDATA[Перенаправить в управление аккаунтом.]]></string>
 
-    <string name="_bx_events_grid_column_title_name"><![CDATA[Название]]></string>
-    <string name="_bx_events_grid_column_title_role_id"><![CDATA[Роль]]></string>
-    <string name="_bx_events_grid_column_title_period"><![CDATA[Период]]></string>
-    <string name="_bx_events_grid_column_title_price"><![CDATA[Цена]]></string>
-    <string name="_bx_events_grid_action_title_add"><![CDATA[Добавить]]></string>
-    <string name="_bx_events_grid_action_title_edit"><![CDATA[Изменить]]></string>
-    <string name="_bx_events_grid_action_title_delete"><![CDATA[Удалить]]></string>
-    <string name="_bx_events_grid_action_title_buy"><![CDATA[Купить]]></string>
-    <string name="_bx_events_grid_action_title_buy_title"><![CDATA[Единовременный платеж]]></string>
-    <string name="_bx_events_grid_action_title_subscribe"><![CDATA[Подписаться]]></string>
-    <string name="_bx_events_grid_action_title_subscribe_title"><![CDATA[Создать подписку с регулярным выставлением счетов]]></string>
-    <string name="_bx_events_grid_action_title_choose"><![CDATA[Выбирать]]></string>
-    <string name="_bx_events_grid_action_title_choose_title"><![CDATA[Бесплатно переключиться на уровень]]></string>
-    <string name="_bx_events_popup_title_price_add"><![CDATA[Добавить ценовой план]]></string>
-    <string name="_bx_events_popup_title_price_edit"><![CDATA[Редактировать ценовой план]]></string>
-
     <string name="_bx_events_chart_growth"><![CDATA[События: Развитие]]></string>
     <string name="_bx_events_chart_growth_speed"><![CDATA[События: Скорость развития]]></string>
 
@@ -394,8 +339,6 @@
     <string name="_bx_events_txt_account_suspended"><![CDATA[Это событие заблокировано.]]></string>
     <string name="_bx_events_txt_N_fans"><![CDATA[{0} участников]]></string>
     <string name="_bx_events_txt_role"><![CDATA[Роль]]></string>
-    <string name="_bx_events_txt_role_added"><![CDATA[Начало]]></string>
-    <string name="_bx_events_txt_role_expired"><![CDATA[Окончание]]></string>
     <string name="_bx_events_txt_sample_single"><![CDATA[событие]]></string>
     <string name="_bx_events_txt_sample_single_with_article"><![CDATA[событие]]></string>
     <string name="_bx_events_txt_sample_comment_single"><![CDATA[комментарий к событию]]></string>
@@ -411,12 +354,6 @@
     <string name="_bx_events_txt_invite_popup_button_decline"><![CDATA[Отклонить]]></string>
     <string name="_bx_events_txt_invite_popup_error_invitation_absent"><![CDATA[Извините, произошла ошибка. Вы не можете присоединиться к этому событию. Приглашение устарело или удалено.]]></string>
     <string name="_bx_events_txt_invite_popup_error_invitation_wrong_user"><![CDATA[Извините, произошла ошибка. Вы не можете присоединиться к этому событию. Приглашение адресовано не Вам.]]></string>
-    <string name="_bx_events_txt_n_unit"><![CDATA[{0} ({1})]]></string>
-    <string name="_bx_events_txt_cart_item_title"><![CDATA[{0}: {1} ({2} {3})]]></string>
-
-    <string name="_bx_events_msg_performed"><![CDATA[Действие было успешно выполнено.]]></string>
-    <string name="_bx_events_err_price_duplicate"><![CDATA[Аналогичный ценовой план уже существует.]]></string>
-    <string name="_bx_events_err_cannot_perform"><![CDATA[Невозможно выполнить действие. Пожалуйста, оповестите нас об этой проблеме.]]></string>
 
     <string name="_bx_events_alert_action_fan_added"><![CDATA[присоединение нового участника]]></string>
     <string name="_bx_events_txt_ntfs_fan_added"><![CDATA[У события <b class="bx-ntfs-content-profile">{owner_name}</b> новый участник <b class="bx-ntfs-content-entry">{subentry_sample}</b>]]></string>
@@ -456,12 +393,6 @@
     <string name="_bx_events_role_administrator"><![CDATA[Администратор]]></string>
     <string name="_bx_events_role_moderator"><![CDATA[Модератор]]></string>
 
-    <string name="_bx_events_pre_lists_period_units"><![CDATA[Платежный интервал]]></string>
-    <string name="_bx_events_period_unit_day"><![CDATA[день]]></string>
-    <string name="_bx_events_period_unit_week"><![CDATA[неделя]]></string>
-    <string name="_bx_events_period_unit_month"><![CDATA[месяц]]></string>
-    <string name="_bx_events_period_unit_year"><![CDATA[год]]></string>
-
     <string name="_bx_events_pre_lists_repeat_year"><![CDATA[Повторять: год]]></string>
     <string name="_bx_events_cat_repeat_year_every_year"><![CDATA[Каждый год]]></string>
     <string name="_bx_events_cat_repeat_year_every_2_years"><![CDATA[Каждые 2 года]]></string>

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

@@ -48,7 +48,7 @@
     <string name="_bx_groups_form_profile_input_delete_confirm"><![CDATA[Я уверен, что хочу удалить эту группу]]></string>
     <string name="_bx_groups_form_profile_input_delete_confirm_info"><![CDATA[Это действие не может быть отменено.]]></string>
     <string name="_bx_groups_form_profile_input_delete_confirm_error"><![CDATA[Пожалуйста, отметьте этот флажок, если действительно хотите удалить группу.]]></string>
-    <string name="_bx_groups_form_entry_input_allow_view_favorite_list"><![CDATA[Видимость]]></string>
+    <string name="_bx_groups_form_profile_input_allow_view_favorite_list"><![CDATA[Видимость]]></string>
 
     <string name="_bx_groups_form_price"><![CDATA[Цена]]></string>
     <string name="_bx_groups_form_price_display_add"><![CDATA[Добавление]]></string>

+ 1 - 0
modules/boonex/russian/data/langs/bx_payment/ru.xml

@@ -423,6 +423,7 @@
     <string name="_bx_payment_cdt_active_cpt"><![CDATA[Активировать]]></string>
     <string name="_bx_payment_cdt_active_dsc"><![CDATA[Активировать(деактивировать) платежную систему.]]></string>
     <string name="_bx_payment_cdt_msg_charged"><![CDATA[Платеж успешно принят.]]></string>
+    <string name="_bx_payment_cdt_msg_subscribed"><![CDATA[Спасибо! Подписка создана. Пожалуйста, проверьте ваш email для получения дальнейших инструкций.]]></string>
     <string name="_bx_payment_cdt_err_not_available"><![CDATA[В данное время оплата Кредитами не доступна.]]></string>
     <string name="_bx_payment_cdt_err_wrong_transaction"><![CDATA[Не удалось верифицировать транзакцию.]]></string>
     <string name="_bx_payment_txt_name_credits"><![CDATA[Кредиты]]></string>

+ 75 - 1
modules/boonex/russian/data/langs/bx_spaces/ru.xml

@@ -10,6 +10,7 @@
     <string name="_bx_spaces_option_searchable_fields"><![CDATA[Поля для поиска]]></string>
     <string name="_bx_spaces_option_members_mode"><![CDATA[Спец. режим для членов пространства]]></string>
     <string name="_bx_spaces_option_members_mode_multi_roles"><![CDATA[Множественные роли]]></string>
+    <string name="_bx_spaces_option_per_page_for_favorites_lists"><![CDATA[Количество списков избранного на странице]]></string>
     <string name="_bx_spaces_option_internal_notifications"><![CDATA[Использовать встроенную нотификацию]]></string>
 
     <string name="_bx_spaces_form_profile"><![CDATA[Пространства]]></string>
@@ -26,6 +27,7 @@
     <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_favorite_list"><![CDATA[Видимость]]></string>
     <string name="_bx_spaces_form_profile_input_allow_view_to_desc"><![CDATA[Закрытая - все могут найти пространство и видеть кто в ней состоит, только участники могут видеть сообщения. Секретная - только участники могут найти пространство и видеть сообщения.]]></string>
     <string name="_bx_spaces_form_profile_input_sys_allow_post_to"><![CDATA[Оставлять сообщения в профиле могут]]></string>
     <string name="_bx_spaces_form_profile_input_allow_post_to"><![CDATA[Оставлять сообщения в профиле могут]]></string>
@@ -51,7 +53,32 @@
     <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_form_price"><![CDATA[Цена]]></string>
+    <string name="_bx_spaces_form_price_display_add"><![CDATA[Добавление]]></string>
+    <string name="_bx_spaces_form_price_display_edit"><![CDATA[Редактирование]]></string>
+    <string name="_bx_spaces_form_price_input_sys_id"><![CDATA[ID]]></string>
+    <string name="_bx_spaces_form_price_input_sys_role_id"><![CDATA[ID роли]]></string>
+    <string name="_bx_spaces_form_price_input_sys_name"><![CDATA[Имя]]></string>
+    <string name="_bx_spaces_form_price_input_name"><![CDATA[Имя]]></string>
+    <string name="_bx_spaces_form_price_input_inf_name"><![CDATA[Уникальное значение, которое будет использоваться в серверной части и API запросах]]></string>
+    <string name="_bx_spaces_form_price_input_err_name"><![CDATA[Введите уникальное значение]]></string>
+    <string name="_bx_spaces_form_price_input_sys_period"><![CDATA[Период]]></string>
+    <string name="_bx_spaces_form_price_input_period"><![CDATA[Период]]></string>
+    <string name="_bx_spaces_form_price_input_inf_period"><![CDATA[Используйте 0 для пожизненного]]></string>
+    <string name="_bx_spaces_form_price_input_sys_period_unit"><![CDATA[Единица измерения периода]]></string>
+    <string name="_bx_spaces_form_price_input_period_unit"><![CDATA[Единица измерения периода]]></string>
+    <string name="_bx_spaces_form_price_input_inf_period_unit"><![CDATA[Оставьте пустым для пожизненного уровня.]]></string>
+    <string name="_bx_spaces_form_price_input_err_period_unit"><![CDATA[Здесь Вам необходимо выбрать единицу измерения периода.]]></string>
+    <string name="_bx_spaces_form_price_input_sys_price"><![CDATA[Цена]]></string>
+    <string name="_bx_spaces_form_price_input_price"><![CDATA[Цена]]></string>
+    <string name="_bx_spaces_form_price_input_inf_price"><![CDATA[Введите 0 или оставьте пустым для создания бесплатного уровня.]]></string>
+    <string name="_bx_spaces_form_price_input_sys_do_submit"><![CDATA[Выполнить]]></string>
+    <string name="_bx_spaces_form_price_input_do_submit"><![CDATA[Выполнить]]></string>
+    <string name="_bx_spaces_form_price_input_sys_do_cancel"><![CDATA[Отменить]]></string>
+    <string name="_bx_spaces_form_price_input_do_cancel"><![CDATA[Отменить]]></string>
+
 	<string name="_bx_spaces_acl_action_create_profile"><![CDATA[Создать пространство]]></string>
+        <string name="_bx_spaces_acl_action_use_paid_join"><![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>
@@ -68,6 +95,8 @@
 	<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_join_profile"><![CDATA[Присоединиться к пространству]]></string>
+        <string name="_bx_spaces_page_title_join_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>
@@ -86,6 +115,8 @@
     <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_profile_pricing"><![CDATA[Цены]]></string>
+        <string name="_bx_spaces_page_title_profile_pricing"><![CDATA[Цены]]></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>
@@ -97,6 +128,8 @@
     <string name="_bx_spaces_page_title_invite_to_space"><![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_title_sys_entries_favorites"><![CDATA[Избранные пространства]]></string>
+    <string name="_bx_spaces_page_title_entries_favorites"><![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>
@@ -115,6 +148,9 @@
 	<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_system_profile_pricing"><![CDATA[Цены]]></string>
+        <string name="_bx_spaces_page_block_title_profile_pricing"><![CDATA[Цены]]></string>
+        <string name="_bx_spaces_page_block_title_profile_pricing_link"><![CDATA[Расценки пространства: <a href="{profile_link}">{display_name}</a>]]></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>
@@ -149,6 +185,9 @@
     <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_page_block_title_top_level_spaces"><![CDATA[Пространства верхнего уровня]]></string>
+    <string name="_bx_spaces_page_block_title_favorites_entries"><![CDATA[Список "{title}"]]></string>
+    <string name="_bx_spaces_page_block_title_favorites_entries_info"><![CDATA[Информация]]></string>
+    <string name="_bx_spaces_page_block_title_favorites_entries_actions"><![CDATA[Действия]]></string>
 
   <string name="_bx_spaces_menu_title_submenu"><![CDATA[Пространства - Подменю]]></string>
     <string name="_bx_spaces_menu_set_title_submenu"><![CDATA[Пространства - Подменю]]></string>
@@ -171,6 +210,8 @@
     <string name="_bx_spaces_menu_item_title_clear_reports"><![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_pricing"><![CDATA[Редактировать цены]]></string>
+    <string name="_bx_spaces_menu_item_title_edit_pricing"><![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>
@@ -216,6 +257,9 @@
     <string name="_bx_spaces_menu_item_title_leave_space_cancel_request"><![CDATA[Отменить присоединение]]></string>
     <string name="_bx_spaces_menu_item_title_leave_space_reject_request"><![CDATA[Отвергнуть присоединение]]></string>
 
+    <string name="_bx_spaces_menu_item_title_system_pay_and_join"><![CDATA[Оплатить и присоединиться]]></string>
+    <string name="_bx_spaces_menu_item_title_pay_and_join"><![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>
@@ -260,6 +304,22 @@
 	  <string name="_bx_spaces_grid_action_err_delete"><![CDATA[Невозможно удалить выбранную(ные) пространство(ы).]]></string>
 	  <string name="_bx_spaces_grid_txt_account_manager"><![CDATA[Перенаправить в управление аккаунтом.]]></string>
 
+    <string name="_bx_spaces_grid_column_title_name"><![CDATA[Название]]></string>
+    <string name="_bx_spaces_grid_column_title_role_id"><![CDATA[Роль]]></string>
+    <string name="_bx_spaces_grid_column_title_period"><![CDATA[Период]]></string>
+    <string name="_bx_spaces_grid_column_title_price"><![CDATA[Цена]]></string>
+    <string name="_bx_spaces_grid_action_title_add"><![CDATA[Добавить]]></string>
+    <string name="_bx_spaces_grid_action_title_edit"><![CDATA[Изменить]]></string>
+    <string name="_bx_spaces_grid_action_title_delete"><![CDATA[Удалить]]></string>
+    <string name="_bx_spaces_grid_action_title_buy"><![CDATA[Купить]]></string>
+    <string name="_bx_spaces_grid_action_title_buy_title"><![CDATA[Единовременный платеж]]></string>
+    <string name="_bx_spaces_grid_action_title_subscribe"><![CDATA[Подписаться]]></string>
+    <string name="_bx_spaces_grid_action_title_subscribe_title"><![CDATA[Создать подписку с регулярным выставлением счетов]]></string>
+    <string name="_bx_spaces_grid_action_title_choose"><![CDATA[Выбирать]]></string>
+    <string name="_bx_spaces_grid_action_title_choose_title"><![CDATA[Бесплатно переключиться на уровень]]></string>
+    <string name="_bx_spaces_popup_title_price_add"><![CDATA[Добавить ценовой план]]></string>
+    <string name="_bx_spaces_popup_title_price_edit"><![CDATA[Редактировать ценовой план]]></string>
+
     <string name="_bx_spaces_chart_growth"><![CDATA[Пространства: Развитие]]></string>
     <string name="_bx_spaces_chart_growth_speed"><![CDATA[Пространства: Скорость развития]]></string>
 
@@ -271,6 +331,8 @@
     <string name="_bx_spaces_txt_account_suspended"><![CDATA[Эта пространство заблокирована.]]></string>
     <string name="_bx_spaces_txt_N_fans"><![CDATA[{0} участников]]></string>
     <string name="_bx_spaces_txt_role"><![CDATA[Роль]]></string>
+    <string name="_bx_spaces_txt_role_added"><![CDATA[Начало]]></string>
+    <string name="_bx_spaces_txt_role_expired"><![CDATA[Окончание]]></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>
@@ -285,7 +347,13 @@
     <string name="_bx_spaces_txt_invite_popup_button_decline"><![CDATA[Отклонить]]></string>
     <string name="_bx_spaces_txt_invite_popup_error_invitation_absent"><![CDATA[Извините, произошла ошибка. Вы не можете вступить в это пространство. Приглашение устарело или удалено.]]></string>
     <string name="_bx_spaces_txt_invite_popup_error_invitation_wrong_user"><![CDATA[Извините, произошла ошибка. Вы не можете вступить в это пространство. Приглашение адресовано не Вам.]]></string>
-	
+    <string name="_bx_spaces_txt_n_unit"><![CDATA[{0} ({1})]]></string>
+    <string name="_bx_spaces_txt_cart_item_title"><![CDATA[{0}: {1} ({2} {3})]]></string>
+
+    <string name="_bx_spaces_msg_performed"><![CDATA[Действие было успешно выполнено.]]></string>
+    <string name="_bx_spaces_err_price_duplicate"><![CDATA[Аналогичный ценовой план уже существует.]]></string>
+    <string name="_bx_spaces_err_cannot_perform"><![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_invitation_notif"><![CDATA[приглашение вступить в группу]]></string>
@@ -307,6 +375,12 @@
     <string name="_bx_spaces_role_administrator"><![CDATA[Администратор]]></string>
     <string name="_bx_spaces_role_moderator"><![CDATA[Модератор]]></string>
 
+    <string name="_bx_spaces_pre_lists_period_units"><![CDATA[Платежный интервал]]></string>
+    <string name="_bx_spaces_period_unit_day"><![CDATA[день]]></string>
+    <string name="_bx_spaces_period_unit_week"><![CDATA[неделя]]></string>
+    <string name="_bx_spaces_period_unit_month"><![CDATA[месяц]]></string>
+    <string name="_bx_spaces_period_unit_year"><![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}

+ 25 - 2
modules/boonex/spaces/classes/BxSpacesConfig.php

@@ -33,6 +33,7 @@ class BxSpacesConfig extends BxBaseModGroupsConfig
             'TABLE_ENTRIES_FULLTEXT' => 'search_fields',
             'TABLE_ADMINS' => $aModule['db_prefix'] . 'admins',
             'TABLE_INVITES' => $aModule['db_prefix'] . 'invites',
+            'TABLE_PRICES' => $aModule['db_prefix'] . 'prices',
 
             // database fields
             'FIELD_ID' => 'id',
@@ -57,10 +58,14 @@ class BxSpacesConfig extends BxBaseModGroupsConfig
             'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
             'FIELD_LABELS' => 'labels',
 
+            'FIELD_PRICE_ROLE_ID' => 'role_id',
+            'FIELD_PRICE_NAME' => 'name',
+
             // page URIs
             'URI_VIEW_ENTRY' => 'view-space-profile',
             'URI_EDIT_ENTRY' => 'edit-space-profile',
             'URI_EDIT_COVER' => 'edit-space-cover',
+            'URI_JOIN_ENTRY' => 'join-space-profile',
             'URI_JOINED_ENTRIES' => 'joined-spaces',
             'URI_MANAGE_COMMON' => 'spaces-manage',
 
@@ -77,6 +82,9 @@ class BxSpacesConfig extends BxBaseModGroupsConfig
             'PARAM_PER_PAGE_BROWSE_RECOMMENDED' => 'bx_spaces_per_page_browse_recommended',
 
             'PARAM_MMODE' => 'bx_spaces_members_mode',
+            'PARAM_PAID_JOIN_ENABLED' => true,
+            'PARAM_RECURRING_RESERVE' => 3, // 3 days for recurring payment to be registered
+            'PARAM_PER_PAGE_FOR_FAVORITES_LISTS' => 'bx_spaces_per_page_for_favorites_lists',
             'PARAM_USE_IN' => 'bx_spaces_internal_notifications',
 
             // objects
@@ -107,6 +115,9 @@ class BxSpacesConfig extends BxBaseModGroupsConfig
             '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_FORM_PRICE' => 'bx_spaces_price',
+            'OBJECT_FORM_PRICE_DISPLAY_ADD' => 'bx_spaces_price_add',
+            'OBJECT_FORM_PRICE_DISPLAY_EDIT' => 'bx_spaces_price_edit',
             '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_VIEW_ENTRY_ALL' => 'bx_spaces_view_actions_all', // all actions menu on view entry page
@@ -120,16 +131,20 @@ class BxSpacesConfig extends BxBaseModGroupsConfig
             '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_LIST_VIEW' => 'bx_spaces_allow_view_favorite_list',
             'OBJECT_PRIVACY_VIEW_NOTIFICATION_EVENT' => 'bx_spaces_allow_view_notification_to',
             'OBJECT_PRIVACY_POST' => 'bx_spaces_allow_post_to',
             'OBJECT_GRID_ADMINISTRATION' => 'bx_spaces_administration',
             'OBJECT_GRID_COMMON' => 'bx_spaces_common',
             'OBJECT_GRID_CONNECTIONS' => 'bx_spaces_fans',
             'OBJECT_GRID_INVITES' => 'bx_spaces_invites',
+            'OBJECT_GRID_PRICES_MANAGE' => 'bx_spaces_prices_manage',
+            'OBJECT_GRID_PRICES_VIEW' => 'bx_spaces_prices_view',
             'OBJECT_CONNECTIONS' => 'bx_spaces_fans',
             'OBJECT_UPLOADERS_COVER' => array('bx_spaces_cover_crop'),
             'OBJECT_UPLOADERS_PICTURE' => array('bx_spaces_picture_crop'),
             'OBJECT_PRE_LIST_ROLES' => 'bx_spaces_roles',
+            'OBJECT_PRE_LIST_PERIOD_UNITS' => 'bx_spaces_period_units',
 
             'BADGES_AVALIABLE' => true,
             'INVITES_KEYS_LIFETIME' => 86400,
@@ -207,6 +222,12 @@ class BxSpacesConfig extends BxBaseModGroupsConfig
 				'txt_invitation_popup_decline_button' => '_bx_spaces_txt_invite_popup_button_decline',
                 'txt_invitation_popup_error_invitation_absent' => '_bx_spaces_txt_invite_popup_error_invitation_absent',
 				'txt_invitation_popup_error_wrong_user' => '_bx_spaces_txt_invite_popup_error_invitation_wrong_user',
+                'txt_n_unit' => '_bx_spaces_txt_n_unit',
+                'txt_buy_title' => '_bx_spaces_grid_action_title_buy_title',
+                'txt_cart_item_title' => '_bx_spaces_txt_cart_item_title',
+                'txt_subscribe_title' => '_bx_spaces_grid_action_title_subscribe_title',
+                'msg_performed' => '_bx_spaces_msg_performed',
+                'err_cannot_perform' => '_bx_spaces_err_cannot_perform',
             ),
 
         );
@@ -214,13 +235,15 @@ class BxSpacesConfig extends BxBaseModGroupsConfig
         $this->_aJsClasses = array(
             'main' => 'BxSpacesMain',
             'manage_tools' => 'BxSpacesManageTools',
-            'invite_popup' => 'BxSpacesInvitePopup'
+            'invite_popup' => 'BxSpacesInvitePopup',
+            'prices' => 'BxSpacesPrices'
         );
 
         $this->_aJsObjects = array(
             'main' => 'oBxSpacesMain',
             'manage_tools' => 'oBxSpacesManageTools',
-            'invite_popup' => 'oBxSpacesInvitePopup'
+            'invite_popup' => 'oBxSpacesInvitePopup',
+            'prices' => 'oBxSpacesPrices'
         );
 
         $this->_aGridObjects = array(

+ 22 - 0
modules/boonex/spaces/classes/BxSpacesCronPruning.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
+ *
+ * @defgroup    Spaces Spaces
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxSpacesCronPruning extends BxBaseModGroupsCronPruning
+{
+    public function __construct()
+    {
+        $this->_sModule = 'bx_spaces';
+
+        parent::__construct();
+    }
+}
+
+/** @} */

+ 22 - 0
modules/boonex/spaces/classes/BxSpacesFormPrice.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
+ *
+ * @defgroup    Spaces Spaces
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxSpacesFormPrice extends BxBaseModGroupsFormPrice
+{
+    public function __construct($aInfo, $oTemplate = false)
+    {
+        $this->_sModule = 'bx_spaces';
+
+        parent::__construct($aInfo, $oTemplate);
+    }
+}
+
+/** @} */

+ 22 - 0
modules/boonex/spaces/classes/BxSpacesGridPricesManage.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
+ *
+ * @defgroup    Spaces Spaces
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxSpacesGridPricesManage extends BxBaseModGroupsGridPricesManage
+{
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+        $this->_sModule = 'bx_spaces';
+
+        parent::__construct ($aOptions, $oTemplate);
+    }
+}
+
+/** @} */

+ 22 - 0
modules/boonex/spaces/classes/BxSpacesGridPricesView.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
+ *
+ * @defgroup    Spaces Spaces
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxSpacesGridPricesView extends BxBaseModGroupsGridPricesView
+{
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+        $this->_sModule = 'bx_spaces';
+
+        parent::__construct ($aOptions, $oTemplate);
+    }
+}
+
+/** @} */

+ 10 - 0
modules/boonex/spaces/classes/BxSpacesMenuViewActionsAll.php

@@ -21,6 +21,11 @@ class BxSpacesMenuViewActionsAll extends BxBaseModGroupsMenuViewActionsAll
         parent::__construct($aObject, $oTemplate);
     }
 
+    protected function _getMenuItemJoinSpaceProfile($aItem)
+    {
+        return $this->_getMenuItemByNameActions($aItem);
+    }
+
     protected function _getMenuItemEditSpaceCover($aItem)
     {
         return $this->_getMenuItemByNameActionsMore($aItem);
@@ -31,6 +36,11 @@ class BxSpacesMenuViewActionsAll extends BxBaseModGroupsMenuViewActionsAll
         return $this->_getMenuItemByNameActionsMore($aItem);
     }
 
+    protected function _getMenuItemEditSpacePricing($aItem)
+    {
+        return $this->_getMenuItemByNameActionsMore($aItem);
+    }
+
     protected function _getMenuItemInviteToSpace($aItem)
     {
         return $this->_getMenuItemByNameActionsMore($aItem);

+ 24 - 0
modules/boonex/spaces/classes/BxSpacesPageListEntry.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
+ *
+ * @defgroup    Spaces Spaces
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * List entry page
+ */
+class BxSpacesPageListEntry extends BxBaseModGroupsPageListEntry
+{    
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_spaces';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 75 - 1
modules/boonex/spaces/install/langs/en.xml

@@ -10,6 +10,7 @@
     <string name="_bx_spaces_option_searchable_fields"><![CDATA[Searchable fields]]></string>
     <string name="_bx_spaces_option_members_mode"><![CDATA[Special mode for space members]]></string>
     <string name="_bx_spaces_option_members_mode_multi_roles"><![CDATA[Multi Roles]]></string>
+    <string name="_bx_spaces_option_per_page_for_favorites_lists"><![CDATA[Number of favorite lists per page]]></string>
     <string name="_bx_spaces_option_internal_notifications"><![CDATA[Use internal notifications]]></string>
 
     <string name="_bx_spaces_form_profile"><![CDATA[Spaces]]></string>
@@ -26,6 +27,7 @@
     <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[Visible to]]></string>
     <string name="_bx_spaces_form_profile_input_allow_view_to"><![CDATA[Visible to]]></string>
+    <string name="_bx_spaces_form_profile_input_allow_view_favorite_list"><![CDATA[Visibility]]></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_allow_post_to"><![CDATA[Who can post]]></string>
     <string name="_bx_spaces_form_profile_input_allow_post_to"><![CDATA[Who can post]]></string>
@@ -51,7 +53,32 @@
     <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_form_price"><![CDATA[Price]]></string>
+    <string name="_bx_spaces_form_price_display_add"><![CDATA[Add]]></string>
+    <string name="_bx_spaces_form_price_display_edit"><![CDATA[Edit]]></string>
+    <string name="_bx_spaces_form_price_input_sys_id"><![CDATA[ID]]></string>
+    <string name="_bx_spaces_form_price_input_sys_role_id"><![CDATA[Role ID]]></string>
+    <string name="_bx_spaces_form_price_input_sys_name"><![CDATA[Name]]></string>
+    <string name="_bx_spaces_form_price_input_name"><![CDATA[Name]]></string>
+    <string name="_bx_spaces_form_price_input_inf_name"><![CDATA[Unique value which will be used in back end and API calls]]></string>
+    <string name="_bx_spaces_form_price_input_err_name"><![CDATA[You need to enter a unique value here]]></string>
+    <string name="_bx_spaces_form_price_input_sys_period"><![CDATA[Period]]></string>
+    <string name="_bx_spaces_form_price_input_period"><![CDATA[Period]]></string>
+    <string name="_bx_spaces_form_price_input_inf_period"><![CDATA[Use 0 for lifetime]]></string>
+    <string name="_bx_spaces_form_price_input_sys_period_unit"><![CDATA[Period unit]]></string>
+    <string name="_bx_spaces_form_price_input_period_unit"><![CDATA[Period unit]]></string>
+    <string name="_bx_spaces_form_price_input_inf_period_unit"><![CDATA[Leave empty for lifetime level.]]></string>
+    <string name="_bx_spaces_form_price_input_err_period_unit"><![CDATA[You need to select a period unit here.]]></string>
+    <string name="_bx_spaces_form_price_input_sys_price"><![CDATA[Price]]></string>
+    <string name="_bx_spaces_form_price_input_price"><![CDATA[Price]]></string>
+    <string name="_bx_spaces_form_price_input_inf_price"><![CDATA[Use 0 or leave empty to create free level.]]></string>
+    <string name="_bx_spaces_form_price_input_sys_do_submit"><![CDATA[Submit]]></string>
+    <string name="_bx_spaces_form_price_input_do_submit"><![CDATA[Submit]]></string>
+    <string name="_bx_spaces_form_price_input_sys_do_cancel"><![CDATA[Cancel]]></string>
+    <string name="_bx_spaces_form_price_input_do_cancel"><![CDATA[Cancel]]></string>
+
     <string name="_bx_spaces_acl_action_create_profile"><![CDATA[Create Space]]></string>
+    <string name="_bx_spaces_acl_action_use_paid_join"><![CDATA[Use paid join]]></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>
@@ -68,6 +95,8 @@
 	<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_join_profile"><![CDATA[Join Space]]></string>
+        <string name="_bx_spaces_page_title_join_profile"><![CDATA[Join 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>
@@ -86,6 +115,8 @@
 	<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_profile_pricing"><![CDATA[Pricing]]></string>
+        <string name="_bx_spaces_page_title_profile_pricing"><![CDATA[Pricing]]></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>
@@ -93,10 +124,14 @@
 	<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_joined"><![CDATA[Joined  Spaces]]></string>
+        <string name="_bx_spaces_page_title_joined"><![CDATA[Joined 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_title_sys_entries_favorites"><![CDATA[Favorives Groups]]></string>
+        <string name="_bx_spaces_page_title_entries_favorites"><![CDATA[Favorives Groups]]></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>
@@ -112,9 +147,13 @@
 	<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_join_profile"><![CDATA[Join 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_system_profile_pricing"><![CDATA[Pricing]]></string>
+        <string name="_bx_spaces_page_block_title_profile_pricing"><![CDATA[Pricing]]></string>
+        <string name="_bx_spaces_page_block_title_profile_pricing_link"><![CDATA[Pricing of <a href="{profile_link}">{display_name}</a>]]></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>
@@ -172,6 +211,8 @@
   <string name="_bx_spaces_menu_item_title_clear_reports"><![CDATA[Clear reports]]></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_pricing"><![CDATA[Edit Pricing]]></string>
+        <string name="_bx_spaces_menu_item_title_edit_pricing"><![CDATA[Edit Pricing]]></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>
@@ -216,7 +257,10 @@
 	<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_pay_and_join"><![CDATA[Pay & Join]]></string>
+    <string name="_bx_spaces_menu_item_title_pay_and_join"><![CDATA[Pay & Join]]></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>
@@ -261,6 +305,22 @@
 	<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_grid_column_title_name"><![CDATA[Name]]></string>
+    <string name="_bx_spaces_grid_column_title_role_id"><![CDATA[Role]]></string>
+    <string name="_bx_spaces_grid_column_title_period"><![CDATA[Period]]></string>
+    <string name="_bx_spaces_grid_column_title_price"><![CDATA[Price]]></string>
+    <string name="_bx_spaces_grid_action_title_add"><![CDATA[Add]]></string>
+    <string name="_bx_spaces_grid_action_title_edit"><![CDATA[Edit]]></string>
+    <string name="_bx_spaces_grid_action_title_delete"><![CDATA[Delete]]></string>
+    <string name="_bx_spaces_grid_action_title_buy"><![CDATA[Buy]]></string>
+    <string name="_bx_spaces_grid_action_title_buy_title"><![CDATA[One-time payment]]></string>
+    <string name="_bx_spaces_grid_action_title_subscribe"><![CDATA[Subscribe]]></string>
+    <string name="_bx_spaces_grid_action_title_subscribe_title"><![CDATA[Create a subscription with recurring billing]]></string>
+    <string name="_bx_spaces_grid_action_title_choose"><![CDATA[Choose]]></string>
+    <string name="_bx_spaces_grid_action_title_choose_title"><![CDATA[Switch to the level for free]]></string>
+    <string name="_bx_spaces_popup_title_price_add"><![CDATA[Add Pricing Plan]]></string>
+    <string name="_bx_spaces_popup_title_price_edit"><![CDATA[Edit Pricing Plan]]></string>
+
 	<string name="_bx_spaces_chart_growth"><![CDATA[Spaces: Growth]]></string>
 	<string name="_bx_spaces_chart_growth_speed"><![CDATA[Spaces: Growth Speed]]></string>
 	
@@ -272,6 +332,8 @@
     <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_role"><![CDATA[Role]]></string>
+    <string name="_bx_spaces_txt_role_added"><![CDATA[Added]]></string>
+    <string name="_bx_spaces_txt_role_expired"><![CDATA[Expires]]></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>
@@ -286,6 +348,12 @@
     <string name="_bx_spaces_txt_invite_popup_button_decline"><![CDATA[Decline]]></string>
     <string name="_bx_spaces_txt_invite_popup_error_invitation_absent"><![CDATA[Sorry, an error has occurred. You can not join this space. The invitation is expired or deleted.]]></string>
     <string name="_bx_spaces_txt_invite_popup_error_invitation_wrong_user"><![CDATA[Sorry, an error has occurred. You can not join this space. This invitation cannot be used by you.]]></string>
+    <string name="_bx_spaces_txt_n_unit"><![CDATA[{0} ({1})]]></string>
+    <string name="_bx_spaces_txt_cart_item_title"><![CDATA[{0}: {1} ({2} {3})]]></string>
+
+    <string name="_bx_spaces_msg_performed"><![CDATA[The action was successfully performed.]]></string>
+    <string name="_bx_spaces_err_price_duplicate"><![CDATA[Similar pricing plan is already exists.]]></string>
+    <string name="_bx_spaces_err_cannot_perform"><![CDATA[An error appeared. Please report.]]></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>
@@ -308,6 +376,12 @@
     <string name="_bx_spaces_role_administrator"><![CDATA[Administrator]]></string>
     <string name="_bx_spaces_role_moderator"><![CDATA[Moderator]]></string>
 
+    <string name="_bx_spaces_pre_lists_period_units"><![CDATA[Billing Interval]]></string>
+    <string name="_bx_spaces_period_unit_day"><![CDATA[day]]></string>
+    <string name="_bx_spaces_period_unit_week"><![CDATA[week]]></string>
+    <string name="_bx_spaces_period_unit_month"><![CDATA[month]]></string>
+    <string name="_bx_spaces_period_unit_year"><![CDATA[year]]></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}

+ 8 - 5
modules/boonex/spaces/install/sql/disable.sql

@@ -8,7 +8,7 @@ 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');
+DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_spaces' OR `object` IN('bx_spaces_create_profile', 'bx_spaces_delete_profile', 'bx_spaces_join_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_pricing', 'bx_spaces_profile_comments', 'bx_spaces_home', 'bx_spaces_fans', 'bx_spaces_joined', 'bx_spaces_favorites', 'bx_spaces_top', 'bx_spaces_search', 'bx_spaces_manage', 'bx_spaces_administration');
 
 -- MENU
 DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_spaces';
@@ -38,9 +38,9 @@ DELETE FROM `sys_statistics` WHERE `name` LIKE 'bx_spaces%';
 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', 'bx_spaces_invites');
-DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_spaces_administration', 'bx_spaces_moderation', 'bx_spaces_common', 'bx_spaces_fans', 'bx_spaces_invites');
-DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_spaces_administration', 'bx_spaces_moderation', 'bx_spaces_common', 'bx_spaces_fans', 'bx_spaces_invites');
+DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_spaces_administration', 'bx_spaces_moderation', 'bx_spaces_common', 'bx_spaces_fans', 'bx_spaces_invites', 'bx_spaces_prices_manage', 'bx_spaces_prices_view');
+DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_spaces_administration', 'bx_spaces_moderation', 'bx_spaces_common', 'bx_spaces_fans', 'bx_spaces_invites', 'bx_spaces_prices_manage', 'bx_spaces_prices_view');
+DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_spaces_administration', 'bx_spaces_moderation', 'bx_spaces_common', 'bx_spaces_fans', 'bx_spaces_invites', 'bx_spaces_prices_manage', 'bx_spaces_prices_view');
 
 -- ALERTS
 SET @iHandler := (SELECT `id` FROM `sys_alerts_handlers` WHERE `name` = 'bx_spaces' LIMIT 1);
@@ -48,10 +48,13 @@ 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', 'bx_spaces_allow_post_to');
+DELETE FROM `sys_objects_privacy` WHERE `object` IN ('bx_spaces_allow_view_to', 'bx_spaces_allow_view_notification_to', 'bx_spaces_allow_post_to', 'bx_spaces_allow_view_favorite_list');
 
 -- 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');
+
+-- CRON
+DELETE FROM `sys_cron_jobs` WHERE `name` IN ('bx_spaces_pruning');

+ 96 - 21
modules/boonex/spaces/install/sql/enable.sql

@@ -17,6 +17,7 @@ INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `e
 ('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_per_page_for_favorites_lists', '5', @iCategId, '_bx_spaces_option_per_page_for_favorites_lists', 'digit', '', '', '', 17),
 ('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),
 ('bx_spaces_members_mode', '', @iCategId, '_bx_spaces_option_members_mode', 'select', 'a:2:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:24:"get_options_members_mode";}', '', '', 40),
 ('bx_spaces_internal_notifications', '', @iCategId, '_bx_spaces_option_internal_notifications', 'checkbox', '', '', '', 50);
@@ -93,6 +94,13 @@ INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module
 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: join 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_join_profile', 'join-space-profile', '_bx_spaces_page_title_sys_join_profile', '_bx_spaces_page_title_join_profile', 'bx_spaces', 5, 2147483647, 1, 'page.php?i=join-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_join_profile', 1, 'bx_spaces', '_bx_spaces_page_block_title_join_profile', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:11:"entity_join";s:6:"params";a:1:{i:0;s:12:"{profile_id}";}}', 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 
@@ -102,6 +110,13 @@ INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `t
 ('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: manage profile pricing
+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_pricing', 'edit-space-pricing', '_bx_spaces_page_title_sys_profile_pricing', '_bx_spaces_page_title_profile_pricing', 'bx_spaces', 5, 2147483647, 1, 'page.php?i=edit-space-pricing', '', '', '', 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_pricing', 1, 'bx_spaces', '_bx_spaces_page_block_title_system_profile_pricing', '_bx_spaces_page_block_title_profile_pricing_link', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:14:"entity_pricing";s:6:"params";a:1:{i:0;s:12:"{profile_id}";}}', 0, 0, 1, 1);
+
 -- 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 
@@ -179,11 +194,21 @@ INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `t
 ('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: favorites by list
+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_favorites', '_bx_spaces_page_title_sys_entries_favorites', '_bx_spaces_page_title_entries_favorites', 'bx_spaces', 12, 2147483647, 1, 'spaces-favorites', 'page.php?i=spaces-favorites', '', '', '', 0, 1, 0, 'BxSpacesPageListEntry', 'modules/boonex/spaces/classes/BxSpacesPageListEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_spaces_favorites', 2, 'bx_spaces', '_bx_spaces_page_block_title_favorites_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:15:"browse_favorite";s:6:"params";a:2:{s:10:"profile_id";s:12:"{profile_id}";s:6:"params";a:3:{s:9:"unit_view";s:7:"gallery";s:13:"empty_message";b:0;s:13:"ajax_paginate";b:0;}}}', 0, 1, 1),
+('bx_spaces_favorites', 3, 'bx_spaces', '_bx_spaces_page_block_title_favorites_entries_info', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:19:"favorites_list_info";}', 0, 0, 0),
+('bx_spaces_favorites', 3, 'bx_spaces', '_bx_spaces_page_block_title_favorites_entries_actions', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:22:"favorites_list_actions";}', 0, 0, 1);
+
 -- 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
@@ -220,6 +245,7 @@ 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`, `visibility_custom`, `active`, `copyable`, `editable`, `order`) VALUES 
+('bx_spaces_view_actions', 'bx_spaces', 'join-space-profile', '_bx_spaces_menu_item_title_system_pay_and_join', '_bx_spaces_menu_item_title_pay_and_join', 'page.php?i=join-space-profile&profile_id={profile_id}', '', '', 'sign-in-alt', '', 0, 2147483647, 'a:3:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:22:"is_paid_join_avaliable";s:6:"params";a:1:{i:0;s:12:"{profile_id}";}}', 1, 0, 0, 5),
 ('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}\')', '', 'sign-in-alt', '', 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-set-badges', '_sys_menu_item_title_system_set_badges', '_sys_menu_item_title_set_badges', 'javascript:void(0)', 'bx_menu_popup(''sys_set_badges'', window, {}, {module: ''bx_spaces'', content_id: {content_id}});', '', 'check-circle', '', 0, 192, 'a:2:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:19:"is_badges_avaliable";}', 1, 0, 1, 30),
@@ -233,13 +259,14 @@ INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `templat
 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}\')', '', 'sign-out-alt', '', 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}', '', '', 'edit', '', 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-alt', '', 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-friends', '', 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);
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `visibility_custom`, `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}\')', '', 'sign-out-alt', '', 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}', '', '', 'edit', '', 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-alt', '', 2147483647, '', 1, 0, 40),
+('bx_spaces_view_actions_more', 'bx_spaces', 'edit-space-pricing', '_bx_spaces_menu_item_title_system_edit_pricing', '_bx_spaces_menu_item_title_edit_pricing', 'page.php?i=edit-space-pricing&profile_id={profile_id}', '', '', 'money-check-alt', '', 2147483647, 'a:3:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:20:"is_pricing_avaliable";s:6:"params";a:1:{i:0;s:12:"{profile_id}";}}', 1, 0, 41),
+('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-friends', '', 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: all actions menu for view entry 
 
@@ -250,6 +277,7 @@ INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
 ('bx_spaces_view_actions_all', 'bx_spaces', '_sys_menu_set_title_view_actions', 0);
 
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `submenu_popup`, `visible_for_levels`, `visibility_custom`, `active`, `copyable`, `order`) VALUES 
+('bx_spaces_view_actions_all', 'bx_spaces', 'join-space-profile', '_bx_spaces_menu_item_title_system_pay_and_join', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 5),
 ('bx_spaces_view_actions_all', 'bx_spaces', 'profile-fan-add', '_bx_spaces_menu_item_title_system_become_fan', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 10),
 ('bx_spaces_view_actions_all', 'bx_spaces', 'profile-fan-remove', '_bx_spaces_menu_item_title_system_leave_group', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 20),
 ('bx_spaces_view_actions_all', 'bx_spaces', 'profile-subscribe-add', '_bx_spaces_menu_item_title_system_subscribe', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 30),
@@ -270,6 +298,7 @@ INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `titl
 ('bx_spaces_view_actions_all', 'bx_spaces', 'social-sharing-pinterest', '_sys_menu_item_title_system_social_sharing_pinterest', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 330),
 ('bx_spaces_view_actions_all', 'bx_spaces', 'edit-space-cover', '_bx_spaces_menu_item_title_system_edit_cover', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 400),
 ('bx_spaces_view_actions_all', 'bx_spaces', 'edit-space-profile', '_bx_spaces_menu_item_title_system_edit_profile', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 410),
+('bx_spaces_view_actions_all', 'bx_spaces', 'edit-space-pricing', '_bx_spaces_menu_item_title_system_edit_pricing', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 415),
 ('bx_spaces_view_actions_all', 'bx_spaces', 'invite-to-space', '_bx_spaces_menu_item_title_system_invite', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 420),
 ('bx_spaces_view_actions_all', 'bx_spaces', 'delete-space-profile', '_bx_spaces_menu_item_title_system_delete_profile', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 430),
 ('bx_spaces_view_actions_all', 'bx_spaces', 'more-auto', '_sys_menu_item_title_system_va_more_auto', '_sys_menu_item_title_va_more_auto', 'javascript:void(0)', '', '', 'ellipsis-v', '', '', 0, 2147483647, '', 1, 0, 9999);
@@ -323,18 +352,19 @@ INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `templat
 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', 'date', '_sys_menu_item_title_system_sm_date', '_sys_menu_item_title_sm_date', '', '', '', '', '', 2147483647, 0, 0, 1, 1),
-('bx_spaces_snippet_meta', 'bx_spaces', 'tags', '_sys_menu_item_title_system_sm_tags', '_sys_menu_item_title_sm_tags', '', '', '', '', '', 2147483647, 0, 0, 1, 2),
-('bx_spaces_snippet_meta', 'bx_spaces', 'views', '_sys_menu_item_title_system_sm_views', '_sys_menu_item_title_sm_views', '', '', '', '', '', 2147483647, 0, 0, 1, 3),
-('bx_spaces_snippet_meta', 'bx_spaces', 'comments', '_sys_menu_item_title_system_sm_comments', '_sys_menu_item_title_sm_comments', '', '', '', '', '', 2147483647, 0, 0, 1, 4),
-('bx_spaces_snippet_meta', 'bx_spaces', 'members', '_sys_menu_item_title_system_sm_members', '_sys_menu_item_title_sm_members', '', '', '', '', '', 2147483647, 0, 0, 1, 5),
-('bx_spaces_snippet_meta', 'bx_spaces', 'subscribers', '_sys_menu_item_title_system_sm_subscribers', '_sys_menu_item_title_sm_subscribers', '', '', '', '', '', 2147483647, 1, 0, 1, 6),
-('bx_spaces_snippet_meta', 'bx_spaces', 'nl', '_sys_menu_item_title_system_sm_nl', '_sys_menu_item_title_sm_nl', '', '', '', '', '', 2147483647, 1, 0, 1, 7),
-('bx_spaces_snippet_meta', 'bx_spaces', 'join', '_sys_menu_item_title_system_sm_join', '_sys_menu_item_title_sm_join', '', '', '', '', '', 2147483647, 0, 0, 1, 8),
-('bx_spaces_snippet_meta', 'bx_spaces', 'leave', '_sys_menu_item_title_system_sm_leave', '_sys_menu_item_title_sm_leave', '', '', '', '', '', 2147483647, 0, 0, 1, 9),
-('bx_spaces_snippet_meta', 'bx_spaces', 'subscribe', '_sys_menu_item_title_system_sm_subscribe', '_sys_menu_item_title_sm_subscribe', '', '', '', '', '', 2147483647, 1, 0, 1, 10),
-('bx_spaces_snippet_meta', 'bx_spaces', 'unsubscribe', '_sys_menu_item_title_system_sm_unsubscribe', '_sys_menu_item_title_sm_unsubscribe', '', '', '', '', '', 2147483647, 0, 0, 1, 11);
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `visibility_custom`, `active`, `copyable`, `editable`, `order`) VALUES
+('bx_spaces_snippet_meta', 'bx_spaces', 'date', '_sys_menu_item_title_system_sm_date', '_sys_menu_item_title_sm_date', '', '', '', '', '', 2147483647, '', 0, 0, 1, 1),
+('bx_spaces_snippet_meta', 'bx_spaces', 'tags', '_sys_menu_item_title_system_sm_tags', '_sys_menu_item_title_sm_tags', '', '', '', '', '', 2147483647, '', 0, 0, 1, 2),
+('bx_spaces_snippet_meta', 'bx_spaces', 'views', '_sys_menu_item_title_system_sm_views', '_sys_menu_item_title_sm_views', '', '', '', '', '', 2147483647, '', 0, 0, 1, 3),
+('bx_spaces_snippet_meta', 'bx_spaces', 'comments', '_sys_menu_item_title_system_sm_comments', '_sys_menu_item_title_sm_comments', '', '', '', '', '', 2147483647, '', 0, 0, 1, 4),
+('bx_spaces_snippet_meta', 'bx_spaces', 'members', '_sys_menu_item_title_system_sm_members', '_sys_menu_item_title_sm_members', '', '', '', '', '', 2147483647, '', 0, 0, 1, 5),
+('bx_spaces_snippet_meta', 'bx_spaces', 'subscribers', '_sys_menu_item_title_system_sm_subscribers', '_sys_menu_item_title_sm_subscribers', '', '', '', '', '', 2147483647, '', 1, 0, 1, 6),
+('bx_spaces_snippet_meta', 'bx_spaces', 'nl', '_sys_menu_item_title_system_sm_nl', '_sys_menu_item_title_sm_nl', '', '', '', '', '', 2147483647, '', 1, 0, 1, 7),
+('bx_spaces_snippet_meta', 'bx_spaces', 'join-paid', '_sys_menu_item_title_system_sm_join_paid', '_sys_menu_item_title_sm_join_paid', '', '', '', '', '', 2147483647, 'a:3:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:33:"is_paid_join_avaliable_by_content";s:6:"params";a:1:{i:0;s:12:"{content_id}";}}', 1, 0, 1, 8),
+('bx_spaces_snippet_meta', 'bx_spaces', 'join', '_sys_menu_item_title_system_sm_join', '_sys_menu_item_title_sm_join', '', '', '', '', '', 2147483647, 'a:3:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:33:"is_free_join_avaliable_by_content";s:6:"params";a:1:{i:0;s:12:"{content_id}";}}', 0, 0, 1, 9),
+('bx_spaces_snippet_meta', 'bx_spaces', 'leave', '_sys_menu_item_title_system_sm_leave', '_sys_menu_item_title_sm_leave', '', '', '', '', '', 2147483647, '', 0, 0, 1, 10),
+('bx_spaces_snippet_meta', 'bx_spaces', 'subscribe', '_sys_menu_item_title_system_sm_subscribe', '_sys_menu_item_title_sm_subscribe', '', '', '', '', '', 2147483647, '', 1, 0, 1, 11),
+('bx_spaces_snippet_meta', 'bx_spaces', 'unsubscribe', '_sys_menu_item_title_system_sm_unsubscribe', '_sys_menu_item_title_sm_unsubscribe', '', '', '', '', '', 2147483647, '', 0, 0, 1, 12);
 
 -- 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);
@@ -368,6 +398,10 @@ INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`,
 ('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', 'use paid join', NULL, '_bx_spaces_acl_action_use_paid_join', '', 1, 1);
+SET @iIdActionUsePaidJoin = 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();
@@ -409,6 +443,12 @@ INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
 (@iAdministrator, @iIdActionProfileCreate),
 (@iPremium, @iIdActionProfileCreate),
 
+-- use paid join
+(@iStandard, @iIdActionUsePaidJoin),
+(@iModerator, @iIdActionUsePaidJoin),
+(@iAdministrator, @iIdActionUsePaidJoin),
+(@iPremium, @iIdActionUsePaidJoin),
+
 -- profile delete
 (@iAccount, @iIdActionProfileDelete),
 (@iStandard, @iIdActionProfileDelete),
@@ -474,7 +514,9 @@ INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `fie
 INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `params`, `order`) VALUES
 ('bx_spaces_fans', 'name', '_sys_name', '50%', '', 10),
 ('bx_spaces_fans', 'role', '_bx_spaces_txt_role', '10%', '', 15),
-('bx_spaces_fans', 'actions', '', '40%', '', 20);
+('bx_spaces_fans', 'role_added', '_bx_spaces_txt_role_added', '10%', '', 16),
+('bx_spaces_fans', 'role_expired', '_bx_spaces_txt_role_expired', '10%', '', 17),
+('bx_spaces_fans', 'actions', '', '20%', '', 20);
 
 INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `confirm`, `order`) VALUES
 ('bx_spaces_fans', 'single', 'accept', '_sys_accept', '', 0, 10),
@@ -524,6 +566,34 @@ INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon
 ('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);
 
+-- GRIDS: Pricing
+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_prices_manage', 'Sql', 'SELECT * FROM `bx_spaces_prices` WHERE 1 ', 'bx_spaces_prices', 'id', 'order', '', '', 100, NULL, 'start', '', 'period,period_unit,price', '', 'like', '', '', 2147483647, 'BxSpacesGridPricesManage', 'modules/boonex/spaces/classes/BxSpacesGridPricesManage.php'),
+('bx_spaces_prices_view', 'Sql', 'SELECT * FROM `bx_spaces_prices` WHERE 1 ', 'bx_spaces_prices', 'id', 'order', '', '', 100, NULL, 'start', '', 'period,period_unit,price', '', 'like', '', '', 2147483647, 'BxSpacesGridPricesView', 'modules/boonex/spaces/classes/BxSpacesGridPricesView.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('bx_spaces_prices_manage', 'checkbox', '_sys_select', '1%', 0, '', '', 1),
+('bx_spaces_prices_manage', 'order', '', '1%', 0, '', '', 2),
+('bx_spaces_prices_manage', 'name', '_bx_spaces_grid_column_title_name', '38%', 0, 32, '', 3),
+('bx_spaces_prices_manage', 'price', '_bx_spaces_grid_column_title_price', '20%', 0, 16, '', 4),
+('bx_spaces_prices_manage', 'period', '_bx_spaces_grid_column_title_period', '20%', 0, 16, '', 5),
+('bx_spaces_prices_manage', 'actions', '', '20%', 0, '', '', 6),
+
+('bx_spaces_prices_view', 'role_id', '_bx_spaces_grid_column_title_role_id', '40%', 0, 32, '', 1),
+('bx_spaces_prices_view', 'price', '_bx_spaces_grid_column_title_price', '20%', 0, 16, '', 2),
+('bx_spaces_prices_view', 'period', '_bx_spaces_grid_column_title_period', '20%', 0, 16, '', 3),
+('bx_spaces_prices_view', 'actions', '', '20%', 0, '', '', 4);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon_only`, `confirm`, `order`) VALUES
+('bx_spaces_prices_manage', 'independent', 'add', '_bx_spaces_grid_action_title_add', '', 0, 0, 1),
+('bx_spaces_prices_manage', 'single', 'edit', '_bx_spaces_grid_action_title_edit', 'pencil-alt', 1, 0, 1),
+('bx_spaces_prices_manage', 'single', 'delete', '_bx_spaces_grid_action_title_delete', 'remove', 1, 1, 2),
+('bx_spaces_prices_manage', 'bulk', 'delete', '_bx_spaces_grid_action_title_delete', '', 0, 1, 1),
+
+('bx_spaces_prices_view', 'single', 'buy', '_bx_spaces_grid_action_title_buy', 'cart-plus', 0, 0, 1),
+('bx_spaces_prices_view', 'single', 'subscribe', '_bx_spaces_grid_action_title_subscribe', 'credit-card', 0, 0, 2),
+('bx_spaces_prices_view', 'single', 'choose', '_bx_spaces_grid_action_title_choose', 'far check-square', 0, 0, 3);
+
 
 -- ALERTS
 
@@ -558,7 +628,8 @@ INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
 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'),
-('bx_spaces_allow_post_to', 'bx_spaces', 'post', '_bx_spaces_form_profile_input_allow_post_to', '3', '', 'bx_spaces_data', 'id', 'author', 'BxSpacesPrivacyPost', 'modules/boonex/spaces/classes/BxSpacesPrivacyPost.php');
+('bx_spaces_allow_post_to', 'bx_spaces', 'post', '_bx_spaces_form_profile_input_allow_post_to', '3', '', 'bx_spaces_data', 'id', 'author', 'BxSpacesPrivacyPost', 'modules/boonex/spaces/classes/BxSpacesPrivacyPost.php'),
+('bx_spaces_allow_view_favorite_list', 'bx_spaces', 'view_favorite_list', '_bx_spaces_form_profile_input_allow_view_favorite_list', '3', '', 'bx_spaces_favorites_lists', 'id', 'author_id', 'BxSpacesPrivacy', 'modules/boonex/spaces/classes/BxSpacesPrivacy.php');
 
 -- EMAIL TEMPLATES
 
@@ -578,3 +649,7 @@ INSERT INTO `sys_objects_uploader` (`object`, `active`, `override_class_name`, `
 ('bx_spaces_cover_crop', 1, 'BxSpacesUploaderCoverCrop', 'modules/boonex/spaces/classes/BxSpacesUploaderCoverCrop.php'),
 ('bx_spaces_picture_crop', 1, 'BxSpacesUploaderPictureCrop', 'modules/boonex/spaces/classes/BxSpacesUploaderPictureCrop.php');
 
+
+-- CRON
+INSERT INTO `sys_cron_jobs` (`name`, `time`, `class`, `file`, `service_call`) VALUES
+('bx_spaces_pruning', '0 0 * * *', 'BxSpacesCronPruning', 'modules/boonex/spaces/classes/BxSpacesCronPruning.php', '');

+ 81 - 2
modules/boonex/spaces/install/sql/install.sql

@@ -200,7 +200,9 @@ CREATE TABLE IF NOT EXISTS `bx_spaces_admins` (
   `group_profile_id` int(10) unsigned NOT NULL,
   `fan_id` int(10) unsigned NOT NULL,
   `role` int(10) unsigned NOT NULL default '0',
+  `order` varchar(32) NOT NULL default '',
   `added` int(11) unsigned NOT NULL default '0',
+  `expired` int(11) unsigned NOT NULL default '0',
   PRIMARY KEY (`id`),
   UNIQUE KEY `admin` (`group_profile_id`,`fan_id`)
 );
@@ -209,10 +211,21 @@ CREATE TABLE IF NOT EXISTS `bx_spaces_admins` (
 CREATE TABLE `bx_spaces_favorites_track` (
   `object_id` int(11) NOT NULL default '0',
   `author_id` int(11) NOT NULL default '0',
+  `list_id` int(11) NOT NULL default '0',
   `date` int(11) NOT NULL default '0',
   KEY `id` (`object_id`,`author_id`)
 );
 
+CREATE TABLE `bx_spaces_favorites_lists` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `title` varchar(255) NOT NULL,
+  `author_id` int(11) NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  `allow_view_favorite_list_to` varchar(16) NOT NULL DEFAULT '3',
+   PRIMARY KEY (`id`)
+);
+
+
 -- TABLE: scores
 CREATE TABLE IF NOT EXISTS `bx_spaces_scores` (
   `object_id` int(11) NOT NULL default '0',
@@ -242,6 +255,21 @@ CREATE TABLE IF NOT EXISTS `bx_spaces_invites` (
   PRIMARY KEY (`id`)
 );
 
+-- TABLE: Pricing
+CREATE TABLE IF NOT EXISTS `bx_spaces_prices` (
+  `id` int(11) NOT NULL auto_increment,
+  `profile_id` int(11) NOT NULL default '0',
+  `role_id` int(11) unsigned NOT NULL default '0',
+  `name` varchar(128) NOT NULL default '',
+  `period` int(11) unsigned NOT NULL default '1',
+  `period_unit` varchar(32) NOT NULL default '',
+  `price` float unsigned NOT NULL default '1',
+  `order` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `name` (`name`),
+  UNIQUE KEY `type` (`profile_id`, `role_id`,`period`, `period_unit`)
+);
+
 -- 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),
@@ -334,6 +362,46 @@ INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for
 ('bx_space_view_full', 'space_cat', 2147483647, 1, 2),
 ('bx_space_view_full', 'space_desc', 2147483647, 1, 3);
 
+-- FORMS: Price
+INSERT INTO `sys_objects_form` (`object`, `module`, `title`, `action`, `form_attrs`, `submit_name`, `table`, `key`, `uri`, `uri_title`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
+('bx_spaces_price', 'bx_spaces', '_bx_spaces_form_price', '', '', 'do_submit', 'bx_spaces_prices', 'id', '', '', '', 0, 1, 'BxSpacesFormPrice', 'modules/boonex/spaces/classes/BxSpacesFormPrice.php');
+
+INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
+('bx_spaces_price_add', 'bx_spaces', 'bx_spaces_price', '_bx_spaces_form_price_display_add', 0),
+('bx_spaces_price_edit', 'bx_spaces', 'bx_spaces_price', '_bx_spaces_form_price_display_edit', 0);
+
+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_spaces_price', 'bx_spaces', 'id', '', '', 0, 'hidden', '_bx_spaces_form_price_input_sys_id', '', '', 1, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
+('bx_spaces_price', 'bx_spaces', 'role_id', '', '', 0, 'hidden', '_bx_spaces_form_price_input_sys_role_id', '', '', 1, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
+('bx_spaces_price', 'bx_spaces', 'name', '', '', 0, 'text', '_bx_spaces_form_price_input_sys_name', '_bx_spaces_form_price_input_name', '_bx_spaces_form_price_input_inf_name', 1, 0, 0, '', '', '', 'Avail', '', '_bx_spaces_form_price_input_err_name', 'Xss', '', 1, 0),
+('bx_spaces_price', 'bx_spaces', 'period', '', '', 0, 'text', '_bx_spaces_form_price_input_sys_period', '_bx_spaces_form_price_input_period', '_bx_spaces_form_price_input_inf_period', 1, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
+('bx_spaces_price', 'bx_spaces', 'period_unit', '', '#!bx_spaces_period_units', 0, 'select', '_bx_spaces_form_price_input_sys_period_unit', '_bx_spaces_form_price_input_period_unit', '_bx_spaces_form_price_input_inf_period_unit', 1, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
+('bx_spaces_price', 'bx_spaces', 'price', '', '', 0, 'text', '_bx_spaces_form_price_input_sys_price', '_bx_spaces_form_price_input_price', '_bx_spaces_form_price_input_inf_price', 1, 0, 0, '', '', '', '', '', '', 'Float', '', 1, 0),
+('bx_spaces_price', 'bx_spaces', 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_spaces_price', 'bx_spaces', 'do_submit', '_bx_spaces_form_price_input_do_submit', '', 0, 'submit', '_bx_spaces_form_price_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_spaces_price', 'bx_spaces', 'do_cancel', '_bx_spaces_form_price_input_do_cancel', '', 0, 'button', '_bx_spaces_form_price_input_sys_do_cancel', '', '', 0, 0, 0, 'a:2:{s:7:"onclick";s:45:"$(''.bx-popup-applied:visible'').dolPopupHide()";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 1, 0);
+
+INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
+('bx_spaces_price_add', 'id', 2147483647, 0, 1),
+('bx_spaces_price_add', 'role_id', 2147483647, 1, 2),
+('bx_spaces_price_add', 'name', 2147483647, 1, 3),
+('bx_spaces_price_add', 'price', 2147483647, 1, 4),
+('bx_spaces_price_add', 'period', 2147483647, 1, 5),
+('bx_spaces_price_add', 'period_unit', 2147483647, 1, 6),
+('bx_spaces_price_add', 'controls', 2147483647, 1, 7),
+('bx_spaces_price_add', 'do_submit', 2147483647, 1, 8),
+('bx_spaces_price_add', 'do_cancel', 2147483647, 1, 9),
+
+('bx_spaces_price_edit', 'id', 2147483647, 1, 1),
+('bx_spaces_price_edit', 'role_id', 2147483647, 1, 2),
+('bx_spaces_price_edit', 'name', 2147483647, 1, 3),
+('bx_spaces_price_edit', 'price', 2147483647, 1, 4),
+('bx_spaces_price_edit', 'period', 2147483647, 1, 5),
+('bx_spaces_price_edit', 'period_unit', 2147483647, 1, 6),
+('bx_spaces_price_edit', 'controls', 2147483647, 1, 7),
+('bx_spaces_price_edit', 'do_submit', 2147483647, 1, 8),
+('bx_spaces_price_edit', 'do_cancel', 2147483647, 1, 9);
+
 -- 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');
@@ -355,6 +423,17 @@ INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALU
 ('bx_spaces_roles', '1', 2, '_bx_spaces_role_administrator', ''),
 ('bx_spaces_roles', '2', 3, '_bx_spaces_role_moderator', '');
 
+INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
+('bx_spaces_period_units', '_bx_spaces_pre_lists_period_units', 'bx_spaces', '0');
+
+INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES
+('bx_spaces_period_units', '', 0, '_sys_please_select', ''),
+('bx_spaces_period_units', 'day', 1, '_bx_spaces_period_unit_day', ''),
+('bx_spaces_period_units', 'week', 2, '_bx_spaces_period_unit_week', ''),
+('bx_spaces_period_units', 'month', 3, '_bx_spaces_period_unit_month', ''),
+('bx_spaces_period_units', 'year', 4, '_bx_spaces_period_unit_year', '');
+
+
 -- 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', 'BxSpacesCmts', 'modules/boonex/spaces/classes/BxSpacesCmts.php'),
@@ -377,8 +456,8 @@ INSERT INTO `sys_objects_report` (`name`, `module`, `table_main`, `table_track`,
 ('bx_spaces', 'bx_spaces', 'bx_spaces_reports', 'bx_spaces_reports_track', '1', 'page.php?i=view-space-profile&id={object_id}', 'bx_spaces_notes', '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', '', '');
+INSERT INTO `sys_objects_favorite` (`name`, `table_track`, `table_lists`, `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', 'bx_spaces_favorites_lists', '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`, `module`, `is_on`, `is_undo`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_flag`, `class_name`, `class_file`) VALUES 

+ 2 - 2
modules/boonex/spaces/install/sql/uninstall.sql

@@ -1,7 +1,7 @@
 
 -- TABLES
 
-DROP TABLE IF EXISTS `bx_spaces_data`, `bx_spaces_pics`, `bx_spaces_pics_resized`, `bx_spaces_cmts`, `bx_spaces_cmts_notes`, `bx_spaces_views_track`, `bx_spaces_meta_keywords`, `bx_spaces_meta_locations`, `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`, `bx_spaces_invites`;
+DROP TABLE IF EXISTS `bx_spaces_data`, `bx_spaces_pics`, `bx_spaces_pics_resized`, `bx_spaces_cmts`, `bx_spaces_cmts_notes`, `bx_spaces_views_track`, `bx_spaces_meta_keywords`, `bx_spaces_meta_locations`, `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_favorites_lists`, `bx_spaces_scores`, `bx_spaces_scores_track`, `bx_spaces_invites`, `bx_spaces_prices`;
 
 -- PROFILES
 
@@ -21,7 +21,7 @@ DELETE FROM `sys_transcoder_images_files` WHERE `transcoder_object` IN('bx_space
 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');
+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', 'bx_space_invite', 'bx_spaces_price_add', 'bx_spaces_price_edit');
 
 -- PRE-VALUES
 DELETE FROM `sys_form_pre_lists` WHERE `module` = 'bx_spaces';

+ 59 - 0
modules/boonex/spaces/js/prices.js

@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Spaces Spaces
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+
+function BxSpacesPrices(oOptions) {
+    this._sActionsUri = oOptions.sActionUri;
+    this._sActionsUrl = oOptions.sActionUrl;
+    this._sObjNameGrid = oOptions.sObjNameGrid;
+    this._sObjName = oOptions.sObjName == undefined ? 'oBxSpacesPrices' : oOptions.sObjName;
+    this._aHtmlIds = oOptions.aHtmlIds == undefined ? {} : oOptions.aHtmlIds;
+    this._oRequestParams = oOptions.oRequestParams == undefined ? {} : oOptions.oRequestParams;
+}
+
+BxSpacesPrices.prototype.checkName = function(sNameId, iId) {
+    var oDate = new Date();
+
+    var oName = jQuery("[name='" + sNameId + "']");
+    var sName = oName.val();
+
+    if(!sName.length)
+        return;
+
+    jQuery.get(
+        this._sActionsUrl + 'check_name',
+        {
+            name: sName,
+            id: iId && parseInt(iId) > 0 ? iId : 0,
+            _t: oDate.getTime()
+        },
+        function(oData) {
+            if(!oData || oData.name == undefined)
+                return;
+
+            oName.val(oData.name);
+        },
+        'json'
+    );
+};
+
+BxSpacesPrices.prototype.onChangeRole = function() {
+	this.reloadGrid($('#bx-grid-level-' + this._sObjNameGrid).val());
+};
+
+BxSpacesPrices.prototype.reloadGrid = function(iRoleId) {
+    if(glGrids[this._sObjNameGrid]._oQueryAppend['role_id'] == iRoleId)
+        return;
+
+    glGrids[this._sObjNameGrid]._oQueryAppend['role_id'] = iRoleId;
+    glGrids[this._sObjNameGrid].reload(0);
+};
+
+/** @} */

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

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

+ 1 - 0
modules/boonex/spaces/template/favorite-list-info.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/general/template/favorite-list-info.html />

+ 1 - 0
modules/boonex/spaces/template/favorite-lists.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/general/template/favorite-lists.html />

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

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