Explorar o código

Modules updates.

AntonLV %!s(int64=3) %!d(string=hai) anos
pai
achega
c429adcc7f
Modificáronse 25 ficheiros con 4162 adicións e 0 borrados
  1. 51 0
      modules/boonex/facebook_connect/updates/13.0.3_13.0.4/install/config.php
  2. 13 0
      modules/boonex/facebook_connect/updates/13.0.3_13.0.4/install/installer.php
  3. 8 0
      modules/boonex/facebook_connect/updates/13.0.3_13.0.4/install/sql/enable.sql
  4. 68 0
      modules/boonex/facebook_connect/updates/13.0.3_13.0.4/source/install/config.php
  5. 24 0
      modules/boonex/facebook_connect/updates/13.0.3_13.0.4/source/install/sql/disable.sql
  6. 51 0
      modules/boonex/facebook_connect/updates/13.0.3_13.0.4/source/install/sql/enable.sql
  7. 51 0
      modules/boonex/notifications/updates/13.0.7_13.0.8/install/config.php
  8. 13 0
      modules/boonex/notifications/updates/13.0.7_13.0.8/install/installer.php
  9. 439 0
      modules/boonex/notifications/updates/13.0.7_13.0.8/source/classes/BxNtfsDb.php
  10. 700 0
      modules/boonex/notifications/updates/13.0.7_13.0.8/source/classes/BxNtfsModule.php
  11. 449 0
      modules/boonex/notifications/updates/13.0.7_13.0.8/source/classes/BxNtfsTemplate.php
  12. 82 0
      modules/boonex/notifications/updates/13.0.7_13.0.8/source/install/config.php
  13. 54 0
      modules/boonex/russian/updates/13.0.10_13.0.11/install/config.php
  14. 13 0
      modules/boonex/russian/updates/13.0.10_13.0.11/install/installer.php
  15. 8 0
      modules/boonex/russian/updates/13.0.10_13.0.11/install/langs/bx_spaces/ru.xml
  16. 444 0
      modules/boonex/russian/updates/13.0.10_13.0.11/source/data/langs/bx_spaces/ru.xml
  17. 71 0
      modules/boonex/russian/updates/13.0.10_13.0.11/source/install/config.php
  18. 51 0
      modules/boonex/spaces/updates/13.0.6_13.0.7/install/config.php
  19. 13 0
      modules/boonex/spaces/updates/13.0.6_13.0.7/install/installer.php
  20. 8 0
      modules/boonex/spaces/updates/13.0.6_13.0.7/install/langs/en.xml
  21. 2 0
      modules/boonex/spaces/updates/13.0.6_13.0.7/install/sql/enable.sql
  22. 278 0
      modules/boonex/spaces/updates/13.0.6_13.0.7/source/classes/BxSpacesConfig.php
  23. 152 0
      modules/boonex/spaces/updates/13.0.6_13.0.7/source/install/config.php
  24. 448 0
      modules/boonex/spaces/updates/13.0.6_13.0.7/source/install/langs/en.xml
  25. 671 0
      modules/boonex/spaces/updates/13.0.6_13.0.7/source/install/sql/enable.sql

+ 51 - 0
modules/boonex/facebook_connect/updates/13.0.3_13.0.4/install/config.php

@@ -0,0 +1,51 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ */
+
+$aConfig = array(
+    /**
+     * Main Section.
+     */
+    'title' => 'Facebook connect',
+    'version_from' => '13.0.3',
+    'version_to' => '13.0.4',
+    'vendor' => 'BoonEx',
+
+    'compatible_with' => array(
+        '13.0.0-RC6'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/facebook_connect/updates/update_13.0.3_13.0.4/',
+    'home_uri' => 'facebook_connect_update_1303_1304',
+
+    'module_dir' => 'boonex/facebook_connect/',
+    'module_uri' => 'facebook_connect',
+
+    'db_prefix' => 'bx_facebook_',
+    'class_prefix' => 'BxFaceBookConnect',
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+        'execute_sql' => 1,
+        'update_files' => 1,
+        'update_languages' => 0,
+        'clear_db_cache' => 1,
+    ),
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => 'Facebook',
+
+    /**
+     * Files Section
+     */
+    'delete_files' => array(),
+);

+ 13 - 0
modules/boonex/facebook_connect/updates/13.0.3_13.0.4/install/installer.php

@@ -0,0 +1,13 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ */
+
+class BxFaceBookConnectUpdater extends BxDolStudioUpdater
+{
+    function __construct($aConfig)
+    {
+        parent::__construct($aConfig);
+    }
+}

+ 8 - 0
modules/boonex/facebook_connect/updates/13.0.3_13.0.4/install/sql/enable.sql

@@ -0,0 +1,8 @@
+-- PAGES
+DELETE FROM `sys_objects_page` WHERE `object`='bx_facebook_error';
+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_facebook_error', 'facebook-error', '_bx_facebook_error', '_bx_facebook_error', 'bx_facebook', 5, 2147483647, 0, '', '', '', '', 0, 1, 0, 'BxFaceBookConnectPage', 'modules/boonex/facebook_connect/classes/BxFaceBookConnectPage.php');
+
+DELETE FROM `sys_pages_blocks` WHERE `object`='bx_facebook_error';
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_facebook_error', 1, 'bx_facebook', '_bx_facebook_error', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:11:\"bx_facebook\";s:6:\"method\";s:10:\"last_error\";}', 0, 0, 1, 1);

+ 68 - 0
modules/boonex/facebook_connect/updates/13.0.3_13.0.4/source/install/config.php

@@ -0,0 +1,68 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    FacebookConnect Facebook Connect
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_facebook',
+    'title' => 'Facebook connect',
+    'note' => 'Join the site using Facebook account.',
+    'version' => '13.0.4',
+    'vendor' => 'BoonEx',
+    'help_url' => 'http://feed.una.io/?section={module_name}',
+
+    'compatible_with' => array(
+        '13.0.0-RC6'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/facebook_connect/',
+    'home_uri' => 'facebook_connect',
+
+    'db_prefix' => 'bx_facebook_',
+    'class_prefix' => 'BxFaceBookConnect',
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => 'Facebook',
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+        'execute_sql' => 1,
+        'update_languages' => 1,
+    ),
+    'uninstall' => array (
+        'execute_sql' => 1,
+        'update_languages' => 1,
+    ),
+    'enable' => array(
+        'execute_sql' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'disable' => array (
+        'execute_sql' => 1,
+        'clear_db_cache' => 1,
+    ),
+
+    /**
+     * Dependencies Section
+     */
+    'dependencies' => array(),
+);
+
+/** @} */

+ 24 - 0
modules/boonex/facebook_connect/updates/13.0.3_13.0.4/source/install/sql/disable.sql

@@ -0,0 +1,24 @@
+
+-- EMAIL 
+
+DELETE FROM `sys_email_templates` WHERE `Name` = 'bx_facebook_password_generated';
+
+-- OBJECTS: AUTH
+
+DELETE FROM `sys_objects_auths` WHERE `Name` = 'bx_facebook';
+
+-- ALERTS
+
+SET @iHandlerId := (SELECT `id` FROM `sys_alerts_handlers` WHERE `name` = 'bx_facebook_connect');
+
+DELETE FROM `sys_alerts_handlers` WHERE `id`  = @iHandlerId;
+DELETE FROM `sys_alerts` WHERE `handler_id` =  @iHandlerId ;
+
+-- SETTINGS
+
+DELETE FROM `top`, `toc`, `to` USING `sys_options_types` AS `top` LEFT JOIN `sys_options_categories` AS `toc` ON `top`.`id`=`toc`.`type_id` LEFT JOIN `sys_options` AS `to` ON `toc`.`id`=`to`.`category_id` WHERE `top`.`name` = 'bx_facebook';
+
+-- PAGES
+
+DELETE FROM `sys_objects_page` WHERE `module` = 'bx_facebook';
+DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_facebook';

+ 51 - 0
modules/boonex/facebook_connect/updates/13.0.3_13.0.4/source/install/sql/enable.sql

@@ -0,0 +1,51 @@
+
+-- EMAIL 
+
+INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `Body`) VALUES
+('bx_facebook', '_bx_facebook_conect_et_password_generated', 'bx_facebook_password_generated', '_bx_facebook_conect_et_password_generated_subject', '_bx_facebook_conect_et_password_generated_body');
+
+-- OBJECTS: AUTH
+
+INSERT INTO `sys_objects_auths` (`Name`, `Title`, `Link`, `Icon`, `Style`) VALUES
+('bx_facebook', '_bx_facebook_auth_title', 'modules/?r=facebook_connect/login_form', 'fab facebook-square', 'a:1:{s:7:".bx-btn";a:1:{s:10:"background";s:18:"#3b5999 !important";}}');
+
+-- ALERTS
+
+INSERT INTO `sys_alerts_handlers` SET `name` = 'bx_facebook_connect', `class` = 'BxFaceBookConnectAlerts', `file` = 'modules/boonex/facebook_connect/classes/BxFaceBookConnectAlerts.php';
+
+SET @iHandlerId := (SELECT `id` FROM `sys_alerts_handlers`  WHERE `name` = 'bx_facebook_connect');
+
+INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
+('account', 'logout', @iHandlerId),
+('profile', 'delete', @iHandlerId),
+('profile', 'add', @iHandlerId);
+
+-- SETTINGS
+
+SET @iTypeOrder = (SELECT MAX(`order`) FROM `sys_options_types` WHERE `group` = 'modules');
+INSERT INTO `sys_options_types` (`group`, `name`, `caption`, `icon`, `order`) VALUES 
+('modules', 'bx_facebook', '_bx_facebook_adm_stg_cpt_type', 'bx_facebook@modules/boonex/facebook_connect/|std-icon.svg', IF(NOT ISNULL(@iTypeOrder), @iTypeOrder + 1, 1));
+SET @iTypeId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
+VALUES (@iTypeId, 'bx_facebook_general', '_sys_connect_adm_stg_cpt_category_general', 1);
+SET @iCategId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_error`, `order`, `extra`) VALUES
+('bx_facebook_connect_api_key', '', @iCategId, '_bx_facebook_option_app_id', 'digit', '', '', 10, ''),
+('bx_facebook_connect_secret', '', @iCategId, '_bx_facebook_option_app_secret', 'digit', '', '', 20, ''),
+('bx_facebook_connect_redirect_page', 'dashboard', @iCategId, '_sys_connect_option_redirect', 'select', '', '', 30, 'join,settings,dashboard,index'),
+('bx_facebook_connect_module', 'bx_persons', @iCategId, '_sys_connect_option_module', 'select', '', '', 40, 'a:2:{s:6:"module";s:11:"bx_facebook";s:6:"method";s:20:"get_profiles_modules";}'),
+('bx_facebook_connect_privacy', '3', @iCategId, '_sys_connect_option_privacy', 'select', '', '', 44, 'a:2:{s:6:"module";s:11:"bx_facebook";s:6:"method";s:18:"get_privacy_groups";}'),
+('bx_facebook_connect_auto_friends', 'on', @iCategId, '_bx_facebook_option_auto_friends', 'checkbox', '', '', 50, ''),
+('bx_facebook_connect_extended_info', '', @iCategId, '_bx_facebook_option_fetch_extended_info', 'checkbox', '', '', 60, ''),
+('bx_facebook_connect_confirm_email', 'on', @iCategId, '_sys_connect_option_confirm_email', 'checkbox', '', '', 70, ''),
+('bx_facebook_connect_approve', '', @iCategId, '_sys_connect_option_approve', 'checkbox', '', '', 80, '');
+
+-- PAGE: error
+
+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_facebook_error', 'facebook-error', '_bx_facebook_error', '_bx_facebook_error', 'bx_facebook', 5, 2147483647, 0, '', '', '', '', 0, 1, 0, 'BxFaceBookConnectPage', 'modules/boonex/facebook_connect/classes/BxFaceBookConnectPage.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_facebook_error', 1, 'bx_facebook', '_bx_facebook_error', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:11:\"bx_facebook\";s:6:\"method\";s:10:\"last_error\";}', 0, 0, 1, 1);

+ 51 - 0
modules/boonex/notifications/updates/13.0.7_13.0.8/install/config.php

@@ -0,0 +1,51 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ */
+
+$aConfig = array(
+    /**
+     * Main Section.
+     */
+    'title' => 'Notifications',
+    'version_from' => '13.0.7',
+    'version_to' => '13.0.8',
+    'vendor' => 'BoonEx',
+
+    'compatible_with' => array(
+        '13.0.0-RC6'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/notifications/updates/update_13.0.7_13.0.8/',
+    'home_uri' => 'notifications_update_1307_1308',
+
+    'module_dir' => 'boonex/notifications/',
+    'module_uri' => 'notifications',
+
+    'db_prefix' => 'bx_notifications_',
+    'class_prefix' => 'BxNtfs',
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+        'execute_sql' => 0,
+        'update_files' => 1,
+        'update_languages' => 0,
+        'clear_db_cache' => 0,
+    ),
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => 'Notifications',
+
+    /**
+     * Files Section
+     */
+    'delete_files' => array(),
+);

+ 13 - 0
modules/boonex/notifications/updates/13.0.7_13.0.8/install/installer.php

@@ -0,0 +1,13 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ */
+
+class BxNtfsUpdater extends BxDolStudioUpdater
+{
+    function __construct($aConfig)
+    {
+        parent::__construct($aConfig);
+    }
+}

+ 439 - 0
modules/boonex/notifications/updates/13.0.7_13.0.8/source/classes/BxNtfsDb.php

@@ -0,0 +1,439 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Notifications Notifications
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxNtfsDb extends BxBaseModNotificationsDb
+{
+    protected $_sTableEvt2Usr;
+    protected $_sTableQueue;
+
+    /*
+     * Constructor.
+     */
+    function __construct(&$oConfig)
+    {
+        parent::__construct($oConfig);
+
+        $this->_aDeliveryTypes = array(
+            BX_BASE_MOD_NTFS_DTYPE_SITE, 
+            BX_BASE_MOD_NTFS_DTYPE_EMAIL, 
+            BX_BASE_MOD_NTFS_DTYPE_PUSH
+        );
+
+        $this->_sTableEvt2Usr = $this->_sPrefix . 'events2users';
+        $this->_sTableQueue = $this->_sPrefix . 'queue';
+        $this->_sTableRead = $this->_sPrefix . 'read';
+    }
+
+    public function markAsClicked($iUserId, $iEventId)
+    {
+        return $this->query("INSERT INTO `" . $this->_sTableEvt2Usr . "` (`user_id`, `event_id`, `clicked`) VALUES (:user_id, :event_id, 1) ON DUPLICATE KEY UPDATE `clicked`=1", [
+            'user_id' => $iUserId,
+            'event_id' => $iEventId
+        ]);
+    }
+
+    public function markAsRead($iUserId, $iEventId)
+    {
+        $this->queueDeleteByProfile($iUserId, $iEventId);
+
+        return $this->query("INSERT INTO `" . $this->_sTableRead . "` (`user_id`, `event_id`) VALUES (:user_id, :event_id) ON DUPLICATE KEY UPDATE `event_id`=:event_id", array(
+            'user_id' => $iUserId,
+            'event_id' => $iEventId
+        ));
+    }
+
+    public function getLastRead($iUserId)
+    {
+        return (int)$this->getOne("SELECT `event_id` FROM `" . $this->_sTableRead . "` WHERE `user_id`=:user_id LIMIT 1", array(
+            'user_id' => (int)$iUserId
+        ));
+    }
+
+    public function deleteEvent($aParams, $sWhereAddon = "")
+    {
+        $aEvents = $this->getAll("SELECT * FROM `{$this->_sTable}` WHERE " . $this->arrayToSQL($aParams, " AND ") . $sWhereAddon);
+        if(!empty($aEvents) && is_array($aEvents)) 
+            foreach($aEvents as $aEvent)
+                $this->queueDelete(array('event_id' => $aEvent['id']));
+
+        return parent::deleteEvent($aParams, $sWhereAddon);
+    }
+
+    public function getEvents($aParams, $bReturnCount = false)
+    {
+        bx_alert($this->_oConfig->getName(), 'get_events_before', 0, 0, [
+            'params' => &$aParams,
+        ]);
+
+        if($aParams['browse'] != 'list' || $aParams['type'] != BX_NTFS_TYPE_OBJECT_OWNER_AND_CONNECTIONS)
+            return parent::getEvents($aParams);
+
+        $bClickedIndicator = $this->_oConfig->isClickedIndicator();
+        $bCountOnly = !empty($aParams['count_only']);
+        $bViewerId = !empty($aParams['viewer_id']);
+
+        //--- Get query for 'Object Owner' notifications
+        $sLimitClause = isset($aParams['per_page']) ? "LIMIT 0, " . ($aParams['start'] + $aParams['per_page']) : "";
+
+        $aParams['type'] = BX_BASE_MOD_NTFS_TYPE_OBJECT_OWNER;
+        list($sMethod, $sSelectClause, $sJoinClausePo, $sWhereClausePo, $sOrderClausePo) = $this->_getSqlPartsEvents($aParams);
+
+        if($bClickedIndicator && $bViewerId) {
+            $sSelectClause .= ", IF(ISNULL(`{$this->_sTableEvt2Usr}`.`clicked`) OR `{$this->_sTableEvt2Usr}`.`clicked`=0, 0, 1) AS `clicked`";
+            $sJoinClausePo .= $this->prepareAsString(" LEFT JOIN `{$this->_sTableEvt2Usr}` ON `{$this->_sTable}`.`id`=`{$this->_sTableEvt2Usr}`.`event_id` AND `{$this->_sTableEvt2Usr}`.`user_id`=?", $aParams['viewer_id']);
+        }
+
+        $sQueryOwner = "SELECT {select}
+            FROM `{$this->_sTable}`
+            LEFT JOIN `{$this->_sTableHandlers}` ON `{$this->_sTable}`.`type`=`{$this->_sTableHandlers}`.`alert_unit` AND `{$this->_sTable}`.`action`=`{$this->_sTableHandlers}`.`alert_action` " . $sJoinClausePo . "
+            WHERE 1 " . $sWhereClausePo . (!$bCountOnly ? " " . $sOrderClausePo . " " . $sLimitClause : "");
+
+        //--- Get query for 'Connections based' notifications
+        $aParams['type'] = BX_BASE_MOD_NTFS_TYPE_CONNECTIONS;
+        list($sMethod, $sSelectClause, $sJoinClausePc, $sWhereClausePc, $sOrderClausePc) = $this->_getSqlPartsEvents($aParams);
+
+        if($bClickedIndicator && $bViewerId) {
+            $sSelectClause .= ", IF(ISNULL(`{$this->_sTableEvt2Usr}`.`clicked`) OR `{$this->_sTableEvt2Usr}`.`clicked`=0, 0, 1) AS `clicked`";
+            $sJoinClausePc .= $this->prepareAsString(" LEFT JOIN `{$this->_sTableEvt2Usr}` ON `{$this->_sTable}`.`id`=`{$this->_sTableEvt2Usr}`.`event_id` AND `{$this->_sTableEvt2Usr}`.`user_id`=?", $aParams['viewer_id']);
+        }
+
+        $sQueryConnections = "SELECT {select}
+            FROM `{$this->_sTable}`
+            LEFT JOIN `{$this->_sTableHandlers}` ON `{$this->_sTable}`.`type`=`{$this->_sTableHandlers}`.`alert_unit` AND `{$this->_sTable}`.`action`=`{$this->_sTableHandlers}`.`alert_action` " . $sJoinClausePc . "
+            WHERE 1 " . $sWhereClausePc . (!$bCountOnly ? " " . $sOrderClausePc . " " . $sLimitClause : "");
+
+        //--- Combine both queries in one
+        $bStartFromItem = isset($aParams['start_from_item']) && $aParams['start_from_item'] === true;
+
+        $sUnionMethod = 'getColumn';
+        $sUnionOrderClause = $sUnionLimitClause = '';
+        if(!$bCountOnly) {
+            $sUnionMethod = $sMethod;
+            $sUnionOrderClause = "ORDER BY `date` DESC, `id` DESC";
+            $sUnionLimitClause = isset($aParams['per_page']) ? "LIMIT " . (!$bStartFromItem ? $aParams['start'] : 0) . ", " . $aParams['per_page'] : "";
+        }
+
+        $aAlertParams = $aParams;
+        unset($aAlertParams['browse']);
+
+        /**
+         * Parts: 
+         * PO - notifications related to Owner's content
+         * PC - notifications related to Connections' content
+         */
+        bx_alert($this->_oConfig->getName(), 'get_events', 0, 0, [
+            'browse' => $aParams['browse'],
+            'params' => $aAlertParams,
+            'table' => $this->_sTable,
+            'method' => &$sUnionMethod,
+            'select_clause' => &$sSelectClause,
+            'join_clause_po' => &$sJoinClausePo,
+            'join_clause_pc' => &$sJoinClausePc,
+            'where_clause_po' => &$sWhereClausePo,
+            'where_clause_pc' => &$sWhereClausePc,
+            'order_clause_po' => &$sOrderClausePo,
+            'order_clause_pc' => &$sOrderClausePc,
+            'order_clause' => &$sUnionOrderClause,
+            'limit_clause' => &$sUnionLimitClause,
+            'query_po' => &$sQueryOwner,
+            'query_pc' => &$sQueryConnections,
+        ]);
+
+        $sQuery = "(" . $sQueryOwner . ") UNION (" . $sQueryConnections . ") {order} {limit}";
+        $sQuery = str_replace(['{select}', '{order}', '{limit}'], [$sSelectClause, $sUnionOrderClause, $sUnionLimitClause], $sQuery);
+        $aEntries = $this->$sUnionMethod($sQuery);
+
+        if($bCountOnly)
+            $aEntries = (int)array_sum($aEntries);
+
+        return $aEntries;
+    }
+
+    protected function _getSqlPartsEvents($aParams)
+    {
+        list($sMethod, $sSelectClause, $sJoinClause, $sWhereClause, $sOrderClause, $sLimitClause) = parent::_getSqlPartsEvents($aParams);
+
+        switch($aParams['browse']) {
+            case 'list':
+                if(!empty($aParams['count_only'])) {
+                    $sMethod = 'getOne';
+                    $sSelectClause = 'COUNT(DISTINCT `' . $this->_sTable . '`.`id`)';
+                }
+                else {
+                    $sSelectClause .= ", `{$this->_sTableHandlers}`.`priority` AS `priority`";
+
+                    if(in_array($aParams['type'], array(BX_BASE_MOD_NTFS_TYPE_CONNECTIONS, BX_NTFS_TYPE_OBJECT_OWNER_AND_CONNECTIONS)))
+                        $sSelectClause = 'DISTINCT ' . $sSelectClause;
+                }
+
+                break;
+        }
+
+        return array($sMethod, $sSelectClause, $sJoinClause, $sWhereClause, $sOrderClause, $sLimitClause);
+    }
+
+    protected function _getSqlPartsEventsList($aParams)
+    {
+        $sJoinClause = $sWhereClause = "";
+
+        //--- Apply 'start from'  filter
+        $sWhereClauseStartFrom = '';
+        if(isset($aParams['start_from_item']) && $aParams['start_from_item'] === true && $aParams['start'] != 0)
+            $sWhereClauseStartFrom = $this->prepareAsString("AND `{$this->_sTable}`.`id`<? ", (int)$aParams['start']);
+
+        //--- Apply status filter
+        $sWhereClauseStatus = '';
+        if(isset($aParams['active']))
+            $sWhereClauseStatus = $this->prepareAsString("AND `{$this->_sTable}`.`active`=? ", (int)$aParams['active']);
+
+        //--- Apply modules or handlers filter
+        $sWhereClauseModules = '';
+        if(!empty($aParams['modules']) && is_array($aParams['modules']))
+            $sWhereClauseModules = "AND `" . $this->_sTable . "`.`type` IN (" . $this->implode_escape($aParams['modules']) . ") ";
+
+        if($sWhereClauseModules == '') {
+            $aHidden = $this->_oConfig->getHandlersHidden();
+            $sWhereClauseModules = !empty($aHidden) && is_array($aHidden) ? "AND `" . $this->_sTableHandlers . "`.`id` NOT IN (" . $this->implode_escape($aHidden) . ") " : "";
+        }
+
+        //--- Check flag 'New'
+        $sWhereClauseNew = '';
+        if(!empty($aParams['new']) && !empty($aParams['owner_id']))
+            $sWhereClauseNew = $this->prepareAsString("AND `{$this->_sTable}`.`id`>? ", $this->getLastRead((int)$aParams['owner_id']));
+
+        //--- Check type
+        $sWhereClauseSettings = $sWhereClauseType = '';
+        if(!empty($aParams['owner_id']))
+            switch($aParams['type']) {
+                /*
+                 * Note. It isn't used for now and outdated.
+                 */
+                case BX_BASE_MOD_NTFS_TYPE_OWNER:
+                    $sWhereClauseType = $this->prepareAsString("AND `{$this->_sTable}`.`owner_id`=? ", $aParams['owner_id']);
+                    break;
+
+                case BX_BASE_MOD_NTFS_TYPE_OBJECT_OWNER:
+                    $sJoinClause .= $this->prepareAsString(" INNER JOIN `{$this->_sTableSettings}` ON `{$this->_sTableHandlers}`.`id`=`{$this->_sTableSettings}`.`handler_id` AND `{$this->_sTableSettings}`.`delivery`='" . BX_BASE_MOD_NTFS_DTYPE_SITE . "' AND `{$this->_sTableSettings}`.`active`='1' AND `{$this->_sTableSettings}`.`type`=?", BX_NTFS_STYPE_PERSONAL);
+
+                    $sJoinClauseS2U = " LEFT JOIN `{$this->_sTableSettings2Users}` ON `{$this->_sTableSettings}`.`id`=`{$this->_sTableSettings2Users}`.`setting_id` ";
+                    if(!empty($aParams['owner_id']))
+                        $sJoinClauseS2U .= $this->prepareAsString("AND `{$this->_sTableSettings2Users}`.`user_id`=? ", $aParams['owner_id']);
+
+                    $sJoinClause .= $sJoinClauseS2U;
+                    $sWhereClauseSettings = "AND ((ISNULL(`{$this->_sTableSettings2Users}`.`active`) AND `{$this->_sTableSettings}`.`value`='1') OR (NOT ISNULL(`{$this->_sTableSettings2Users}`.`active`) AND `{$this->_sTableSettings2Users}`.`active`='1')) ";
+
+                    $sWhereClauseType = $this->prepareAsString("AND `{$this->_sTable}`.`owner_id`<>`{$this->_sTable}`.`object_owner_id` AND ((`{$this->_sTable}`.`owner_id`=? AND `{$this->_sTable}`.`object_privacy_view`<0 AND `{$this->_sTable}`.`owner_id`=ABS(`{$this->_sTable}`.`object_privacy_view`)) OR `{$this->_sTable}`.`object_owner_id`=?) ", $aParams['owner_id'], $aParams['owner_id']);
+                    break;
+
+                case BX_BASE_MOD_NTFS_TYPE_CONNECTIONS:
+                    $oConnection = BxDolConnection::getObjectInstance($this->_oConfig->getObject('conn_subscriptions'));
+                    $aQueryParts = $oConnection->getConnectedContentAsSQLParts($this->_sPrefix . "events", 'owner_id', $aParams['owner_id']);
+                    if(empty($aQueryParts) || !is_array($aQueryParts) || empty($aQueryParts['join']))
+                        break;
+
+                    $sJoinClause .= " LEFT JOIN `sys_profiles` AS `tsp` ON `{$this->_sTable}`.`owner_id`=`tsp`.`id` " . $aQueryParts['join'];
+
+                    $sWhereClauseType = '';
+                    if(!empty($aQueryParts['fields']['added']))
+                        $sWhereClauseType = "AND `{$this->_sTable}`.`date` > " . $aQueryParts['fields']['added'];
+
+                    list($aModulesProfiles, $aModulesContexts) = $this->_oConfig->getProfileBasedModules();
+                    $sJoinClause .= $this->prepareAsString(" INNER JOIN `{$this->_sTableSettings}` ON `{$this->_sTableHandlers}`.`id`=`{$this->_sTableSettings}`.`handler_id` AND `{$this->_sTableSettings}`.`delivery`='" . BX_BASE_MOD_NTFS_DTYPE_SITE . "' AND `{$this->_sTableSettings}`.`active`='1' AND ((`{$this->_sTableSettings}`.`type`=? AND `tsp`.`type` IN (" . $this->implode_escape($aModulesProfiles) . ")) || (`{$this->_sTableSettings}`.`type`=? AND `tsp`.`type` IN (" . $this->implode_escape($aModulesContexts) . ")))", BX_NTFS_STYPE_FOLLOW_MEMBER, BX_NTFS_STYPE_FOLLOW_CONTEXT);
+
+                    $sJoinClauseS2U = " LEFT JOIN `{$this->_sTableSettings2Users}` ON `{$this->_sTableSettings}`.`id`=`{$this->_sTableSettings2Users}`.`setting_id` ";
+                    if(!empty($aParams['owner_id']))
+                        $sJoinClauseS2U .= $this->prepareAsString("AND `{$this->_sTableSettings2Users}`.`user_id`=? ", $aParams['owner_id']);
+
+                    $sJoinClause .= $sJoinClauseS2U;
+                    $sWhereClauseSettings = "AND ((ISNULL(`{$this->_sTableSettings2Users}`.`active`) AND `{$this->_sTableSettings}`.`value`='1') OR (NOT ISNULL(`{$this->_sTableSettings2Users}`.`active`) AND `{$this->_sTableSettings2Users}`.`active`='1')) ";
+                    break;
+
+                case BX_NTFS_TYPE_OBJECT_OWNER_AND_CONNECTIONS:
+                    /**
+                     * 'personal' notifications are taken by: 
+                     * 1. 'owner_id', in case of somebody performed an action in requested profile's context
+                     * 'object_privacy_view' < 0 AND 'owner_id' == ABS('object_privacy_view'))
+                     * Currently it happens when somebody posted a Direct Timeline post in requested profile.
+                     * 2. 'object_owner_id', in case of somebody performed an action with content 
+                     * owned by the requested profile.
+                     */
+                    $sWhereClauseObjectOwner = $this->prepareAsString("`{$this->_sTable}`.`owner_id` <> `{$this->_sTable}`.`object_owner_id` AND ((`{$this->_sTable}`.`owner_id`=? AND `{$this->_sTable}`.`object_privacy_view`<0 AND `{$this->_sTable}`.`owner_id`=ABS(`{$this->_sTable}`.`object_privacy_view`)) OR `{$this->_sTable}`.`object_owner_id`=?) ", $aParams['owner_id'], $aParams['owner_id']);
+
+                    /**
+                     * 'follow' notifications are taken by connection with `owner_id`
+                     */
+                    $sWhereClauseConnections = '0';
+                    $oConnection = BxDolConnection::getObjectInstance($this->_oConfig->getObject('conn_subscriptions'));
+                    $aQueryParts = $oConnection->getConnectedContentAsSQLPartsExt($this->_sTable, 'owner_id', $aParams['owner_id']);
+                    if(!empty($aQueryParts) && is_array($aQueryParts) && !empty($aQueryParts['join'])) {
+                        $sJoinClause .= " LEFT JOIN `sys_profiles` AS `tsp` ON `{$this->_sTable}`.`owner_id`=`tsp`.`id`";
+                        $sJoinClause .= " LEFT JOIN `" . $aQueryParts['join']['table'] . "` AS `" . $aQueryParts['join']['table_alias'] . "` ON (" . $aQueryParts['join']['condition'] . ")";
+
+                        $sWhereClauseConnections = "NOT ISNULL(`c`.`content`) ";
+                        if(!empty($aQueryParts['fields']['added']))
+                            $sWhereClauseConnections .= "AND `{$this->_sTable}`.`date` >= `" . $aQueryParts['fields']['added']['table_alias'] . "`.`" . $aQueryParts['fields']['added']['name'] . "` ";
+                    }
+
+                    list($aModulesProfiles, $aModulesContexts) = $this->_oConfig->getProfileBasedModules();
+                    $sJoinClause .= $this->prepareAsString(" INNER JOIN `{$this->_sTableSettings}` ON `{$this->_sTableHandlers}`.`id`=`{$this->_sTableSettings}`.`handler_id` AND `{$this->_sTableSettings}`.`delivery`='" . BX_BASE_MOD_NTFS_DTYPE_SITE . "' AND `{$this->_sTableSettings}`.`active`='1' AND (`{$this->_sTableSettings}`.`type`=? OR ((`{$this->_sTableSettings}`.`type`=? AND `tsp`.`type` IN (" . $this->implode_escape($aModulesProfiles) . ")) || (`{$this->_sTableSettings}`.`type`=? AND `tsp`.`type` IN (" . $this->implode_escape($aModulesContexts) . "))))", BX_NTFS_STYPE_PERSONAL, BX_NTFS_STYPE_FOLLOW_MEMBER, BX_NTFS_STYPE_FOLLOW_CONTEXT);
+
+                    $sJoinClauseS2U = " LEFT JOIN `{$this->_sTableSettings2Users}` ON `{$this->_sTableSettings}`.`id`=`{$this->_sTableSettings2Users}`.`setting_id` ";
+                    if(!empty($aParams['owner_id']))
+                        $sJoinClauseS2U .= $this->prepareAsString("AND `{$this->_sTableSettings2Users}`.`user_id`=? ", $aParams['owner_id']);
+
+                    $sJoinClause .= $sJoinClauseS2U;
+                    $sWhereClauseSettings = "AND ((ISNULL(`{$this->_sTableSettings2Users}`.`active`) AND `{$this->_sTableSettings}`.`value`='1') OR (NOT ISNULL(`{$this->_sTableSettings2Users}`.`active`) AND `{$this->_sTableSettings2Users}`.`active`='1')) ";
+
+                    $sWhereClauseType = "AND ((" . $sWhereClauseObjectOwner . ") OR (" . $sWhereClauseConnections . ")) ";
+                    break;
+            }
+
+        $aAlertParams = $aParams;
+        unset($aAlertParams['type'], $aAlertParams['owner_id']);
+
+        bx_alert($this->_oConfig->getName(), 'get_list_by_type', 0, 0, [
+            'type' => $aParams['type'],
+            'owner_id' => $aParams['owner_id'],
+            'params' => $aAlertParams,
+            'table' => $this->_sTable,
+            'join_clause' => &$sJoinClause,
+            'where_clause' => &$sWhereClause,
+            'where_clause_start_from' => &$sWhereClauseStartFrom,
+            'where_clause_status' => &$sWhereClauseStatus,
+            'where_clause_modules' => &$sWhereClauseModules,
+            'where_clause_new' => &$sWhereClauseNew,
+            'where_clause_settings' => &$sWhereClauseSettings,
+            'where_clause_type' => &$sWhereClauseType
+        ]);
+
+        $sWhereClause .= $sWhereClauseStartFrom;
+        $sWhereClause .= $sWhereClauseStatus;
+        $sWhereClause .= $sWhereClauseModules;
+        $sWhereClause .= $sWhereClauseNew;
+        $sWhereClause .= $sWhereClauseSettings;
+        $sWhereClause .= $sWhereClauseType;
+
+        return [$sJoinClause, $sWhereClause];
+    }
+
+    public function getEventsToProcess($iLimit = 0)
+    {
+        $aEvents = $this->getAll("SELECT * FROM `" . $this->_sTable . "` WHERE `id`>:id ORDER BY `id` ASC" . ($iLimit != 0 ? ' LIMIT ' . $iLimit : ''), array(
+            'id' => $this->_oConfig->getProcessedEvent()
+        ));
+
+        if(!empty($aEvents) && is_array($aEvents)) {
+            $aEventEnd = end($aEvents);
+
+            $this->_oConfig->setProcessedEvent($aEventEnd['id']);
+
+            reset($aEvents);
+        }
+
+        return $aEvents;
+    }
+
+    public function queueGet($aParams)
+    {
+    	$aMethod = array('name' => 'getAll', 'params' => array(0 => 'query'));
+
+    	$sSelectClause = "*";
+    	$sWhereClause = $sOrderClause = $sLimitClause = "";
+
+        switch($aParams['type']) {
+            case 'count':
+            	$aMethod['name'] = 'getOne';
+
+                $sSelectClause = "COUNT(*)";
+                break;
+
+            case 'id':
+            	$aMethod['name'] = 'getRow';
+            	$aMethod['params'][1] = array(
+                    'id' => $aParams['id']
+                );
+
+                $sWhereClause = " AND `id`=:id";
+                break;
+
+            case 'all_to_send':
+                $aMethod['name'] = 'getAllWithKey';
+                $aMethod['params'][1] = 'id';
+                $aMethod['params'][2] = array(
+                    'timeout' => $aParams['timeout']
+                );
+
+                $sWhereClause = " AND `date`+:timeout < UNIX_TIMESTAMP()";
+                $sOrderClause = "`date` ASC";
+                break;
+        }
+
+        $sOrderClause = !empty($sOrderClause) ? "ORDER BY " . $sOrderClause : $sOrderClause;
+        $sLimitClause = !empty($sLimitClause) ? "LIMIT " . $sLimitClause : $sLimitClause;
+
+        $aMethod['params'][0] = "SELECT
+                " . $sSelectClause . "
+            FROM `" . $this->_sTableQueue . "`
+            WHERE 1" . $sWhereClause . " " . $sOrderClause . " " . $sLimitClause;
+
+        return call_user_func_array(array($this, $aMethod['name']), $aMethod['params']);
+    }
+
+    public function queueAdd($aSet)
+    {
+        if(empty($aSet))
+            return false;
+
+        return (int)$this->query("INSERT INTO `" . $this->_sTableQueue . "` SET " . $this->arrayToSQL($aSet)) > 0;
+    }
+
+    public function queueDelete($aWhere)
+    {
+    	if(empty($aWhere))
+            return false;
+
+        return (int)$this->query("DELETE FROM `" . $this->_sTableQueue . "` WHERE " . $this->arrayToSQL($aWhere, ' AND ')) > 0;
+    }
+
+    public function queueDeleteByProfile($iProfileId, $iEventId)
+    {
+        return (int)$this->query("DELETE FROM `" . $this->_sTableQueue . "` WHERE `profile_id`=:profile_id AND `event_id`<=:event_id", array(
+            'profile_id' => $iProfileId,
+            'event_id' => $iEventId
+        )) > 0;
+    }
+
+    public function queueDeleteByIds($mixedId)
+    {
+        if(empty($mixedId))
+            return false;
+
+        if(!is_array($mixedId))
+            $mixedId = array($mixedId);
+
+        return (int)$this->query("DELETE FROM `" . $this->_sTableQueue . "` WHERE `id` IN (" . $this->implode_escape($mixedId) . ")") > 0;
+    }
+    
+    public function cleanEvents($iClearIntervalInDays)
+    {
+        $this->query("DELETE FROM `{$this->_sTable}` WHERE `date` < :date", array('date' => time() - $iClearIntervalInDays * 86400));
+    }   
+
+    public function filterProfileIdsByModule($aIds, $mixedModule)
+    {
+        if(!is_array($mixedModule))
+            $mixedModule = array($mixedModule);
+
+        return $this->getColumn("SELECT `id` FROM `sys_profiles` WHERE `id` IN (" . $this->implode_escape($aIds) . ") AND `type` IN (" . $this->implode_escape($mixedModule) . ")");
+    }
+}
+
+/** @} */

+ 700 - 0
modules/boonex/notifications/updates/13.0.7_13.0.8/source/classes/BxNtfsModule.php

@@ -0,0 +1,700 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Notifications Notifications
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+bx_import('BxBaseModNotificationsModule');
+
+define('BX_NTFS_TYPE_OBJECT_OWNER_AND_CONNECTIONS', 'obj_own_and_con');
+define('BX_NTFS_TYPE_DEFAULT', BX_NTFS_TYPE_OBJECT_OWNER_AND_CONNECTIONS);
+
+/**
+ * STYPE - Setting Type:
+ * 1. personal - related to you;
+ * 2. follow_member - related to members you follow;
+ * 3. follow_context - related to contexts you follow;
+ * 4. other - others.
+ */
+define('BX_NTFS_STYPE_PERSONAL', 'personal');
+define('BX_NTFS_STYPE_FOLLOW_MEMBER', 'follow_member');
+define('BX_NTFS_STYPE_FOLLOW_CONTEXT', 'follow_context');
+define('BX_NTFS_STYPE_OTHER', 'other');
+
+/**
+ * SLTMODE - Silent mode:
+ * It is needed for alert sending module to tell that the alert should be ignored 
+ * with Notifications module completely or partially. Available values: 
+ * 1. disabled (global, value = 0) - all notifications are available;
+ * 2. absolute (global, value = 1) - alert isn't registered which means that there is no notifications at all;
+ * 3. absolute (for Notifications only, value = 11) - the same as global absolute.
+ * 3. on-site only (value = 12) - alert is registered. It means that on-site notification is available while the others are disabled.
+ * 4. on-site + email (value = 13) - alert is registered (on-site) and notification via 'email' is enabled.
+ * 5. on-site + push (value = 14) - alert is registered (on-site) and notification via 'push' is enabled.
+ * 
+ * @see BxNtfsResponse::response - 'silent_mode' parameter in Alerts Extras array.
+ */
+define('BX_NTFS_SLTMODE_ABSOLUTE', 11);
+define('BX_NTFS_SLTMODE_SITE', 12);
+define('BX_NTFS_SLTMODE_SITE_EMAIL', 13);
+define('BX_NTFS_SLTMODE_SITE_PUSH', 14);
+
+class BxNtfsModule extends BxBaseModNotificationsModule
+{
+    /**
+     * Constructor
+     */
+    function __construct($aModule)
+    {
+        parent::__construct($aModule);
+
+        $this->_iOwnerId = $this->getUserId();
+    }
+
+    /**
+     * ACTION METHODS
+     */
+    function actionMarkAsClicked()
+    {
+        $iId = bx_process_input(bx_get('id'), BX_DATA_INT);
+        $aEvent = $this->_oDb->getEvents(['browse' => 'id', 'value' => $iId]);
+        if(empty($aEvent) || !is_array($aEvent))
+            return echoJson(['code' => 1]);
+
+        $aParams = $this->_prepareParamsGet();
+        if($this->_oDb->markAsClicked($aParams['viewer_id'], $iId) === false)
+            return echoJson(['code' => 2]);
+
+        echoJson([
+            'code' => 0, 
+            'id' => $iId
+        ]);
+    }
+
+    function actionGetPosts()
+    {
+        $aParams = $this->_prepareParamsGet();
+        if(empty($aParams['owner_id']) || (int)$aParams['owner_id'] != $this->_iOwnerId)
+            return echoJson([]);
+
+        echoJson([
+            'events' => $this->_oTemplate->getPosts($aParams)
+        ]);
+    }
+
+    /**
+     * SERVICE METHODS
+     */
+
+    public function serviceGetSafeServices()
+    {
+        return [
+            'GetBlockView' => '',
+            'GetData' => '',
+        ];
+    }
+
+    /**
+     * @page service Service Calls
+     * @section bx_notifications Invitations
+     * @subsection bx_notifications-other Other
+     * @subsubsection bx_notifications-get_include get_include
+     * 
+     * @code bx_srv('bx_notifications', 'get_include', [...]); @endcode
+     * 
+     * Get all necessary CSS and JS files to include in a page.
+     *
+     * @return string with all necessary CSS and JS files.
+     * 
+     * @see BxInvModule::serviceGetInclude
+     */
+    /** 
+     * @ref bx_notifications-get_include "get_include"
+     */
+    public function serviceGetInclude($bIncludeCss = true, $mixedIncludeJs = false)
+    {
+        return $this->_oTemplate->getInclude($bIncludeCss, $mixedIncludeJs);
+    }
+
+    /**
+     * @page service Service Calls
+     * @section bx_notifications Notifications
+     * @subsection bx_notifications-page_blocks Page Blocks
+     * @subsubsection bx_notifications-get_block_settings get_block_settings
+     * 
+     * @code bx_srv('bx_notifications', 'get_block_settings', [...]); @endcode
+     * 
+     * Get Settings block for a separate page.
+     *
+     * @return a string with block content to display on the site. All necessary CSS and JS files are automatically added to the HEAD section of the site HTML.
+     * 
+     * @see BxNtfsModule::serviceGetBlockSettings
+     */
+    /** 
+     * @ref bx_notifications-get_block_settings "get_block_settings"
+     */
+    public function serviceGetBlockSettings($sDeliveryType = '', $aParams = array())
+    {
+        if(!isLogged())
+            return '';
+
+        if(empty($sDeliveryType) && bx_get('delivery') !== false)
+            $sDeliveryType = bx_process_input(bx_get('delivery'));
+
+        if(empty($sDeliveryType))
+            $sDeliveryType = BX_BASE_MOD_NTFS_DTYPE_SITE;
+
+        $iUserId = bx_get_logged_profile_id();
+        if(!empty($aParams['user_id']))
+            $iUserId = (int)$aParams['user_id'];
+        else
+            $aParams['user_id'] = $iUserId;
+
+        $this->_oDb->initSettingUser($iUserId);
+
+        return array(
+            'content' => $this->getBlockSettings($sDeliveryType, $aParams),
+        );
+    }
+
+    
+    /**
+     * @page service Service Calls
+     * @section bx_notifications Notifications
+     * @subsection bx_notifications-page_blocks Page Blocks
+     * @subsubsection bx_notifications-get_data get_data
+     * 
+     * @code bx_srv('bx_notifications', 'get_data', [...]); @endcode
+     * 
+     * Get data for app
+     *
+     * @return an array .
+     * 
+     * @see BxNtfsModule::serviceGetData
+     */
+     /** 
+     * @ref bx_notifications-get_data "get_data"
+     * @api @ref bx_notifications-get_data "get_data"
+     */
+    public function serviceGetData($aParams)
+    {
+        if(is_string($aParams)){
+            $aParams = json_decode($aParams, true);
+        }
+
+        return $this->serviceGetBlockView($aParams['params']['type'], $aParams['params']['start'], $aParams['params']['per_page'], $aParams['params']['modules']);
+    }
+    
+    /**
+     * @page service Service Calls
+     * @section bx_notifications Notifications
+     * @subsection bx_notifications-page_blocks Page Blocks
+     * @subsubsection bx_notifications-get_block_view get_block_view
+     * 
+     * @code bx_srv('bx_notifications', 'get_block_view', [...]); @endcode
+     * 
+     * Get View block for a separate page. Will return a block with "Empty" message if nothing found.
+     *
+     * @return an array describing a block to display on the site. All necessary CSS and JS files are automatically added to the HEAD section of the site HTML.
+     * 
+     * @see BxNtfsModule::serviceGetBlockView
+     */
+    /** 
+     * @ref bx_notifications-get_block_view "get_block_view"
+     */
+    public function serviceGetBlockView($sType = '', $iStart = -1, $iPerPage = -1, $aModules = [])
+    {
+    	$aBrowseTypes = [BX_NTFS_TYPE_OBJECT_OWNER_AND_CONNECTIONS, BX_BASE_MOD_NTFS_TYPE_CONNECTIONS, BX_BASE_MOD_NTFS_TYPE_OBJECT_OWNER];
+
+    	if(empty($sType)) {
+            $mixedType = bx_get('type');
+            if($mixedType !== false && in_array($mixedType, $aBrowseTypes))
+                $sType = $mixedType;
+
+            if(empty($sType))
+                $sType = BX_NTFS_TYPE_DEFAULT;
+    	}
+
+    	$iOwnerId = $this->getUserId();
+        if(!$iOwnerId)
+            return ['content' => MsgBox(_t('_bx_ntfs_txt_msg_no_results'))];
+
+        $aParams = $this->_prepareParams($sType, $iOwnerId, $iStart, $iPerPage, $aModules);
+
+        if(bx_is_api()) {
+            $aParams['start_from_item'] = true;
+
+            $aContent = $this->_oTemplate->getPosts($aParams);
+            $iContent = count($aContent);
+            if($iContent > $aParams['per_page'])
+                $aContent = array_slice($aContent, 0, -($iContent - $aParams['per_page']));
+
+            $aParams['start'] = end($aContent)['id'];
+            return [bx_api_get_block('browse', [
+                'unit' => 'notifications',  
+                'request_url' => '/api.php?r=bx_notifications/get_data/&params[]=',
+                'params' => $aParams,
+                'id' => $iOwnerId,
+                'data' => $aContent]),
+            ];
+        }
+
+        $sContent = $this->_oTemplate->getViewBlock($aParams);
+
+        $aParams['browse'] = 'first';
+    	$aEvent = $this->_oDb->getEvents($aParams);
+    	if(!empty($aEvent))
+            $this->_oDb->markAsRead($iOwnerId, $aEvent['id']);
+
+        return ['content' => $sContent]; 
+    }
+
+    /**
+     * @page service Service Calls
+     * @section bx_notifications Notifications
+     * @subsection bx_notifications-browsing Browsing
+     * @subsubsection bx_notifications-get_event_by_id get_event_by_id
+     * 
+     * @code bx_srv('bx_notifications', 'get_event_by_id', [...]); @endcode
+     * 
+     * Get event's data by event ID.
+     *
+     * @return an array with event's data.
+     * 
+     * @see BxNtfsModule::serviceGetEventById
+     */
+    /** 
+     * @ref bx_notifications-get_event_by_id "get_event_by_id"
+     */
+    public function serviceGetEventById($iId)
+    {
+        $aParams = array(
+            'browse' => 'id',
+            'value' => $iId,
+        );
+    	return $this->_oDb->getEvents($aParams);
+    }
+
+    /**
+     * @page service Service Calls
+     * @section bx_notifications Notifications
+     * @subsection bx_notifications-other Other
+     * @subsubsection bx_notifications-get_notifications get_notifications
+     * 
+     * @code bx_srv('bx_notifications', 'get_notifications', [...]); @endcode
+     * 
+     * Get notifications by params.
+     *
+     * @return array with notifications.
+     * 
+     * @see BxNtfsModule::serviceGetNotifications
+     */
+    /** 
+     * @ref bx_notifications-get_notifications "get_notifications"
+     */
+    public function serviceGetNotifications($iOwnerId = 0, $aBrowseParams = array())
+    {
+        if(!$iOwnerId)
+            $iOwnerId = $this->getUserId();
+
+        if(!$iOwnerId)
+            return 0;
+
+        $aParams = $this->_prepareParams(BX_NTFS_TYPE_DEFAULT, $iOwnerId);
+        if(!empty($aBrowseParams) && is_array($aBrowseParams))
+            $aParams = array_merge($aParams, $aBrowseParams);
+
+        $aEvents = $this->_oDb->getEvents($aParams);
+
+        if($this->_oConfig->isEventsGrouped())
+            $this->groupEvents($aEvents);
+
+        // returns parsed content for React Jot
+        if (!is_array($aBrowseParams) && $aBrowseParams === 'return_parsed_content')
+            foreach ($aEvents as &$aContent)
+                $this->_oTemplate->getPost($aContent, array('return_parsed_content'));
+
+        return $aEvents;
+    }
+
+    /**
+     * @page service Service Calls
+     * @section bx_notifications Notifications
+     * @subsection bx_notifications-other Other
+     * @subsubsection bx_notifications-get_unread_notifications get_unread_notifications
+     * 
+     * @code bx_srv('bx_notifications', 'get_unread_notifications', [...]); @endcode
+     * 
+     * Get unread notifications.
+     *
+     * @return array with unread notifications.
+     * 
+     * @see BxNtfsModule::serviceGetUnreadNotifications
+     */
+    /** 
+     * @ref bx_notifications-get_unread_notifications "get_unread_notifications"
+     */
+    public function serviceGetUnreadNotifications($iOwnerId = 0)
+    {
+        return $this->serviceGetNotifications($iOwnerId, array('new' => 1));
+    }
+
+    /**
+     * @page service Service Calls
+     * @section bx_notifications Notifications
+     * @subsection bx_notifications-other Other
+     * @subsubsection bx_notifications-get_unread_notifications_num get_unread_notifications_num
+     * 
+     * @code bx_srv('bx_notifications', 'get_unread_notifications_num', [...]); @endcode
+     * 
+     * Get number of unread notifications.
+     *
+     * @return integer value with number of unread notifications.
+     * 
+     * @see BxNtfsModule::serviceGetUnreadNotificationsNum
+     */
+    /** 
+     * @ref bx_notifications-get_unread_notifications_num "get_unread_notifications_num"
+     */
+    public function serviceGetUnreadNotificationsNum($iOwnerId = 0)
+    {
+        if(!$iOwnerId)
+            $iOwnerId = $this->getUserId();
+
+        if(!$iOwnerId)
+            return 0;
+
+        $sModule = $this->_oConfig->getName();
+        $aBrowseParams = $this->_prepareParams(BX_NTFS_TYPE_DEFAULT, $iOwnerId, 0, PHP_INT_MAX);
+
+        $sParamCheck = 'perform_privacy_check';
+        $sParamCheckFor = 'perform_privacy_check_for';
+
+        $iEvents = 0;
+        if($this->_oConfig->isEventsGrouped()) {
+            $aEvents = $this->_oDb->getEvents($aBrowseParams);
+
+            $this->groupEvents($aEvents);
+
+            $iCount = 0;
+            $iLastRead = $this->_oDb->getLastRead((int)$aBrowseParams['owner_id']);
+            foreach($aEvents as $aEvent)
+                if($aEvent['id'] > $iLastRead)
+                    $iCount++;
+
+            $aEvents = array_slice($aEvents, 0, $iCount);
+        }
+        else {
+            $aBrowseParams = array_merge($aBrowseParams, [
+                'new' => 1,
+            ]);
+
+            $aEvents = $this->_oDb->getEvents($aBrowseParams);
+        }
+
+        foreach($aEvents as $aEvent) {
+            if(isset($aBrowseParams[$sParamCheck]) && $aBrowseParams[$sParamCheck] !== true) 
+                continue;
+
+            $iViewerId = !empty($aBrowseParams[$sParamCheckFor]) ? (int)$aBrowseParams[$sParamCheckFor] : 0;
+
+            $oPrivacyInt = BxDolPrivacy::getObjectInstance($this->_oConfig->getObject('privacy_view'));
+            if(!$oPrivacyInt->check($aEvent['id'], $iViewerId))
+                continue;
+
+            $oPrivacyExt = $this->_oConfig->getPrivacyObject($aEvent['type'] . '_' . $aEvent['action']);
+            if($oPrivacyExt !== false && !$oPrivacyExt->check($aEvent['id'], $iViewerId))
+                continue;
+
+            $sSrvModule = $this->_oConfig->getContentModule($aEvent);
+            $sSrvMethod = 'check_allowed_with_content_for_profile';
+            if($sSrvModule && BxDolRequest::serviceExists($sSrvModule, $sSrvMethod) && BxDolService::call($sSrvModule, $sSrvMethod, array('view', $this->_oConfig->getContentObjectId($aEvent), $iViewerId)) !== CHECK_ACTION_RESULT_ALLOWED)
+                continue;
+
+            $bEventCanceled = false;
+            bx_alert($sModule, 'is_notification', 0, 0, [
+                'event' => &$aEvent, 
+                'event_canceled' => &$bEventCanceled,
+                'browse_params' => $aBrowseParams
+            ]);
+
+            if($bEventCanceled)
+                continue;
+
+            $iEvents++;
+        }
+
+        return $iEvents;
+    }
+
+    /**
+     * @page service Service Calls
+     * @section bx_notifications Notifications
+     * @subsection bx_notifications-other Other
+     * @subsubsection bx_notifications-get_live_updates get_live_updates
+     * 
+     * @code bx_srv('bx_notifications', 'get_live_updates', [...]); @endcode
+     * 
+     * Get data for Live Updates system.
+     *
+     * @return an array with special format.
+     * 
+     * @see BxNtfsModule::serviceGetLiveUpdates
+     */
+    /** 
+     * @ref bx_notifications-get_live_updates "get_live_updates"
+     */
+    public function serviceGetLiveUpdates($aMenuItemParent, $aMenuItemChild, $iCount = 0)
+    {
+        $iOwnerId = $this->getUserId();
+        $iCountNew = $this->serviceGetUnreadNotificationsNum($iOwnerId);
+        if($iCountNew == $iCount)
+			return false;
+
+        return array(
+    		'count' => $iCountNew, // required
+    		'method' => 'bx_menu_show_live_update(oData)', // required
+    		'data' => array(
+    			'code' => BxDolTemplate::getInstance()->parseHtmlByTemplateName('menu_item_addon', array(
+    				'content' => '{count}'
+                )),
+                'mi_parent' => $aMenuItemParent,
+                'mi_child' => $aMenuItemChild
+    		),  // optional, may have some additional data to be passed in JS method provided using 'method' param above.
+    	);
+    }
+
+    /*
+     * COMMON METHODS
+     */
+    public function getBlockSettings($sDeliveryType, $aParams = array())
+    {
+        return $this->_oTemplate->getSettingsBlock($sDeliveryType, $aParams);
+    }
+
+    public function setSubmenu($sSelected)
+    {
+    	$oSubmenuSystem = BxDolMenu::getObjectInstance('sys_site_submenu');
+        if(!$oSubmenuSystem)
+            return;
+
+        $CNF = &$this->_oConfig->CNF;
+
+        $oSubmenuSystem->setObjectSubmenu($CNF['OBJECT_MENU_SUBMENU'], array (
+            'title' => _t('_bx_ntfs'),
+            'link' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME'])),
+            'icon' => '',
+        ));
+
+        $oSubmenuModule = BxDolMenu::getObjectInstance($CNF['OBJECT_MENU_SUBMENU']);
+        if($oSubmenuModule)
+            $oSubmenuModule->setSelected($this->_oConfig->getName(), $sSelected);
+    }
+
+    public function onPost($iId)
+    {
+    	//--- Event -> Post for Alerts Engine ---//
+        $oAlert = new BxDolAlerts($this->_oConfig->getObject('alert'), 'post', $iId);
+        $oAlert->alert();
+        //--- Event -> Post for Alerts Engine ---//
+    }
+
+    public function enableSettingsLike($iId, $bValue, $bAdministration = false)
+    {
+        $aSetting = $this->_oDb->getSetting(array(
+            'by' => $bAdministration ? 'id' : 'tsu_id', 
+            'id' => (int)$iId
+        ));
+        if(empty($aSetting) || !is_array($aSetting))
+            return false;
+
+        $aSettingsIds = $this->_oDb->getSetting(array(
+            'by' => 'group_type_delivery', 
+            'group' => $aSetting['group'], 
+            'delivery' => $aSetting['delivery'], 
+            'type' => $aSetting['type'], 
+            'active' => !$bAdministration
+        ));
+        if(empty($aSettingsIds) || !is_array($aSettingsIds))
+            return false;
+
+        $iUserId = bx_get_logged_profile_id();
+
+        $mixedResult = false;
+        if($bAdministration)
+            $mixedResult =  $this->_oDb->activateSettingById($bValue, $aSettingsIds);
+        else
+            $mixedResult = $this->_oDb->activateSettingByIdUser($bValue, $iUserId, $aSettingsIds);
+
+        return $mixedResult;
+    }
+
+    public function _changeSettingsValueLike($iId, $sField, $mixedValue, $bAdministration = false)
+    {
+        $aSetting = $this->_oDb->getSetting(array(
+            'by' => $bAdministration ? 'id' : 'tsu_id', 
+            'id' => (int)$iId
+        ));
+        if(empty($aSetting) || !is_array($aSetting))
+            return false;
+
+        $aSettingsIds = $this->_oDb->getSetting(array(
+            'by' => 'group_type_delivery', 
+            'group' => $aSetting['group'], 
+            'delivery' => $aSetting['delivery'], 
+            'type' => $aSetting['type'], 
+            'active' => !$bAdministration
+        ));
+        if(empty($aSettingsIds) || !is_array($aSettingsIds))
+            return false;
+
+        $iUserId = bx_get_logged_profile_id();
+
+        $mixedResult = false;
+        if($bAdministration)
+            $mixedResult =  $this->_oDb->changeSettingById($sField, $mixedValue, $aSettingsIds);
+        else
+            $mixedResult = $this->_oDb->changeSettingByIdUser($sField, $mixedValue, $iUserId, $aSettingsIds);
+
+        return $mixedResult;
+    }
+
+    public function sendNotificationEmail($iProfile, $aNotification)
+    {
+        if(!$iProfile)
+            return false;
+
+        $aSettings = &$aNotification['settings'];
+
+        $sTemplate = !empty($aSettings['template']) ? $aSettings['template'] : 'bx_notifications_new_event';
+        $aTemplateMarkers = array('content' => $aNotification['content']);
+        if(!empty($aSettings['markers']) && is_array($aSettings['markers']))
+            $aTemplateMarkers = array_merge($aTemplateMarkers, $aSettings['markers']);              
+
+        $aTemplate = null;
+        bx_alert($this->_aModule['name'], 'before_parse_email_template', 0, 0, array('profile_id' => $iProfile, 'template' => $sTemplate, 'markers' => $aTemplateMarkers, 'notification' => $aNotification, 'override_result' => &$aTemplate));
+        if(is_null($aTemplate))
+            $aTemplate = BxDolEmailTemplates::getInstance()->parseTemplate($sTemplate, $aTemplateMarkers, 0, $iProfile);
+        if(!$aTemplate)
+            return false;
+
+        $sEmail = BxDolProfileQuery::getInstance()->getEmailById($iProfile);
+        $sSubject = !empty($aSettings['subject']) ? $aSettings['subject'] : $aTemplate['Subject'];
+        return sendMail($sEmail, $sSubject, $aTemplate['Body'], 0, array(), BX_EMAIL_NOTIFY, 'html', false, array(), true);
+    }
+
+    public function sendNotificationPush($iProfile, $aNotification)
+    {
+        if(!$iProfile)
+            return false;
+
+        $aContent = &$aNotification['content'];
+        $aSettings = &$aNotification['settings'];
+
+        $sSubject = !empty($aSettings['subject']) ? $aSettings['subject'] : _t('_bx_ntfs_push_new_event_subject', getParam('site_title'));
+        
+        bx_alert($this->_aModule['name'], 'before_send_notification_push', 0, 0, array('profile_id' => $iProfile, 'content' => &$aContent, 'setting' => &$aSettings, 'subject' => &$sSubject));
+   
+        return BxDolPush::getInstance()->send($iProfile, array(
+            'contents' => array(
+                'en' => $aContent['message']
+            ),
+            'headings' => array(
+                'en' => $sSubject
+            ),
+            'url' => $aContent['url'],
+            'icon' => $aContent['icon']
+        ), true);
+    }
+
+    public function groupEvents(&$aEvents)
+    {
+        //--- Check for Visual Grouping
+        $aGroups = [];
+        foreach($aEvents as $iIndex => $aEvent) {
+            if(empty($aEvent['source']))
+                continue;
+
+            $sSource = $aEvent['source'];
+            if(!isset($aGroups[$sSource]))
+               $aGroups[$sSource] = [];
+
+            $aGroups[$sSource][$iIndex] = $aEvent['priority'];
+        }
+
+        //--- Perform Visual Grouping
+        foreach($aGroups as $sSource => $aGroup) {
+            if(!is_array($aGroup) || count($aGroup) < 2)
+                continue;
+
+            arsort($aGroup);
+            $iPriorityMax = reset($aGroup);
+
+            foreach($aGroup as $iIndex => $iPriority)
+                if($iPriority != $iPriorityMax)
+                    unset($aEvents[$iIndex]);
+        }
+    }
+
+    /*
+     * INTERNAL METHODS
+     */
+    protected function _prepareParams($sType = '', $iOwnerId = 0, $iStart = -1, $iPerPage = -1, $aModules = [])
+    {
+        $iUserId = $this->getUserId();
+        $iOwnerId = (int)$iOwnerId != 0 ? $iOwnerId : $iUserId;
+
+        $aParams = [
+            'browse' => 'list',
+            'type' => !empty($sType) ? $sType : BX_NTFS_TYPE_DEFAULT,
+            'owner_id' => $iOwnerId,
+            'start' => (int)$iStart > 0 ? $iStart : 0,
+            'start_from_item' => false,
+            'per_page' => (int)$iPerPage > 0 ? $iPerPage : $this->_oConfig->getPerPage(),
+            'modules' => is_array($aModules) && !empty($aModules) ? $aModules : [],
+            'last_read' => $this->_oDb->getLastRead($iOwnerId),
+            'viewer_id' => $iUserId,
+            'active' => 1
+        ];
+
+        return $aParams;
+    }
+
+    protected function _prepareParamsGet()
+    {
+        $aParams = [];
+        $aParams['browse'] = 'list';
+
+        $sType = bx_get('type');
+        $aParams['type'] = $sType !== false ? bx_process_input($sType, BX_DATA_TEXT) : BX_NTFS_TYPE_DEFAULT;
+
+        $aParams['owner_id'] = $sType !== false ? bx_process_input(bx_get('owner_id'), BX_DATA_INT) : $this->getUserId();
+
+        $iStart = bx_get('start');
+        $aParams['start'] = $iStart !== false ? bx_process_input($iStart, BX_DATA_INT) : 0;
+        $aParams['start_from_item'] = false;
+
+        $iPerPage = bx_get('per_page');
+        $aParams['per_page'] = $iPerPage !== false ? bx_process_input($iPerPage, BX_DATA_INT) : $this->_oConfig->getPerPage();
+
+        $aModules = bx_get('modules');
+        $aParams['modules'] = $aModules !== false ? bx_process_input($aModules, BX_DATA_TEXT) : [];
+
+        $iViewerId = $this->getUserId();
+        if(($aParams['viewer_id'] = bx_get('viewer_id')) !== false)
+            $aParams['viewer_id'] = bx_process_input($aParams['viewer_id'], BX_DATA_INT);
+        if(!$aParams['viewer_id'] || $aParams['viewer_id'] != $iViewerId)
+            $aParams['viewer_id'] = $iViewerId;
+
+        $aParams['active'] = 1;
+
+        return $aParams;
+    }
+}
+
+/** @} */

+ 449 - 0
modules/boonex/notifications/updates/13.0.7_13.0.8/source/classes/BxNtfsTemplate.php

@@ -0,0 +1,449 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Notifications Notifications
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
+
+class BxNtfsTemplate extends BxBaseModNotificationsTemplate
+{
+    function __construct(&$oConfig, &$oDb)
+    {
+        parent::__construct($oConfig, $oDb);
+    }
+
+    public function getInclude($bIncludeCss = true, $mixedIncludeJs = false)
+    {
+        if($bIncludeCss)
+            $this->getAddedCss();
+
+        $sResult = '';
+        if(is_string($mixedIncludeJs) && !empty($mixedIncludeJs)) {
+            $this->getAddedJs();
+            
+            $sResult = $this->getJsCode($mixedIncludeJs);
+        }
+            
+        return $sResult;
+    }
+
+    public function getViewBlock($aParams)
+    {
+        return $this->parseHtmlByName('block_view.html', array(
+            'html_id_view_block' => $this->_oConfig->getHtmlIds('view', 'block'),
+            'html_id_events' => $this->_oConfig->getHtmlIds('view', 'events'),
+            'style_prefix' => $this->_oConfig->getPrefix('style'),
+            'content' => $this->getPosts($aParams),
+            'js_content' => $this->getJsCode('view', array(
+                'oRequestParams' => array(
+                    'type' => $aParams['type'],
+                    'owner_id' => $aParams['owner_id'],
+                    'start' => $aParams['start'],
+                    'per_page' => $aParams['per_page'],
+                    'modules' => $aParams['modules']
+                )
+            ))
+        ));
+    }
+
+    public function getSettingsBlock($sDeliveryType, $aParams = array())
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        $iUserId = !empty($aParams['user_id']) ? (int)$aParams['user_id'] : bx_get_logged_profile_id();
+        $sGrid = !empty($aParams['grid']) ? $aParams['grid'] : $CNF['OBJECT_GRID_SETTINGS_COMMON'];
+        $oTemplate = !empty($aParams['template']) ? $aParams['template'] : $this;
+
+        $oGrid = BxDolGrid::getObjectInstance($sGrid, $oTemplate);
+        if(!$oGrid)
+            return '';
+
+        $oGrid->setDeliveryType($sDeliveryType);
+        if(method_exists($oGrid, 'setUserId'))
+            $oGrid->setUserId($iUserId);
+
+        return $oGrid->getCode();
+    }
+
+    public function getPosts($aParams)
+    {
+    	$sJsObject = $this->_oConfig->getJsObject('view');
+
+    	$aParamsDb = $aParams;
+    	$aParamsDb['per_page'] = 3 * $aParamsDb['per_page'];
+
+        $aEvents = $this->_oDb->getEvents($aParamsDb);
+        if(empty($aEvents))
+            return bx_is_api() ? [] : $this->getEmpty();
+
+        if($this->_oConfig->isEventsGrouped())
+            $this->_oModule->groupEvents($aEvents);
+
+        $aTmplVarsEvents = array();
+
+        foreach($aEvents as $aEvent) {
+            $sEvent = $this->getPost($aEvent, $aParams);
+            if(empty($sEvent))
+                continue;
+            if (bx_is_api()){
+                $sEvent['author_data'] = BxDolProfile::getData($sEvent['object_owner_id']);
+                $aTmplVarsEvents[] = $sEvent;
+            }
+            else
+                $aTmplVarsEvents[] = ['event' => $sEvent];
+            if(count($aTmplVarsEvents) >= ($aParams['per_page'] + 1))
+            	break;
+        }
+
+        if (bx_is_api())
+            return $aTmplVarsEvents;
+
+        $oPaginate = new BxTemplPaginate(array(
+            'start' => $aParams['start'],
+            'per_page' => $aParams['per_page'],
+            'page_url' => $this->_oConfig->getViewUrl(),
+            'on_change_page' => $sJsObject . ".changePage(this, {start}, {per_page})"
+        ));
+        $oPaginate->setNumFromDataArray($aTmplVarsEvents);
+
+        return $this->parseHtmlByName('events.html', array(
+            'style_prefix' => $this->_oConfig->getPrefix('style'),
+            'bx_repeat:events' => $aTmplVarsEvents,
+            'paginate' => $oPaginate->getSimplePaginate()
+        ));
+    }
+
+    /**
+     * Enter description here ...
+     * @example Available keys are:
+     * 1. owner_name and owner_link
+     * 2. entry_caption and entry_url
+     * 3. subentry_url and subentry_sample
+     * 
+     */
+    public function getPost(&$aEvent, $aBrowseParams = array())
+    {
+    	$oModule = $this->getModule();
+
+        if(!empty($aEvent['content']) && is_string($aEvent['content']))
+            $aEvent['content'] = unserialize($aEvent['content']);
+
+    	if((int)$aEvent['processed'] == 0)
+            $this->_processContent($aEvent);
+
+        if((int)$aEvent['processed'] == 0 || empty($aEvent['content']))
+            return '';
+
+        $sParamCheck = 'perform_privacy_check';
+        if(!isset($aBrowseParams[$sParamCheck]) || $aBrowseParams[$sParamCheck] === true) {
+            $sParamCheckFor = 'perform_privacy_check_for';
+            $iViewerId = !empty($aBrowseParams[$sParamCheckFor]) ? (int)$aBrowseParams[$sParamCheckFor] : 0;
+
+            $oPrivacyInt = BxDolPrivacy::getObjectInstance($this->_oConfig->getObject('privacy_view'));
+            if(!$oPrivacyInt->check($aEvent['id'], $iViewerId))
+                return '';
+
+            $oPrivacyExt = $this->_oConfig->getPrivacyObject($aEvent['type'] . '_' . $aEvent['action']);
+            if($oPrivacyExt !== false && !$oPrivacyExt->check($aEvent['id'], $iViewerId))
+                return '';
+
+            $sSrvModule = $this->_oConfig->getContentModule($aEvent);
+            $sSrvMethod = 'check_allowed_with_content_for_profile';
+            if($sSrvModule && BxDolRequest::serviceExists($sSrvModule, $sSrvMethod) && BxDolService::call($sSrvModule, $sSrvMethod, array('view', $this->_oConfig->getContentObjectId($aEvent), $iViewerId)) !== CHECK_ACTION_RESULT_ALLOWED)
+                return '';
+        }
+
+        $bShowRealProfile = !isset($aBrowseParams['show_real_profile']) || $aBrowseParams['show_real_profile'] === true;
+
+        $oOwner = $oModule->getObjectUser($aEvent['owner_id']);
+        if(!$bShowRealProfile && $oOwner instanceof BxDolProfileAnonymous)
+            $oOwner->setShowRealProfile($bShowRealProfile);
+
+        $aEvent['content']['owner_name'] = strmaxtextlen($oOwner->getDisplayName(), $this->_oConfig->getOwnerNameMaxLen());
+        $aEvent['content']['owner_link'] = $oOwner->getUrl();
+        $aEvent['content']['owner_icon'] = $oOwner->getThumb();
+
+        if(!empty($aEvent['content']['entry_caption'])) {
+            $sEntryCaption = bx_process_output($aEvent['content']['entry_caption'], BX_DATA_TEXT);
+            if(get_mb_substr($sEntryCaption, 0, 1) == '_')
+                $sEntryCaption = _t($sEntryCaption);
+
+            $aEvent['content']['entry_caption'] = strmaxtextlen($sEntryCaption, $this->_oConfig->getContentMaxLen());
+        }
+
+        $iObjectOwner = (int)$aEvent['object_owner_id'];
+        if(empty($iObjectOwner) && !empty($aEvent['content']['entry_author']))
+            $iObjectOwner = (int)$aEvent['content']['entry_author'];
+
+        $oObjectOwner = $oModule->getObjectUser($iObjectOwner);
+        if($oObjectOwner) {
+            if(!$bShowRealProfile && $oObjectOwner instanceof BxDolProfileAnonymous)
+                $oObjectOwner->setShowRealProfile($bShowRealProfile);
+
+            $aEvent['content']['object_owner_name'] = strmaxtextlen($oObjectOwner->getDisplayName(), $this->_oConfig->getOwnerNameMaxLen());
+            $aEvent['content']['object_owner_link'] = $oObjectOwner->getUrl();
+            $aEvent['content']['object_owner_icon'] = $oObjectOwner->getThumb();
+        }
+
+        foreach($aEvent['content'] as $sKey => $sValue) {
+            if(!is_string($sValue) || substr($sValue, 0, 1) != '_') 
+                continue;
+
+            $aCallParams = array($sValue);
+
+            $sKeyParams = $sKey . '_params';
+            if(isset($aEvent['content'][$sKeyParams]) && is_array($aEvent['content'][$sKeyParams])) {
+                foreach($aEvent['content'][$sKeyParams] as $iParamIndex => $sParamValue)
+                    if(is_string($sParamValue) && substr($sParamValue, 0, 1) == '_')
+                        $aEvent['content'][$sKeyParams][$iParamIndex] = _t($sParamValue);
+
+                $aCallParams = array_merge($aCallParams, $aEvent['content'][$sKeyParams]);
+                unset($aEvent['content'][$sKeyParams]);
+            }
+
+            $aEvent['content'][$sKey] = call_user_func_array('_t', $aCallParams);
+        }
+
+        $sOwnerUnit = $oOwner->getUnit(0, ['template' => 'unit_wo_info_links']);
+
+        $bEventParsed = false;
+        $bEventCanceled = false;
+        bx_alert($this->_oConfig->getName(), 'get_notification', 0, 0, [
+            'event' => &$aEvent, 
+            'event_parsed' => &$bEventParsed, 
+            'event_canceled' => &$bEventCanceled,
+            'owner' => &$oOwner, 
+            'owner_unit' => &$sOwnerUnit, 
+            'browse_params' => $aBrowseParams
+        ]);
+        
+        if ($bEventCanceled)
+            return '';
+
+        if(!$bEventParsed) {
+            $mLk = '';
+            if(!empty($aEvent['content']['lang_key'])) {
+                $mLk = $aEvent['content']['lang_key'];
+                if(!is_string($mLk) && !(is_array($mLk) && isset($mLk['site'], $mLk['email'], $mLk['push'])))
+                    $mLk = '';
+            }
+
+            if(empty($mLk))
+                $mLk = $this->_getContentLangKey($aEvent);
+
+            if(is_array($mLk))
+                foreach($mLk as $sDeliveryType => $sLangKey)
+                    $aEvent['content_parsed'][$sDeliveryType] = $this->_parseContentLangKey($sLangKey, $aEvent);
+            else
+                $aEvent['content_parsed'] = $this->_parseContentLangKey($mLk, $aEvent);
+        }
+
+        // returns parsed content for React Jot
+        if(isset($aBrowseParams['return_parsed_content']))
+            return $aEvent;
+
+        $bClickedIndicator = $this->_oConfig->isClickedIndicator();
+        $sJsObject = $this->_oConfig->getJsObject('view');
+
+        if (bx_is_api())
+            return $aEvent;
+             
+        return $this->parseHtmlByName('event.html', array (
+            'html_id' => $this->_oConfig->getHtmlIds('view', 'event') . $aEvent['id'],
+            'style_prefix' => $this->_oConfig->getPrefix('style'),
+            'js_object' => $sJsObject,
+            'class' => !empty($aBrowseParams['last_read']) && $aEvent['id'] > $aBrowseParams['last_read'] ? ' bx-def-color-bg-box-active' : '', 
+            'id' => $aEvent['id'],
+            'author_unit' => $sOwnerUnit,
+            'link' => $this->_getContentLink($aEvent),
+            'content' => is_array($aEvent['content_parsed']) && isset($aEvent['content_parsed']['site']) ? $aEvent['content_parsed']['site'] : $aEvent['content_parsed'],
+            'date' => bx_time_js($aEvent['date']),
+            'bx_if:show_onclick' => [
+                'condition' => $bClickedIndicator,
+                'content' => [
+                    'js_object' => $sJsObject,
+                    'id' => $aEvent['id']
+                ]
+            ],
+            'bx_if:show_clicked_indicator' => [
+                'condition' => $bClickedIndicator && (int)$aEvent['clicked'] != 0,
+                'content' => []
+            ],
+        ));
+    }
+
+    public function getNotificationEmail($iRecipient, &$aEvent)
+    {
+        $sEvent = $this->getPost($aEvent, array('perform_privacy_check_for' => $iRecipient, 'show_real_profile' => false));
+        if(empty($sEvent) || empty($aEvent['content_parsed']))
+            return false;
+
+        $aContent = &$aEvent['content'];
+        return array(
+            'content' => $this->parseHtmlByName('et_new_event.html', array(
+                'icon_url' => !empty($aContent['owner_icon']) ? $aContent['owner_icon'] : $this->getIconUrl('std-icon.svg'),
+                'content_url' => $this->_getContentLink($aEvent),
+                'content' => is_array($aEvent['content_parsed']) && isset($aEvent['content_parsed']['email']) ? $aEvent['content_parsed']['email'] : $aEvent['content_parsed'],
+                'date' => bx_process_output($aEvent['date'], BX_DATA_DATE_TS),
+            )),
+            'settings' => !empty($aContent['settings']['email']) ? $aContent['settings']['email'] : array()
+        );
+    }
+
+    public function getNotificationPush($iRecipient, &$aEvent)
+    {
+        $sEvent = $this->getPost($aEvent, array('perform_privacy_check_for' => $iRecipient, 'show_real_profile' => false));
+        if(empty($sEvent) || empty($aEvent['content_parsed']))
+            return false;
+
+        $sMessage = is_array($aEvent['content_parsed']) && isset($aEvent['content_parsed']['push']) ? $aEvent['content_parsed']['push'] : $aEvent['content_parsed'];
+        $sMessage = preg_replace('/<\/?[a-zA-Z0-9=\'":;\(\)\s_-]+>/i', '"', $sMessage);
+        if($sMessage)
+            $sMessage = BxTemplFunctions::getInstance()->getStringWithLimitedLength(html_entity_decode($sMessage), $this->_oConfig->getPushMaxLen());
+
+        if(empty($sMessage))
+            return false;
+
+        $aContent = &$aEvent['content'];
+        return array(
+            'content' => array(
+                'url' => $this->_getContentLink($aEvent),
+                'message' => $sMessage,
+                'icon' => !empty($aContent['owner_icon']) ? $aContent['owner_icon'] : ''
+            ),
+            'settings' => !empty($aContent['settings']['push']) ? $aContent['settings']['push'] : array()
+        );
+    }
+
+    public function getEmpty($bVisible = true)
+    {
+        return $this->parseHtmlByName('empty.html', array(
+            'style_prefix' => $this->_oConfig->getPrefix('style'),
+            'visible' => $bVisible ? 'block' : 'none',
+            'content' => MsgBox(_t('_bx_ntfs_txt_msg_no_results'))
+        ));
+    }
+
+    protected function _processContent(&$aEvent)
+    {
+    	$aContent = $this->_getContent($aEvent);
+        if(empty($aContent) || !is_array($aContent)) 
+            return;
+
+        bx_alert($this->_oConfig->getName(), 'get_content', 0, 0, array(
+            'event' => $aEvent,
+            'override_result' => &$aContent
+        ));
+
+        $aSet = array();
+        if(!empty($aContent['entry_author'])) {
+            $aSet['object_owner_id'] = (int)$aContent['entry_author'];
+            unset($aContent['entry_author']);
+        }
+
+        if(!empty($aContent['entry_privacy'])) {
+            $aSet['allow_view_event_to'] = $aContent['entry_privacy'];
+            $aEvent['allow_view_event_to'] = $aContent['entry_privacy'];
+            unset($aContent['entry_privacy']);
+        }
+
+        if(!empty($aEvent['content'])) {
+            if(is_string($aEvent['content']))
+                $aEvent['content'] = unserialize($aEvent['content']);
+
+            if(is_array($aEvent['content']))
+                $aEvent['content'] = array_merge($aEvent['content'], $aContent);
+        }
+        else
+            $aEvent['content'] = $aContent;
+
+        $aEvent['processed'] = 1;
+
+        $aSet = array_merge($aSet, array(
+            'content' => serialize($aEvent['content']), 
+            'processed' => 1
+        ));
+
+        $this->_oDb->updateEvent($aSet, array('id' => $aEvent['id']));
+        return;
+    }
+
+    protected function _getContent(&$aEvent)
+    {
+        $sHandler = $aEvent['type'] . '_' . $aEvent['action'];
+        if(!$this->_oConfig->isHandler($sHandler))
+            return array();
+
+        $aHandler = $this->_oConfig->getHandlers($sHandler);
+        if(!empty($aHandler['module_name']) && !empty($aHandler['module_class']) && !empty($aHandler['module_method']))
+            return BxDolService::call($aHandler['module_name'], $aHandler['module_method'], array($aEvent), $aHandler['module_class']);
+
+        $sMethod = 'display' . bx_gen_method_name($aHandler['alert_unit'] . '_' . $aHandler['alert_action']);
+        if(!method_exists($this, $sMethod))
+            return array();
+
+        return $this->$sMethod($aEvent);
+    }
+
+    protected function _getContentLangKey(&$aEvent)
+    {
+        $bInContext = $this->_isInContext($aEvent);
+
+        if(!empty($aEvent['subobject_id']))
+            return '_bx_ntfs_txt_subobject_added' . ($bInContext ? '_in_context' : '');
+
+        $sKey = '';
+        switch($aEvent['action']) {
+            case 'pending_approval':
+                $sKey = '_bx_ntfs_txt_object_pending_approval';
+                break;
+
+            case 'publish_failed':
+                $sKey = '_bx_ntfs_txt_object_publish_failed';
+                break;
+
+            case 'publish_succeeded':
+                $sKey = '_bx_ntfs_txt_object_publish_succeeded';
+                break;
+
+            default:
+                $sKey = '_bx_ntfs_txt_object_' . $aEvent['action'] . ($bInContext ? '_in_context' : '');
+        }
+
+    	return $sKey;
+    }
+
+    protected function _parseContentLangKey($sLangKey, &$aEvent)
+    {
+        $aExclude = array(
+            'lang_key' => 1,
+            'settings' => 1
+        );
+
+        return $this->parseHtmlByContent(_t($sLangKey), array_diff_key($aEvent['content'], $aExclude), array('{', '}'));
+    }
+
+    protected function _getContentLink(&$aEvent)
+    {
+        $sLink = $aEvent['content']['entry_url'];
+        if(!empty($aEvent['subobject_id']) && !empty($aEvent['content']['subentry_url'])) 
+            $sLink = $aEvent['content']['subentry_url'];
+
+        return bx_replace_markers($sLink, [
+            'bx_url_root' => BX_DOL_URL_ROOT
+        ]);
+    }
+
+    protected function _isInContext(&$aEvent)
+    {
+        return (int)$aEvent['object_privacy_view'] < 0;
+    }
+}
+
+/** @} */

+ 82 - 0
modules/boonex/notifications/updates/13.0.7_13.0.8/source/install/config.php

@@ -0,0 +1,82 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Notifications Notifications
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_notifications',
+    'title' => 'Notifications',
+    'note' => 'Notifications module.',
+    'version' => '13.0.8',
+    'vendor' => 'BoonEx',
+    'help_url' => 'http://feed.una.io/?section={module_name}',
+
+    'compatible_with' => array(
+        '13.0.0-RC6'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/notifications/',
+    'home_uri' => 'notifications',
+
+    'db_prefix' => 'bx_notifications_',
+    'class_prefix' => 'BxNtfs',
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => 'Notifications',
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+        'execute_sql' => 1,
+        'update_languages' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'uninstall' => array (
+        'execute_sql' => 1,
+        'update_languages' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'enable' => array(
+        'execute_sql' => 1,
+    	'update_relations_for_all' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'disable' => array (
+        'execute_sql' => 1,
+    	'update_relations_for_all' => 1,
+        'clear_db_cache' => 1,
+    ),
+
+    /**
+     * Dependencies Section
+     */
+    'dependencies' => array(),
+
+    /**
+     * Relations Section
+     */
+    'relation_handlers' => array(
+    	'on_install' => '',
+    	'on_uninstall' => 'delete_module_events',
+	    'on_enable' => 'add_handlers',
+	    'on_disable' => 'delete_handlers',
+    ),
+);
+
+/** @} */

+ 54 - 0
modules/boonex/russian/updates/13.0.10_13.0.11/install/config.php

@@ -0,0 +1,54 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ */
+
+$aConfig = array(
+    /**
+     * Main Section.
+     */
+    'title' => 'Russian',
+    'version_from' => '13.0.10',
+    'version_to' => '13.0.11',
+    'vendor' => 'BoonEx',
+
+    'compatible_with' => array(
+        '13.0.0-RC6'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/russian/updates/update_13.0.10_13.0.11/',
+    'home_uri' => 'ru_update_13010_13011',
+
+    'module_dir' => 'boonex/russian/',
+    'module_uri' => 'ru',
+
+    'db_prefix' => 'bx_rsn_',
+    'class_prefix' => 'BxRsn',
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+        'execute_sql' => 0,
+        'update_files' => 1,
+        'update_languages' => 1,
+        'restore_languages' => 0,
+        'clear_db_cache' => 0,
+    ),
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => array(
+        array('name' => 'Spaces', 'path' => 'bx_spaces/'),
+    ),
+
+    /**
+     * Files Section
+     */
+    'delete_files' => array(),
+);

+ 13 - 0
modules/boonex/russian/updates/13.0.10_13.0.11/install/installer.php

@@ -0,0 +1,13 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ */
+
+class BxRsnUpdater extends BxDolStudioUpdater
+{
+    function __construct($aConfig)
+    {
+        parent::__construct($aConfig);
+    }
+}

+ 8 - 0
modules/boonex/russian/updates/13.0.10_13.0.11/install/langs/bx_spaces/ru.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="ru" flag="ru" title="Russian">
+	<string_add name="_bx_spaces_menu_item_title_leave_group_cancel_request"><![CDATA[Отменить присоединение]]></string_add>
+    <string_add name="_bx_spaces_menu_item_title_leave_group_reject_request"><![CDATA[Отвергнуть присоединение]]></string_add>
+
+	<string_del name="_bx_spaces_menu_item_title_leave_space_cancel_request"><![CDATA[Отменить присоединение]]></string_del>
+    <string_del name="_bx_spaces_menu_item_title_leave_space_reject_request"><![CDATA[Отвергнуть присоединение]]></string_del>
+</resources>

+ 444 - 0
modules/boonex/russian/updates/13.0.10_13.0.11/source/data/langs/bx_spaces/ru.xml

@@ -0,0 +1,444 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="ru" flag="ru" title="Russian">
+    <string name="_bx_spaces"><![CDATA[Пространства]]></string>
+    <string name="_bx_spaces_cmts"><![CDATA[Пространства - Комментарии]]></string>
+
+    <string name="_bx_spaces_option_enable_auto_approve"><![CDATA[Автоматически активировать пространство после создания]]></string>
+    <string name="_bx_spaces_option_enable_multilevel_hierarchy"><![CDATA[Включить многоуровневую иерархию (экспериментально)]]></string>
+    <string name="_bx_spaces_option_num_connections_quick"><![CDATA[Количество элементов в блоке друзей]]></string>
+    <string name="_bx_spaces_option_per_page_browse"><![CDATA[Количество элементов на странице]]></string>
+    <string name="_bx_spaces_option_num_rss"><![CDATA[Количество элементов в ленте RSS]]></string>
+    <string name="_bx_spaces_option_searchable_fields"><![CDATA[Поля для поиска]]></string>
+    <string name="_bx_spaces_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>
+    <string name="_bx_spaces_form_profile_display_add"><![CDATA[Добавление пространства]]></string>
+    <string name="_bx_spaces_form_profile_display_edit"><![CDATA[Редактирование пространства]]></string>
+    <string name="_bx_spaces_form_profile_display_edit_cover"><![CDATA[Редактирование обложки]]></string>
+    <string name="_bx_spaces_form_profile_display_delete"><![CDATA[Удаление пространства]]></string>
+    <string name="_bx_spaces_form_profile_display_view"><![CDATA[Просмотр пространства]]></string>
+    <string name="_bx_spaces_form_profile_display_view_full"><![CDATA[Полный просмотр пространства]]></string>
+    <string name="_bx_spaces_form_profile_display_invite"><![CDATA[Приглашение в пространство]]></string>
+    <string name="_bx_spaces_form_entry_input_author"><![CDATA[Автор]]></string>
+    <string name="_bx_spaces_form_profile_input_sys_do_submit"><![CDATA[Выполнить]]></string>
+    <string name="_bx_spaces_form_profile_input_sys_join_confirm"><![CDATA[Подтверждение присоединения]]></string>
+    <string name="_bx_spaces_form_profile_input_join_confirm"><![CDATA[Для присоединения требуется разрешение]]></string>
+    <string name="_bx_spaces_form_profile_input_sys_allow_view_to"><![CDATA[Доступно для]]></string>
+    <string name="_bx_spaces_form_profile_input_allow_view_to"><![CDATA[Доступно для]]></string>
+    <string name="_bx_spaces_form_profile_input_allow_view_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>
+    <string name="_bx_spaces_form_profile_input_sys_initial_members"><![CDATA[Пригласить участников]]></string>
+    <string name="_bx_spaces_form_profile_input_sys_parent_space"><![CDATA[Родительское пространство]]></string>
+    <string name="_bx_spaces_form_profile_input_parent_space"><![CDATA[Родительское пространство]]></string>
+    <string name="_bx_spaces_form_profile_input_initial_members"><![CDATA[Пригласить участников]]></string>
+    <string name="_bx_spaces_form_profile_input_sys_space_name"><![CDATA[Название пространства]]></string>
+    <string name="_bx_spaces_form_profile_input_space_name"><![CDATA[Название пространства]]></string>
+    <string name="_bx_spaces_form_profile_input_space_name_err"><![CDATA[Эта информация необходима. Пожалуйста, заполните это поле.]]></string>
+    <string name="_bx_spaces_form_profile_input_sys_space_desc"><![CDATA[Описание]]></string>
+    <string name="_bx_spaces_form_profile_input_space_desc"><![CDATA[Описание]]></string>
+    <string name="_bx_spaces_form_profile_input_sys_space_cat"><![CDATA[Категория]]></string>
+    <string name="_bx_spaces_form_profile_input_space_cat"><![CDATA[Категория]]></string>
+    <string name="_bx_spaces_form_profile_input_space_cat_err"><![CDATA[Поле категории необходимо]]></string>
+    <string name="_bx_spaces_form_profile_input_sys_picture"><![CDATA[Картинка пространства]]></string>
+    <string name="_bx_spaces_form_profile_input_picture"><![CDATA[Загрузить новую картинку пространства]]></string>
+    <string name="_bx_spaces_form_profile_input_picture_err"><![CDATA[Необходима картинка пространства.]]></string>
+    <string name="_bx_spaces_form_profile_input_sys_cover"><![CDATA[Картинка обложки]]></string>
+    <string name="_bx_spaces_form_profile_input_cover"><![CDATA[Загрузить новую картинку обложки]]></string>
+    <string name="_bx_spaces_form_profile_input_sys_delete_confirm"><![CDATA[Подтверждение на удаление]]></string>
+    <string name="_bx_spaces_form_profile_input_delete_confirm"><![CDATA[Я уверен, что хочу удалить эту пространство]]></string>
+    <string name="_bx_spaces_form_profile_input_delete_confirm_info"><![CDATA[Это действие не может быть отменено.]]></string>
+    <string name="_bx_spaces_form_profile_input_delete_confirm_error"><![CDATA[Пожалуйста, отметьте этот флажок, если действительно хотите удалить пространство.]]></string>
+
+    <string name="_bx_spaces_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>
+	<string name="_bx_spaces_acl_action_delete_any_profile"><![CDATA[Удалять любую пространство]]></string>
+	<string name="_bx_spaces_acl_action_delete_invites"><![CDATA[Удалять приглашения]]></string>
+
+	<string name="_bx_spaces_page_title_sys_joined_entries"><![CDATA[Пространства профиля]]></string>
+	<string name="_bx_spaces_page_title_joined_entries"><![CDATA[Пространства профиля]]></string>
+	<string name="_bx_spaces_page_title_sys_create_profile"><![CDATA[Создать пространство]]></string>
+	<string name="_bx_spaces_page_title_create_profile"><![CDATA[Создать пространство]]></string>
+	<string name="_bx_spaces_page_title_sys_edit_profile"><![CDATA[Редактировать пространство]]></string>
+	<string name="_bx_spaces_page_title_edit_profile"><![CDATA[Редактировать пространство]]></string>
+	<string name="_bx_spaces_page_title_sys_edit_profile_cover"><![CDATA[Редактировать обложку пространства]]></string>
+	<string name="_bx_spaces_page_title_edit_profile_cover"><![CDATA[Редактировать обложку]]></string>
+	<string name="_bx_spaces_page_title_sys_delete_profile"><![CDATA[Удалить пространство]]></string>
+	<string name="_bx_spaces_page_title_delete_profile"><![CDATA[Удалить пространство]]></string>
+        <string name="_bx_spaces_page_title_sys_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>
+	<string name="_bx_spaces_page_title_browse"><![CDATA[Пространства]]></string>
+	<string name="_bx_spaces_page_title_browse_by_author"><![CDATA[Пространства {display_name}]]></string>
+	<string name="_bx_spaces_page_title_browse_featured"><![CDATA[Продвинутые пространства]]></string>
+    <string name="_bx_spaces_page_title_browse_top"><![CDATA[Популярные пространства]]></string>
+	<string name="_bx_spaces_page_title_browse_recent"><![CDATA[Новые пространства]]></string>
+	<string name="_bx_spaces_page_title_browse_connections"><![CDATA[{0} связей]]></string>
+	<string name="_bx_spaces_page_title_browse_connections_mutual"><![CDATA[{0} и {1} обоюдных связей]]></string>
+	<string name="_bx_spaces_page_title_sys_profile_friends"><![CDATA[Друзья]]></string>
+	<string name="_bx_spaces_page_title_profile_friends"><![CDATA[Друзья]]></string>
+	<string name="_bx_spaces_page_title_sys_space_fans"><![CDATA[Участники]]></string>
+	<string name="_bx_spaces_page_title_space_fans"><![CDATA[Участники]]></string>
+	<string name="_bx_spaces_page_title_sys_profile_comments"><![CDATA[Комментарии]]></string>
+    <string name="_bx_spaces_page_title_profile_comments"><![CDATA[Комментарии]]></string>
+	<string name="_bx_spaces_page_title_sys_profile_info"><![CDATA[Инфо пространства]]></string>
+	<string name="_bx_spaces_page_title_profile_info"><![CDATA[Инфо о {display_name}]]></string>
+        <string name="_bx_spaces_page_title_sys_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>
+	<string name="_bx_spaces_page_title_sys_manage_administration"><![CDATA[Управление всеми пространствами]]></string>
+	<string name="_bx_spaces_page_title_manage"><![CDATA[Управление]]></string>
+	<string name="_bx_spaces_page_title_sys_top"><![CDATA[Популярные пространства]]></string>
+    <string name="_bx_spaces_page_title_top"><![CDATA[Популярные пространства]]></string>
+    <string name="_bx_spaces_page_title_sys_invite_to_space"><![CDATA[Пригласить участников в пространство]]></string>
+    <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>
+    <string name="_bx_spaces_page_block_title_sys_entries_of_author"><![CDATA[Пространства автора]]></string>
+    <string name="_bx_spaces_page_block_title_entries_of_author"><![CDATA[{display_name} - Пространства]]></string>
+    <string name="_bx_spaces_page_block_title_favorites_of_author"><![CDATA[Избранные пространства]]></string>   
+    <string name="_bx_spaces_page_block_title_sys_favorites_of_author"><![CDATA[Избранные пространства]]></string>
+    <string name="_bx_spaces_page_block_title_sys_joined_entries"><![CDATA[Участие в пространствах]]></string>
+    <string name="_bx_spaces_page_block_title_joined_entries"><![CDATA[Участие в пространствах]]></string>
+    <string name="_bx_spaces_page_block_title_parent"><![CDATA[Родительское пространство]]></string>
+    <string name="_bx_spaces_page_block_title_childs"><![CDATA[Дочерние пространства]]></string>
+    <string name="_bx_spaces_page_block_title_create_profile"><![CDATA[Создать пространство]]></string>
+    <string name="_bx_spaces_page_block_title_edit_profile"><![CDATA[Редактировать пространство]]></string>
+    <string name="_bx_spaces_page_block_title_edit_profile_cover"><![CDATA[Редактировать обложку]]></string>
+    <string name="_bx_spaces_page_block_title_delete_profile"><![CDATA[Удалить пространство]]></string>
+    <string name="_bx_spaces_page_block_title_profile_info_link"><![CDATA[<a href="{profile_link}">{display_name}</a> - Инфо]]></string>
+    <string name="_bx_spaces_page_block_title_profile_info"><![CDATA[Инфо]]></string>
+    <string name="_bx_spaces_page_block_title_system_profile_info"><![CDATA[Инфо]]></string>
+    <string name="_bx_spaces_page_block_title_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>
+    <string name="_bx_spaces_page_block_title_system_profile_friends"><![CDATA[Друзья]]></string>
+    <string name="_bx_spaces_page_block_title_admins"><![CDATA[Администраторы]]></string>
+    <string name="_bx_spaces_page_block_title_fans_link"><![CDATA[Участники пространства: <a href="{profile_link}">{display_name}</a>]]></string>
+    <string name="_bx_spaces_page_block_title_fans"><![CDATA[Участники]]></string>
+    <string name="_bx_spaces_page_block_title_system_fans"><![CDATA[Участники]]></string>
+    <string name="_bx_spaces_page_block_title_fans_invites"><![CDATA[Приглашения]]></string>
+    <string name="_bx_spaces_page_block_title_system_invites"><![CDATA[Приглашения]]></string>
+    <string name="_bx_spaces_page_block_title_profile_location"><![CDATA[Расположение]]></string>
+    <string name="_bx_spaces_page_block_title_profile_comments"><![CDATA[Комментарии]]></string>
+    <string name="_bx_spaces_page_block_title_profile_comments_link"><![CDATA[Комментарии к <a href="{entry_link}">{title}</a>]]></string>
+    <string name="_bx_spaces_page_block_title_profile_actions"><![CDATA[Действия]]></string>
+    <string name="_bx_spaces_page_block_title_featured_profiles"><![CDATA[Продвинутые пространства]]></string>
+    <string name="_bx_spaces_page_block_title_latest_profiles"><![CDATA[Новые пространства]]></string>
+    <string name="_bx_spaces_page_block_title_system_manage"><![CDATA[Управление собственными пространствами]]></string>
+    <string name="_bx_spaces_page_block_title_system_manage_administration"><![CDATA[Управление всеми пространствами]]></string>
+    <string name="_bx_spaces_page_block_title_manage"><![CDATA[Управление]]></string>
+    <string name="_bx_spaces_page_block_title_top_profiles"><![CDATA[Популярные пространства]]></string>
+    <string name="_bx_spaces_page_block_title_joined_profiles"><![CDATA[Мои пространства]]></string>
+    <string name="_bx_spaces_page_block_title_entry_all_actions"><![CDATA[Все действия]]></string>
+    <string name="_bx_spaces_page_block_title_entry_social_sharing"><![CDATA[Поделиться]]></string>
+    <string name="_bx_spaces_page_block_title_categories"><![CDATA[Категории пространств]]></string>
+    <string name="_bx_spaces_page_block_title_invite_to_space"><![CDATA[Пригласить участников в пространство]]></string>
+    <string name="_bx_spaces_page_block_title_search_form"><![CDATA[Форма поиска]]></string>
+    <string name="_bx_spaces_page_block_title_search_results"><![CDATA[Результаты поиска]]></string>
+    <string name="_bx_spaces_page_block_title_search_form_cmts"><![CDATA[Форма поиска комментариев]]></string>
+    <string name="_bx_spaces_page_block_title_search_results_cmts"><![CDATA[Результаты поиска комментариев]]></string>
+    <string name="_bx_spaces_page_block_title_sys_featured_entries_view_showcase"><![CDATA[Продвинутые пространства]]></string>
+    <string name="_bx_spaces_page_block_title_featured_entries_view_showcase"><![CDATA[Продвинутые пространства (Витринный просмотр)]]></string>
+    <string name="_bx_spaces_page_block_title_sys_recommended_entries_view_showcase"><![CDATA[Рекомендованные пространства (Витринный просмотр)]]></string>
+    <string name="_bx_spaces_page_block_title_recommended_entries_view_showcase"><![CDATA[Рекомендованные пространства]]></string>
+    <string name="_bx_spaces_page_block_title_top_level_spaces"><![CDATA[Пространства верхнего уровня]]></string>
+    <string name="_bx_spaces_page_block_title_sys_favorites_entries"><![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_page_block_title_sys_cover_block"><![CDATA[Обложка]]></string>
+    <string name="_bx_spaces_page_block_title_cover_block"><![CDATA[Обложка]]></string>
+
+    <string name="_bx_spaces_menu_title_submenu"><![CDATA[Пространства - Подменю]]></string>
+    <string name="_bx_spaces_menu_set_title_submenu"><![CDATA[Пространства - Подменю]]></string>
+    <string name="_bx_spaces_menu_set_title_view_profile_actions"><![CDATA[Пространство - Действия]]></string>
+    <string name="_bx_spaces_menu_title_view_profile_actions"><![CDATA[Пространство - Действия]]></string>
+    <string name="_bx_spaces_menu_set_title_view_profile_actions_more"><![CDATA[Пространство - Дополнительные действия]]></string>
+    <string name="_bx_spaces_menu_title_view_profile_actions_more"><![CDATA[Пространство - Дополнительные действия]]></string>
+    <string name="_bx_spaces_menu_title_view_profile_meta"><![CDATA[Пространство - Мета инфо]]></string>
+    <string name="_bx_spaces_menu_set_title_view_profile_meta"><![CDATA[Пространство - Мета инфо]]></string>
+    <string name="_bx_spaces_menu_set_title_view_profile_submenu"><![CDATA[Подменю просмотра пространства]]></string>
+    <string name="_bx_spaces_menu_title_view_profile_submenu"><![CDATA[Подменю просмотра пространства]]></string>
+    <string name="_bx_spaces_menu_title_entries_my"><![CDATA[Пространства профиля - Меню действий]]></string>
+    <string name="_bx_spaces_menu_set_title_entries_my"><![CDATA[Пространства профиля - Меню]]></string>
+    <string name="_bx_spaces_menu_set_title_manage_tools"><![CDATA[Инструменты управления - Подменю]]></string>
+    <string name="_bx_spaces_menu_title_manage_tools"><![CDATA[Инструменты управления - Подменю]]></string>
+    <string name="_bx_spaces_menu_item_title_system_delete"><![CDATA[Удалить]]></string>
+    <string name="_bx_spaces_menu_item_title_delete"><![CDATA[Удалить]]></string>
+    <string name="_bx_spaces_menu_item_title_system_delete_with_content"><![CDATA[Удалить вместе с содержимым]]></string>
+    <string name="_bx_spaces_menu_item_title_delete_with_content"><![CDATA[Удалить вместе с содержимым]]></string>
+    <string name="_bx_spaces_menu_item_title_system_clear_reports"><![CDATA[Очистить жалобы]]></string>
+    <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>
+    <string name="_bx_spaces_menu_item_title_delete_profile"><![CDATA[Удалить пространство]]></string>
+    <string name="_bx_spaces_menu_item_title_system_delete_account"><![CDATA[Удалить аккаунт]]></string>
+    <string name="_bx_spaces_menu_item_title_delete_account"><![CDATA[Удалить аккаунт]]></string>
+    <string name="_bx_spaces_menu_item_title_system_profile_type"><![CDATA[Пространство]]></string>
+    <string name="_bx_spaces_menu_item_title_profile_type"><![CDATA[Пространство]]></string>
+    <string name="_bx_spaces_menu_item_title_system_create_profile"><![CDATA[Пространство]]></string>
+    <string name="_bx_spaces_menu_item_title_create_profile"><![CDATA[Пространство]]></string>
+    <string name="_bx_spaces_menu_item_title_system_view_profile_friends"><![CDATA[Друзья]]></string>
+    <string name="_bx_spaces_menu_item_title_view_profile_friends"><![CDATA[Друзья]]></string>
+    <string name="_bx_spaces_menu_item_title_system_view_joined_spaces"><![CDATA[Пространства]]></string>
+    <string name="_bx_spaces_menu_item_title_view_joined_spaces"><![CDATA[Пространства]]></string>
+    <string name="_bx_spaces_menu_item_title_system_view_fans"><![CDATA[Участники]]></string>
+    <string name="_bx_spaces_menu_item_title_view_fans"><![CDATA[Участники]]></string>
+    <string name="_bx_spaces_menu_item_title_system_view_profile_comments"><![CDATA[Комментарии]]></string>
+    <string name="_bx_spaces_menu_item_title_view_profile_comments"><![CDATA[Комментарии]]></string>
+    <string name="_bx_spaces_menu_item_title_system_view_profile_info"><![CDATA[Инфо]]></string>
+    <string name="_bx_spaces_menu_item_title_view_profile_info"><![CDATA[Инфо]]></string>
+    <string name="_bx_spaces_menu_item_title_system_view_profile_view"><![CDATA[Пространство]]></string>
+    <string name="_bx_spaces_menu_item_title_view_profile_view"><![CDATA[Пространство]]></string>
+    <string name="_bx_spaces_menu_item_title_system_view_profile_more_auto"><![CDATA[Еще]]></string>
+    <string name="_bx_spaces_menu_item_title_view_profile_more_auto"><![CDATA[Еще]]></string>
+    <string name="_bx_spaces_menu_item_title_system_invite"><![CDATA[Пригласить]]></string>
+    <string name="_bx_spaces_menu_item_title_invite"><![CDATA[Пригласить]]></string>
+    
+    <string name="_bx_spaces_menu_item_title_system_befriend"><![CDATA[Добавить в друзья]]></string>
+    <string name="_bx_spaces_menu_item_title_befriend"><![CDATA[Добавить в друзья]]></string>
+    <string name="_bx_spaces_menu_item_title_befriend_sent"><![CDATA[Добавить в друзья (запрошено)]]></string>
+    <string name="_bx_spaces_menu_item_title_befriend_confirm"><![CDATA[Принять запрос о дружбе]]></string>
+    <string name="_bx_spaces_menu_item_title_system_unfriend"><![CDATA[Удалить из друзей]]></string>
+    <string name="_bx_spaces_menu_item_title_unfriend"><![CDATA[Удалить из друзей]]></string>
+    <string name="_bx_spaces_menu_item_title_unfriend_cancel_request"><![CDATA[Отменить запрос о дружбе]]></string>
+    <string name="_bx_spaces_menu_item_title_unfriend_reject_request"><![CDATA[Отвергнуть запрос о дружбе]]></string>
+
+    <string name="_bx_spaces_menu_item_title_system_become_fan"><![CDATA[Присоединиться]]></string>
+    <string name="_bx_spaces_menu_item_title_become_fan"><![CDATA[Присоединиться]]></string>
+    <string name="_bx_spaces_menu_item_title_become_fan_sent"><![CDATA[Присоединение запрошено]]></string>
+    <string name="_bx_spaces_menu_item_title_become_fan_confirm"><![CDATA[Одобрить присоединение]]></string>
+    <string name="_bx_spaces_menu_item_title_system_leave_group"><![CDATA[Покинуть пространство]]></string>
+    <string name="_bx_spaces_menu_item_title_leave_group"><![CDATA[Покинуть пространство]]></string>
+    <string name="_bx_spaces_menu_item_title_leave_group_cancel_request"><![CDATA[Отменить присоединение]]></string>
+    <string name="_bx_spaces_menu_item_title_leave_group_reject_request"><![CDATA[Отвергнуть присоединение]]></string>
+
+    <string name="_bx_spaces_menu_item_title_system_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>
+    <string name="_bx_spaces_menu_item_title_unsubscribe"><![CDATA[Отключить уведомления]]></string>
+    <string name="_bx_spaces_menu_item_title_system_more_actions"><![CDATA[Дополнительные действия]]></string>
+    <string name="_bx_spaces_menu_item_title_more_actions"><![CDATA[]]></string>
+    <string name="_bx_spaces_menu_item_title_system_friends"><![CDATA[Друзья]]></string>
+    <string name="_bx_spaces_menu_item_title_friends"><![CDATA[Друзья]]></string>
+    <string name="_bx_spaces_menu_item_title_system_manage_my_spaces"><![CDATA[Мои пространства]]></string>
+    <string name="_bx_spaces_menu_item_title_manage_my_spaces"><![CDATA[Пространства]]></string>
+    <string name="_bx_spaces_menu_item_title_system_followings"><![CDATA[Пространства]]></string>
+    <string name="_bx_spaces_menu_item_title_followings"><![CDATA[Пространства]]></string>
+    <string name="_bx_spaces_menu_item_title_system_entries_recent"><![CDATA[Новые]]></string>
+    <string name="_bx_spaces_menu_item_title_entries_recent"><![CDATA[Новые]]></string>
+    <string name="_bx_spaces_menu_item_title_system_entries_search"><![CDATA[Поиск]]></string>
+    <string name="_bx_spaces_menu_item_title_entries_search"><![CDATA[Поиск]]></string>
+    <string name="_bx_spaces_menu_item_title_system_entries_joined"><![CDATA[Участие]]></string>
+    <string name="_bx_spaces_menu_item_title_entries_joined"><![CDATA[Участие]]></string>
+    <string name="_bx_spaces_menu_item_title_system_entries_manage"><![CDATA[Управление]]></string>
+    <string name="_bx_spaces_menu_item_title_entries_manage"><![CDATA[Управление]]></string>
+    <string name="_bx_spaces_menu_item_title_system_entries_home"><![CDATA[Пространства]]></string>
+    <string name="_bx_spaces_menu_item_title_entries_home"><![CDATA[Пространства]]></string>
+    <string name="_bx_spaces_menu_item_title_system_admt_spaces"><![CDATA[Пространства]]></string>
+    <string name="_bx_spaces_menu_item_title_admt_spaces"><![CDATA[Пространства]]></string>
+    <string name="_bx_spaces_menu_item_title_manage_my"><![CDATA[Мои пространства]]></string>
+    <string name="_bx_spaces_menu_item_title_manage_all"><![CDATA[Все пространства]]></string>
+    <string name="_bx_spaces_menu_item_title_system_entries_top"><![CDATA[Популярные]]></string>
+    <string name="_bx_spaces_menu_item_title_entries_top"><![CDATA[Популярные]]></string>
+    <string name="_bx_spaces_menu_item_title_system_sm_parent"><![CDATA[Предок]]></string>
+    <string name="_bx_spaces_menu_item_title_sm_parent"><![CDATA[Предок]]></string>
+
+    <string name="_bx_spaces_grid_filter_item_title_adm_select_one_filter1"><![CDATA[Все статусы]]></string>
+    <string name="_bx_spaces_grid_filter_item_title_adm_select_one_filter2"><![CDATA[Любая аудитория]]></string>
+    <string name="_bx_spaces_grid_filter_item_title_adm_active"><![CDATA[Активные]]></string>
+    <string name="_bx_spaces_grid_filter_item_title_adm_hidden"><![CDATA[Спрятанные]]></string>
+    <string name="_bx_spaces_grid_filter_item_title_adm_pending"><![CDATA[В ожидании]]></string>
+    <string name="_bx_spaces_grid_filter_item_title_adm_suspended"><![CDATA[Заблокированные]]></string>
+    <string name="_bx_spaces_grid_column_title_adm_active"><![CDATA[Активные]]></string>
+    <string name="_bx_spaces_grid_column_title_adm_name"><![CDATA[Название]]></string>
+    <string name="_bx_spaces_grid_column_title_adm_added"><![CDATA[Создание]]></string>
+    <string name="_bx_spaces_grid_column_title_adm_account"><![CDATA[Аккаунт]]></string>
+    <string name="_bx_spaces_grid_action_title_adm_delete"><![CDATA[Удалить]]></string>
+    <string name="_bx_spaces_grid_action_title_adm_delete_with_content"><![CDATA[Удалить вместе с содержимым]]></string>
+    <string name="_bx_spaces_grid_action_title_adm_more_actions"><![CDATA[Дополнительные действия]]></string>
+    <string name="_bx_spaces_grid_action_title_adm_audit_context"><![CDATA[Аудит действий в контексте]]></string>
+    <string name="_bx_spaces_grid_action_title_adm_audit_content"><![CDATA[Аудит действий над контентом]]></string>
+    <string name="_bx_spaces_grid_action_title_adm_clear_reports"><![CDATA[Очистить жалобы]]></string>
+    <string name="_bx_spaces_grid_action_err_delete"><![CDATA[Невозможно удалить выбранную(ные) пространство(ы).]]></string>
+    <string name="_bx_spaces_grid_txt_account_manager"><![CDATA[Перенаправить в управление аккаунтом.]]></string>
+
+    <string name="_bx_spaces_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>
+
+    <string name="_bx_spaces_search_extended"><![CDATA[Поиск пространств]]></string>
+    <string name="_bx_spaces_search_extended_cmts"><![CDATA[Поиск комментариев к пространством]]></string>
+
+    <string name="_bx_spaces_err_delete_child_presend"><![CDATA[Невозможно удалить пространство, т.к. оно используется другими в качестве родительского.]]></string>
+    <string name="_bx_spaces_txt_account_pending"><![CDATA[Это пространство ожидает одобрения. Пожалуйста, дождитесь ее активации.]]></string>
+    <string name="_bx_spaces_txt_account_suspended"><![CDATA[Это пространство заблокировано.]]></string>
+    <string name="_bx_spaces_txt_status_hidden"><![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>
+    <string name="_bx_spaces_txt_sample_vote_single"><![CDATA[голос за пространство]]></string>
+    <string name="_bx_spaces_txt_sample_score_up_single"><![CDATA[голос за пространство]]></string>
+    <string name="_bx_spaces_txt_sample_score_down_single"><![CDATA[голос против пространства]]></string>
+    <string name="_bx_spaces_txt_set_role"><![CDATA[Задать роль]]></string>
+    <string name="_bx_spaces_txt_private_space"><![CDATA[Приватная пространство]]></string>
+    <string name="_bx_spaces_txt_invite_popup_text"><![CDATA[Вы были приглашены в это пространство.  Нажмите кнопку ниже чтобы принять приглашение.]]></string>
+    <string name="_bx_spaces_txt_invite_popup_title"><![CDATA[Приглашение в пространство]]></string>
+    <string name="_bx_spaces_txt_invite_popup_button_accept"><![CDATA[Принять]]></string>
+    <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_txt_cart_item_title_lifetime"><![CDATA[{0}: {1} (пожизненно)]]></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>
+    <string name="_bx_spaces_alert_action_join_request"><![CDATA[запрос на присоединение к пространству]]></string>
+    <string name="_bx_spaces_txt_ntfs_join_invitation"><![CDATA[Представитель пространства <b class="bx-ntfs-content-profile">{owner_name}</b> пригласил <b class="bx-ntfs-content-entry">{subentry_sample}</b> вступить в пространство]]></string>
+    <string name="_bx_spaces_txt_ntfs_join_request"><![CDATA[В пространство <b class="bx-ntfs-content-profile">{owner_name}</b> хочет вступить <b class="bx-ntfs-content-entry">{subentry_sample}</b>]]></string>
+    <string name="_bx_spaces_txt_ntfs_timeline_post_common"><![CDATA[В пространству <b class="bx-ntfs-content-profile">{owner_name}</b> новая публикация <b class="bx-ntfs-content-entry">{subentry_sample}</b>]]></string>
+
+    <string name="_bx_spaces_pre_lists_cats"><![CDATA[Категории пространств]]></string>
+    <string name="_bx_spaces_cat_General"><![CDATA[Обобщение]]></string>
+    <string name="_bx_spaces_cat_Business"><![CDATA[Бизнес]]></string>
+    <string name="_bx_spaces_cat_Interests"><![CDATA[Увлечение]]></string>
+    <string name="_bx_spaces_cat_Causes"><![CDATA[Движение]]></string>
+    <string name="_bx_spaces_cat_Fun"><![CDATA[Юмор]]></string>
+    <string name="_bx_spaces_cat_Uncategorised"><![CDATA[Без категории]]></string>
+
+    <string name="_bx_spaces_pre_lists_roles"><![CDATA[Роли в пространствах]]></string>
+    <string name="_bx_spaces_role_regular"><![CDATA[Обычный]]></string>
+    <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}
+<p>Получен запрос на присоединение к пространству <a href="{EntryUrl}">{EntryTitle}</a> от <a href="{NewMemberUrl}">{NewMemberDisplayName}</a></p>
+{email_footer}]]></string>
+
+    <string name="_bx_spaces_email_join_reject"><![CDATA[Отклонение запроса на присоединение к пространству]]></string>
+    <string name="_bx_spaces_email_join_reject_subject"><![CDATA[Ваш запрос на присоединение к пространству был отклонен]]></string>
+    <string name="_bx_spaces_email_join_reject_body"><![CDATA[{email_header}
+<p>Ваш запрос на присоединение к пространству <a href="{EntryUrl}">{EntryTitle}</a> был отклонен администратором пространства.</p>
+{email_footer}]]></string>
+
+    <string name="_bx_spaces_email_join_confirm"><![CDATA[Одобрение запроса на присоединение к пространству]]></string>
+    <string name="_bx_spaces_email_join_confirm_subject"><![CDATA[Ваш запрос на присоединение к пространству был одобрен]]></string>
+    <string name="_bx_spaces_email_join_confirm_body"><![CDATA[{email_header}
+<p>Ваш запрос на присоединение к пространству <a href="{EntryUrl}">{EntryTitle}</a> был одобрен.</p>
+{email_footer}]]></string>
+
+    <string name="_bx_spaces_email_fan_remove"><![CDATA[Удаление из пространства]]></string>
+    <string name="_bx_spaces_email_fan_remove_subject"><![CDATA[Вы были удалены из пространства]]></string>
+    <string name="_bx_spaces_email_fan_remove_body"><![CDATA[{email_header}
+<p>Ваш профиль был удален из пространства <a href="{EntryUrl}">{EntryTitle}</a> администратором пространства.</p>
+{email_footer}]]></string>
+
+    <string name="_bx_spaces_email_fan_become_admin"><![CDATA[Получение статуса администратора пространства]]></string>
+    <string name="_bx_spaces_email_fan_become_admin_subject"><![CDATA[Вы стали администратором пространства]]></string>
+    <string name="_bx_spaces_email_fan_become_admin_body"><![CDATA[{email_header}
+<p>Вы получили статус администратора пространства <a href="{EntryUrl}">{EntryTitle}</a>.</p>
+{email_footer}]]></string>
+
+    <string name="_bx_spaces_email_admin_become_fan"><![CDATA[Лишение статуса администратора пространства]]></string>
+    <string name="_bx_spaces_email_admin_become_fan_subject"><![CDATA[Вы были лишены статуса администратора пространства]]></string>
+    <string name="_bx_spaces_email_admin_become_fan_body"><![CDATA[{email_header}
+<p>Вы были лишены статуса администратора пространства <a href="{EntryUrl}">{EntryTitle}</a></p>
+{email_footer}]]></string>
+
+    <string name="_bx_spaces_email_set_role"><![CDATA[Изменение статуса в пространстве]]></string>
+    <string name="_bx_spaces_email_set_role_subject"><![CDATA[Ваш статус в пространстве был изменен]]></string>
+    <string name="_bx_spaces_email_set_role_body"><![CDATA[{email_header}
+<p>Ваш статус в пространстве <a href="{EntryUrl}">{EntryTitle}</a> был изменен на <b>{Role}</b>.</p>
+{email_footer}]]></string>
+
+    <string name="_bx_spaces_email_invitation"><![CDATA[Приглашение в пространство]]></string>
+    <string name="_bx_spaces_email_invitation_subject"><![CDATA[Приглашение в пространство "{EntryTitle}"]]></string>
+    <string name="_bx_spaces_email_invitation_body"><![CDATA[{email_header}
+<p><a href="{InviterUrl}">{InviterDisplayName}</a> пригласил Вас в пространство <a href="{EntryUrl}">{EntryTitle}</a>.</p>
+{email_footer}]]></string>
+</resources>

+ 71 - 0
modules/boonex/russian/updates/13.0.10_13.0.11/source/install/config.php

@@ -0,0 +1,71 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Russian Russian language
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_LANGUAGE,
+    'name' => 'bx_ru',
+    'title' => 'Russian',
+    'note' => 'Language file',
+    'version' => '13.0.11',
+    'vendor' => 'Boonex',
+    'help_url' => 'http://feed.una.io/?section={module_name}',
+
+    'compatible_with' => array(
+        '13.0.0-RC6'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/russian/',
+    'home_uri' => 'ru',
+
+    'db_prefix' => 'bx_rsn_',
+    'class_prefix' => 'BxRsn',
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => 'BoonEx Russian',
+
+    /**
+     * Installation/Uninstallation Section.
+     * NOTE. The sequence of actions is critical. Don't change the order.
+     */
+    'install' => array(
+        'execute_sql' => 1,
+        'update_languages' => 1,
+        'install_language' => 1,
+        'clear_db_cache' => 1
+    ),
+    'uninstall' => array (
+        'update_languages' => 1,
+        'execute_sql' => 1,
+        'clear_db_cache' => 1
+    ),
+    'enable' => array(
+        'execute_sql' => 1
+    ),
+    'disable' => array(
+        'execute_sql' => 1
+    ),
+
+    /**
+     * Dependencies Section
+     */
+    'dependencies' => array(),
+
+);
+
+/** @} */

+ 51 - 0
modules/boonex/spaces/updates/13.0.6_13.0.7/install/config.php

@@ -0,0 +1,51 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ */
+
+$aConfig = array(
+    /**
+     * Main Section.
+     */
+    'title' => 'Spaces',
+    'version_from' => '13.0.6',
+    'version_to' => '13.0.7',
+    'vendor' => 'BoonEx',
+
+    'compatible_with' => array(
+        '13.0.0-RC6'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/spaces/updates/update_13.0.6_13.0.7/',
+    'home_uri' => 'spaces_update_1306_1307',
+
+    'module_dir' => 'boonex/spaces/',
+    'module_uri' => 'spaces',
+
+    'db_prefix' => 'bx_spaces_',
+    'class_prefix' => 'BxSpaces',
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+        'execute_sql' => 1,
+        'update_files' => 1,
+        'update_languages' => 1,
+        'clear_db_cache' => 1,
+    ),
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => 'Spaces',
+
+    /**
+     * Files Section
+     */
+    'delete_files' => array(),
+);

+ 13 - 0
modules/boonex/spaces/updates/13.0.6_13.0.7/install/installer.php

@@ -0,0 +1,13 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ */
+
+class BxSpacesUpdater extends BxDolStudioUpdater
+{
+    function __construct($aConfig)
+    {
+        parent::__construct($aConfig);
+    }
+}

+ 8 - 0
modules/boonex/spaces/updates/13.0.6_13.0.7/install/langs/en.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+	<string_add name="_bx_spaces_menu_item_title_leave_group_cancel_request"><![CDATA[Cancel Request]]></string_add>
+	<string_add name="_bx_spaces_menu_item_title_leave_group_reject_request"><![CDATA[Reject Request]]></string_add>
+
+	<string_del name="_bx_spaces_menu_item_title_leave_space_cancel_request"><![CDATA[Cancel Request]]></string_del>
+	<string_del name="_bx_spaces_menu_item_title_leave_space_reject_request"><![CDATA[Reject Request]]></string_del>
+</resources>

+ 2 - 0
modules/boonex/spaces/updates/13.0.6_13.0.7/install/sql/enable.sql

@@ -0,0 +1,2 @@
+-- MENUS
+UPDATE `sys_menu_items` SET `title_system`='_bx_spaces_menu_item_title_system_leave_group' WHERE `set_name`='bx_spaces_view_actions_more' AND `name`='profile-fan-remove';

+ 278 - 0
modules/boonex/spaces/updates/13.0.6_13.0.7/source/classes/BxSpacesConfig.php

@@ -0,0 +1,278 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defdroup    Spaces Spaces
+ * @indroup     UnaModules
+ *
+ * @{
+ */
+
+class BxSpacesConfig extends BxBaseModGroupsConfig
+{
+    function __construct($aModule)
+    {
+        parent::__construct($aModule);
+
+        $this->_aMenuItems2MethodsActions = array_merge($this->_aMenuItems2MethodsActions, array(
+            'view-space-profile' => 'checkAllowedView',
+            'edit-space-profile' => 'checkAllowedEdit',
+            'edit-space-cover' => 'checkAllowedChangeCover',
+            'invite-to-space' => 'checkAllowedInvite',
+            'delete-space-profile' => 'checkAllowedDelete',
+            'approve-space-profile' => 'checkAllowedApprove',
+        ));
+
+        $this->CNF = array (
+
+            // module icon
+            'ICON' => 'object-group col-red2',
+
+            // database tables
+            'TABLE_ENTRIES' => $aModule['db_prefix'] . 'data',
+            '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',
+            'FIELD_AUTHOR' => 'author',
+            'FIELD_ADDED' => 'added',
+            'FIELD_CHANGED' => 'changed',
+            'FIELD_NAME' => 'space_name',
+            'FIELD_PARENT' => 'parent_space',
+            'FIELD_LEVEL' => 'level',
+            'FIELD_TITLE' => 'space_name',
+            'FIELD_TEXT' => 'space_desc',
+            'FIELD_CATEGORY' => 'space_cat',
+            'FIELD_PICTURE' => 'picture',
+            'FIELD_COVER' => 'cover',
+            'FIELD_COVER_POSITION' => 'cover_data',
+            'FIELD_JOIN_CONFIRMATION' => 'join_confirmation',
+            'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
+            'FIELD_ALLOW_POST_TO' => 'allow_post_to',
+            'FIELD_CF' => 'cf',
+            'FIELD_VIEWS' => 'views',
+            'FIELD_VOTES' => 'votes',
+            'FIELD_STATUS' => 'status',
+            'FIELD_STATUS_ADMIN' => 'status_admin',
+            'FIELD_COMMENTS' => 'comments',
+            'FIELDS_QUICK_SEARCH' => array('space_name'),
+            'FIELD_LOCATION' => 'location',
+            'FIELD_LOCATION_PREFIX' => 'location',
+            '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_JOIN_ENTRY' => 'join-space-profile',
+            'URI_JOINED_ENTRIES' => 'joined-spaces',
+            'URI_MANAGE_COMMON' => 'spaces-manage',
+
+            'URL_HOME' => 'page.php?i=spaces-home',
+            'URL_ENTRY_FANS' => 'page.php?i=space-fans',
+            'URL_MANAGE_COMMON' => 'page.php?i=spaces-manage',
+            'URL_MANAGE_ADMINISTRATION' => 'page.php?i=spaces-administration',
+
+            'PARAM_AUTO_APPROVE' => 'bx_spaces_enable_auto_approve',
+            'PARAM_MULTILEVEL_HIERARCHY' => 'bx_spaces_enable_multilevel_hierarchy',
+            'PARAM_NUM_RSS' => 'bx_spaces_num_rss',
+            'PARAM_NUM_CONNECTIONS_QUICK' => 'bx_spaces_num_connections_quick',
+            'PARAM_SEARCHABLE_FIELDS' => 'bx_spaces_searchable_fields',
+            'PARAM_PER_PAGE_BROWSE_SHOWCASE' => 'bx_spaces_per_page_browse_showcase',
+            'PARAM_PER_PAGE_BROWSE_RECOMMENDED' => 'bx_spaces_per_page_browse_recommended',
+
+            '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
+            'OBJECT_STORAGE' => 'bx_spaces_pics',
+            'OBJECT_STORAGE_COVER' => 'bx_spaces_pics',
+            'OBJECT_IMAGES_TRANSCODER_THUMB' => 'bx_spaces_thumb',
+            'OBJECT_IMAGES_TRANSCODER_ICON' => 'bx_spaces_icon',
+            'OBJECT_IMAGES_TRANSCODER_AVATAR' => 'bx_spaces_avatar',
+            'OBJECT_IMAGES_TRANSCODER_AVATAR_BIG' => 'bx_spaces_avatar_big',
+            'OBJECT_IMAGES_TRANSCODER_PICTURE' => 'bx_spaces_picture',
+            'OBJECT_IMAGES_TRANSCODER_COVER' => 'bx_spaces_cover',
+            'OBJECT_IMAGES_TRANSCODER_COVER_THUMB' => 'bx_spaces_cover_thumb',
+            'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_spaces_gallery',
+            'OBJECT_VIEWS' => 'bx_spaces',
+            'OBJECT_VOTES' => 'bx_spaces',
+            'OBJECT_SCORES' => 'bx_spaces',
+            'OBJECT_FAVORITES' => 'bx_spaces',
+            'OBJECT_FEATURED' => 'bx_spaces',
+            'OBJECT_COMMENTS' => 'bx_spaces',
+            'OBJECT_NOTES' => 'bx_spaces_notes',
+            'OBJECT_REPORTS' => 'bx_spaces',
+            'OBJECT_METATAGS' => 'bx_spaces',
+            'OBJECT_CATEGORY' => 'bx_spaces_cats',
+            'OBJECT_FORM_ENTRY' => 'bx_space',
+            'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_space_view',
+            'OBJECT_FORM_ENTRY_DISPLAY_VIEW_FULL' => 'bx_space_view_full', // for "info" tab on view space page
+            'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_space_add',
+            'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_space_edit',
+            'OBJECT_FORM_ENTRY_DISPLAY_EDIT_COVER' => 'bx_space_edit_cover',
+            'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_space_delete',
+            'OBJECT_FORM_ENTRY_DISPLAY_INVITE' => 'bx_space_invite',
+            'OBJECT_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
+            'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_spaces_my', // actions menu on profile entries page
+            'OBJECT_MENU_SUBMENU' => 'bx_spaces_submenu', // main module submenu
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_spaces_view_submenu',  // view entry submenu
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'spaces-home', // first item in view entry submenu from main module submenu
+            'OBJECT_MENU_VIEW_ENTRY_META' => 'bx_spaces_view_meta', // meta menu on view entry page
+            'OBJECT_MENU_SNIPPET_META' => 'bx_spaces_snippet_meta', // menu for snippet meta info
+            'OBJECT_MENU_MANAGE_TOOLS' => 'bx_spaces_menu_manage_tools', //manage menu in content administration tools
+            'OBJECT_PAGE_VIEW_ENTRY' => 'bx_spaces_view_profile',
+            'OBJECT_PAGE_VIEW_ENTRY_CLOSED' => 'bx_spaces_view_profile_closed',
+            'OBJECT_PRIVACY_VIEW' => 'bx_spaces_allow_view_to',
+            'OBJECT_PRIVACY_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,
+
+            'EMAIL_INVITATION' => 'bx_spaces_invitation',
+            'EMAIL_JOIN_REQUEST' => 'bx_spaces_join_request',
+            'EMAIL_JOIN_CONFIRM' => 'bx_spaces_join_confirm',
+            'EMAIL_FAN_BECOME_ADMIN' => 'bx_spaces_fan_become_admin',
+            'EMAIL_ADMIN_BECOME_FAN' => 'bx_spaces_admin_become_fan',
+            'EMAIL_FAN_SET_ROLE' => 'bx_spaces_set_role',
+            'EMAIL_FAN_REMOVE' => 'bx_spaces_fan_remove',
+            'EMAIL_JOIN_REJECT' => 'bx_spaces_join_reject',
+
+            'TRIGGER_MENU_PROFILE_VIEW_SUBMENU' => 'trigger_group_view_submenu',
+            'TRIGGER_MENU_PROFILE_SNIPPET_META' => 'trigger_group_snippet_meta',
+            'TRIGGER_MENU_PROFILE_VIEW_ACTIONS' => 'trigger_group_view_actions',
+            'TRIGGER_PAGE_VIEW_ENTRY' => 'trigger_page_group_view_entry',
+
+            // menu items which visibility depends on custom visibility checking
+            'MENU_ITEM_TO_METHOD' => array (
+                'bx_spaces_view_actions' => $this->_aMenuItems2MethodsActions,
+                'bx_spaces_view_actions_more' => $this->_aMenuItems2MethodsActions,
+                'bx_spaces_view_actions_all' => $this->_aMenuItems2MethodsActions,
+            ),
+
+            // informer messages
+            'INFORMERS' => array (
+                'status' => array (
+                    'name' => 'bx-spaces-status-not-active',
+                    'map' => array (
+                        BX_PROFILE_STATUS_PENDING => '_bx_spaces_txt_account_pending',
+                        BX_PROFILE_STATUS_SUSPENDED => '_bx_spaces_txt_account_suspended',
+                    ),
+                ),
+                'approving' => array (
+                    'name' => 'bx-groups-approving',
+                    'map' => array (
+                        'pending' => array('msg' => '_bx_spaces_txt_account_pending', 'type' => BX_INFORMER_ALERT),
+                        'hidden' => array('msg' => '_bx_spaces_txt_status_hidden', 'type' => BX_INFORMER_ERROR),
+                    ),
+                ),
+            ),
+
+            // some language keys
+            'T' => array (
+                'txt_sample_single' => '_bx_spaces_txt_sample_single',
+                'txt_sample_single_with_article' => '_bx_spaces_txt_sample_single_with_article',
+                'txt_sample_comment_single' => '_bx_spaces_txt_sample_comment_single',
+                'txt_sample_vote_single' => '_bx_spaces_txt_sample_vote_single',
+                'txt_sample_score_up_single' => '_bx_spaces_txt_sample_score_up_single',
+                'txt_sample_score_down_single' => '_bx_spaces_txt_sample_score_down_single',
+                'txt_private_group' => '_bx_spaces_txt_private_space',
+                'txt_N_fans' => '_bx_spaces_txt_N_fans',
+                'txt_ntfs_join_invitation' => '_bx_spaces_txt_ntfs_join_invitation',
+                'txt_ntfs_join_request' => '_bx_spaces_txt_ntfs_join_request',
+                'txt_ntfs_fan_added' => '_bx_spaces_txt_ntfs_fan_added',
+                'txt_ntfs_timeline_post_common' => '_bx_spaces_txt_ntfs_timeline_post_common',
+                'option_members_mode_multi_roles' => '_bx_spaces_option_members_mode_multi_roles',
+                'form_field_author' => '_bx_spaces_form_entry_input_author',
+                'menu_item_title_befriend_sent' => '_bx_spaces_menu_item_title_befriend_sent',
+                'menu_item_title_unfriend_cancel_request' => '_bx_spaces_menu_item_title_unfriend_cancel_request',
+                'menu_item_title_befriend_confirm' => '_bx_spaces_menu_item_title_befriend_confirm',
+                'menu_item_title_unfriend_reject_request' => '_bx_spaces_menu_item_title_unfriend_reject_request',
+                'menu_item_title_befriend' => '_bx_spaces_menu_item_title_befriend',
+                'menu_item_title_unfriend' => '_bx_spaces_menu_item_title_unfriend',
+                'grid_action_err_delete' => '_bx_spaces_grid_action_err_delete',
+                'grid_txt_account_manager' => '_bx_spaces_grid_txt_account_manager',
+                'filter_item_active' => '_bx_spaces_grid_filter_item_title_adm_active',
+                'filter_item_hidden' => '_bx_spaces_grid_filter_item_title_adm_hidden',
+                'filter_item_pending' => '_bx_spaces_grid_filter_item_title_adm_pending',
+                'filter_item_suspended' => '_bx_spaces_grid_filter_item_title_adm_suspended',
+                'filter_item_select_one_filter1' => '_bx_spaces_grid_filter_item_title_adm_select_one_filter1',
+                'filter_item_select_one_filter2' => '_bx_spaces_grid_filter_item_title_adm_select_one_filter2',
+                'menu_item_manage_my' => '_bx_spaces_menu_item_title_manage_my',
+                'menu_item_manage_all' => '_bx_spaces_menu_item_title_manage_all',
+                'menu_item_title_become_fan_sent' => '_bx_spaces_menu_item_title_become_fan_sent',
+                'menu_item_title_leave_group_cancel_request' => '_bx_spaces_menu_item_title_leave_group_cancel_request',
+                'menu_item_title_become_fan' => '_bx_spaces_menu_item_title_become_fan',
+                'menu_item_title_leave_group' => '_bx_spaces_menu_item_title_leave_group',
+                'txt_all_entries_by_author' => '_bx_spaces_page_title_browse_by_author',
+                'txt_invitation_popup_title' => '_bx_spaces_txt_invite_popup_title',
+                'txt_invitation_popup_text' => '_bx_spaces_txt_invite_popup_text',
+                'txt_invitation_popup_accept_button' => '_bx_spaces_txt_invite_popup_button_accept',
+                '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_cart_item_title_lifetime' => '_bx_spaces_txt_cart_item_title_lifetime',
+                'txt_subscribe_title' => '_bx_spaces_grid_action_title_subscribe_title',
+                'popup_title_price_add' => '_bx_spaces_popup_title_price_add',
+                'popup_title_price_edit' => '_bx_spaces_popup_title_price_edit',
+                'msg_performed' => '_bx_spaces_msg_performed',
+                'err_period_unit' => '_bx_spaces_form_price_input_err_period_unit',
+                'err_price_duplicate' => '_bx_spaces_err_price_duplicate',
+                'err_cannot_perform' => '_bx_spaces_err_cannot_perform',
+            ),
+        );
+
+        $this->_aJsClasses = array(
+            'main' => 'BxSpacesMain',
+            'manage_tools' => 'BxSpacesManageTools',
+            'invite_popup' => 'BxSpacesInvitePopup',
+            'prices' => 'BxSpacesPrices'
+        );
+
+        $this->_aJsObjects = array(
+            'main' => 'oBxSpacesMain',
+            'manage_tools' => 'oBxSpacesManageTools',
+            'invite_popup' => 'oBxSpacesInvitePopup',
+            'prices' => 'oBxSpacesPrices'
+        );
+
+        $this->_aGridObjects = array(
+            'common' => $this->CNF['OBJECT_GRID_COMMON'],
+            'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
+        );
+    }
+
+}
+
+/** @} */

+ 152 - 0
modules/boonex/spaces/updates/13.0.6_13.0.7/source/install/config.php

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

+ 448 - 0
modules/boonex/spaces/updates/13.0.6_13.0.7/source/install/langs/en.xml

@@ -0,0 +1,448 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+    <string name="_bx_spaces"><![CDATA[Spaces]]></string>
+    <string name="_bx_spaces_cmts"><![CDATA[Spaces' Comments]]></string>
+
+    <string name="_bx_spaces_option_enable_auto_approve"><![CDATA[Auto approve a space after creation]]></string>
+    <string name="_bx_spaces_option_enable_multilevel_hierarchy"><![CDATA[Allow multilevel hierarchy (experimental)]]></string>
+    <string name="_bx_spaces_option_num_connections_quick"><![CDATA[Number of items in friends block]]></string>
+    <string name="_bx_spaces_option_per_page_browse"><![CDATA[Number of items per page]]></string>
+    <string name="_bx_spaces_option_num_rss"><![CDATA[Number of items in RSS feed]]></string>
+    <string name="_bx_spaces_option_searchable_fields"><![CDATA[Searchable fields]]></string>
+    <string name="_bx_spaces_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>
+    <string name="_bx_spaces_form_profile_display_add"><![CDATA[Add Space]]></string>
+    <string name="_bx_spaces_form_profile_display_edit"><![CDATA[Edit Space]]></string>
+    <string name="_bx_spaces_form_profile_display_edit_cover"><![CDATA[Edit Cover]]></string>
+    <string name="_bx_spaces_form_profile_display_delete"><![CDATA[Delete Space]]></string>
+    <string name="_bx_spaces_form_profile_display_view"><![CDATA[View Space]]></string>
+    <string name="_bx_spaces_form_profile_display_view_full"><![CDATA[Full View Space]]></string>
+    <string name="_bx_spaces_form_profile_display_invite"><![CDATA[Invite to Space]]></string>
+    <string name="_bx_spaces_form_entry_input_author"><![CDATA[Author]]></string>
+    <string name="_bx_spaces_form_profile_input_sys_do_submit"><![CDATA[Submit]]></string>
+    <string name="_bx_spaces_form_profile_input_sys_join_confirm"><![CDATA[Join confirmation]]></string>
+    <string name="_bx_spaces_form_profile_input_join_confirm"><![CDATA[Approval required to join]]></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>
+    <string name="_bx_spaces_form_profile_input_sys_initial_members"><![CDATA[Invite Members]]></string>
+    <string name="_bx_spaces_form_profile_input_initial_members"><![CDATA[Invite Members]]></string>
+    <string name="_bx_spaces_form_profile_input_sys_parent_space"><![CDATA[Parent Space]]></string>
+    <string name="_bx_spaces_form_profile_input_parent_space"><![CDATA[Parent Space]]></string>
+    <string name="_bx_spaces_form_profile_input_sys_space_name"><![CDATA[Space Name]]></string>
+    <string name="_bx_spaces_form_profile_input_space_name"><![CDATA[Space Name]]></string>
+    <string name="_bx_spaces_form_profile_input_space_name_err"><![CDATA[This information is essential. Please, fill in this field.]]></string>
+    <string name="_bx_spaces_form_profile_input_sys_space_desc"><![CDATA[Description]]></string>
+    <string name="_bx_spaces_form_profile_input_space_desc"><![CDATA[Description]]></string>
+    <string name="_bx_spaces_form_profile_input_sys_space_cat"><![CDATA[Category]]></string>
+    <string name="_bx_spaces_form_profile_input_space_cat"><![CDATA[Category]]></string>
+    <string name="_bx_spaces_form_profile_input_space_cat_err"><![CDATA[Category field is mandatory]]></string>
+    <string name="_bx_spaces_form_profile_input_sys_picture"><![CDATA[Space Picture]]></string>
+    <string name="_bx_spaces_form_profile_input_picture"><![CDATA[Upload New Space Picture]]></string>
+    <string name="_bx_spaces_form_profile_input_picture_err"><![CDATA[Space picture is mandatory.]]></string>
+    <string name="_bx_spaces_form_profile_input_sys_cover"><![CDATA[Cover Picture]]></string>
+    <string name="_bx_spaces_form_profile_input_cover"><![CDATA[Upload New Cover Picture]]></string>
+    <string name="_bx_spaces_form_profile_input_sys_delete_confirm"><![CDATA[Delete confirmation]]></string>
+    <string name="_bx_spaces_form_profile_input_delete_confirm"><![CDATA[I am sure I want to delete this space]]></string>
+    <string name="_bx_spaces_form_profile_input_delete_confirm_info"><![CDATA[This action can not be undone.]]></string>
+    <string name="_bx_spaces_form_profile_input_delete_confirm_error"><![CDATA[Please check this checkbox if you really want to delete space.]]></string>
+
+    <string name="_bx_spaces_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>
+	<string name="_bx_spaces_acl_action_delete_any_profile"><![CDATA[Delete Any Space]]></string>
+    <string name="_bx_spaces_acl_action_delete_invites"><![CDATA[Delete Invites]]></string>
+	
+	<string name="_bx_spaces_page_title_sys_joined_entries"><![CDATA[Profile Spaces]]></string>
+	<string name="_bx_spaces_page_title_joined_entries"><![CDATA[Profile Spaces]]></string>
+	<string name="_bx_spaces_page_title_sys_create_profile"><![CDATA[Create Space]]></string>
+	<string name="_bx_spaces_page_title_create_profile"><![CDATA[Create Space]]></string>
+	<string name="_bx_spaces_page_title_sys_edit_profile"><![CDATA[Edit Space]]></string>
+	<string name="_bx_spaces_page_title_edit_profile"><![CDATA[Edit Space]]></string>
+	<string name="_bx_spaces_page_title_sys_edit_profile_cover"><![CDATA[Edit Space Cover]]></string>
+	<string name="_bx_spaces_page_title_edit_profile_cover"><![CDATA[Edit Cover]]></string>
+	<string name="_bx_spaces_page_title_sys_delete_profile"><![CDATA[Delete Space]]></string>
+	<string name="_bx_spaces_page_title_delete_profile"><![CDATA[Delete Space]]></string>
+        <string name="_bx_spaces_page_title_sys_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>
+	<string name="_bx_spaces_page_title_browse"><![CDATA[Spaces]]></string>
+	<string name="_bx_spaces_page_title_browse_by_author"><![CDATA[Spaces of {display_name}]]></string>
+	<string name="_bx_spaces_page_title_browse_featured"><![CDATA[Featured Spaces]]></string>
+	<string name="_bx_spaces_page_title_browse_top"><![CDATA[Top Spaces]]></string>
+	<string name="_bx_spaces_page_title_browse_recent"><![CDATA[New Spaces]]></string>
+	<string name="_bx_spaces_page_title_browse_connections"><![CDATA[{0} connections]]></string>
+	<string name="_bx_spaces_page_title_browse_connections_mutual"><![CDATA[{0} and {1} mutual connections]]></string>
+	<string name="_bx_spaces_page_title_sys_profile_friends"><![CDATA[Friends]]></string>
+	<string name="_bx_spaces_page_title_profile_friends"><![CDATA[Friends]]></string>
+	<string name="_bx_spaces_page_title_sys_space_fans"><![CDATA[Members]]></string>
+	<string name="_bx_spaces_page_title_space_fans"><![CDATA[Members]]></string>
+	<string name="_bx_spaces_page_title_sys_profile_comments"><![CDATA[Comments]]></string>
+	<string name="_bx_spaces_page_title_profile_comments"><![CDATA[Comments]]></string>
+	<string name="_bx_spaces_page_title_sys_profile_info"><![CDATA[Space Info]]></string>
+	<string name="_bx_spaces_page_title_profile_info"><![CDATA[Info about {display_name}]]></string>
+        <string name="_bx_spaces_page_title_sys_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>
+	<string name="_bx_spaces_page_title_sys_manage_administration"><![CDATA[Manage All Spaces]]></string>
+	<string name="_bx_spaces_page_title_manage"><![CDATA[Manage Spaces]]></string>
+	<string name="_bx_spaces_page_title_sys_top"><![CDATA[Top Spaces]]></string>
+	<string name="_bx_spaces_page_title_top"><![CDATA[Top Spaces]]></string>
+        <string name="_bx_spaces_page_title_sys_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[Favorites Spaces]]></string>
+        <string name="_bx_spaces_page_title_entries_favorites"><![CDATA[Favorites Spaces]]></string>
+	
+	<string name="_bx_spaces_page_block_title_sys_entries_actions"><![CDATA[Spaces actions]]></string>
+	<string name="_bx_spaces_page_block_title_entries_actions"><![CDATA[Spaces actions]]></string>
+        <string name="_bx_spaces_page_block_title_sys_favorites_entries"><![CDATA[Favorite List]]></string>
+        <string name="_bx_spaces_page_block_title_favorites_entries"><![CDATA["{title}" List]]></string>
+        <string name="_bx_spaces_page_block_title_favorites_entries_info"><![CDATA[Info]]></string>
+        <string name="_bx_spaces_page_block_title_favorites_entries_actions"><![CDATA[Favorites List Actions]]></string>
+	<string name="_bx_spaces_page_block_title_sys_entries_of_author"><![CDATA[Spaces of author]]></string>
+	<string name="_bx_spaces_page_block_title_entries_of_author"><![CDATA[Spaces by {display_name}]]></string>
+	<string name="_bx_spaces_page_block_title_favorites_of_author"><![CDATA[Favorite Spaces]]></string>
+	<string name="_bx_spaces_page_block_title_sys_favorites_of_author"><![CDATA[Favorite Spaces]]></string>
+	<string name="_bx_spaces_page_block_title_sys_joined_entries"><![CDATA[Joined Spaces]]></string>
+	<string name="_bx_spaces_page_block_title_joined_entries"><![CDATA[Joined Spaces]]></string>
+  <string name="_bx_spaces_page_block_title_parent"><![CDATA[Parent Space]]></string>
+  <string name="_bx_spaces_page_block_title_childs"><![CDATA[Child Spaces]]></string>
+  <string name="_bx_spaces_page_block_title_create_profile"><![CDATA[Create Space]]></string>
+	<string name="_bx_spaces_page_block_title_edit_profile"><![CDATA[Edit Space]]></string>
+	<string name="_bx_spaces_page_block_title_edit_profile_cover"><![CDATA[Edit Cover]]></string>
+	<string name="_bx_spaces_page_block_title_delete_profile"><![CDATA[Delete Space]]></string>
+        <string name="_bx_spaces_page_block_title_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>
+	<string name="_bx_spaces_page_block_title_system_profile_friends"><![CDATA[Friends]]></string>
+	<string name="_bx_spaces_page_block_title_admins"><![CDATA[Administrators]]></string>
+	<string name="_bx_spaces_page_block_title_fans_link"><![CDATA[Members of <a href="{profile_link}">{display_name}</a>]]></string>
+	<string name="_bx_spaces_page_block_title_fans"><![CDATA[Members]]></string>
+	<string name="_bx_spaces_page_block_title_system_fans"><![CDATA[Members]]></string>
+  <string name="_bx_spaces_page_block_title_fans_invites"><![CDATA[Invites]]></string>
+  <string name="_bx_spaces_page_block_title_system_invites"><![CDATA[Invites]]></string>
+        <string name="_bx_spaces_page_block_title_profile_location"><![CDATA[Location]]></string>
+	<string name="_bx_spaces_page_block_title_profile_comments"><![CDATA[Comments]]></string>
+	<string name="_bx_spaces_page_block_title_entry_reports"><![CDATA[Reports]]></string>
+	<string name="_bx_spaces_page_block_title_profile_comments_link"><![CDATA[Comments to <a href="{entry_link}">{title}</a>]]></string>
+	<string name="_bx_spaces_page_block_title_profile_actions"><![CDATA[Actions]]></string>
+	<string name="_bx_spaces_page_block_title_featured_profiles"><![CDATA[Featured Spaces]]></string>
+	<string name="_bx_spaces_page_block_title_latest_profiles"><![CDATA[New Spaces]]></string>
+	<string name="_bx_spaces_page_block_title_system_manage"><![CDATA[Manage Own Spaces]]></string>
+	<string name="_bx_spaces_page_block_title_system_manage_administration"><![CDATA[Manage All Spaces]]></string>
+	<string name="_bx_spaces_page_block_title_manage"><![CDATA[Manage Spaces]]></string>
+	<string name="_bx_spaces_page_block_title_top_profiles"><![CDATA[Top Spaces]]></string>
+        <string name="_bx_spaces_page_block_title_joined_profiles"><![CDATA[Joined Spaces]]></string>
+        <string name="_bx_spaces_page_block_title_entry_all_actions"><![CDATA[All Actions]]></string>
+	<string name="_bx_spaces_page_block_title_entry_social_sharing"><![CDATA[Share]]></string>
+	<string name="_bx_spaces_page_block_title_categories"><![CDATA[Spaces Categories]]></string>
+	<string name="_bx_spaces_page_block_title_invite_to_space"><![CDATA[Invite Members to the Space]]></string>
+	<string name="_bx_spaces_page_block_title_search_form"><![CDATA[Search Form]]></string>
+	<string name="_bx_spaces_page_block_title_search_results"><![CDATA[Search Results]]></string>
+	<string name="_bx_spaces_page_block_title_search_form_cmts"><![CDATA[Comments Search Form]]></string>
+	<string name="_bx_spaces_page_block_title_search_results_cmts"><![CDATA[Comments Search Results]]></string>
+	<string name="_bx_spaces_page_block_title_sys_featured_entries_view_showcase"><![CDATA[Featured Spaces (Showcase View)]]></string>
+	<string name="_bx_spaces_page_block_title_featured_entries_view_showcase"><![CDATA[Featured Spaces]]></string>
+	<string name="_bx_spaces_page_block_title_sys_recommended_entries_view_showcase"><![CDATA[Recommended Spaces (Showcase View)]]></string>
+	<string name="_bx_spaces_page_block_title_recommended_entries_view_showcase"><![CDATA[Recommended Spaces]]></string>
+  <string name="_bx_spaces_page_block_title_top_level_spaces"><![CDATA[Top Level Spaces]]></string>
+  <string name="_bx_spaces_page_block_title_sys_cover_block"><![CDATA[Cover]]></string>
+  <string name="_bx_spaces_page_block_title_cover_block"><![CDATA[Cover]]></string>
+
+        <string name="_bx_spaces_menu_title_submenu"><![CDATA[Spaces Submenu]]></string>
+	<string name="_bx_spaces_menu_set_title_submenu"><![CDATA[Spaces Submenu]]></string>
+	<string name="_bx_spaces_menu_set_title_view_profile_actions"><![CDATA[Space Actions]]></string>
+	<string name="_bx_spaces_menu_title_view_profile_actions"><![CDATA[Space Actions]]></string>
+	<string name="_bx_spaces_menu_set_title_view_profile_actions_more"><![CDATA[Space More Actions]]></string>
+	<string name="_bx_spaces_menu_title_view_profile_actions_more"><![CDATA[Space More Actions]]></string>
+        <string name="_bx_spaces_menu_title_view_profile_meta"><![CDATA[Space Meta]]></string>
+        <string name="_bx_spaces_menu_set_title_view_profile_meta"><![CDATA[Space Meta]]></string>
+	<string name="_bx_spaces_menu_set_title_view_profile_submenu"><![CDATA[View Space Submenu]]></string>
+	<string name="_bx_spaces_menu_title_view_profile_submenu"><![CDATA[View Space Submenu]]></string>
+	<string name="_bx_spaces_menu_title_entries_my"><![CDATA[Profile Spaces Action Menu]]></string>
+	<string name="_bx_spaces_menu_set_title_entries_my"><![CDATA[Profile Spaces Menu]]></string>
+	<string name="_bx_spaces_menu_set_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string>
+	<string name="_bx_spaces_menu_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string>
+	<string name="_bx_spaces_menu_item_title_system_delete"><![CDATA[Delete]]></string>
+	<string name="_bx_spaces_menu_item_title_delete"><![CDATA[Delete]]></string>
+	<string name="_bx_spaces_menu_item_title_system_delete_with_content"><![CDATA[Delete With Content]]></string>
+	<string name="_bx_spaces_menu_item_title_delete_with_content"><![CDATA[Delete With Content]]></string>
+        <string name="_bx_spaces_menu_item_title_system_clear_reports"><![CDATA[Clear reports]]></string>
+        <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>
+	<string name="_bx_spaces_menu_item_title_delete_profile"><![CDATA[Delete Space]]></string>
+	<string name="_bx_spaces_menu_item_title_system_delete_account"><![CDATA[Delete Account]]></string>
+	<string name="_bx_spaces_menu_item_title_delete_account"><![CDATA[Delete Account]]></string>
+	<string name="_bx_spaces_menu_item_title_system_profile_type"><![CDATA[Space]]></string>
+	<string name="_bx_spaces_menu_item_title_profile_type"><![CDATA[Space]]></string>
+	<string name="_bx_spaces_menu_item_title_system_create_profile"><![CDATA[Space]]></string>
+	<string name="_bx_spaces_menu_item_title_create_profile"><![CDATA[Space]]></string>
+	<string name="_bx_spaces_menu_item_title_system_view_profile_friends"><![CDATA[Friends]]></string>
+	<string name="_bx_spaces_menu_item_title_view_profile_friends"><![CDATA[Friends]]></string>
+	<string name="_bx_spaces_menu_item_title_system_view_joined_spaces"><![CDATA[Spaces]]></string>
+	<string name="_bx_spaces_menu_item_title_view_joined_spaces"><![CDATA[Spaces]]></string>
+	<string name="_bx_spaces_menu_item_title_system_view_fans"><![CDATA[Members]]></string>
+	<string name="_bx_spaces_menu_item_title_view_fans"><![CDATA[Members]]></string>
+	<string name="_bx_spaces_menu_item_title_system_view_profile_comments"><![CDATA[Comments]]></string>
+	<string name="_bx_spaces_menu_item_title_view_profile_comments"><![CDATA[Comments]]></string>
+	<string name="_bx_spaces_menu_item_title_system_view_profile_info"><![CDATA[Info]]></string>
+	<string name="_bx_spaces_menu_item_title_view_profile_info"><![CDATA[Info]]></string>
+	<string name="_bx_spaces_menu_item_title_system_view_profile_view"><![CDATA[Space]]></string>
+	<string name="_bx_spaces_menu_item_title_view_profile_view"><![CDATA[Space]]></string>
+        <string name="_bx_spaces_menu_item_title_system_view_profile_more_auto"><![CDATA[More]]></string>
+        <string name="_bx_spaces_menu_item_title_view_profile_more_auto"><![CDATA[More]]></string>
+	<string name="_bx_spaces_menu_item_title_system_invite"><![CDATA[Invite]]></string>
+	<string name="_bx_spaces_menu_item_title_invite"><![CDATA[Invite]]></string>
+	
+	<string name="_bx_spaces_menu_item_title_system_befriend"><![CDATA[Add friend]]></string>
+	<string name="_bx_spaces_menu_item_title_befriend"><![CDATA[Add friend]]></string>
+	<string name="_bx_spaces_menu_item_title_befriend_sent"><![CDATA[Add friend (requested)]]></string>
+	<string name="_bx_spaces_menu_item_title_befriend_confirm"><![CDATA[Accept friend request]]></string>
+	<string name="_bx_spaces_menu_item_title_system_unfriend"><![CDATA[Unfriend]]></string>
+	<string name="_bx_spaces_menu_item_title_unfriend"><![CDATA[Unfriend]]></string>
+	<string name="_bx_spaces_menu_item_title_unfriend_cancel_request"><![CDATA[Cancel friend request]]></string>
+	<string name="_bx_spaces_menu_item_title_unfriend_reject_request"><![CDATA[Reject friend request]]></string>
+	
+	<string name="_bx_spaces_menu_item_title_system_become_fan"><![CDATA[Join Space]]></string>
+	<string name="_bx_spaces_menu_item_title_become_fan"><![CDATA[Join Space]]></string>
+	<string name="_bx_spaces_menu_item_title_become_fan_sent"><![CDATA[Join Space (requested)]]></string>
+	<string name="_bx_spaces_menu_item_title_become_fan_confirm"><![CDATA[Accept Request]]></string>
+	<string name="_bx_spaces_menu_item_title_system_leave_group"><![CDATA[Leave Space]]></string>
+	<string name="_bx_spaces_menu_item_title_leave_group"><![CDATA[Leave Space]]></string>
+	<string name="_bx_spaces_menu_item_title_leave_group_cancel_request"><![CDATA[Cancel Request]]></string>
+	<string name="_bx_spaces_menu_item_title_leave_group_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>
+	<string name="_bx_spaces_menu_item_title_unsubscribe"><![CDATA[Unfollow]]></string>
+	<string name="_bx_spaces_menu_item_title_system_more_actions"><![CDATA[More Actions]]></string>
+	<string name="_bx_spaces_menu_item_title_more_actions"><![CDATA[]]></string>
+	<string name="_bx_spaces_menu_item_title_system_friends"><![CDATA[Friends]]></string>
+	<string name="_bx_spaces_menu_item_title_friends"><![CDATA[Friends]]></string>
+	<string name="_bx_spaces_menu_item_title_system_manage_my_spaces"><![CDATA[My spaces]]></string>
+	<string name="_bx_spaces_menu_item_title_manage_my_spaces"><![CDATA[Spaces]]></string>
+        <string name="_bx_spaces_menu_item_title_system_followings"><![CDATA[Spaces]]></string>
+	<string name="_bx_spaces_menu_item_title_followings"><![CDATA[Spaces]]></string>
+	<string name="_bx_spaces_menu_item_title_system_entries_recent"><![CDATA[New]]></string>
+	<string name="_bx_spaces_menu_item_title_entries_recent"><![CDATA[New]]></string>
+	<string name="_bx_spaces_menu_item_title_system_entries_search"><![CDATA[Search]]></string>
+	<string name="_bx_spaces_menu_item_title_entries_search"><![CDATA[Search]]></string>
+        <string name="_bx_spaces_menu_item_title_system_entries_joined"><![CDATA[Joined]]></string>
+        <string name="_bx_spaces_menu_item_title_entries_joined"><![CDATA[Joined]]></string>
+	<string name="_bx_spaces_menu_item_title_system_entries_manage"><![CDATA[Manage]]></string>
+	<string name="_bx_spaces_menu_item_title_entries_manage"><![CDATA[Manage]]></string>
+	<string name="_bx_spaces_menu_item_title_system_entries_home"><![CDATA[Spaces]]></string>
+	<string name="_bx_spaces_menu_item_title_entries_home"><![CDATA[Spaces]]></string>
+	<string name="_bx_spaces_menu_item_title_system_admt_spaces"><![CDATA[Spaces]]></string>
+	<string name="_bx_spaces_menu_item_title_admt_spaces"><![CDATA[Spaces]]></string>
+	<string name="_bx_spaces_menu_item_title_manage_my"><![CDATA[My Spaces]]></string>
+	<string name="_bx_spaces_menu_item_title_manage_all"><![CDATA[All Spaces]]></string>
+	<string name="_bx_spaces_menu_item_title_system_entries_top"><![CDATA[Top]]></string>
+	<string name="_bx_spaces_menu_item_title_entries_top"><![CDATA[Top]]></string>
+	
+    <string name="_bx_spaces_grid_filter_item_title_adm_select_one_filter1"><![CDATA[All Statuses]]></string>
+    <string name="_bx_spaces_grid_filter_item_title_adm_select_one_filter2"><![CDATA[Any Audience]]></string>
+    <string name="_bx_spaces_grid_filter_item_title_adm_active"><![CDATA[Active]]></string>
+    <string name="_bx_spaces_grid_filter_item_title_adm_hidden"><![CDATA[Hidden]]></string>
+    <string name="_bx_spaces_grid_filter_item_title_adm_pending"><![CDATA[Pending]]></string>
+    <string name="_bx_spaces_grid_filter_item_title_adm_suspended"><![CDATA[Suspended]]></string>
+    <string name="_bx_spaces_grid_column_title_adm_active"><![CDATA[Active]]></string>
+    <string name="_bx_spaces_grid_column_title_adm_name"><![CDATA[Name]]></string>
+    <string name="_bx_spaces_grid_column_title_adm_added"><![CDATA[Created]]></string>
+    <string name="_bx_spaces_grid_column_title_adm_account"><![CDATA[Account]]></string>
+    <string name="_bx_spaces_grid_action_title_adm_delete"><![CDATA[Delete]]></string>
+    <string name="_bx_spaces_grid_action_title_adm_delete_with_content"><![CDATA[Delete With Content]]></string>
+    <string name="_bx_spaces_grid_action_title_adm_more_actions"><![CDATA[More Actions]]></string>
+    <string name="_bx_spaces_grid_action_title_adm_audit_context"><![CDATA[Audit actions in context]]></string>
+    <string name="_bx_spaces_grid_action_title_adm_audit_content"><![CDATA[Audit actions with content]]></string>
+    <string name="_bx_spaces_grid_action_title_adm_clear_reports"><![CDATA[Clear reports]]></string>
+    <string name="_bx_spaces_grid_action_err_delete"><![CDATA[Cannot delete the selected space(s).]]></string>
+    <string name="_bx_spaces_grid_txt_account_manager"><![CDATA[Redirect to manage account.]]></string>
+    <string name="_bx_spaces_menu_item_title_system_sm_parent"><![CDATA[Parent]]></string>
+    <string name="_bx_spaces_menu_item_title_sm_parent"><![CDATA[Parent]]></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>
+	
+	<string name="_bx_spaces_search_extended"><![CDATA[Spaces Search]]></string>
+	<string name="_bx_spaces_search_extended_cmts"><![CDATA[Spaces Comments Search]]></string>
+
+    <string name="_bx_spaces_err_delete_child_presend"><![CDATA[Cannot delete this space because there are child elements.]]></string>
+    <string name="_bx_spaces_txt_account_pending"><![CDATA[This space is pending approval, please wait until it is activated.]]></string>
+    <string name="_bx_spaces_txt_account_suspended"><![CDATA[This space is suspended.]]></string>
+    <string name="_bx_spaces_txt_status_hidden"><![CDATA[This space was hidden.]]></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>
+    <string name="_bx_spaces_txt_sample_vote_single"><![CDATA[vote to space]]></string>
+    <string name="_bx_spaces_txt_sample_score_up_single"><![CDATA[score up vote to space]]></string>
+    <string name="_bx_spaces_txt_sample_score_down_single"><![CDATA[score down vote to space]]></string>
+    <string name="_bx_spaces_txt_set_role"><![CDATA[Set Role]]></string>
+    <string name="_bx_spaces_txt_private_space"><![CDATA[Private space]]></string>
+    <string name="_bx_spaces_txt_invite_popup_text"><![CDATA[You have been invited to a space. Click the button below to accept the invitation.]]></string>
+    <string name="_bx_spaces_txt_invite_popup_title"><![CDATA[Invitation to a space]]></string>
+    <string name="_bx_spaces_txt_invite_popup_button_accept"><![CDATA[Accept]]></string>
+    <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_txt_cart_item_title_lifetime"><![CDATA[{0}: {1} (lifetime)]]></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>
+    <string name="_bx_spaces_alert_action_join_invitation_notif"><![CDATA[join invitation]]></string>
+    <string name="_bx_spaces_alert_action_join_request"><![CDATA[join request]]></string>
+    <string name="_bx_spaces_txt_ntfs_join_invitation"><![CDATA[<b class="bx-ntfs-content-profile">{owner_name}</b> space's representative invites <b class="bx-ntfs-content-entry">{subentry_sample}</b> to join space]]></string>
+    <string name="_bx_spaces_txt_ntfs_join_request"><![CDATA[Space <b class="bx-ntfs-content-profile">{owner_name}</b> has a join request from <b class="bx-ntfs-content-entry">{subentry_sample}</b>]]></string>
+    <string name="_bx_spaces_txt_ntfs_timeline_post_common"><![CDATA[New post <b class="bx-ntfs-content-entry">{subentry_sample}</b> in <b class="bx-ntfs-content-profile">{owner_name}</b> space timeline]]></string>
+
+    <string name="_bx_spaces_pre_lists_cats"><![CDATA[Space categories]]></string>
+    <string name="_bx_spaces_cat_General"><![CDATA[General]]></string>
+    <string name="_bx_spaces_cat_Business"><![CDATA[Business]]></string>
+    <string name="_bx_spaces_cat_Interests"><![CDATA[Interests]]></string>
+    <string name="_bx_spaces_cat_Causes"><![CDATA[Causes]]></string>
+    <string name="_bx_spaces_cat_Fun"><![CDATA[Fun]]></string>
+    <string name="_bx_spaces_cat_Uncategorised"><![CDATA[Uncategorised]]></string>
+
+    <string name="_bx_spaces_pre_lists_roles"><![CDATA[Space roles]]></string>
+    <string name="_bx_spaces_role_regular"><![CDATA[Regular]]></string>
+    <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}
+    <p>New request to join <a href="{EntryUrl}">{EntryTitle}</a> space from <a href="{NewMemberUrl}">{NewMemberDisplayName}</a></p>
+    {email_footer}]]></string>
+
+    <string name="_bx_spaces_email_join_reject"><![CDATA[Space join request was rejected]]></string>
+    <string name="_bx_spaces_email_join_reject_subject"><![CDATA[Request to join a space was rejected]]></string>
+    <string name="_bx_spaces_email_join_reject_body"><![CDATA[{email_header}
+    <p>Your request to join <a href="{EntryUrl}">{EntryTitle}</a> space was rejected by space admin.</p>
+    {email_footer}]]></string>
+
+    <string name="_bx_spaces_email_join_confirm"><![CDATA[Space join request was confirmed]]></string>
+    <string name="_bx_spaces_email_join_confirm_subject"><![CDATA[Your request to join a space was confirmed]]></string>
+    <string name="_bx_spaces_email_join_confirm_body"><![CDATA[{email_header}
+    <p>Your request to join <a href="{EntryUrl}">{EntryTitle}</a> space was confirmed by the space admin.</p>
+    {email_footer}]]></string>
+
+    <string name="_bx_spaces_email_fan_remove"><![CDATA[Profile was removed from space fans]]></string>
+    <string name="_bx_spaces_email_fan_remove_subject"><![CDATA[Your profile was removed from the space]]></string>
+    <string name="_bx_spaces_email_fan_remove_body"><![CDATA[{email_header}
+    <p>Your profile was removed from <a href="{EntryUrl}">{EntryTitle}</a> space by the space admin.</p>
+    {email_footer}]]></string>
+
+    <string name="_bx_spaces_email_fan_become_admin"><![CDATA[Space admin status was granted]]></string>
+    <string name="_bx_spaces_email_fan_become_admin_subject"><![CDATA[You are a space admin now]]></string>
+    <string name="_bx_spaces_email_fan_become_admin_body"><![CDATA[{email_header}
+    <p>You are an admin of <a href="{EntryUrl}">{EntryTitle}</a> space now.</p>
+    {email_footer}]]></string>
+
+    <string name="_bx_spaces_email_admin_become_fan"><![CDATA[Space admin status was revoked]]></string>
+    <string name="_bx_spaces_email_admin_become_fan_subject"><![CDATA[Your space admin status was revoked]]></string>
+    <string name="_bx_spaces_email_admin_become_fan_body"><![CDATA[{email_header}
+    <p>Your admin status was revoked from <a href="{EntryUrl}">{EntryTitle}</a> space.</p>
+    {email_footer}]]></string>
+
+    <string name="_bx_spaces_email_set_role"><![CDATA[Space member status was changed]]></string>
+    <string name="_bx_spaces_email_set_role_subject"><![CDATA[Your space status was changed]]></string>
+    <string name="_bx_spaces_email_set_role_body"><![CDATA[{email_header}
+<p>Your status in <a href="{EntryUrl}">{EntryTitle}</a> space was changed to <b>{Role}</b>.</p>
+{email_footer}]]></string>
+
+    <string name="_bx_spaces_email_invitation"><![CDATA[Invitation to space]]></string>
+    <string name="_bx_spaces_email_invitation_subject"><![CDATA[Invitation to "{EntryTitle}" space]]></string>
+    <string name="_bx_spaces_email_invitation_body"><![CDATA[{email_header}
+    <p><a href="{InviterUrl}">{InviterDisplayName}</a> invited you to <a href="{EntryUrl}">{EntryTitle} space</a>.</p>
+    {email_footer}]]></string>
+</resources>

+ 671 - 0
modules/boonex/spaces/updates/13.0.6_13.0.7/source/install/sql/enable.sql

@@ -0,0 +1,671 @@
+
+-- SETTINGS
+
+SET @iTypeOrder = (SELECT MAX(`order`) FROM `sys_options_types` WHERE `group` = 'modules');
+INSERT INTO `sys_options_types`(`group`, `name`, `caption`, `icon`, `order`) VALUES 
+('modules', 'bx_spaces', '_bx_spaces', 'bx_spaces@modules/boonex/spaces/|std-icon.svg', IF(ISNULL(@iTypeOrder), 1, @iTypeOrder + 1));
+SET @iTypeId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order`)
+VALUES (@iTypeId, 'bx_spaces', '_bx_spaces', 1);
+SET @iCategId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
+('bx_spaces_enable_multilevel_hierarchy', '', @iCategId, '_bx_spaces_option_enable_multilevel_hierarchy', 'checkbox', '', '', '', 0),
+('bx_spaces_enable_auto_approve', 'on', @iCategId, '_bx_spaces_option_enable_auto_approve', 'checkbox', '', '', '', 1),
+('bx_spaces_num_connections_quick', '6', @iCategId, '_bx_spaces_option_num_connections_quick', 'digit', '', '', '', 10),
+('bx_spaces_per_page_browse', '24', @iCategId, '_bx_spaces_option_per_page_browse', 'digit', '', '', '', 11),
+('bx_spaces_num_rss', '10', @iCategId, '_bx_spaces_option_num_rss', 'digit', '', '', '', 12),
+('bx_spaces_per_page_browse_showcase', '32', @iCategId, '_sys_option_per_page_browse_showcase', 'digit', '', '', '', 15),
+('bx_spaces_per_page_browse_recommended', '10', @iCategId, '_sys_option_per_page_browse_recommended', 'digit', '', '', '', 16),
+('bx_spaces_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);
+
+
+-- PAGES
+
+-- PAGE: create profile
+
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_create_profile', 'create-space-profile', '_bx_spaces_page_title_sys_create_profile', '_bx_spaces_page_title_create_profile', 'bx_spaces', 5, 2147483647, 1, 'page.php?i=create-space-profile', '', '', '', 0, 1, 0, '', '');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_spaces_create_profile', 1, 'bx_spaces', '_bx_spaces_page_block_title_create_profile', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:13:\"entity_create\";}', 0, 1, 1);
+
+-- PAGE: view profile
+
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_view_profile', 'view-space-profile', '_bx_spaces_page_title_sys_view_profile', '_bx_spaces_page_title_view_profile', 'bx_spaces', 10, 2147483647, 1, 'page.php?i=view-space-profile', '', '', '', 0, 1, 0, 'BxSpacesPageEntry', 'modules/boonex/spaces/classes/BxSpacesPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES
+('bx_spaces_view_profile', 1, 'bx_spaces', '', '_bx_spaces_page_block_title_entry_social_sharing', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:21:\"entity_social_sharing\";}', 0, 0, 0, 0),
+('bx_spaces_view_profile', 1, 'bx_spaces', '', '_bx_spaces_page_block_title_entry_all_actions', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:18:"entity_all_actions";}', 0, 0, 0, 0),
+('bx_spaces_view_profile', 2, 'bx_spaces', '', '_bx_spaces_page_block_title_profile_info', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:11:\"entity_info\";}', 0, 0, 1, 0),
+('bx_spaces_view_profile', 2, 'bx_spaces', '', '_bx_spaces_page_block_title_parent', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:13:\"entity_parent\";}', 0, 0, 1, 1),
+('bx_spaces_view_profile', 2, 'bx_spaces', '', '_bx_spaces_page_block_title_childs', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:13:\"entity_childs\";}', 0, 0, 1, 2),
+('bx_spaces_view_profile', 3, 'bx_spaces', '', '_bx_spaces_page_block_title_profile_location', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:15:\"entity_location\";}', 0, 0, 0, 0),
+('bx_spaces_view_profile', 3, 'bx_spaces', '', '_bx_spaces_page_block_title_fans', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:4:\"fans\";}', 0, 0, 1, 0),
+('bx_spaces_view_profile', 3, 'bx_spaces', '', '_bx_spaces_page_block_title_admins', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:6:\"admins\";}', 0, 0, 1, 1),
+('bx_spaces_view_profile', 3, 'bx_spaces', '', '_bx_spaces_page_block_title_profile_location', 3, 2147483647, 'service', 'a:4:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:13:\"locations_map\";s:6:\"params\";a:2:{i:0;s:9:\"bx_spaces\";i:1;s:12:\"{content_id}\";}s:5:\"class\";s:20:\"TemplServiceMetatags\";}', 0, 0, 1, 2),
+('bx_spaces_view_profile', 4, 'bx_spaces', '', '_bx_spaces_page_block_title_profile_description', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:17:\"entity_text_block\";}', 0, 0, 1, 0),
+('bx_spaces_view_profile', 4, 'bx_spaces', '', '_bx_spaces_page_block_title_profile_comments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 0, 0),
+('bx_spaces_view_profile', 2, 'bx_spaces', '', '_bx_spaces_page_block_title_entry_reports', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:14:\"entity_reports\";}', 0, 0, 1, 6);
+
+
+-- PAGE: view closed profile 
+
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_view_profile_closed', 'view-space-profile-closed', '_bx_spaces_page_title_sys_view_profile_closed', '_bx_spaces_page_title_view_profile', 'bx_spaces', 10, 2147483647, 1, 'page.php?i=view-space-profile', '', '', '', 0, 1, 0, 'BxSpacesPageEntry', 'modules/boonex/spaces/classes/BxSpacesPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_spaces_view_profile_closed', 2, 'bx_spaces', '', '_bx_spaces_page_block_title_profile_info', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:11:\"entity_info\";}', 0, 0, 1, 0),
+('bx_spaces_view_profile_closed', 3, 'bx_spaces', '', '_bx_spaces_page_block_title_fans', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:4:\"fans\";}', 0, 0, 1, 0);
+
+-- PAGE: edit profile
+
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_edit_profile', 'edit-space-profile', '_bx_spaces_page_title_sys_edit_profile', '_bx_spaces_page_title_edit_profile', 'bx_spaces', 5, 2147483647, 1, 'page.php?i=edit-space-profile', '', '', '', 0, 1, 0, 'BxSpacesPageEntry', 'modules/boonex/spaces/classes/BxSpacesPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_spaces_edit_profile', 1, 'bx_spaces', '_bx_spaces_page_block_title_edit_profile', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:11:\"entity_edit\";}', 0, 0, 0);
+
+-- PAGE: invite members
+
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_invite', 'invite-to-space', '_bx_spaces_page_title_sys_invite_to_space', '_bx_spaces_page_title_invite_to_space', 'bx_spaces', 5, 2147483647, 1, 'page.php?i=invite-to-space', '', '', '', 0, 1, 0, 'BxSpacesPageEntry', 'modules/boonex/spaces/classes/BxSpacesPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_spaces_invite', 1, 'bx_spaces', '_bx_spaces_page_block_title_invite_to_space', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:13:\"entity_invite\";}', 0, 0, 0);
+
+-- PAGE: delete profile
+
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_delete_profile', 'delete-space-profile', '_bx_spaces_page_title_sys_delete_profile', '_bx_spaces_page_title_delete_profile', 'bx_spaces', 5, 2147483647, 1, 'page.php?i=delete-space-profile', '', '', '', 0, 1, 0, 'BxSpacesPageEntry', 'modules/boonex/spaces/classes/BxSpacesPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_spaces_delete_profile', 1, 'bx_spaces', '_bx_spaces_page_block_title_delete_profile', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:13:\"entity_delete\";}', 0, 0, 0);
+
+-- PAGE: 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 
+('bx_spaces_profile_info', 'space-profile-info', '_bx_spaces_page_title_sys_profile_info', '_bx_spaces_page_title_profile_info', 'bx_spaces', 5, 2147483647, 1, 'page.php?i=space-profile-info', '', '', '', 0, 1, 0, 'BxSpacesPageEntry', 'modules/boonex/spaces/classes/BxSpacesPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_spaces_profile_info', 1, 'bx_spaces', '_bx_spaces_page_block_title_system_profile_info', '_bx_spaces_page_block_title_profile_info_link', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:16:\"entity_info_full\";}', 0, 0, 1, 1),
+('bx_spaces_profile_info', 1, 'bx_spaces', '', '_bx_spaces_page_block_title_profile_description', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:17:\"entity_text_block\";}', 0, 0, 1, 2);
+
+-- PAGE: 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 
+('bx_spaces_fans', 'space-fans', '_bx_spaces_page_title_sys_space_fans', '_bx_spaces_page_title_space_fans', 'bx_spaces', 5, 2147483647, 1, 'page.php?i=space-fans', '', '', '', 0, 1, 0, 'BxSpacesPageEntry', 'modules/boonex/spaces/classes/BxSpacesPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_spaces_fans', 1, 'bx_spaces', '_bx_spaces_page_block_title_system_fans', '_bx_spaces_page_block_title_fans_link', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:10:"fans_table";}', 0, 0, 1, 1),
+('bx_spaces_fans', 1, 'bx_spaces', '_bx_spaces_page_block_title_system_invites', '_bx_spaces_page_block_title_fans_invites', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:13:"invites_table";}', 0, 0, 1, 2);
+
+-- PAGE: view entry comments
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_profile_comments', '_bx_spaces_page_title_sys_profile_comments', '_bx_spaces_page_title_profile_comments', 'bx_spaces', 5, 2147483647, 1, 'space-profile-comments', '', '', '', '', 0, 1, 0, 'BxSpacesPageEntry', 'modules/boonex/spaces/classes/BxSpacesPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_spaces_profile_comments', 1, 'bx_spaces', '_bx_spaces_page_block_title_profile_comments', '_bx_spaces_page_block_title_profile_comments_link', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 0, 1);
+
+-- PAGE: module home
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_home', '_bx_spaces_page_title_sys_recent', '_bx_spaces_page_title_recent', 'bx_spaces', 5, 2147483647, 1, 'spaces-home', 'page.php?i=spaces-home', '', '', '', 0, 1, 0, 'BxSpacesPageBrowse', 'modules/boonex/spaces/classes/BxSpacesPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`, `active`) VALUES
+('bx_spaces_home', 1, 'bx_spaces', '_bx_spaces_page_block_title_featured_profiles', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:15:"browse_featured";s:6:"params";a:1:{i:0;s:7:"gallery";}}', 0, 1, 0, 1),
+('bx_spaces_home', 1, 'bx_spaces', '_bx_spaces_page_block_title_latest_profiles', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:22:\"browse_recent_profiles\";s:6:"params";a:1:{i:0;b:1;}}', 0, 1, 1, 1),
+('bx_spaces_home', 1, 'bx_spaces', '_bx_spaces_page_block_title_top_level_spaces', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:16:\"browse_top_level\";s:6:"params";a:1:{i:0;b:1;}}', 0, 1, 2, 0);
+
+-- PAGE: top profiles
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_top', '_bx_spaces_page_title_sys_top', '_bx_spaces_page_title_top', 'bx_spaces', 5, 2147483647, 1, 'spaces-top', 'page.php?i=spaces-top', '', '', '', 0, 1, 0, 'BxSpacesPageBrowse', 'modules/boonex/spaces/classes/BxSpacesPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_spaces_top', 1, 'bx_spaces', '_bx_spaces_page_block_title_top_profiles', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:19:\"browse_top_profiles\";s:6:"params";a:1:{i:0;b:1;}}', 0, 1, 0);
+
+-- PAGE: search for entries
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_search', '_bx_spaces_page_title_sys_entries_search', '_bx_spaces_page_title_entries_search', 'bx_spaces', 5, 2147483647, 1, 'spaces-search', 'page.php?i=spaces-search', '', '', '', 0, 1, 0, 'BxSpacesPageBrowse', 'modules/boonex/spaces/classes/BxSpacesPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_spaces_search', 1, 'bx_spaces', '_bx_spaces_page_block_title_search_form', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:8:"get_form";s:6:"params";a:1:{i:0;a:1:{s:6:"object";s:9:"bx_spaces";}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 1, 1),
+('bx_spaces_search', 1, 'bx_spaces', '_bx_spaces_page_block_title_search_results', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_results";s:6:"params";a:1:{i:0;a:2:{s:6:"object";s:9:"bx_spaces";s:10:"show_empty";b:1;}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 1, 2),
+('bx_spaces_search', 1, 'bx_spaces', '_bx_spaces_page_block_title_search_form_cmts', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:8:"get_form";s:6:"params";a:1:{i:0;a:1:{s:6:"object";s:14:"bx_spaces_cmts";}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 0, 3),
+('bx_spaces_search', 1, 'bx_spaces', '_bx_spaces_page_block_title_search_results_cmts', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_results";s:6:"params";a:1:{i:0;a:2:{s:6:"object";s:14:"bx_spaces_cmts";s:10:"show_empty";b:1;}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 0, 4);
+
+-- PAGE: joined profiles
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_joined_spaces', '_bx_spaces_page_title_sys_joined', '_bx_spaces_page_title_joined', 'bx_spaces', 5, 2147483647, 1, 'spaces-joined', 'page.php?i=spaces-joined', '', '', '', 0, 1, 0, 'BxSpacesPageBrowse', 'modules/boonex/spaces/classes/BxSpacesPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_joined_spaces', 1, 'bx_spaces', '_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;s:12:"{profile_id}";i:1;b:1;}}', 0, 1, 0);
+
+
+-- PAGE: module manage own
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_manage', '_bx_spaces_page_title_sys_manage', '_bx_spaces_page_title_manage', 'bx_spaces', 5, 2147483647, 1, 'spaces-manage', 'page.php?i=spaces-manage', '', '', '', 0, 1, 0, 'BxSpacesPageBrowse', 'modules/boonex/spaces/classes/BxSpacesPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_spaces_manage', 1, 'bx_spaces', '_bx_spaces_page_block_title_system_manage', '_bx_spaces_page_block_title_manage', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:12:\"manage_tools\";}}', 0, 1, 0);
+
+-- PAGE: module manage all
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_administration', '_bx_spaces_page_title_sys_manage_administration', '_bx_spaces_page_title_manage', 'bx_spaces', 5, 192, 1, 'spaces-administration', 'page.php?i=spaces-administration', '', '', '', 0, 1, 0, 'BxSpacesPageBrowse', 'modules/boonex/spaces/classes/BxSpacesPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_spaces_administration', 1, 'bx_spaces', '_bx_spaces_page_block_title_system_manage_administration', '_bx_spaces_page_block_title_manage', 11, 192, 'service', 'a:3:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:12:\"manage_tools\";s:6:\"params\";a:1:{i:0;s:14:\"administration\";}}', 0, 1, 0);
+
+-- PAGE: user's spaces
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_joined', 'joined-spaces', '_bx_spaces_page_title_sys_joined_entries', '_bx_spaces_page_title_joined_entries', 'bx_spaces', 5, 2147483647, 1, '', '', '', '', 0, 1, 0, 'BxSpacesPageJoinedEntries', 'modules/boonex/spaces/classes/BxSpacesPageJoinedEntries.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES
+('bx_spaces_joined', 1, 'bx_spaces', '_bx_spaces_page_block_title_sys_entries_actions', '_bx_spaces_page_block_title_entries_actions', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:18:"my_entries_actions";}', 0, 0, 1, 1),
+('bx_spaces_joined', 1, 'bx_spaces', '_bx_spaces_page_block_title_sys_entries_of_author', '_bx_spaces_page_block_title_entries_of_author', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:22:"browse_created_entries";}', 0, 0, 0, 2),
+('bx_spaces_joined', 1, 'bx_spaces', '_bx_spaces_page_block_title_sys_favorites_of_author', '_bx_spaces_page_block_title_favorites_of_author', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:15:"browse_favorite";s:6:"params";a:1:{i:0;s:12:"{profile_id}";}}', 0, 1, 1, 3),
+('bx_spaces_joined', 1, 'bx_spaces', '_bx_spaces_page_block_title_sys_joined_entries', '_bx_spaces_page_block_title_joined_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:21:"browse_joined_entries";s:6:"params";a:2:{i:0;i:0;i:1;b:1;}}', 0, 0, 1, 4);
+
+-- PAGE: 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_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_spaces_favorites', 2, 'bx_spaces', '_bx_spaces_page_block_title_sys_favorites_entries', '_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
+('', 0, 'bx_spaces', '', '_bx_spaces_page_block_title_categories', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:15:"categories_list";s:6:"params";a:2:{i:0;s:14:"bx_spaces_cats";i:1;a:2:{s:10:\"show_empty\";b:1;s:21:\"show_empty_categories\";b:1;}}s:5:"class";s:20:"TemplServiceCategory";}', 1, 1, 1, IFNULL(@iBlockOrder, 0) + 1),
+('', 0, 'bx_spaces', '_bx_spaces_page_block_title_sys_featured_entries_view_showcase', '_bx_spaces_page_block_title_featured_entries_view_showcase', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:15:\"browse_featured\";s:6:\"params\";a:3:{s:9:\"unit_view\";s:8:\"showcase\";s:13:\"empty_message\";b:0;s:13:\"ajax_paginate\";b:0;}}', 0, 1, 1, IFNULL(@iBlockOrder, 0) + 2),
+('', 0, 'bx_spaces', '_bx_spaces_page_block_title_sys_recommended_entries_view_showcase', '_bx_spaces_page_block_title_recommended_entries_view_showcase', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:18:\"browse_recommended\";s:6:\"params\";a:3:{s:9:\"unit_view\";s:8:\"showcase\";s:13:\"empty_message\";b:0;s:13:\"ajax_paginate\";b:0;}}', 0, 1, 1, IFNULL(@iBlockOrder, 0) + 3),
+('', 0, 'bx_spaces', '_bx_spaces_page_block_title_sys_cover_block', '_bx_spaces_page_block_title_cover_block', 3, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_spaces\";s:6:\"method\";s:12:\"entity_cover\";}', 0, 1, 1, IFNULL(@iBlockOrder, 0) + 4);
+
+-- MENU
+
+-- MENU: add to site menu
+
+SET @iSiteMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_site' AND `active` = 1 AND `order` < 9999 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('sys_site', 'bx_spaces', 'spaces-home', '_bx_spaces_menu_item_title_system_entries_home', '_bx_spaces_menu_item_title_entries_home', 'page.php?i=spaces-home', '', '', 'object-group col-red2', 'bx_spaces_submenu', 2147483647, 1, 1, IFNULL(@iSiteMenuOrder, 0) + 1);
+
+-- MENU: add to homepage menu
+
+SET @iHomepageMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_homepage' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('sys_homepage', 'bx_spaces', 'spaces-home', '_bx_spaces_menu_item_title_system_entries_home', '_bx_spaces_menu_item_title_entries_home', 'page.php?i=spaces-home', '', '', 'object-group col-red2', 'bx_spaces_submenu', 2147483647, 1, 1, IFNULL(@iHomepageMenuOrder, 0) + 1);
+
+-- MENU: add to "add content" menu
+
+SET @iAddMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_add_content_links' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('sys_add_content_links', 'bx_spaces', 'create-space-profile', '_bx_spaces_menu_item_title_system_create_profile', '_bx_spaces_menu_item_title_create_profile', 'page.php?i=create-space-profile', '', '', 'object-group col-red2', '', 2147483647, 1, 1, IFNULL(@iAddMenuOrder, 0) + 1);
+
+-- MENU: view actions
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_view_actions', '_bx_spaces_menu_title_view_profile_actions', 'bx_spaces_view_actions', 'bx_spaces', 9, 0, 1, 'BxSpacesMenuViewActions', 'modules/boonex/spaces/classes/BxSpacesMenuViewActions.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_spaces_view_actions', 'bx_spaces', '_bx_spaces_menu_set_title_view_profile_actions', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `submenu_popup`, `visible_for_levels`, `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, 'a:3:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:22:"is_free_join_avaliable";s:6:"params";a:1:{i:0;s:12:"{profile_id}";}}', 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),
+('bx_spaces_view_actions', 'bx_spaces', 'profile-actions-more', '_bx_spaces_menu_item_title_system_more_actions', '_bx_spaces_menu_item_title_more_actions', 'javascript:void(0)', 'bx_menu_popup(''bx_spaces_view_actions_more'', this, {}, {profile_id:{profile_id}});', '', 'cog', 'bx_spaces_view_actions_more', 1, 2147483647, '', 1, 0, 1, 9999);
+
+-- MENU: view actions more
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_view_actions_more', '_bx_spaces_menu_title_view_profile_actions_more', 'bx_spaces_view_actions_more', 'bx_spaces', 6, 0, 1, 'BxSpacesMenuViewActions', 'modules/boonex/spaces/classes/BxSpacesMenuViewActions.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_spaces_view_actions_more', 'bx_spaces', '_bx_spaces_menu_set_title_view_profile_actions_more', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `visibility_custom`, `active`, `copyable`, `order`) VALUES 
+('bx_spaces_view_actions_more', 'bx_spaces', 'profile-fan-remove', '_bx_spaces_menu_item_title_system_leave_group', '{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-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),
+('bx_spaces_view_actions_more', 'bx_spaces', 'approve-space-profile', '_sys_menu_item_title_system_va_approve', '_sys_menu_item_title_va_approve', 'javascript:void(0)', 'javascript:bx_approve(this, ''{module_uri}'', {content_id});', '', 'check', '', 2147483647, '', 1, 0, 60);
+
+-- MENU: all actions menu for view entry 
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_view_actions_all', '_sys_menu_title_view_actions', 'bx_spaces_view_actions_all', 'bx_spaces', 15, 0, 1, 'BxSpacesMenuViewActionsAll', 'modules/boonex/spaces/classes/BxSpacesMenuViewActionsAll.php');
+
+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),
+('bx_spaces_view_actions_all', 'bx_spaces', 'profile-subscribe-remove', '_bx_spaces_menu_item_title_system_unsubscribe', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 40),
+('bx_spaces_view_actions_all', 'bx_spaces', 'profile-set-badges', '_sys_menu_item_title_system_set_badges', '', '', '', '', '', '', '', 0, 192, 'a:2:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:19:"is_badges_avaliable";}', 1, 0, 50),
+('bx_spaces_view_actions_all', 'bx_spaces', 'comment', '_sys_menu_item_title_system_va_comment', '', '', '', '', '', '', '', 0, 2147483647, '', 0, 0, 200),
+('bx_spaces_view_actions_all', 'bx_spaces', 'view', '_sys_menu_item_title_system_va_view', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 210),
+('bx_spaces_view_actions_all', 'bx_spaces', 'vote', '_sys_menu_item_title_system_va_vote', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 220),
+('bx_spaces_view_actions_all', 'bx_spaces', 'score', '_sys_menu_item_title_system_va_score', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 230),
+('bx_spaces_view_actions_all', 'bx_spaces', 'favorite', '_sys_menu_item_title_system_va_favorite', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 240),
+('bx_spaces_view_actions_all', 'bx_spaces', 'feature', '_sys_menu_item_title_system_va_feature', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 250),
+('bx_spaces_view_actions_all', 'bx_spaces', 'repost', '_sys_menu_item_title_system_va_repost', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 260),
+('bx_spaces_view_actions_all', 'bx_spaces', 'report', '_sys_menu_item_title_system_va_report', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 270),
+('bx_spaces_view_actions_all', 'bx_spaces', 'notes', '_sys_menu_item_title_system_va_notes', '_sys_menu_item_title_va_notes', 'javascript:void(0)', 'javascript:bx_get_notes(this,  ''{module_uri}'', {content_id});', '', 'exclamation-triangle', '', '', 0, 2147483647, '', 1, 0, 280),
+('bx_spaces_view_actions_all', 'bx_spaces', 'audit', '_sys_menu_item_title_system_va_audit', '_sys_menu_item_title_va_audit', 'page.php?i=dashboard-audit&module=bx_spaces&content_id={content_id}', '', '', 'history', '', '', 0, 192, '', 1, 0, 290),
+('bx_spaces_view_actions_all', 'bx_spaces', 'social-sharing', '_sys_menu_item_title_system_social_sharing', '_sys_menu_item_title_social_sharing', 'javascript:void(0)', 'oBxDolPage.share(this, \'{url_encoded}\')', '', 'share', '', '', 0, 2147483647, '', 1, 0, 300),
+('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', 'approve-space-profile', '_sys_menu_item_title_system_va_approve', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 440),
+('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);
+
+-- MENU: meta (counters) menu for view entry
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_view_meta', '_bx_spaces_menu_title_view_profile_meta', 'bx_spaces_view_meta', 'bx_spaces', 15, 0, 1, 'BxSpacesMenuViewMeta', 'modules/boonex/spaces/classes/BxSpacesMenuViewMeta.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_spaces_view_meta', 'bx_spaces', '_bx_spaces_menu_set_title_view_profile_meta', 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`, `order`) VALUES 
+('bx_spaces_view_meta', 'bx_spaces', 'members', '_sys_menu_item_title_system_sm_members', '_sys_menu_item_title_sm_members', '', '', '', '', '', 0, 2147483647, '', 1, 0, 10),
+('bx_spaces_view_meta', 'bx_spaces', 'subscribers', '_sys_menu_item_title_system_sm_subscribers', '_sys_menu_item_title_sm_subscribers', '', '', '', '', '', 0, 2147483647, '', 1, 0, 20),
+('bx_spaces_view_meta', 'bx_spaces', 'views', '_sys_menu_item_title_system_sm_views', '_sys_menu_item_title_sm_views', '', '', '', '', '', 0, 2147483647, '', 1, 0, 30),
+('bx_spaces_view_meta', 'bx_spaces', 'votes', '_sys_menu_item_title_system_sm_votes', '_sys_menu_item_title_sm_votes', '', '', '', '', '', 0, 2147483647, '', 1, 0, 40),
+('bx_spaces_view_meta', 'bx_spaces', 'comments', '_sys_menu_item_title_system_sm_comments', '_sys_menu_item_title_sm_comments', '', '', '', '', '', 0, 2147483647, '', 1, 0, 50);
+
+-- MENU: actions menu for my entries
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_my', '_bx_spaces_menu_title_entries_my', 'bx_spaces_my', 'bx_spaces', 9, 0, 1, 'BxSpacesMenu', 'modules/boonex/spaces/classes/BxSpacesMenu.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_spaces_my', 'bx_spaces', '_bx_spaces_menu_set_title_entries_my', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('bx_spaces_my', 'bx_spaces', 'create-space-profile', '_bx_spaces_menu_item_title_system_create_profile', '_bx_spaces_menu_item_title_create_profile', 'page.php?i=create-space-profile', '', '', 'plus', '', 2147483647, 1, 0, 0);
+
+-- MENU: module sub-menu
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_submenu', '_bx_spaces_menu_title_submenu', 'bx_spaces_submenu', 'bx_spaces', 8, 0, 1, '', '');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_spaces_submenu', 'bx_spaces', '_bx_spaces_menu_set_title_submenu', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('bx_spaces_submenu', 'bx_spaces', 'spaces-home', '_bx_spaces_menu_item_title_system_entries_recent', '_bx_spaces_menu_item_title_entries_recent', 'page.php?i=spaces-home', '', '', '', '', 2147483647, 1, 1, 1),
+('bx_spaces_submenu', 'bx_spaces', 'spaces-top', '_bx_spaces_menu_item_title_system_entries_top', '_bx_spaces_menu_item_title_entries_top', 'page.php?i=spaces-top', '', '', '', '', 2147483647, 1, 1, 2),
+('bx_spaces_submenu', 'bx_spaces', 'spaces-search', '_bx_spaces_menu_item_title_system_entries_search', '_bx_spaces_menu_item_title_entries_search', 'page.php?i=spaces-search', '', '', '', '', 2147483647, 1, 1, 3),
+('bx_spaces_submenu', 'bx_spaces', 'spaces-joined', '_bx_spaces_menu_item_title_system_entries_joined', '_bx_spaces_menu_item_title_entries_joined', 'page.php?i=spaces-joined', '', '', '', '', 2147483647, 1, 1, 4),
+('bx_spaces_submenu', 'bx_spaces', 'spaces-manage', '_bx_spaces_menu_item_title_system_entries_manage', '_bx_spaces_menu_item_title_entries_manage', 'page.php?i=spaces-manage', '', '', '', '', 2147483646, 1, 1, 5);
+
+-- MENU: view submenu
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_view_submenu', '_bx_spaces_menu_title_view_profile_submenu', 'bx_spaces_view_submenu', 'bx_spaces', 18, 0, 1, 'BxSpacesMenuView', 'modules/boonex/spaces/classes/BxSpacesMenuView.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_spaces_view_submenu', 'bx_spaces', '_bx_spaces_menu_set_title_view_profile_submenu', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `submenu_popup`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('bx_spaces_view_submenu', 'bx_spaces', 'view-space-profile', '_bx_spaces_menu_item_title_system_view_profile_view', '_bx_spaces_menu_item_title_view_profile_view', 'page.php?i=view-space-profile&id={content_id}', '', '', 'object-group col-red2', '', '', 0, 2147483647, 1, 0, 1),
+('bx_spaces_view_submenu', 'bx_spaces', 'space-profile-info', '_bx_spaces_menu_item_title_system_view_profile_info', '_bx_spaces_menu_item_title_view_profile_info', 'page.php?i=space-profile-info&id={content_id}', '', '', 'info-circle col-gray', '', '', 0, 2147483647, 1, 0, 2),
+('bx_spaces_view_submenu', 'bx_spaces', 'space-profile-comments', '_bx_spaces_menu_item_title_system_view_profile_comments', '_bx_spaces_menu_item_title_view_profile_comments', 'page.php?i=space-profile-comments&id={content_id}', '', '', '', '', '', 0, 2147483647, 0, 0, 3),
+('bx_spaces_view_submenu', 'bx_spaces', 'space-fans', '_bx_spaces_menu_item_title_system_view_fans', '_bx_spaces_menu_item_title_view_fans', 'page.php?i=space-fans&profile_id={profile_id}', '', '', 'object-group col-blue3', '', '', 0, 2147483647, 1, 0, 4),
+('bx_spaces_view_submenu', 'bx_spaces', 'more-auto', '_bx_spaces_menu_item_title_system_view_profile_more_auto', '_bx_spaces_menu_item_title_view_profile_more_auto', 'javascript:void(0)', '', '', 'ellipsis-v', '', '', 0, 2147483647, 1, 0, 9999);
+
+-- MENU: custom menu for snippet meta info
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_snippet_meta', '_sys_menu_title_snippet_meta', 'bx_spaces_snippet_meta', 'bx_spaces', 15, 0, 1, 'BxSpacesMenuSnippetMeta', 'modules/boonex/spaces/classes/BxSpacesMenuSnippetMeta.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_spaces_snippet_meta', 'bx_spaces', '_sys_menu_set_title_snippet_meta', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `visibility_custom`, `active`, `copyable`, `editable`, `order`) VALUES
+('bx_spaces_snippet_meta', 'bx_spaces', 'parent', '_bx_spaces_menu_item_title_system_sm_parent', '_bx_spaces_menu_item_title_sm_parent', '', '', '', '', '', 2147483647, '', 0, 0, 1, 0),
+('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', 'category', '_sys_menu_item_title_system_sm_category', '_sys_menu_item_title_sm_category', '', '', '', '', '', 2147483647, '', 0, 0, 1, 5),
+('bx_spaces_snippet_meta', 'bx_spaces', 'tags', '_sys_menu_item_title_system_sm_tags', '_sys_menu_item_title_sm_tags', '', '', '', '', '', 2147483647, '', 0, 0, 1, 10),
+('bx_spaces_snippet_meta', 'bx_spaces', 'views', '_sys_menu_item_title_system_sm_views', '_sys_menu_item_title_sm_views', '', '', '', '', '', 2147483647, '', 0, 0, 1, 15),
+('bx_spaces_snippet_meta', 'bx_spaces', 'comments', '_sys_menu_item_title_system_sm_comments', '_sys_menu_item_title_sm_comments', '', '', '', '', '', 2147483647, '', 0, 0, 1, 20),
+('bx_spaces_snippet_meta', 'bx_spaces', 'members', '_sys_menu_item_title_system_sm_members', '_sys_menu_item_title_sm_members', '', '', '', '', '', 2147483647, '', 0, 0, 1, 25),
+('bx_spaces_snippet_meta', 'bx_spaces', 'subscribers', '_sys_menu_item_title_system_sm_subscribers', '_sys_menu_item_title_sm_subscribers', '', '', '', '', '', 2147483647, '', 1, 0, 1, 30),
+('bx_spaces_snippet_meta', 'bx_spaces', 'nl', '_sys_menu_item_title_system_sm_nl', '_sys_menu_item_title_sm_nl', '', '', '', '', '', 2147483647, '', 1, 0, 1, 35),
+('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, 40),
+('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, 45),
+('bx_spaces_snippet_meta', 'bx_spaces', 'leave', '_sys_menu_item_title_system_sm_leave', '_sys_menu_item_title_sm_leave', '', '', '', '', '', 2147483647, '', 0, 0, 1, 50),
+('bx_spaces_snippet_meta', 'bx_spaces', 'subscribe', '_sys_menu_item_title_system_sm_subscribe', '_sys_menu_item_title_sm_subscribe', '', '', '', '', '', 2147483647, '', 1, 0, 1, 55),
+('bx_spaces_snippet_meta', 'bx_spaces', 'unsubscribe', '_sys_menu_item_title_system_sm_unsubscribe', '_sys_menu_item_title_sm_unsubscribe', '', '', '', '', '', 2147483647, '', 0, 0, 1, 60);
+
+-- MENU: profile stats
+SET @iNotifMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name` = 'sys_profile_stats' AND `active` = 1 LIMIT 1);
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
+('sys_profile_stats', 'bx_spaces', 'profile-stats-my-spaces', '_bx_spaces_menu_item_title_system_manage_my_spaces', '_bx_spaces_menu_item_title_manage_my_spaces', 'page.php?i=joined-spaces&profile_id={member_id}', '', '_self', 'object-group col-red2', 'a:2:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:41:"get_menu_addon_manage_tools_profile_stats";}', '', 2147483646, 1, 0, @iNotifMenuOrder + 2);
+
+-- MENU: profile followings
+SET @iFollowingsMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name`='sys_profile_followings' LIMIT 1);
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `collapsed`, `active`, `copyable`, `order`) VALUES 
+('sys_profile_followings', 'bx_spaces', 'spaces', '_bx_spaces_menu_item_title_system_followings', '_bx_spaces_menu_item_title_followings', 'javascript:void(0)', '', '_self', 'object-group col-red2', '', '', 2147483647, 0, 1, 0, @iFollowingsMenuOrder + 1);
+
+-- MENU: manage tools submenu
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_spaces_menu_manage_tools', '_bx_spaces_menu_title_manage_tools', 'bx_spaces_menu_manage_tools', 'bx_spaces', 6, 0, 1, 'BxSpacesMenuManageTools', 'modules/boonex/spaces/classes/BxSpacesMenuManageTools.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_spaces_menu_manage_tools', 'bx_spaces', '_bx_spaces_menu_set_title_manage_tools', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('bx_spaces_menu_manage_tools', 'bx_spaces', 'clear-reports', '_bx_spaces_menu_item_title_system_clear_reports', '_bx_spaces_menu_item_title_clear_reports', 'javascript:void(0)', 'javascript:{js_object}.onClickClearReports({content_id});', '_self', 'eraser', '', 2147483647, 1, 0, 1),
+('bx_spaces_menu_manage_tools', 'bx_spaces', 'delete', '_bx_spaces_menu_item_title_system_delete', '_bx_spaces_menu_item_title_delete', 'javascript:void(0)', 'javascript:{js_object}.onClickDelete({content_id});', '_self', 'far trash-alt', '', 2147483647, 1, 0, 2),
+('bx_spaces_menu_manage_tools', 'bx_spaces', 'delete-with-content', '_bx_spaces_menu_item_title_system_delete_with_content', '_bx_spaces_menu_item_title_delete_with_content', 'javascript:void(0)', 'javascript:{js_object}.onClickDeleteWithContent({content_id});', '_self', 'far trash-alt', '', 2147483647, 0, 0, 3);
+
+-- MENU: dashboard manage tools
+SET @iManageMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name`='sys_account_dashboard_manage_tools' LIMIT 1);
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('sys_account_dashboard_manage_tools', 'bx_spaces', 'spaces-administration', '_bx_spaces_menu_item_title_system_admt_spaces', '_bx_spaces_menu_item_title_admt_spaces', 'page.php?i=spaces-administration', '', '_self', 'object-group', 'a:2:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:27:"get_menu_addon_manage_tools";}', '', 192, 1, 0, @iManageMenuOrder + 1);
+
+-- MENU: add menu item to profiles modules (trigger* menu sets are processed separately upon modules enable/disable)
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('trigger_profile_view_submenu', 'bx_spaces', 'joined-spaces', '_bx_spaces_menu_item_title_system_view_joined_spaces', '_bx_spaces_menu_item_title_view_joined_spaces', 'page.php?i=joined-spaces&profile_id={profile_id}', '', '', 'object-group col-red2', '', 2147483647, 1, 0, 0);
+
+-- ACL
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_spaces', 'create entry', NULL, '_bx_spaces_acl_action_create_profile', '', 1, 1);
+SET @iIdActionProfileCreate = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_spaces', '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();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_spaces', 'view entry', NULL, '_bx_spaces_acl_action_view_profile', '', 1, 0);
+SET @iIdActionProfileView = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_spaces', 'edit any entry', NULL, '_bx_spaces_acl_action_edit_any_profile', '', 1, 3);
+SET @iIdActionProfileEditAny = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_spaces', 'delete any entry', NULL, '_bx_spaces_acl_action_delete_any_profile', '', 1, 3);
+SET @iIdActionProfileDeleteAny = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_spaces', 'delete invites', NULL, '_bx_spaces_acl_action_delete_invites', '', 1, 3);
+SET @iIdActionProfileDeleteInvites = LAST_INSERT_ID();
+
+SET @iUnauthenticated = 1;
+SET @iAccount = 2;
+SET @iStandard = 3;
+SET @iUnconfirmed = 4;
+SET @iPending = 5;
+SET @iSuspended = 6;
+SET @iModerator = 7;
+SET @iAdministrator = 8;
+SET @iPremium = 9;
+
+INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
+
+-- profile create
+(@iAccount, @iIdActionProfileCreate),
+(@iStandard, @iIdActionProfileCreate),
+(@iUnconfirmed, @iIdActionProfileCreate),
+(@iPending, @iIdActionProfileCreate),
+(@iModerator, @iIdActionProfileCreate),
+(@iAdministrator, @iIdActionProfileCreate),
+(@iPremium, @iIdActionProfileCreate),
+
+-- use paid join
+(@iStandard, @iIdActionUsePaidJoin),
+(@iModerator, @iIdActionUsePaidJoin),
+(@iAdministrator, @iIdActionUsePaidJoin),
+(@iPremium, @iIdActionUsePaidJoin),
+
+-- profile delete
+(@iAccount, @iIdActionProfileDelete),
+(@iStandard, @iIdActionProfileDelete),
+(@iUnconfirmed, @iIdActionProfileDelete),
+(@iPending, @iIdActionProfileDelete),
+(@iModerator, @iIdActionProfileDelete),
+(@iAdministrator, @iIdActionProfileDelete),
+(@iPremium, @iIdActionProfileDelete),
+
+-- profile view
+(@iUnauthenticated, @iIdActionProfileView),
+(@iAccount, @iIdActionProfileView),
+(@iStandard, @iIdActionProfileView),
+(@iUnconfirmed, @iIdActionProfileView),
+(@iPending, @iIdActionProfileView),
+(@iModerator, @iIdActionProfileView),
+(@iAdministrator, @iIdActionProfileView),
+(@iPremium, @iIdActionProfileView),
+
+-- any profile edit
+(@iModerator, @iIdActionProfileEditAny),
+(@iAdministrator, @iIdActionProfileEditAny),
+
+-- any profile delete
+(@iAdministrator, @iIdActionProfileDeleteAny),
+
+-- any invites edit
+(@iModerator, @iIdActionProfileDeleteInvites),
+(@iAdministrator, @iIdActionProfileDeleteInvites);
+
+-- METATAGS
+INSERT INTO `sys_objects_metatags` (`object`, `module`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_spaces', 'bx_spaces', 'bx_spaces_meta_keywords', 'bx_spaces_meta_locations', 'bx_spaces_meta_mentions', '', '');
+
+-- CATEGORY
+INSERT INTO `sys_objects_category` (`object`, `module`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
+('bx_spaces_cats', 'bx_spaces', 'bx_spaces', 'bx_space', 'bx_spaces_cats', 'bx_spaces_data', 'space_cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`content_id` = `bx_spaces_data`.`id` AND `sys_profiles`.`type` = ''bx_spaces'')', 'AND `sys_profiles`.`status` = ''active''', '', '');
+
+-- SEARCH
+SET @iSearchOrder = (SELECT IFNULL(MAX(`Order`), 0) FROM `sys_objects_search`);
+INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `Order`, `ClassName`, `ClassPath`) VALUES
+('bx_spaces', '_bx_spaces', @iSearchOrder + 1, 'BxSpacesSearchResult', 'modules/boonex/spaces/classes/BxSpacesSearchResult.php');
+
+-- CONNECTIONS
+INSERT INTO `sys_objects_connection` (`object`, `table`, `profile_initiator`, `profile_content`, `type`, `override_class_name`, `override_class_file`) VALUES
+('bx_spaces_fans', 'bx_spaces_fans', 1, 1, 'mutual', 'BxSpacesConnectionFans', 'modules/boonex/spaces/classes/BxSpacesConnectionFans.php');
+
+-- STATS
+SET @iMaxOrderStats = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_statistics`);
+INSERT INTO `sys_statistics` (`module`, `name`, `title`, `link`, `icon`, `query`, `order`) VALUES 
+('bx_spaces', 'bx_spaces', '_bx_spaces', 'page.php?i=spaces-home', 'object-group col-red2', 'SELECT COUNT(*) FROM `bx_spaces_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id` = `tp`.`content_id` AND `tp`.`type`=''bx_spaces'' WHERE 1 AND `tp`.`status`=''active''', @iMaxOrderStats + 1);
+
+-- CHARTS
+SET @iMaxOrderCharts = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_objects_chart`);
+INSERT INTO `sys_objects_chart` (`object`, `title`, `table`, `field_date_ts`, `field_date_dt`, `field_status`, `query`, `active`, `order`, `class_name`, `class_file`) VALUES
+('bx_spaces_growth', '_bx_spaces_chart_growth', 'bx_spaces_data', 'added', '', '', 'SELECT {field_date_formatted} AS `period`, COUNT(*) AS {object} FROM {table} LEFT JOIN `sys_profiles` AS `tp` ON {table}.`id` = `tp`.`content_id` AND `tp`.`type`=''bx_spaces'' WHERE 1 AND `tp`.`status`=''active'' {where_inteval} GROUP BY `period` ORDER BY {table}.{field_date} ASC', 1, @iMaxOrderCharts + 1, 'BxDolChartGrowth', ''),
+('bx_spaces_growth_speed', '_bx_spaces_chart_growth_speed', 'bx_spaces_data', 'added', '', '', 'SELECT {field_date_formatted} AS `period`, COUNT(*) AS {object} FROM {table} LEFT JOIN `sys_profiles` AS `tp` ON {table}.`id` = `tp`.`content_id` AND `tp`.`type`=''bx_spaces'' WHERE 1 AND `tp`.`status`=''active'' {where_inteval} GROUP BY `period` ORDER BY {table}.{field_date} ASC', 1, @iMaxOrderCharts + 2, 'BxDolChartGrowthSpeed', '');
+
+-- GRID: connections
+INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `responsive`, `override_class_name`, `override_class_file`) VALUES
+('bx_spaces_fans', 'Sql', 'SELECT `p`.`id`, `c`.`added`, `c`.`mutual` FROM `sys_profiles` AS `p` INNER JOIN `sys_accounts` AS `a` ON (`a`.`id` = `p`.`account_id`) {join_connections}', 'sys_profiles', 'id', 'c`.`added', '', '', 10, NULL, 'start', '', 'name,email', '', 'auto', '', '', 2147483647, 1, 'BxSpacesGridConnections', 'modules/boonex/spaces/classes/BxSpacesGridConnections.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `params`, `order`) VALUES
+('bx_spaces_fans', 'name', '_sys_name', '50%', '', 10),
+('bx_spaces_fans', 'role', '_bx_spaces_txt_role', '10%', '', 15),
+('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),
+('bx_spaces_fans', 'single', 'set_role', '_bx_spaces_txt_set_role', '', 0, 20),
+('bx_spaces_fans', 'single', 'set_role_submit', '', '', 0, 21),
+('bx_spaces_fans', 'single', 'delete', '', 'remove', 1, 40);
+
+-- GRID: invites
+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`, `responsive`, `override_class_name`, `override_class_file`) VALUES
+('bx_spaces_invites', 'Sql', 'SELECT `bx_spaces_invites`.`id`, `bx_spaces_invites`.`invited_profile_id`, `bx_spaces_invites`.`added`, `bx_spaces_invites`.`author_profile_id` FROM `sys_profiles` AS `p` INNER JOIN `sys_accounts` AS `a` ON (`a`.`id` = `p`.`account_id`) INNER JOIN `bx_spaces_invites` ON `bx_spaces_invites`.`invited_profile_id` = `p`.`id` ', 'bx_spaces_invites', 'id', 'bx_spaces_invites`.`added', '', '', 10, NULL, 'start', '', 'name,email', '', 'auto', '', '', 2147483647, 0, 'BxSpacesGridInvites', 'modules/boonex/spaces/classes/BxSpacesGridInvites.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `params`, `order`) VALUES
+('bx_spaces_invites', 'name', '_sys_name', '33%', '', 10),
+('bx_spaces_invites', 'added', '_sys_added', '33%', '', 20),
+('bx_spaces_invites', 'actions', '', '34%', '', 30);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `confirm`, `order`) VALUES
+('bx_spaces_invites', 'single', 'delete', '', 'remove', 1, 10);
+
+-- GRIDS: administration
+
+INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
+('bx_spaces_administration', 'Sql', 'SELECT `td`.*, `td`.`space_name` AS `name`, `ta`.`email` AS `account`, `td`.`added` AS `added_ts`, `tp`.`status` AS `status` FROM `bx_spaces_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id`=`tp`.`content_id` AND `tp`.`type`=''bx_spaces'' LEFT JOIN `sys_accounts` AS `ta` ON `tp`.`account_id`=`ta`.`id` WHERE 1 ', 'bx_spaces_data', 'id', 'added', 'status_admin', '', 20, NULL, 'start', '', 'space_name', '', 'like', 'reports', '', 192, 'BxSpacesGridAdministration', 'modules/boonex/spaces/classes/BxSpacesGridAdministration.php'),
+('bx_spaces_common', 'Sql', 'SELECT `td`.*, `td`.`space_name` AS `name`, `ta`.`email` AS `account`, `td`.`added` AS `added_ts`, `tp`.`status` AS `status` FROM `bx_spaces_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id`=`tp`.`content_id` AND `tp`.`type`=''bx_spaces'' LEFT JOIN `sys_accounts` AS `ta` ON `tp`.`account_id`=`ta`.`id` WHERE 1 ', 'bx_spaces_data', 'id', 'added', 'status', '', 20, NULL, 'start', '', 'space_name', '', 'like', '', '', 2147483647, 'BxSpacesGridCommon', 'modules/boonex/spaces/classes/BxSpacesGridCommon.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('bx_spaces_administration', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
+('bx_spaces_administration', 'switcher', '_bx_spaces_grid_column_title_adm_active', '8%', 0, '', '', 2),
+('bx_spaces_administration', 'reports', '_sys_txt_reports_title', '5%', 0, '', '', 3),
+('bx_spaces_administration', 'name', '_bx_spaces_grid_column_title_adm_name', '25%', 0, '', '', 4),
+('bx_spaces_administration', 'added_ts', '_bx_spaces_grid_column_title_adm_added', '20%', 1, '25', '', 5),
+('bx_spaces_administration', 'account', '_bx_spaces_grid_column_title_adm_account', '20%', 0, '25', '', 6),
+('bx_spaces_administration', 'actions', '', '20%', 0, '', '', 7),
+
+('bx_spaces_common', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
+('bx_spaces_common', 'switcher', '_bx_spaces_grid_column_title_adm_active', '8%', 0, '', '', 2),
+('bx_spaces_common', 'name', '_bx_spaces_grid_column_title_adm_name', '40%', 0, '', '', 3),
+('bx_spaces_common', 'added_ts', '_bx_spaces_grid_column_title_adm_added', '30%', 1, '25', '', 4),
+('bx_spaces_common', 'actions', '', '20%', 0, '', '', 5);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon_only`, `confirm`, `active`, `order`) VALUES
+('bx_spaces_administration', 'bulk', 'clear_reports', '_bx_spaces_grid_action_title_adm_clear_reports', '', 0, 1, 1, 1),
+('bx_spaces_administration', 'bulk', 'delete', '_bx_spaces_grid_action_title_adm_delete', '', 0, 1, 1, 2),
+('bx_spaces_administration', 'bulk', 'delete_with_content', '_bx_spaces_grid_action_title_adm_delete_with_content', '', 0, 1, 0, 3),
+('bx_spaces_administration', 'single', 'settings', '_bx_spaces_grid_action_title_adm_more_actions', 'cog', 1, 0, 1, 2),
+('bx_spaces_administration', 'single', 'audit_content', '_bx_spaces_grid_action_title_adm_audit_content', 'search', 1, 0, 1, 3),
+('bx_spaces_administration', 'single', 'audit_context', '_bx_spaces_grid_action_title_adm_audit_context', 'search-location', 1, 0, 1, 4),
+
+('bx_spaces_common', 'bulk', 'delete', '_bx_spaces_grid_action_title_adm_delete', '', 0, 1, 1, 1),
+('bx_spaces_common', 'bulk', 'delete_with_content', '_bx_spaces_grid_action_title_adm_delete_with_content', '', 0, 1, 0, 2),
+('bx_spaces_common', 'single', 'settings', '_bx_spaces_grid_action_title_adm_more_actions', 'cog', 1, 0, 1, 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
+
+INSERT INTO `sys_alerts_handlers` (`name`, `class`, `file`, `service_call`) VALUES 
+('bx_spaces', 'BxSpacesAlertsResponse', 'modules/boonex/spaces/classes/BxSpacesAlertsResponse.php', '');
+SET @iHandler := LAST_INSERT_ID();
+
+INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
+('system', 'save_setting', @iHandler),
+('bx_timeline', 'post_common', @iHandler),
+('bx_spaces_pics', 'file_deleted', @iHandler),
+('bx_spaces_fans', 'connection_added', @iHandler),
+('bx_spaces_fans', 'connection_removed', @iHandler),
+('profile', 'delete', @iHandler),
+('bx_spaces', 'fan_added', @iHandler),
+('bx_spaces', 'join_invitation', @iHandler),
+('bx_spaces', 'join_request', @iHandler),
+('bx_spaces', 'join_request_accepted', @iHandler),
+('bx_spaces', 'timeline_view', @iHandler),
+('bx_spaces', 'timeline_post', @iHandler),
+('bx_spaces', 'timeline_delete', @iHandler),
+('bx_spaces', 'timeline_comment', @iHandler),
+('bx_spaces', 'timeline_vote', @iHandler),
+('bx_spaces', 'timeline_score', @iHandler),
+('bx_spaces', 'timeline_report', @iHandler),
+('bx_spaces', 'timeline_repost', @iHandler),
+('bx_spaces', 'timeline_pin', @iHandler),
+('bx_spaces', 'timeline_promote', @iHandler);
+
+-- PRIVACY 
+
+INSERT INTO `sys_objects_privacy` (`object`, `module`, `action`, `title`, `default_group`, `spaces`, `table`, `table_field_id`, `table_field_author`, `override_class_name`, `override_class_file`) VALUES
+('bx_spaces_allow_view_to', 'bx_spaces', 'view', '_bx_spaces_form_profile_input_allow_view_to', '3', '', 'bx_spaces_data', 'id', 'author', 'BxSpacesPrivacy', 'modules/boonex/spaces/classes/BxSpacesPrivacy.php'),
+('bx_spaces_allow_view_notification_to', 'bx_spaces', 'view_event', '_bx_spaces_form_profile_input_allow_view_notification_to', '3', '', 'bx_notifications_events', 'id', 'object_owner_id', 'BxSpacesPrivacyNotifications', 'modules/boonex/spaces/classes/BxSpacesPrivacyNotifications.php'),
+('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
+
+INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `Body`) VALUES
+('bx_spaces', '_bx_spaces_email_join_request', 'bx_spaces_join_request', '_bx_spaces_email_join_request_subject', '_bx_spaces_email_join_request_body'),
+('bx_spaces', '_bx_spaces_email_join_reject', 'bx_spaces_join_reject', '_bx_spaces_email_join_reject_subject', '_bx_spaces_email_join_reject_body'),
+('bx_spaces', '_bx_spaces_email_join_confirm', 'bx_spaces_join_confirm', '_bx_spaces_email_join_confirm_subject', '_bx_spaces_email_join_confirm_body'),
+('bx_spaces', '_bx_spaces_email_fan_remove', 'bx_spaces_fan_remove', '_bx_spaces_email_fan_remove_subject', '_bx_spaces_email_fan_remove_body'),
+('bx_spaces', '_bx_spaces_email_fan_become_admin', 'bx_spaces_fan_become_admin', '_bx_spaces_email_fan_become_admin_subject', '_bx_spaces_email_fan_become_admin_body'),
+('bx_spaces', '_bx_spaces_email_admin_become_fan', 'bx_spaces_admin_become_fan', '_bx_spaces_email_admin_become_fan_subject', '_bx_spaces_email_admin_become_fan_body'),
+('bx_spaces', '_bx_spaces_email_set_role', 'bx_spaces_set_role', '_bx_spaces_email_set_role_subject', '_bx_spaces_email_set_role_body'),
+('bx_spaces', '_bx_spaces_email_invitation', 'bx_spaces_invitation', '_bx_spaces_email_invitation_subject', '_bx_spaces_email_invitation_body');
+
+-- UPLOADERS
+
+INSERT INTO `sys_objects_uploader` (`object`, `active`, `override_class_name`, `override_class_file`) VALUES
+('bx_spaces_cover_crop', 1, 'BxSpacesUploaderCoverCrop', 'modules/boonex/spaces/classes/BxSpacesUploaderCoverCrop.php'),
+('bx_spaces_picture_crop', 1, 'BxSpacesUploaderPictureCrop', 'modules/boonex/spaces/classes/BxSpacesUploaderPictureCrop.php');
+
+
+-- 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', '');