Alex Trofimov 1 anno fa
parent
commit
50b7e4710b
42 ha cambiato i file con 3764 aggiunte e 0 eliminazioni
  1. 21 0
      modules/boonex/workspaces/classes/BxWorkspacesAlertsResponse.php
  2. 22 0
      modules/boonex/workspaces/classes/BxWorkspacesCmts.php
  3. 24 0
      modules/boonex/workspaces/classes/BxWorkspacesCmtsSearchResult.php
  4. 244 0
      modules/boonex/workspaces/classes/BxWorkspacesConfig.php
  5. 23 0
      modules/boonex/workspaces/classes/BxWorkspacesDb.php
  6. 36 0
      modules/boonex/workspaces/classes/BxWorkspacesFavorite.php
  7. 24 0
      modules/boonex/workspaces/classes/BxWorkspacesFormEntry.php
  8. 23 0
      modules/boonex/workspaces/classes/BxWorkspacesFormsEntryHelper.php
  9. 85 0
      modules/boonex/workspaces/classes/BxWorkspacesGridAdministration.php
  10. 23 0
      modules/boonex/workspaces/classes/BxWorkspacesGridCommon.php
  11. 25 0
      modules/boonex/workspaces/classes/BxWorkspacesMenuManageTools.php
  12. 22 0
      modules/boonex/workspaces/classes/BxWorkspacesMenuSnippetMeta.php
  13. 25 0
      modules/boonex/workspaces/classes/BxWorkspacesMenuView.php
  14. 25 0
      modules/boonex/workspaces/classes/BxWorkspacesMenuViewActions.php
  15. 50 0
      modules/boonex/workspaces/classes/BxWorkspacesMenuViewActionsAll.php
  16. 25 0
      modules/boonex/workspaces/classes/BxWorkspacesMenuViewMeta.php
  17. 76 0
      modules/boonex/workspaces/classes/BxWorkspacesModule.php
  18. 24 0
      modules/boonex/workspaces/classes/BxWorkspacesPageBrowse.php
  19. 24 0
      modules/boonex/workspaces/classes/BxWorkspacesPageEntry.php
  20. 21 0
      modules/boonex/workspaces/classes/BxWorkspacesPrivacy.php
  21. 22 0
      modules/boonex/workspaces/classes/BxWorkspacesPrivacyContact.php
  22. 22 0
      modules/boonex/workspaces/classes/BxWorkspacesPrivacyPost.php
  23. 36 0
      modules/boonex/workspaces/classes/BxWorkspacesReport.php
  24. 208 0
      modules/boonex/workspaces/classes/BxWorkspacesSearchResult.php
  25. 41 0
      modules/boonex/workspaces/classes/BxWorkspacesTemplate.php
  26. 22 0
      modules/boonex/workspaces/classes/BxWorkspacesVote.php
  27. 143 0
      modules/boonex/workspaces/install/config.php
  28. 30 0
      modules/boonex/workspaces/install/installer.php
  29. 344 0
      modules/boonex/workspaces/install/langs/en.xml
  30. 57 0
      modules/boonex/workspaces/install/sql/disable.sql
  31. 563 0
      modules/boonex/workspaces/install/sql/enable.sql
  32. 245 0
      modules/boonex/workspaces/install/sql/install.sql
  33. 43 0
      modules/boonex/workspaces/install/sql/uninstall.sql
  34. 57 0
      modules/boonex/workspaces/install/sql2/disable.sql
  35. 457 0
      modules/boonex/workspaces/install/sql2/enable.sql
  36. 451 0
      modules/boonex/workspaces/install/sql2/install.sql
  37. 56 0
      modules/boonex/workspaces/install/sql2/uninstall.sql
  38. 77 0
      modules/boonex/workspaces/js/manage_tools.js
  39. 18 0
      modules/boonex/workspaces/request.php
  40. 25 0
      modules/boonex/workspaces/template/images/icons/std-icon.svg
  41. BIN
      modules/boonex/workspaces/template/images/no-picture.png
  42. 5 0
      modules/boonex/workspaces/template/images/no-picture.svg

+ 21 - 0
modules/boonex/workspaces/classes/BxWorkspacesAlertsResponse.php

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

+ 22 - 0
modules/boonex/workspaces/classes/BxWorkspacesCmts.php

@@ -0,0 +1,22 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Workspaces Workspaces
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxWorkspacesCmts extends BxBaseModProfileCmts
+{
+    function __construct($sSystem, $iId, $iInit = 1)
+    {
+    	$this->_sModule = 'bx_workspaces';
+
+        parent::__construct($sSystem, $iId, $iInit);
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/workspaces/classes/BxWorkspacesCmtsSearchResult.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Workspaces Workspaces
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxWorkspacesCmtsSearchResult extends BxBaseModGeneralCmtsSearchResult
+{
+    function __construct($sMode = '', $aParams = array())
+    {
+    	$this->sModule = 'bx_workspaces';
+
+        parent::__construct($sMode, $aParams);
+
+        $this->aCurrent['title'] = _t('_bx_workspaces_page_title_browse_by_cmts');
+    }
+}
+
+/** @} */

+ 244 - 0
modules/boonex/workspaces/classes/BxWorkspacesConfig.php

@@ -0,0 +1,244 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Workspaces Workspaces
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxWorkspacesConfig extends BxBaseModProfileConfig
+{
+    function __construct($aModule)
+    {
+        parent::__construct($aModule);
+
+        $this->_aMenuItems2MethodsSubmenu = array_merge($this->_aMenuItems2MethodsSubmenu, array(
+            'workspaces-profile-friends' => 'checkAllowedFriendsView',
+            'workspaces-profile-relations' => 'checkAllowedRelationsView',
+            'workspaces-profile-subscriptions' => 'checkAllowedSubscriptionsView'
+        ));
+
+        $this->_aMenuItems2MethodsActions = array_merge($this->_aMenuItems2MethodsActions, array(
+            'view-workspaces-profile' => 'checkAllowedView',
+            'edit-workspaces-profile' => 'checkAllowedEdit',
+            'edit-workspaces-cover' => 'checkAllowedChangeCover',
+            'delete-workspaces-profile' => 'checkAllowedDelete',
+        ));
+
+        $this->CNF = array (
+
+            // module icon
+            'ICON' => 'user col-blue3',
+
+            // database tables
+            'TABLE_ENTRIES' => $aModule['db_prefix'] . 'data',
+            'TABLE_ENTRIES_FULLTEXT' => 'search_fields',
+
+            // database fields
+            'FIELD_ID' => 'id',
+            'FIELD_AUTHOR' => 'author',
+            'FIELD_ADDED' => 'added',
+            'FIELD_CHANGED' => 'changed',
+            'FIELD_NAME' => 'fullname',
+            'FIELD_TITLE' => 'fullname',
+//            'FIELD_PICTURE' => '',
+//            'FIELD_COVER' => '',
+//            'FIELD_COVER_POSITION' => '',
+            'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
+            'FIELD_ALLOW_POST_TO' => 'allow_post_to',
+            'FIELD_ALLOW_CONTACT_TO' => 'allow_contact_to',
+            'FIELD_VIEWS' => 'views',
+            'FIELD_VOTES' => 'votes',
+            'FIELD_REACTIONS' => 'rvotes',
+            'FIELD_SCORE' => 'score',
+            'FIELD_SCORE_UP' => 'sc_up',
+            'FIELD_SCORE_DOWN' => 'sc_down',
+            'FIELD_COMMENTS' => 'comments',
+            'FIELDS_QUICK_SEARCH' => array(),
+//            'FIELD_LOCATION' => '',
+            'FIELD_LOCATION_PREFIX' => '',
+            'FIELD_LABELS' => 'labels',
+            'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
+
+            // page URIs
+            'URI_VIEW_ENTRY' => 'view-workspaces-profile',
+            'URI_VIEW_FRIENDS' => 'workspaces-profile-friends',
+            'URI_VIEW_FRIEND_REQUESTS' => 'workspaces-friend-requests',
+            'URI_VIEW_FAVORITES' => 'workspaces-profile-favorites',
+            'URI_ADD_ENTRY' => 'create-workspaces-profile',
+            'URI_EDIT_ENTRY' => 'edit-workspaces-profile',
+            'URI_MANAGE_COMMON' => 'workspaces-manage',
+            'URI_VIEW_SUBSCRIPTIONS' => 'workspaces-profile-subscriptions',
+
+            'URL_HOME' => 'page.php?i=workspaces-home',
+            'URL_CREATE' => 'page.php?i=create-workspaces-profile',
+            'URL_MANAGE_COMMON' => 'page.php?i=workspaces-manage',
+            'URL_MANAGE_ADMINISTRATION' => 'page.php?i=workspaces-administration',
+
+            // some params
+            'ALLOW_AS_CONTEXT' => defined('BX_WORKSPACES_AS_CONTEXT'),
+
+            'PARAM_AUTOAPPROVAL' => 'bx_workspaces_autoapproval',
+            'PARAM_ENABLE_ACTIVATION_LETTER' => 'bx_workspaces_enable_profile_activation_letter',
+            'PARAM_DEFAULT_ACL_LEVEL' => 'bx_workspaces_default_acl_level',
+            'PARAM_NUM_RSS' => 'bx_workspaces_num_rss',
+            'PARAM_NUM_CONNECTIONS_QUICK' => 'bx_workspaces_num_connections_quick',
+            'PARAM_SEARCHABLE_FIELDS' => 'bx_workspaces_searchable_fields',
+            'PARAM_FRIENDS' => 'bx_workspaces_friends',
+            'PARAM_PUBLIC_SBSN' => 'bx_workspaces_public_subscriptions',
+            'PARAM_PUBLIC_SBSD' => 'bx_workspaces_public_subscribed_me',
+            'PARAM_REDIRECT_AADD' => 'bx_workspaces_redirect_aadd',
+            'PARAM_REDIRECT_AADD_CUSTOM_URL' => 'bx_workspaces_redirect_aadd_custom_url',
+            'PARAM_PER_PAGE_BROWSE_SHOWCASE' => 'bx_workspaces_per_page_browse_showcase',
+            'PARAM_PER_PAGE_BROWSE_RECOMMENDED' => 'bx_workspaces_per_page_browse_recommended',
+
+            // objects
+            'OBJECT_STORAGE' => '',
+            'OBJECT_STORAGE_COVER' => '',
+            'OBJECT_IMAGES_TRANSCODER_THUMB' => '',
+            'OBJECT_IMAGES_TRANSCODER_ICON' => '',
+            'OBJECT_IMAGES_TRANSCODER_AVATAR' => '',
+            'OBJECT_IMAGES_TRANSCODER_AVATAR_BIG' => '',
+            'OBJECT_IMAGES_TRANSCODER_PICTURE' => '',
+            'OBJECT_IMAGES_TRANSCODER_COVER' => '',
+            'OBJECT_IMAGES_TRANSCODER_COVER_THUMB' => '',
+            'OBJECT_IMAGES_TRANSCODER_GALLERY' => '',
+            'OBJECT_VIEWS' => 'bx_workspaces',
+            'OBJECT_VOTES' => 'bx_workspaces',
+            'OBJECT_REACTIONS' => 'bx_workspaces_reactions',
+            'OBJECT_SCORES' => 'bx_workspaces',
+            'OBJECT_FAVORITES' => 'bx_workspaces',
+            'OBJECT_FEATURED' => 'bx_workspaces',
+            'OBJECT_COMMENTS' => 'bx_workspaces',
+            'OBJECT_NOTES' => 'bx_workspaces_notes',
+            'OBJECT_REPORTS' => 'bx_workspaces',
+            'OBJECT_METATAGS' => '',
+            'OBJECT_FORM_ENTRY' => 'bx_workspace',
+            'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_workspace_view',
+            'OBJECT_FORM_ENTRY_DISPLAY_VIEW_FULL' => 'bx_workspace_view_full', // for "info" tab on view profile page 
+            'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_workspace_add',
+            'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_workspace_edit',
+            'OBJECT_FORM_ENTRY_DISPLAY_EDIT_COVER' => '',
+            'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_workspace_delete',
+            'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_workspaces_view_actions', // actions menu on view entry page
+            'OBJECT_MENU_ACTIONS_VIEW_ENTRY_MORE' => 'bx_workspaces_view_actions_more', // actions menu on view entry page for "more" popup
+            'OBJECT_MENU_ACTIONS_VIEW_ENTRY_ALL' => 'bx_workspaces_view_actions_all', // all actions menu on view entry page
+            'OBJECT_MENU_SUBMENU' => 'bx_workspaces_submenu', // main module submenu
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_workspaces_view_submenu',  // view entry submenu
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'workspaces-home', // first item in view entry submenu from main module submenu
+            'OBJECT_MENU_MANAGE_VIEW_ENTRY' => '',
+            'OBJECT_MENU_VIEW_ENTRY_META' => 'bx_workspaces_view_meta', // meta menu on view entry page
+            'OBJECT_MENU_SNIPPET_META' => 'bx_workspaces_snippet_meta', // menu for snippet meta info
+            'OBJECT_MENU_MANAGE_TOOLS' => 'bx_workspaces_menu_manage_tools', //manage menu in content administration tools
+            'OBJECT_PAGE_VIEW_ENTRY' => 'bx_workspaces_view_profile',
+            'OBJECT_PAGE_VIEW_ENTRY_CLOSED' => 'bx_workspaces_view_profile_closed',
+            'OBJECT_PAGE_JOINED_ENTRY' => 'bx_workspaces_join_profile',
+            'OBJECT_PRIVACY_VIEW' => 'bx_workspaces_allow_view_to',
+            'OBJECT_PRIVACY_POST' => 'bx_workspaces_allow_post_to',
+            'OBJECT_PRIVACY_CONTACT' => 'bx_workspaces_allow_contact_to',
+            'OBJECT_GRID_ADMINISTRATION' => 'bx_workspaces_administration',
+            'OBJECT_GRID_COMMON' => 'bx_workspaces_common',
+            'OBJECT_UPLOADERS_COVER' => array(''),
+            'OBJECT_UPLOADERS_PICTURE' => array(''),
+            
+            'BADGES_AVALIABLE' => true,
+
+            'EMAIL_FRIEND_REQUEST' => 'bx_workspaces_friend_request',
+
+            'TRIGGER_MENU_PROFILE_VIEW_SUBMENU' => 'trigger_profile_view_submenu',
+            'TRIGGER_MENU_PROFILE_SNIPPET_META' => 'trigger_profile_snippet_meta',
+            'TRIGGER_MENU_PROFILE_VIEW_ACTIONS' => 'trigger_profile_view_actions',
+        	'TRIGGER_PAGE_VIEW_ENTRY' => 'trigger_page_profile_view_entry',
+
+            // menu items which visibility depends on custom visibility checking
+            'MENU_ITEM_TO_METHOD' => array (
+                'bx_workspaces_view_submenu' => $this->_aMenuItems2MethodsSubmenu,
+                'bx_workspaces_view_actions' => $this->_aMenuItems2MethodsActions,
+                'bx_workspaces_view_actions_more' => $this->_aMenuItems2MethodsActions,
+                'bx_workspaces_view_actions_all' => $this->_aMenuItems2MethodsActions,
+            ),
+
+            // informer messages
+            'INFORMERS' => array (
+                'status' => array (
+                    'name' => 'bx-workspaces-status-not-active',
+                    'map' => array (
+                        BX_PROFILE_STATUS_PENDING => '_bx_workspaces_txt_account_pending',
+                        BX_PROFILE_STATUS_SUSPENDED => '_bx_workspaces_txt_account_suspended',
+                    ),
+                ),
+                'status_moderation' => array (
+                    'name' => 'bx-workspaces-status-not-active-moderation',
+                    'map' => array (
+                        BX_PROFILE_STATUS_PENDING => '_bx_workspaces_txt_account_pending_moderation',
+                        BX_PROFILE_STATUS_SUSPENDED => '_bx_workspaces_txt_account_suspended_moderation',
+                    ),
+                ),
+            ),
+
+            // some language keys
+            'T' => array (
+                'txt_sample_single' => '_bx_workspaces_txt_sample_single',
+            	'txt_sample_comment_single' => '_bx_workspaces_txt_sample_comment_single',
+                'txt_sample_vote_single' => '_bx_workspaces_txt_sample_vote_single',
+                'txt_sample_score_up_single' => '_bx_workspaces_txt_sample_score_up_single',
+                'txt_sample_score_down_single' => '_bx_workspaces_txt_sample_score_down_single',
+            	'txt_sample_pp_single' => '_bx_workspaces_txt_sample_pp_single',
+            	'txt_sample_pp_single_with_article' => '_bx_workspaces_txt_sample_pp_single_with_article',
+                'txt_sample_pc_single' => '_bx_workspaces_txt_sample_pc_single',
+            	'txt_sample_pc_single_with_article' => '_bx_workspaces_txt_sample_pc_single_with_article',
+            	'txt_sample_pi_action' => '_bx_workspaces_txt_sample_pi_action',
+            	'txt_sample_pi_action_user' => '_bx_workspaces_txt_sample_pi_action_user',
+                'txt_N_fans' => '_bx_workspaces_txt_N_friends',
+            	'txt_ntfs_timeline_post_common' => '_bx_workspaces_txt_ntfs_timeline_post_common',
+            	'form_field_picture' => '_bx_workspaces_form_profile_input_picture_search',
+                'form_field_online' => '_bx_workspaces_form_profile_input_online_search',
+                'menu_item_title_befriend_sent' => '_bx_workspaces_menu_item_title_befriend_sent',
+                'menu_item_title_unfriend_cancel_request' => '_bx_workspaces_menu_item_title_unfriend_cancel_request',
+                'menu_item_title_befriend_confirm' => '_bx_workspaces_menu_item_title_befriend_confirm',
+                'menu_item_title_unfriend_reject_request' => '_bx_workspaces_menu_item_title_unfriend_reject_request',
+                'menu_item_title_befriend' => '_bx_workspaces_menu_item_title_befriend',
+                'menu_item_title_unfriend' => '_bx_workspaces_menu_item_title_unfriend',
+            	'grid_action_err_delete' => '_bx_workspaces_grid_action_err_delete',
+            	'grid_txt_account_manager' => '_bx_workspaces_grid_txt_account_manager',
+            	'filter_item_active' => '_bx_workspaces_grid_filter_item_title_adm_active',
+            	'filter_item_pending' => '_bx_workspaces_grid_filter_item_title_adm_pending',
+            	'filter_item_suspended' => '_bx_workspaces_grid_filter_item_title_adm_suspended',
+                'filter_item_unconfirmed' => '_bx_workspaces_grid_filter_item_title_adm_unconfirmed',
+            	'filter_item_select_one_filter1' => '_bx_workspaces_grid_filter_item_title_adm_select_one_filter1',
+                'filter_item_select_one_filter2' => '_bx_workspaces_grid_filter_item_title_adm_select_one_filter2',
+            	'menu_item_manage_my' => '_bx_workspaces_menu_item_title_manage_my',
+            	'menu_item_manage_all' => '_bx_workspaces_menu_item_title_manage_all',
+            	'txt_browse_favorites' => '_bx_workspaces_page_title_browse_favorites',
+                'option_redirect_aadd_profile' => '_bx_workspaces_option_redirect_aadd_profile',
+            	'option_redirect_aadd_last' => '_bx_workspaces_option_redirect_aadd_last',
+            	'option_redirect_aadd_custom' => '_bx_workspaces_option_redirect_aadd_custom',
+                'option_redirect_aadd_homepage' => '_bx_workspaces_option_redirect_aadd_homepage',
+                'option_activation_on' => '_bx_workspaces_option_activation_on',
+            	'option_activation_off' => '_bx_workspaces_option_activation_off',
+            	'option_activation_add' => '_bx_workspaces_option_activation_add',
+                'option_activation_edit' => '_bx_workspaces_option_activation_edit'
+            ),
+
+        );
+
+        $this->_aJsClasses = array(
+        	'manage_tools' => 'BxWorkspacesManageTools'
+        );
+
+        $this->_aJsObjects = array(
+        	'manage_tools' => 'oBxWorkspacesManageTools'
+        );
+
+        $this->_aGridObjects = array(
+        	'common' => $this->CNF['OBJECT_GRID_COMMON'],
+        	'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
+        	
+        );
+    }
+}
+
+/** @} */

+ 23 - 0
modules/boonex/workspaces/classes/BxWorkspacesDb.php

@@ -0,0 +1,23 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Workspaces Workspaces
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/*
+ * Workspaces module database queries
+ */
+class BxWorkspacesDb extends BxBaseModProfileDb
+{
+    public function __construct(&$oConfig)
+    {
+        parent::__construct($oConfig);
+    }
+}
+
+/** @} */

+ 36 - 0
modules/boonex/workspaces/classes/BxWorkspacesFavorite.php

@@ -0,0 +1,36 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Workspaces Workspaces
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxWorkspacesFavorite extends BxTemplFavorite
+{
+    protected $MODULE;
+    protected $_oModule;
+    
+    function __construct($aOptions, $oTemplate = false)
+    {
+    	$this->MODULE = 'bx_workspaces';
+
+        parent::__construct($aOptions, $oTemplate);
+
+        $this->_oModule = BxDolModule::getInstance($this->MODULE);
+    }
+
+    public function isAllowedFavorite($isPerformAction = false)
+    {
+        $oProfile = BxDolProfile::getInstanceByContentAndType($this->getId(), $this->_oModule->getName());
+        if($oProfile && $oProfile->id() == bx_get_logged_profile_id())
+            return false;
+
+        return parent::isAllowedFavorite($isPerformAction);
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/workspaces/classes/BxWorkspacesFormEntry.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Workspaces Workspaces
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Create/Edit Workspace Form.
+ */
+class BxWorkspacesFormEntry extends BxBaseModProfileFormEntry
+{
+    public function __construct($aInfo, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_workspaces';
+        parent::__construct($aInfo, $oTemplate);
+    }
+}
+
+/** @} */

+ 23 - 0
modules/boonex/workspaces/classes/BxWorkspacesFormsEntryHelper.php

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

+ 85 - 0
modules/boonex/workspaces/classes/BxWorkspacesGridAdministration.php

@@ -0,0 +1,85 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Workspaces Workspaces
+ * @ingroup     UnaModules
+ * 
+ * @{
+ */
+
+class BxWorkspacesGridAdministration extends BxBaseModProfileGridAdministration
+{
+    protected $_sFilter2Name;
+	protected $_sFilter2Value;
+	protected $_aFilter2Values;
+    protected $_sConfirmationType;
+    
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+    	$this->MODULE = 'bx_workspaces';
+        parent::__construct ($aOptions, $oTemplate);
+        
+        $CNF = &$this->_oModule->_oConfig->CNF;
+        $this->_sFilter2Name = 'filter2';
+        $aTmp = array();
+        BxDolAclQuery::getInstance()->getLevels(array('type' => 'all_active_not_automatic_pair'), $aTmp);
+        foreach ($aTmp as $sKey => $sValue) {
+            $this->_aFilter2Values["level" . $sKey] = $sValue;
+        }
+        
+        $sFilter2 = bx_get($this->_sFilter2Name);
+        if(!empty($sFilter2)) {
+            $this->_sFilter2Value = bx_process_input($sFilter2);
+            $this->_aQueryAppend[$this->_sFilter2Name] = $this->_sFilter2Value;
+        }
+        $this->_sConfirmationType = getParam('sys_account_confirmation_type');
+        if ($this->_sConfirmationType != BX_ACCOUNT_CONFIRMATION_NONE)
+            $this->_aFilter1Values['unconfirmed'] = $CNF['T']['filter_item_unconfirmed'];
+    }
+    
+    protected function _getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage)
+    {
+        if(strpos($sFilter, $this->_sParamsDivider) !== false)
+            list($this->_sFilter1Value, $this->_sFilter2Value, $sFilter) = explode($this->_sParamsDivider, $sFilter);
+
+    	if(!empty($this->_sFilter1Value)){
+            if ($this->_sFilter1Value == 'unconfirmed'){
+                switch ($this->_sConfirmationType) {
+                    case BX_ACCOUNT_CONFIRMATION_EMAIL:
+                        $this->_aOptions['source'] .= $this->_oModule->_oDb->prepareAsString(" AND `ta`.`email_confirmed` = 0 ");
+                        break;
+                    case BX_ACCOUNT_CONFIRMATION_PHONE:
+                        $this->_aOptions['source'] .= $this->_oModule->_oDb->prepareAsString(" AND `ta`.`phone_confirmed` = 0 ");
+                        break;
+                    case BX_ACCOUNT_CONFIRMATION_EMAIL_PHONE:
+                        $this->_aOptions['source'] .= $this->_oModule->_oDb->prepareAsString(" AND (`ta`.`email_confirmed` = 0 AND `ta`.`phone_confirmed` = 0) ");
+                        break;
+                }
+            }
+            else{
+        	    $this->_aOptions['source'] .= $this->_oModule->_oDb->prepareAsString(" AND `tp`.`status`=?", $this->_sFilter1Value);
+            }
+        }
+        if(!empty($this->_sFilter2Value)){
+			$iLevel = intval(str_replace("level", "", $this->_sFilter2Value));
+			if ($iLevel <> 3)
+        		$this->_aOptions['source'] .= $this->_oModule->_oDb->prepareAsString(" AND `tp`.`id` IN (SELECT `IDMember` FROM `sys_acl_levels_members` WHERE IDLevel = ?) ", $iLevel);
+			else
+				$this->_aOptions['source'] .= $this->_oModule->_oDb->prepareAsString(" AND `tp`.`id` NOT IN (SELECT `IDMember` FROM `sys_acl_levels_members`) ");
+		}
+
+        return parent::_getDataSqlInner($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage);
+    }
+    
+    protected function _getFilterControls()
+    {
+        parent::_getFilterControls();
+
+        return  $this->_getFilterSelectOne($this->_sFilter1Name, $this->_sFilter1Value, $this->_aFilter1Values) . $this->_getFilterSelectOne($this->_sFilter2Name, $this->_sFilter2Value, $this->_aFilter2Values) . $this->_getSearchInput();
+    }
+    
+}
+
+/** @} */

+ 23 - 0
modules/boonex/workspaces/classes/BxWorkspacesGridCommon.php

@@ -0,0 +1,23 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Workspaces Workspaces
+ * @ingroup     UnaModules
+ * 
+ * @{
+ */
+
+class BxWorkspacesGridCommon extends BxBaseModProfileGridCommon
+{
+    protected $_sFilter2Value;
+    
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+    	$this->MODULE = 'bx_workspaces';
+        parent::__construct ($aOptions, $oTemplate);
+    }
+}
+
+/** @} */

+ 25 - 0
modules/boonex/workspaces/classes/BxWorkspacesMenuManageTools.php

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

+ 22 - 0
modules/boonex/workspaces/classes/BxWorkspacesMenuSnippetMeta.php

@@ -0,0 +1,22 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Workspaces Workspaces
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxWorkspacesMenuSnippetMeta extends BxBaseModProfileMenuSnippetMeta
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->_sModule = 'bx_workspaces';
+
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 25 - 0
modules/boonex/workspaces/classes/BxWorkspacesMenuView.php

@@ -0,0 +1,25 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Workspaces Workspaces
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * 'View workspace' menu.
+ */
+class BxWorkspacesMenuView extends BxBaseModProfileMenuView
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->_sModule = 'bx_workspaces';
+
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 25 - 0
modules/boonex/workspaces/classes/BxWorkspacesMenuViewActions.php

@@ -0,0 +1,25 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Workspaces Workspaces
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * 'View workspace' menu.
+ */
+class BxWorkspacesMenuViewActions extends BxBaseModProfileMenuViewActions
+{
+
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_workspaces';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 50 - 0
modules/boonex/workspaces/classes/BxWorkspacesMenuViewActionsAll.php

@@ -0,0 +1,50 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Workspaces Workspaces
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * View entry all actions menu
+ */
+class BxWorkspacesMenuViewActionsAll extends BxBaseModProfileMenuViewActionsAll
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->_sModule = 'bx_workspaces';
+
+        parent::__construct($aObject, $oTemplate);
+    }
+
+    protected function _getMenuItemEditWorkspacesCover($aItem)
+    {
+        return $this->_getMenuItemByNameActionsMore($aItem);
+    }
+
+    protected function _getMenuItemEditWorkspacesProfile($aItem)
+    {
+        return $this->_getMenuItemByNameActionsMore($aItem);
+    }
+
+    protected function _getMenuItemDeleteWorkspacesProfile($aItem)
+    {
+        return $this->_getMenuItemByNameActionDelete($aItem);
+    }
+
+    protected function _getMenuItemDeleteWorkspacesAccount($aItem)
+    {
+        return $this->_getMenuItemByNameActionsMore($aItem);
+    }
+
+    protected function _getMenuItemDeleteWorkspacesAccountContent($aItem)
+    {
+        return $this->_getMenuItemByNameActionsMore($aItem);
+    }
+}
+
+/** @} */

+ 25 - 0
modules/boonex/workspaces/classes/BxWorkspacesMenuViewMeta.php

@@ -0,0 +1,25 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Workspaces Workspaces
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * View entry meta menu
+ */
+class BxWorkspacesMenuViewMeta extends BxBaseModProfileMenuViewMeta
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->_sModule = 'bx_workspaces';
+
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 76 - 0
modules/boonex/workspaces/classes/BxWorkspacesModule.php

@@ -0,0 +1,76 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Workspaces Workspaces
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Workspace profiles module.
+ */
+class BxWorkspacesModule extends BxBaseModProfileModule
+{
+    function __construct(&$aModule)
+    {
+        parent::__construct($aModule);
+
+        $this->_aSearchableNamesExcept[] = $this->_oConfig->CNF['FIELD_AUTHOR'];
+    }
+    
+    /**
+     * @page service Service Calls
+     * @section bx_workspaces Workspaces 
+     * @subsection bx_workspaces-other Other
+     * @subsubsection bx_workspaces-get_search_options
+     * 
+     * @code bx_srv('bx_workspaces', 'get_search_options', [...]); @endcode
+     * 
+     * Get options for searchable fields
+     * 
+     * @return array - params or false.
+     * 
+     * @see BxWorkspacesModule::serviceGetSearchOptions
+     */
+    /** 
+     * @ref bx_workspaces-get_search_options "get_search_options"
+     */
+    public function serviceGetSearchOptions ($sField, $sFieldType, $sSearchType)
+    {
+        $CNF = $this->_oConfig->CNF;
+        if (isset($CNF['OBJECT_FORM_ENTRY']) && isset($CNF['OBJECT_FORM_ENTRY_DISPLAY_ADD'])){
+            $oForm = BxDolForm::getObjectInstance($CNF['OBJECT_FORM_ENTRY'], $CNF['OBJECT_FORM_ENTRY_DISPLAY_ADD'], $this->_oTemplate);
+            foreach ($oForm->aInputs as $aFld) {
+                if ($aFld['name'] == $sField && $aFld['type'] == $sFieldType && isset($aFld['checker']) && isset($aFld['checker']['params'])){
+                    return $aFld['checker']['params'];
+                }
+            }
+        }
+        
+        if (isset($CNF['OBJECT_FORM_ENTRY']) && isset($CNF['OBJECT_FORM_ENTRY_DISPLAY_EDIT'])){
+            $oForm = BxDolForm::getObjectInstance($CNF['OBJECT_FORM_ENTRY'], $CNF['OBJECT_FORM_ENTRY_DISPLAY_EDIT'], $this->_oTemplate);
+            foreach ($oForm->aInputs as $aFld) {
+                if ($aFld['name'] == $sField && $aFld['type'] == $sFieldType && isset($aFld['checker']) && isset($aFld['checker']['params'])){
+                    return $aFld['checker']['params'];
+                }
+            }
+        }
+        
+        return false;
+    }
+
+    public function getSubtypes()
+    {
+        return pow(2, BX_DOL_MODULE_SUBTYPE_PROFILE);
+    }
+
+    public function getProfileName ($aContentInfo)
+    {
+        return bx_process_output('User' . $aContentInfo[$this->_oConfig->CNF['FIELD_ID']]);
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/workspaces/classes/BxWorkspacesPageBrowse.php

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

+ 24 - 0
modules/boonex/workspaces/classes/BxWorkspacesPageEntry.php

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

+ 21 - 0
modules/boonex/workspaces/classes/BxWorkspacesPrivacy.php

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

+ 22 - 0
modules/boonex/workspaces/classes/BxWorkspacesPrivacyContact.php

@@ -0,0 +1,22 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Workspaces Workspaces
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxWorkspacesPrivacyContact extends BxBaseModProfilePrivacyContact
+{
+    function __construct($aOptions, $oTemplate = false)
+    {
+    	$this->_sModule = 'bx_workspaces';
+
+        parent::__construct($aOptions, $oTemplate);
+    }
+}
+
+/** @} */

+ 22 - 0
modules/boonex/workspaces/classes/BxWorkspacesPrivacyPost.php

@@ -0,0 +1,22 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Workspaces Workspaces
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxWorkspacesPrivacyPost extends BxBaseModProfilePrivacyPost
+{
+    function __construct($aOptions, $oTemplate = false)
+    {
+    	$this->_sModule = 'bx_workspaces';
+
+        parent::__construct($aOptions, $oTemplate);
+    }
+}
+
+/** @} */

+ 36 - 0
modules/boonex/workspaces/classes/BxWorkspacesReport.php

@@ -0,0 +1,36 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Workspaces Workspaces
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxWorkspacesReport extends BxTemplReport
+{
+    protected $MODULE;
+    protected $_oModule;
+    
+    function __construct($aOptions, $oTemplate = false)
+    {
+    	$this->MODULE = 'bx_workspaces';
+
+        parent::__construct($aOptions, $oTemplate);
+
+        $this->_oModule = BxDolModule::getInstance($this->MODULE);
+    }
+
+    public function isAllowedReport($isPerformAction = false)
+    {
+        $oProfile = BxDolProfile::getInstanceByContentAndType($this->getId(), $this->_oModule->getName());
+        if($oProfile && $oProfile->id() == bx_get_logged_profile_id())
+            return false;
+
+        return parent::isAllowedReport($isPerformAction);
+    }
+}
+
+/** @} */

+ 208 - 0
modules/boonex/workspaces/classes/BxWorkspacesSearchResult.php

@@ -0,0 +1,208 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Workspaces Workspaces
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxWorkspacesSearchResult extends BxBaseModProfileSearchResult
+{
+    function __construct($sMode = '', $aParams = false)
+    {
+        parent::__construct($sMode, $aParams);        
+        
+        $this->aCurrent =  array(
+            'name' => 'bx_workspaces',
+            'module_name' => 'bx_workspaces',
+            'object_metatags' => 'bx_workspaces',
+            'title' => _t('_bx_workspaces_page_title_browse'),
+            'table' => 'sys_profiles',
+            'tableSearch' => 'bx_workspaces_data',
+            'ownFields' => array(),
+            'searchFields' => array(),
+            'restriction' => array(
+                'account_id' => array('value' => '', 'field' => 'account_id', 'operator' => '='),
+                'perofileStatus' => array('value' => 'active', 'field' => 'status', 'operator' => '='),
+                'perofileType' => array('value' => 'bx_workspaces', 'field' => 'type', 'operator' => '='),
+                'owner' => array('value' => '', 'field' => 'author', 'operator' => '=', 'table' => 'bx_workspaces_data'),
+                'featured' => array('value' => '', 'field' => 'featured', 'operator' => '<>', 'table' => 'bx_workspaces_data'),
+                'online' => array('value' => '', 'field' => 'date', 'operator' => '>', 'table' => 'sys_sessions'),
+            ),
+            'join' => array (
+                'profile' => array(
+                    'type' => 'INNER',
+                    'table' => 'bx_workspaces_data',
+                    'mainField' => 'content_id',
+                    'onField' => 'id',
+                    'joinFields' => array('id', 'added', 'author', 'allow_view_to'),
+                ),
+                'account' => array(
+                    'type' => 'INNER',
+                    'table' => 'sys_accounts',
+                    'mainField' => 'account_id',
+                    'onField' => 'id',
+                    'joinFields' => array(),
+                ),
+            ),
+            'paginate' => array('perPage' => getParam('bx_workspaces_per_page_browse'), 'start' => 0),
+            'sorting' => 'active',
+            'rss' => array(
+                'title' => '',
+                'link' => '',
+                'image' => '',
+                'profile' => 0,
+                'fields' => array (
+                    'Guid' => 'link',
+                    'Link' => 'link',
+                    'DateTimeUTS' => 'added',
+                ),
+            ),
+            'ident' => 'id'
+        );
+
+        $this->sFilterName = 'bx_workspaces_filter';
+        $this->oModule = $this->getMain();
+
+        $CNF = &$this->oModule->_oConfig->CNF;
+        
+        $sSearchFields = getParam($CNF['PARAM_SEARCHABLE_FIELDS']);
+        $this->aCurrent['searchFields'] = !empty($sSearchFields) ? explode(',', $sSearchFields) : '';
+
+        $this->_setAccountConfirmationConditions($aParams);
+
+        switch ($sMode) {
+
+            case 'connections':
+                if ($this->_setConnectionsConditions($aParams)) {
+                    $oProfile = BxDolProfile::getInstance($aParams['profile']);
+                    $oProfile2 = isset($aParams['profile2']) ? BxDolProfile::getInstance($aParams['profile2']) : null;
+
+                    if (isset($aParams['type']) && $aParams['type'] == 'common' && $oProfile && $oProfile2)
+                        $this->aCurrent['title'] = _t('_bx_workspaces_page_title_browse_connections_mutual', $oProfile->getDisplayName(), $oProfile2->getDisplayName());
+                    elseif ((!isset($aParams['type']) || $aParams['type'] != 'common') && $oProfile)
+                        $this->aCurrent['title'] = _t('_bx_workspaces_page_title_browse_connections', $oProfile->getDisplayName());
+
+                    $this->aCurrent['rss']['link'] = 'modules/?r=workspaces/rss/' . $sMode . '/' . $aParams['object'] . '/' . $aParams['type'] . '/' . (int)$aParams['profile'] . '/' . (int)$aParams['profile2'] . '/' . (int)$aParams['mutual'];
+                }
+                break;
+
+            case 'familiar':
+                if($this->_setFamiliarConnectionsConditions($aParams)) {
+                    $this->aCurrent['title'] = _t('_bx_workspaces_page_title_browse_familiar');
+                    unset($this->aCurrent['rss']);
+                }
+                break;
+
+            case 'acl':
+                if ($this->_setAclConditions($aParams)) {
+                    $this->aCurrent['title'] = _t('_bx_workspaces_page_title_browse_by_acl', implode(', ', $this->aCurrent['title']));
+                    unset($this->aCurrent['rss']);
+                }
+                break;
+
+            case 'favorite':
+                $oProfileAuthor = null;
+                if(!$this->_setFavoriteConditions($sMode, $aParams, $oProfileAuthor)) {
+                    $this->isError = true;
+                    break;
+                }
+                break;
+
+            case 'recent':
+                $this->aCurrent['rss']['link'] = 'modules/?r=workspaces/rss/' . $sMode;
+                $this->aCurrent['title'] = _t('_bx_workspaces_page_title_browse_recent');
+                $this->aCurrent['sorting'] = 'last';
+                $this->sBrowseUrl = 'page.php?i=workspaces-home';
+                break;
+
+            case 'featured':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME']);
+                $this->aCurrent['title'] = _t('_bx_workspaces_page_title_browse_featured');
+                $this->aCurrent['restriction']['featured']['value'] = '0';
+                $this->aCurrent['rss']['link'] = 'modules/?r=workspaces/rss/' . $sMode;
+                $this->aCurrent['sorting'] = 'featured';
+                break;
+                
+            case 'recommended':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME']);
+                $this->aCurrent['title'] = _t('_bx_groups_page_title_browse_recommended');
+                $this->aCurrent['restriction']['featured']['value'] = '0';
+                $this->aCurrent['rss']['link'] = 'modules/?r=groups/rss/' . $sMode;
+                $this->aCurrent['sorting'] = 'recommended';
+                $this->_setConditionsForRecommended();
+                break;    
+            
+            case 'active':
+                $this->aCurrent['rss']['link'] = 'modules/?r=workspaces/rss/' . $sMode;
+                $this->aCurrent['title'] = _t('_bx_workspaces_page_title_browse_active');
+                $this->aCurrent['sorting'] = 'active';
+                $this->sBrowseUrl = 'page.php?i=workspaces-active';
+                break;
+
+            case 'online':
+                $this->aCurrent['rss']['link'] = 'modules/?r=workspaces/rss/' . $sMode;
+                $this->aCurrent['title'] = _t('_bx_workspaces_page_title_browse_online');
+                $this->aCurrent['restriction']['online']['value'] = time() - 60 * (int)getParam('sys_account_online_time');
+                $this->aCurrent['restriction_sql'] = ' AND `sys_accounts`.`profile_id`=`sys_profiles`.`id`';
+                $this->aCurrent['join']['session'] = array(
+                    'type' => 'INNER',
+                    'table' => 'sys_sessions',
+                    'mainField' => 'account_id',
+                    'onField' => 'user_id',
+                    'joinFields' => array('date'),
+                    'groupTable' => $this->aCurrent['table'],
+                    'groupField' => 'id'
+                );
+                $this->aCurrent['sorting'] = 'online';
+                $this->sBrowseUrl = 'page.php?i=workspaces-online';
+                break;
+
+            case '': // search results
+                $this->sBrowseUrl = BX_DOL_SEARCH_KEYWORD_PAGE;
+                $this->aCurrent['title'] = _t('_bx_workspaces');
+                unset($this->aCurrent['paginate']['perPage'], $this->aCurrent['rss']);
+                break;
+
+            default:
+                $this->isError = true;
+        }
+
+        $this->sCenterContentUnitSelector = false;
+    }
+
+    function getAlterOrder()
+    {
+        switch ($this->aCurrent['sorting']) {
+            case 'featured':
+                return array('order' => ' ORDER BY `bx_workspaces_data`.`featured` DESC ');
+            case 'recommended':
+                return array('order' => ' ORDER BY RAND() ');
+            case 'none':
+                return array();
+	        case 'active':
+	            return array('order' => ' ORDER BY `sys_accounts`.`logged` DESC ');
+			case 'online':
+	            return array('order' => ' ORDER BY `sys_sessions`.`date` DESC ');
+	        case 'last':
+	        default:
+	            return array('order' => ' ORDER BY `bx_workspaces_data`.`added` DESC ');
+        }
+    }
+
+    function _getPseud ()
+    {
+        return array(
+            'id' => 'id',
+            'fullname' => 'fullname',
+            'added' => 'added',
+            'author' => 'author',
+            'picture' => 'picture',
+        );
+    }
+}
+
+/** @} */

+ 41 - 0
modules/boonex/workspaces/classes/BxWorkspacesTemplate.php

@@ -0,0 +1,41 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Workspaces Workspaces
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/*
+ * Workspaces module representation.
+ */
+class BxWorkspacesTemplate extends BxBaseModProfileTemplate
+{
+    function __construct(&$oConfig, &$oDb)
+    {
+        $this->MODULE = 'bx_workspaces';
+        parent::__construct($oConfig, $oDb);
+    }
+
+    function unitVars ($aData, $isCheckPrivateContent = true, $mixedTemplate = false, $aParams = [])
+    {
+        $a = ['bx_if:show_thumb_image', 'bx_if:show_thumb_letter', 'bx_if:show_thumbnail', 'bx_if:show_cover', 'thumb_url', 'cover_url', 'cover_settings', 'text', 'summary'];
+
+        $aVars = parent::unitVars ($aData, $isCheckPrivateContent, $mixedTemplate, $aParams);
+
+        $oProfileParent = BxDolProfile::getInstance($aData['author']);
+        if ($oProfileParent && $oModuleParent = BxDolModule::getInstance($oProfileParent->getModule())) {
+            $aDataParent = $oModuleParent->_oDb->getContentInfoById($oProfileParent->getContentId());
+            $aVarsParent = $oModuleParent->_oTemplate->unitVars ($aDataParent, $isCheckPrivateContent, $mixedTemplate, $aParams);
+            foreach ($a as $k)
+                $aVars[$k] = $aVarsParent[$k];
+        }
+
+        return $aVars;
+    }
+}
+
+/** @} */

+ 22 - 0
modules/boonex/workspaces/classes/BxWorkspacesVote.php

@@ -0,0 +1,22 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Workspaces Workspaces
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxWorkspacesVote extends BxBaseModProfileVote
+{
+    function __construct($sSystem, $iId, $iInit = 1)
+    {
+    	$this->_sModule = 'bx_workspaces';
+
+        parent::__construct($sSystem, $iId, $iInit);        
+    }
+}
+
+/** @} */

+ 143 - 0
modules/boonex/workspaces/install/config.php

@@ -0,0 +1,143 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Workspaces Workspaces
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_workspaces',
+    'title' => 'Workspaces',
+    'note' => 'Workspace sub-profiles.',
+    'version' => '15.0.0.DEV',
+    'vendor' => 'UNA INC',
+    'help_url' => 'http://feed.una.io/?section={module_name}',
+
+    'compatible_with' => array(
+        '15.0.x'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/workspaces/',
+    'home_uri' => 'workspaces',
+
+    'db_prefix' => 'bx_workspaces_',
+    'class_prefix' => 'BxWorkspaces',
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => 'Workspaces',
+
+    /**
+     * Connections.
+     */
+    'connections' => array(
+        'sys_profiles_friends' => array ('type' => 'profiles'),
+        'sys_profiles_subscriptions' => array ('type' => 'profiles'),
+        'sys_profiles_relations' => array ('type' => 'profiles'),
+    ),
+
+    /**
+     * Menu triggers.
+     */
+    'menu_triggers' => array(
+        'trigger_profile_view_submenu',
+        'trigger_profile_snippet_meta',
+    	'trigger_profile_view_actions',
+    ),
+
+	/**
+     * Page triggers.
+     */
+    'page_triggers' => array (
+    	'trigger_page_profile_view_entry', 
+    ),
+
+	/**
+     * Storage objects to automatically delete files from upon module uninstallation.
+     * Note. Don't add storage objects used in transcoder objects.
+     */
+    'storages' => array(
+    ),
+
+	/**
+     * Transcoders.
+     */
+    'transcoders' => array(
+    ),
+
+    /**
+     * Extended Search Forms.
+     */
+    'esearches' => array(
+        'bx_workspaces',
+    	'bx_workspaces_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',
+    ),
+);
+
+/** @} */

+ 30 - 0
modules/boonex/workspaces/install/installer.php

@@ -0,0 +1,30 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Workspaces Workspaces
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxWorkspacesInstaller extends BxBaseModProfileInstaller
+{
+    function __construct($aConfig)
+    {
+        parent::__construct($aConfig);
+    }
+
+    function enable($aParams)
+    {
+        $aResult = parent::enable($aParams);
+
+        if($aResult['result'] && getParam($this->_sParamRelations) == '')
+            setParam($this->_sParamRelations, $this->_aConfig['name'] . '_' . $this->_aConfig['name']);
+
+        return $aResult;
+    }
+}
+
+/** @} */

+ 344 - 0
modules/boonex/workspaces/install/langs/en.xml

@@ -0,0 +1,344 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+
+    <string name="_bx_workspaces"><![CDATA[Workspaces]]></string>
+    <string name="_bx_workspaces_cmts"><![CDATA[Workspaces' Comments]]></string>
+
+    <string name="_bx_workspaces_option_autoapproval"><![CDATA[Activate all workspaces automatically]]></string>
+    <string name="_bx_workspaces_option_default_acl_level"><![CDATA[Default member's level to assign after workspace's profile creation]]></string>
+    <string name="_bx_workspaces_option_enable_profile_activation_letter"><![CDATA[Enable profile activation letter]]></string>
+    <string name="_bx_workspaces_option_redirect_aadd"><![CDATA[Redirect after workspace's profile creation to]]></string>
+    <string name="_bx_workspaces_option_redirect_aadd_profile"><![CDATA[Profile Page]]></string>
+    <string name="_bx_workspaces_option_redirect_aadd_last"><![CDATA[Last Page]]></string>
+    <string name="_bx_workspaces_option_redirect_aadd_custom"><![CDATA[Custom Page]]></string>
+    <string name="_bx_workspaces_option_redirect_aadd_homepage"><![CDATA[Homepage]]></string>
+    <string name="_bx_workspaces_option_redirect_aadd_custom_url"><![CDATA[URL for 'Custom Page' redirect]]></string>
+    <string name="_bx_workspaces_option_activation_on"><![CDATA[After creation & after editing]]></string>
+    <string name="_bx_workspaces_option_activation_add"><![CDATA[After creation only]]></string>
+    <string name="_bx_workspaces_option_activation_edit"><![CDATA[After editing only]]></string>
+    <string name="_bx_workspaces_option_activation_off"><![CDATA[Manual activation]]></string>
+    <string name="_bx_workspaces_option_num_connections_quick"><![CDATA[Number of items in friends block]]></string>
+    <string name="_bx_workspaces_option_per_page_browse"><![CDATA[Number of items per page]]></string>
+    <string name="_bx_workspaces_option_num_rss"><![CDATA[Number of items in RSS feed]]></string>
+    <string name="_bx_workspaces_option_searchable_fields"><![CDATA[Searchable fields for keyword search]]></string>
+    <string name="_bx_workspaces_option_friends"><![CDATA[Friendship]]></string>
+    <string name="_bx_workspaces_option_public_subscriptions"><![CDATA[Public following list]]></string>
+    <string name="_bx_workspaces_option_public_subscribed_me"><![CDATA[Public followers list]]></string>
+
+    <string name="_bx_workspaces_form_profile"><![CDATA[Workspaces]]></string>
+    <string name="_bx_workspaces_form_profile_display_add"><![CDATA[Add Workspace]]></string>
+    <string name="_bx_workspaces_form_profile_display_edit"><![CDATA[Edit Workspace]]></string>
+    <string name="_bx_workspaces_form_profile_display_edit_cover"><![CDATA[Edit Cover]]></string>
+    <string name="_bx_workspaces_form_profile_display_delete"><![CDATA[Delete Workspace]]></string>
+    <string name="_bx_workspaces_form_profile_display_view"><![CDATA[View Workspace]]></string>
+    <string name="_bx_workspaces_form_profile_display_view_full"><![CDATA[Full View Workspace]]></string>
+    <string name="_bx_workspaces_form_profile_input_sys_do_submit"><![CDATA[Submit]]></string>
+    <string name="_bx_workspaces_form_profile_input_submit"><![CDATA[Submit]]></string>
+    <string name="_bx_workspaces_form_profile_input_sys_allow_view_to"><![CDATA[Visible to]]></string>
+    <string name="_bx_workspaces_form_profile_input_allow_view_to"><![CDATA[Visible to]]></string>
+    <string name="_bx_workspaces_form_profile_input_sys_allow_post_to"><![CDATA[Who can post to my profile]]></string>
+    <string name="_bx_workspaces_form_profile_input_allow_post_to"><![CDATA[Who can post to my profile]]></string>
+    <string name="_bx_workspaces_form_profile_input_sys_allow_contact_to"><![CDATA[Who can contact me]]></string>
+    <string name="_bx_workspaces_form_profile_input_allow_contact_to"><![CDATA[Who can contact me]]></string>
+    <string name="_bx_workspaces_form_profile_input_sys_fullname"><![CDATA[Name]]></string>
+    <string name="_bx_workspaces_form_profile_input_fullname"><![CDATA[Name]]></string>
+    <string name="_bx_workspaces_form_profile_input_sys_last_name"><![CDATA[Last Name]]></string>
+    <string name="_bx_workspaces_form_profile_input_last_name"><![CDATA[Last Name]]></string>
+    <string name="_bx_workspaces_form_profile_input_fullname_err"><![CDATA[Profile name is mandatory and and cannot start with @]]></string>
+    <string name="_bx_workspaces_form_profile_input_sys_desc"><![CDATA[Description]]></string>
+    <string name="_bx_workspaces_form_profile_input_desc"><![CDATA[Description]]></string>
+    <string name="_bx_workspaces_form_profile_input_sys_picture"><![CDATA[Profile Picture]]></string>
+    <string name="_bx_workspaces_form_profile_input_picture"><![CDATA[Upload a profile picture]]></string>
+    <string name="_bx_workspaces_form_profile_input_picture_err"><![CDATA[Profile picture is mandatory.]]></string>
+    <string name="_bx_workspaces_form_profile_input_picture_search"><![CDATA[With photo]]></string>
+    <string name="_bx_workspaces_form_profile_input_online_search"><![CDATA[Online only]]></string>
+    <string name="_bx_workspaces_form_profile_input_sys_cover"><![CDATA[Cover Picture]]></string>
+    <string name="_bx_workspaces_form_profile_input_cover"><![CDATA[Upload New Cover Picture]]></string>
+    <string name="_bx_workspaces_form_profile_input_sys_delete_confirm"><![CDATA[Delete confirmation]]></string>
+    <string name="_bx_workspaces_form_profile_input_delete_confirm"><![CDATA[I am sure I want to delete this profile]]></string>
+    <string name="_bx_workspaces_form_profile_input_delete_confirm_info"><![CDATA[This action can not be undone.]]></string>
+    <string name="_bx_workspaces_form_profile_input_delete_confirm_error"><![CDATA[Please check this checkbox if you really want to delete your profile.]]></string>
+    <string name="_bx_workspaces_form_profile_input_sys_profile_email"><![CDATA[Email]]></string>
+    <string name="_bx_workspaces_form_profile_input_profile_email"><![CDATA[Email]]></string>
+    <string name="_bx_workspaces_form_profile_input_sys_profile_status"><![CDATA[Status]]></string>
+    <string name="_bx_workspaces_form_profile_input_profile_status"><![CDATA[Status]]></string>
+    <string name="_bx_workspaces_form_profile_input_sys_profile_ip"><![CDATA[IP]]></string>
+    <string name="_bx_workspaces_form_profile_input_profile_ip"><![CDATA[IP]]></string>
+    <string name="_bx_workspaces_form_profile_input_sys_profile_last_active"><![CDATA[Last account activity]]></string>
+    <string name="_bx_workspaces_form_profile_input_profile_last_active"><![CDATA[Last account activity]]></string>
+    <string name="_bx_workspaces_form_profile_input_sys_date_added"><![CDATA[Added]]></string>
+    <string name="_bx_workspaces_form_profile_input_date_added"><![CDATA[Added]]></string>
+    <string name="_bx_workspaces_form_profile_input_sys_date_changed"><![CDATA[Updated]]></string>
+    <string name="_bx_workspaces_form_profile_input_date_changed"><![CDATA[Updated]]></string>
+    <string name="_bx_workspaces_form_profile_input_sys_friends_count"><![CDATA[Friends count]]></string>
+    <string name="_bx_workspaces_form_profile_input_friends_count"><![CDATA[Friends count]]></string>
+    <string name="_bx_workspaces_form_profile_input_sys_followers_count"><![CDATA[Followers count]]></string>
+    <string name="_bx_workspaces_form_profile_input_followers_count"><![CDATA[Followers count]]></string>
+
+	<string name="_bx_workspaces_acl_action_create_profile"><![CDATA[Create Workspace's Profile]]></string>
+	<string name="_bx_workspaces_acl_action_delete_profile"><![CDATA[Delete Workspace's Profile]]></string>
+	<string name="_bx_workspaces_acl_action_view_profile"><![CDATA[View Workspace's Profile]]></string>
+	<string name="_bx_workspaces_acl_action_edit_any_profile"><![CDATA[Edit Any Workspace's Profile]]></string>
+	<string name="_bx_workspaces_acl_action_delete_any_profile"><![CDATA[Delete Any Workspace's Profile]]></string>
+
+	<string name="_bx_workspaces_page_title_sys_create_profile"><![CDATA[Create a Profile - Workspace]]></string>
+	<string name="_bx_workspaces_page_title_create_profile"><![CDATA[Create a Profile - Workspace]]></string>
+	<string name="_bx_workspaces_page_title_sys_edit_profile"><![CDATA[Edit Profile]]></string>
+	<string name="_bx_workspaces_page_title_edit_profile"><![CDATA[Edit Profile]]></string>
+	<string name="_bx_workspaces_page_title_sys_edit_profile_cover"><![CDATA[Edit Cover]]></string>
+	<string name="_bx_workspaces_page_title_edit_profile_cover"><![CDATA[Edit Cover]]></string>
+	<string name="_bx_workspaces_page_title_sys_delete_profile"><![CDATA[Delete Profile]]></string>
+	<string name="_bx_workspaces_page_title_delete_profile"><![CDATA[Delete Profile]]></string>
+    <string name="_bx_workspaces_page_title_sys_view_profile"><![CDATA[View Profile]]></string>
+    <string name="_bx_workspaces_page_title_sys_view_profile_closed"><![CDATA[View Profile with Limited Visibility]]></string>
+	<string name="_bx_workspaces_page_title_view_profile"><![CDATA[{display_name}]]></string>
+	<string name="_bx_workspaces_page_title_browse"><![CDATA[People]]></string>
+	<string name="_bx_workspaces_page_title_browse_featured"><![CDATA[Featured People]]></string>
+	<string name="_bx_workspaces_page_title_browse_active"><![CDATA[Active People]]></string>
+	<string name="_bx_workspaces_page_title_browse_online"><![CDATA[Online People]]></string>
+	<string name="_bx_workspaces_page_title_browse_recent"><![CDATA[New People]]></string>
+	<string name="_bx_workspaces_page_title_browse_connections"><![CDATA[{0} connections]]></string>
+	<string name="_bx_workspaces_page_title_browse_connections_mutual"><![CDATA[{0} and {1} mutual connections]]></string>
+        <string name="_bx_workspaces_page_title_browse_familiar"><![CDATA[People You May Know]]></string>
+	<string name="_bx_workspaces_page_title_browse_favorites"><![CDATA[{0} favorites]]></string>
+	<string name="_bx_workspaces_page_title_browse_by_acl"><![CDATA[{0} People]]></string>
+	<string name="_bx_workspaces_page_title_browse_by_cmts"><![CDATA[People's Comments]]></string>
+	<string name="_bx_workspaces_page_title_sys_profile_favorites"><![CDATA[Favorite workspaces]]></string>
+	<string name="_bx_workspaces_page_title_profile_favorites"><![CDATA[Favorite workspaces]]></string>
+	<string name="_bx_workspaces_page_title_sys_profile_friends"><![CDATA[Friends]]></string>
+	<string name="_bx_workspaces_page_title_profile_friends"><![CDATA[Friends]]></string>
+	<string name="_bx_workspaces_page_title_sys_friend_requests"><![CDATA[Friend Requests]]></string>
+	<string name="_bx_workspaces_page_title_friend_requests"><![CDATA[Friend Requests]]></string>
+	<string name="_bx_workspaces_page_title_sys_profile_subscriptions"><![CDATA[Following]]></string>
+    <string name="_bx_workspaces_page_title_profile_subscriptions"><![CDATA[Following & Followers]]></string>
+    <string name="_bx_workspaces_page_title_sys_profile_relations"><![CDATA[Relationships]]></string>
+    <string name="_bx_workspaces_page_title_profile_relations"><![CDATA[Relationships]]></string>
+    <string name="_bx_workspaces_page_title_sys_profile_comments"><![CDATA[Comments]]></string>
+    <string name="_bx_workspaces_page_title_profile_comments"><![CDATA[Comments]]></string>
+	<string name="_bx_workspaces_page_title_sys_profile_info"><![CDATA[Profile Info]]></string>
+	<string name="_bx_workspaces_page_title_profile_info"><![CDATA[Info about {display_name}]]></string>
+	<string name="_bx_workspaces_page_title_sys_recent"><![CDATA[New People]]></string>
+	<string name="_bx_workspaces_page_title_recent"><![CDATA[New People]]></string>
+	<string name="_bx_workspaces_page_title_sys_manage"><![CDATA[Manage Own People]]></string>
+	<string name="_bx_workspaces_page_title_sys_manage_administration"><![CDATA[Manage All People]]></string>
+	<string name="_bx_workspaces_page_title_manage"><![CDATA[Manage People]]></string>
+	<string name="_bx_workspaces_page_title_sys_active"><![CDATA[Active People]]></string>
+	<string name="_bx_workspaces_page_title_active"><![CDATA[Active People]]></string>
+	<string name="_bx_workspaces_page_title_sys_online"><![CDATA[Online People]]></string>
+	<string name="_bx_workspaces_page_title_online"><![CDATA[Online People]]></string>
+	<string name="_bx_workspaces_page_title_sys_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_workspaces_page_title_entries_search"><![CDATA[Search]]></string>
+
+    <string name="_bx_workspaces_page_block_title_profile_private"><![CDATA[Private Profile]]></string>
+    <string name="_bx_workspaces_page_block_title_choose_type"><![CDATA[Choose Profile Type]]></string>
+    <string name="_bx_workspaces_page_block_title_create_profile"><![CDATA[Create a Profile - Workspace]]></string>
+    <string name="_bx_workspaces_page_block_title_edit_profile"><![CDATA[Edit Profile]]></string>
+    <string name="_bx_workspaces_page_block_title_edit_profile_cover"><![CDATA[Edit Cover]]></string>
+    <string name="_bx_workspaces_page_block_title_delete_profile"><![CDATA[Delete Profile]]></string>
+    <string name="_bx_workspaces_page_block_title_profile_all_actions"><![CDATA[All Actions]]></string>
+    <string name="_bx_workspaces_page_block_title_profile_info_link"><![CDATA[About <a href="{profile_link}">{display_name}</a>]]></string>
+    <string name="_bx_workspaces_page_block_title_profile_info"><![CDATA[Info]]></string>
+    <string name="_bx_workspaces_page_block_title_system_profile_info"><![CDATA[Info]]></string>
+    <string name="_bx_workspaces_page_block_title_profile_membership"><![CDATA[Membership]]></string>
+    <string name="_bx_workspaces_page_block_title_system_profile_membership"><![CDATA[Membership]]></string>
+    <string name="_bx_workspaces_page_block_title_profile_description"><![CDATA[Description]]></string>
+    <string name="_bx_workspaces_page_block_title_profile_favorites"><![CDATA[Favorite workspaces]]></string>
+    <string name="_bx_workspaces_page_block_title_system_profile_favorites"><![CDATA[Favorite workspaces]]></string>
+    <string name="_bx_workspaces_page_block_title_profile_friends_link"><![CDATA[Friends of <a href="{profile_link}">{display_name}</a>]]></string>
+    <string name="_bx_workspaces_page_block_title_profile_friends"><![CDATA[Friends]]></string>
+    <string name="_bx_workspaces_page_block_title_profile_friends_mutual"><![CDATA[Mutual Friends]]></string>
+    <string name="_bx_workspaces_page_block_title_system_profile_friends"><![CDATA[Friends]]></string>
+    <string name="_bx_workspaces_page_block_title_friend_requests_link"><![CDATA[Friend Requests for <a href="{profile_link}">{display_name}</a>]]></string>
+    <string name="_bx_workspaces_page_block_title_system_friend_requests"><![CDATA[Friend Requests]]></string>
+    <string name="_bx_workspaces_page_block_title_profile_location"><![CDATA[Location]]></string>
+    <string name="_bx_workspaces_page_block_title_system_profile_subscriptions"><![CDATA[Following]]></string>
+    <string name="_bx_workspaces_page_block_title_profile_subscriptions"><![CDATA[Following]]></string>
+    <string name="_bx_workspaces_page_block_title_system_profile_subscribed_me"><![CDATA[Followers]]></string>
+    <string name="_bx_workspaces_page_block_title_profile_subscribed_me"><![CDATA[Followers]]></string>
+    <string name="_bx_workspaces_page_block_title_system_profile_relations"><![CDATA[Relationships]]></string>
+    <string name="_bx_workspaces_page_block_title_profile_relations"><![CDATA[Relationships]]></string>
+    <string name="_bx_workspaces_page_block_title_system_profile_related_me"><![CDATA[Relationships with Me]]></string>
+    <string name="_bx_workspaces_page_block_title_profile_related_me"><![CDATA[Relationships with Me]]></string>
+    <string name="_bx_workspaces_page_block_title_profile_comments"><![CDATA[Comments]]></string>
+    <string name="_bx_workspaces_page_block_title_entry_reports"><![CDATA[Reports]]></string>
+    <string name="_bx_workspaces_page_block_title_profile_comments_link"><![CDATA[Comments to <a href="{entry_link}">{title}</a>]]></string>
+    <string name="_bx_workspaces_page_block_title_featured_profiles"><![CDATA[Featured People]]></string>
+    <string name="_bx_workspaces_page_block_title_profile_actions"><![CDATA[Actions]]></string>
+    <string name="_bx_workspaces_page_block_title_profile_calendar"><![CDATA[Calendar]]></string>
+    <string name="_bx_workspaces_page_block_title_latest_profiles"><![CDATA[New People]]></string>
+    <string name="_bx_workspaces_page_block_title_system_manage"><![CDATA[Manage Own People]]></string>
+    <string name="_bx_workspaces_page_block_title_system_manage_administration"><![CDATA[Manage All People]]></string>
+    <string name="_bx_workspaces_page_block_title_manage"><![CDATA[Manage People]]></string>
+    <string name="_bx_workspaces_page_block_title_sys_active_profiles"><![CDATA[Active People]]></string>
+    <string name="_bx_workspaces_page_block_title_active_profiles"><![CDATA[Active People]]></string>
+    <string name="_bx_workspaces_page_block_title_online_profiles"><![CDATA[Online People]]></string>
+    <string name="_bx_workspaces_page_block_title_sys_familiar_profiles"><![CDATA[Familiar People]]></string>
+    <string name="_bx_workspaces_page_block_title_familiar_profiles"><![CDATA[People You May Know]]></string>
+    <string name="_bx_workspaces_page_block_title_search_form"><![CDATA[Search Form]]></string>
+    <string name="_bx_workspaces_page_block_title_search_results"><![CDATA[Search Results]]></string>
+    <string name="_bx_workspaces_page_block_title_search_form_cmts"><![CDATA[Comments Search Form]]></string>
+    <string name="_bx_workspaces_page_block_title_search_results_cmts"><![CDATA[Comments Search Results]]></string>
+    <string name="_bx_workspaces_page_block_title_sys_featured_entries_view_showcase"><![CDATA[Featured People (Showcase View)]]></string>
+    <string name="_bx_workspaces_page_block_title_featured_entries_view_showcase"><![CDATA[Featured People]]></string>
+    <string name="_bx_workspaces_page_block_title_sys_recommended_entries_view_showcase"><![CDATA[Recommended People (Showcase View)]]></string>
+    <string name="_bx_workspaces_page_block_title_recommended_entries_view_showcase"><![CDATA[Recommended People]]></string>
+    <string name="_bx_workspaces_page_block_title_sys_active_entries_view_showcase"><![CDATA[Active People (Showcase View)]]></string>
+    <string name="_bx_workspaces_page_block_title_active_entries_view_showcase"><![CDATA[Active People]]></string>
+    <string name="_bx_workspaces_page_block_title_sys_cover_block"><![CDATA[Cover]]></string>
+    <string name="_bx_workspaces_page_block_title_cover_block"><![CDATA[Cover]]></string>
+
+    <string name="_bx_workspaces_menu_title_submenu"><![CDATA[Workspaces Submenu]]></string>
+    <string name="_bx_workspaces_menu_set_title_submenu"><![CDATA[Workspaces Submenu]]></string>
+    <string name="_bx_workspaces_menu_set_title_view_profile_actions"><![CDATA[Workspace Actions]]></string>
+    <string name="_bx_workspaces_menu_title_view_profile_actions"><![CDATA[Workspace Actions]]></string>
+    <string name="_bx_workspaces_menu_set_title_view_profile_actions_more"><![CDATA[Workspace More Actions]]></string>
+    <string name="_bx_workspaces_menu_title_view_profile_actions_more"><![CDATA[Workspace More Actions]]></string>
+    <string name="_bx_workspaces_menu_title_view_profile_meta"><![CDATA[Workspace Meta]]></string>
+    <string name="_bx_workspaces_menu_set_title_view_profile_meta"><![CDATA[Workspace Meta]]></string>
+    <string name="_bx_workspaces_menu_set_title_view_profile_submenu"><![CDATA[View Workspace Submenu]]></string>
+    <string name="_bx_workspaces_menu_title_view_profile_submenu"><![CDATA[View Workspace Submenu]]></string>
+    <string name="_bx_workspaces_menu_set_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string>
+    <string name="_bx_workspaces_menu_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_delete_with_content"><![CDATA[Delete with Data]]></string>
+    <string name="_bx_workspaces_menu_item_title_delete_with_content"><![CDATA[Delete with Data]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_clear_reports"><![CDATA[Clear reports]]></string>
+    <string name="_bx_workspaces_menu_item_title_clear_reports"><![CDATA[Clear reports]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_manage_cf"><![CDATA[Manage audience]]></string>
+    <string name="_bx_workspaces_menu_item_title_manage_cf"><![CDATA[Manage audience]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_edit_cover"><![CDATA[Edit Cover]]></string>
+    <string name="_bx_workspaces_menu_item_title_edit_cover"><![CDATA[Edit Cover]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_edit_profile"><![CDATA[Edit Workspace]]></string>
+    <string name="_bx_workspaces_menu_item_title_edit_profile"><![CDATA[Edit Profile]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_delete_profile"><![CDATA[Delete Profile and Data]]></string>
+    <string name="_bx_workspaces_menu_item_title_delete_profile"><![CDATA[Delete Profile and Data]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_delete_account"><![CDATA[Delete Account]]></string>
+    <string name="_bx_workspaces_menu_item_title_delete_account"><![CDATA[Delete Account]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_delete_account_content"><![CDATA[Delete Account and Data]]></string>
+    <string name="_bx_workspaces_menu_item_title_delete_account_content"><![CDATA[Delete Account and Data]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_profile_type"><![CDATA[Workspace]]></string>
+    <string name="_bx_workspaces_menu_item_title_profile_type"><![CDATA[Workspace]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_create_profile"><![CDATA[Workspace]]></string>
+    <string name="_bx_workspaces_menu_item_title_create_profile"><![CDATA[Workspace]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_view_profile_friends"><![CDATA[Friends]]></string>
+    <string name="_bx_workspaces_menu_item_title_view_profile_friends"><![CDATA[Friends]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_view_profile_relations"><![CDATA[Relationships]]></string>
+    <string name="_bx_workspaces_menu_item_title_view_profile_relations"><![CDATA[Relationships]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_view_profile_subscriptions"><![CDATA[Following]]></string>
+    <string name="_bx_workspaces_menu_item_title_view_profile_subscriptions"><![CDATA[Following]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_view_profile_comments"><![CDATA[Comments]]></string>
+    <string name="_bx_workspaces_menu_item_title_view_profile_comments"><![CDATA[Comments]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_view_profile_info"><![CDATA[Info]]></string>
+    <string name="_bx_workspaces_menu_item_title_view_profile_info"><![CDATA[Info]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_view_profile_view"><![CDATA[Profile]]></string>
+    <string name="_bx_workspaces_menu_item_title_view_profile_view"><![CDATA[Profile]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_view_profile_more_auto"><![CDATA[More]]></string>
+    <string name="_bx_workspaces_menu_item_title_view_profile_more_auto"><![CDATA[More]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_befriend"><![CDATA[Add friend]]></string>
+    <string name="_bx_workspaces_menu_item_title_befriend"><![CDATA[Add friend]]></string>
+    <string name="_bx_workspaces_menu_item_title_befriend_sent"><![CDATA[Add friend (requested)]]></string>
+    <string name="_bx_workspaces_menu_item_title_befriend_confirm"><![CDATA[Accept friend request]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_unfriend"><![CDATA[Unfriend]]></string>
+    <string name="_bx_workspaces_menu_item_title_unfriend"><![CDATA[Unfriend]]></string>
+    <string name="_bx_workspaces_menu_item_title_unfriend_cancel_request"><![CDATA[Cancel friend request]]></string>
+    <string name="_bx_workspaces_menu_item_title_unfriend_reject_request"><![CDATA[Reject friend request]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_subscribe"><![CDATA[Follow]]></string>
+    <string name="_bx_workspaces_menu_item_title_subscribe"><![CDATA[Follow]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_unsubscribe"><![CDATA[Unfollow]]></string>
+    <string name="_bx_workspaces_menu_item_title_unsubscribe"><![CDATA[Unfollow]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_relation_add"><![CDATA[Add Relationship]]></string>
+    <string name="_bx_workspaces_menu_item_title_relation_add"><![CDATA[Add Relationship]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_relation_delete"><![CDATA[Remove Relationship]]></string>
+    <string name="_bx_workspaces_menu_item_title_relation_delete"><![CDATA[Remove Relationship]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_more_actions"><![CDATA[More Actions]]></string>
+    <string name="_bx_workspaces_menu_item_title_more_actions"><![CDATA[]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_friends"><![CDATA[Friends]]></string>
+    <string name="_bx_workspaces_menu_item_title_friends"><![CDATA[Friends]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_relations"><![CDATA[Relationships]]></string>
+    <string name="_bx_workspaces_menu_item_title_relations"><![CDATA[Relationships]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_friend_requests"><![CDATA[Friend requests number]]></string>
+    <string name="_bx_workspaces_menu_item_title_friend_requests"><![CDATA[Friend requests]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_manage_my_profiles"><![CDATA[My profiles]]></string>
+    <string name="_bx_workspaces_menu_item_title_manage_my_profiles"><![CDATA[Profiles]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_favorites"><![CDATA[Favorite Workspaces]]></string>
+    <string name="_bx_workspaces_menu_item_title_favorites"><![CDATA[Favorite workspaces]]></string>    
+    <string name="_bx_workspaces_menu_item_title_system_subscriptions"><![CDATA[Following]]></string>
+    <string name="_bx_workspaces_menu_item_title_subscriptions"><![CDATA[Following]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_subscribed_me"><![CDATA[Followers]]></string>
+    <string name="_bx_workspaces_menu_item_title_subscribed_me"><![CDATA[Followers]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_relations"><![CDATA[Relationships]]></string>
+    <string name="_bx_workspaces_menu_item_title_relations"><![CDATA[Relationships]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_related_me"><![CDATA[Relationships with Me]]></string>
+    <string name="_bx_workspaces_menu_item_title_related_me"><![CDATA[Relationships with Me]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_followings"><![CDATA[Workspaces]]></string>
+    <string name="_bx_workspaces_menu_item_title_followings"><![CDATA[Workspaces]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_entries_recent"><![CDATA[New]]></string>
+    <string name="_bx_workspaces_menu_item_title_entries_recent"><![CDATA[New]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_workspaces_menu_item_title_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_entries_manage"><![CDATA[Manage]]></string>
+    <string name="_bx_workspaces_menu_item_title_entries_manage"><![CDATA[Manage]]></string>
+    <string name="_bx_workspaces_menu_item_title_system_entries_home"><![CDATA[Workspaces]]></string>
+    <string name="_bx_workspaces_menu_item_title_entries_home"><![CDATA[People]]></string>
+	<string name="_bx_workspaces_menu_item_title_system_admt_workspaces"><![CDATA[Profiles]]></string>
+	<string name="_bx_workspaces_menu_item_title_admt_workspaces"><![CDATA[Profiles]]></string>
+	<string name="_bx_workspaces_menu_item_title_manage_my"><![CDATA[My Profiles]]></string>
+	<string name="_bx_workspaces_menu_item_title_manage_all"><![CDATA[All Profiles]]></string>   
+	<string name="_bx_workspaces_menu_item_title_system_entries_active"><![CDATA[Active]]></string>
+	<string name="_bx_workspaces_menu_item_title_entries_active"><![CDATA[Active]]></string>
+	<string name="_bx_workspaces_menu_item_title_system_entries_online"><![CDATA[Online]]></string>
+	<string name="_bx_workspaces_menu_item_title_entries_online"><![CDATA[Online]]></string>
+
+    <string name="_bx_workspaces_grid_filter_item_title_adm_select_one_filter1"><![CDATA[All Statuses]]></string>
+    <string name="_bx_workspaces_grid_filter_item_title_adm_select_one_filter2"><![CDATA[All]]></string>
+    <string name="_bx_workspaces_grid_filter_item_title_adm_active"><![CDATA[Active]]></string>
+    <string name="_bx_workspaces_grid_filter_item_title_adm_pending"><![CDATA[Pending]]></string>
+    <string name="_bx_workspaces_grid_filter_item_title_adm_suspended"><![CDATA[Suspended]]></string>
+    <string name="_bx_workspaces_grid_filter_item_title_adm_unconfirmed"><![CDATA[Unconfirmed]]></string>
+    <string name="_bx_workspaces_grid_column_title_adm_active"><![CDATA[Active]]></string>
+    <string name="_bx_workspaces_grid_column_title_adm_fullname"><![CDATA[Name]]></string>
+    <string name="_bx_workspaces_grid_column_title_adm_last_online"><![CDATA[Last Logged]]></string>
+    <string name="_bx_workspaces_grid_column_title_adm_account"><![CDATA[Account]]></string>
+    <string name="_bx_workspaces_grid_action_title_adm_delete_with_content"><![CDATA[Delete With Content]]></string>
+    <string name="_bx_workspaces_grid_action_title_adm_clear_reports"><![CDATA[Clear reports]]></string>
+    <string name="_bx_workspaces_grid_action_title_adm_set_acl_level"><![CDATA[Set Membership]]></string>
+    <string name="_bx_workspaces_grid_action_title_adm_more_actions"><![CDATA[More Actions]]></string>
+    <string name="_bx_workspaces_grid_action_title_adm_audit_content"><![CDATA[Audit actions with profile]]></string>
+    <string name="_bx_workspaces_grid_action_title_adm_audit_profile"><![CDATA[Audit profile actions]]></string>
+    <string name="_bx_workspaces_grid_action_title_adm_manage_cf"><![CDATA[Manage audience]]></string>
+    
+    <string name="_bx_workspaces_grid_action_err_delete"><![CDATA[Cannot delete the selected workspace(s).]]></string>
+    <string name="_bx_workspaces_grid_txt_account_manager"><![CDATA[Redirect to manage account.]]></string>
+
+    <string name="_bx_workspaces_chart_growth"><![CDATA[Workspaces: Growth]]></string>
+    <string name="_bx_workspaces_chart_growth_speed"><![CDATA[Workspaces: Growth Speed]]></string>
+
+    <string name="_bx_workspaces_search_extended"><![CDATA[Workspaces Search]]></string>
+    <string name="_bx_workspaces_search_extended_cmts"><![CDATA[Workspaces Comments Search]]></string>
+
+    <string name="_bx_workspaces_alert_action_profile_cover_changed"><![CDATA[cover changed]]></string>
+    <string name="_bx_workspaces_alert_action_profile_picture_changed"><![CDATA[picture changed]]></string>
+
+    <string name="_bx_workspaces_txt_account_pending"><![CDATA[This profile is pending approval, please wait until it is activated.]]></string>
+    <string name="_bx_workspaces_txt_account_pending_moderation"><![CDATA[This <a href="{0}">profile</a> is pending approval.]]></string>
+    <string name="_bx_workspaces_txt_account_suspended"><![CDATA[This profile is suspended.]]></string>
+    <string name="_bx_workspaces_txt_account_suspended_moderation"><![CDATA[This <a href="{0}">profile</a> is suspended.]]></string>
+    <string name="_bx_workspaces_txt_N_friends"><![CDATA[{0} friends]]></string>
+    <string name="_bx_workspaces_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> profile timeline]]></string>
+    <string name="_bx_workspaces_txt_sample_single"><![CDATA[workspace]]></string>
+    <string name="_bx_workspaces_txt_sample_comment_single"><![CDATA[comment to workspace]]></string>
+    <string name="_bx_workspaces_txt_sample_vote_single"><![CDATA[vote to workspace]]></string>
+    <string name="_bx_workspaces_txt_sample_score_up_single"><![CDATA[score up vote to workspace]]></string>
+    <string name="_bx_workspaces_txt_sample_score_down_single"><![CDATA[score down vote to workspace]]></string>
+    <string name="_bx_workspaces_txt_sample_pp_single"><![CDATA[profile picture]]></string>
+    <string name="_bx_workspaces_txt_sample_pp_single_with_article"><![CDATA[a profile picture]]></string>
+    <string name="_bx_workspaces_txt_sample_pc_single"><![CDATA[profile cover]]></string>
+    <string name="_bx_workspaces_txt_sample_pc_single_with_article"><![CDATA[a profile cover]]></string>
+    <string name="_bx_workspaces_txt_sample_pi_action"><![CDATA[changed {0}]]></string>
+    <string name="_bx_workspaces_txt_sample_pi_action_user"><![CDATA[{0} changed {1}]]></string>
+
+    <string name="_bx_workspaces_email_friend_request"><![CDATA[Friend request]]></string>
+    <string name="_bx_workspaces_email_friend_request_subject"><![CDATA[Friendship Request]]></string>
+    <string name="_bx_workspaces_email_friend_request_body"><![CDATA[{email_header}
+<p><a href="{SenderUrl}">{SenderDisplayName}</a> wants to be friends with you. <a href="{FriendsLink}">Respond</a>.</p>
+{email_footer}]]></string>
+</resources>

+ 57 - 0
modules/boonex/workspaces/install/sql/disable.sql

@@ -0,0 +1,57 @@
+
+-- SETTINGS
+
+SET @iTypeId = (SELECT `ID` FROM `sys_options_types` WHERE `name` = 'bx_workspaces' LIMIT 1);
+SET @iCategId = (SELECT `ID` FROM `sys_options_categories` WHERE `type_id` = @iTypeId LIMIT 1);
+DELETE FROM `sys_options` WHERE `category_id` = @iCategId;
+DELETE FROM `sys_options_categories` WHERE `type_id` = @iTypeId;
+DELETE FROM `sys_options_types` WHERE `id` = @iTypeId;
+
+-- PAGES
+
+DELETE FROM `sys_objects_page` WHERE `module` = 'bx_workspaces';
+DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_workspaces' OR `object` IN('bx_workspaces_create_profile', 'bx_workspaces_delete_profile', 'bx_workspaces_edit_profile', 'bx_workspaces_edit_profile_cover', 'bx_workspaces_view_profile', 'bx_workspaces_view_profile_closed', 'bx_workspaces_profile_info', 'bx_workspaces_profile_friends', 'bx_workspaces_friend_requests', 'bx_workspaces_profile_favorites', 'bx_workspaces_profile_subscriptions', 'bx_workspaces_profile_comments', 'bx_workspaces_home', 'bx_workspaces_search', 'bx_workspaces_manage');
+
+-- MENU
+
+DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_workspaces';
+DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_workspaces';
+DELETE FROM `sys_menu_items` WHERE `module` = 'bx_workspaces' OR `set_name` IN('bx_workspaces_view_submenu', 'bx_workspaces_submenu', 'bx_workspaces_view_actions', 'bx_workspaces_view_actions_more', 'bx_workspaces_view_actions_all', 'bx_workspaces_view_meta', 'bx_workspaces_snippet_meta', 'bx_workspaces_menu_manage_tools');
+
+-- ACL
+DELETE `sys_acl_actions`, `sys_acl_matrix` FROM `sys_acl_actions`, `sys_acl_matrix` WHERE `sys_acl_matrix`.`IDAction` = `sys_acl_actions`.`ID` AND `sys_acl_actions`.`Module` = 'bx_workspaces';
+DELETE FROM `sys_acl_actions` WHERE `Module` = 'bx_workspaces';
+
+-- METATAGS
+DELETE FROM `sys_objects_metatags` WHERE `object` = 'bx_workspaces';
+
+-- SEARCH
+DELETE FROM `sys_objects_search` WHERE `ObjectName` IN ('bx_workspaces', 'bx_workspaces_cmts');
+
+-- STATS
+DELETE FROM `sys_statistics` WHERE `name` LIKE 'bx_workspaces%';
+
+-- CHARTS
+DELETE FROM `sys_objects_chart` WHERE `object` LIKE 'bx_workspaces%';
+
+-- GRIDS
+DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_workspaces_administration', 'bx_workspaces_common');
+DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_workspaces_administration', 'bx_workspaces_common');
+DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_workspaces_administration', 'bx_workspaces_common');
+
+-- LIVE UPDATES
+DELETE FROM `sys_objects_live_updates` WHERE `name` LIKE 'bx_workspaces%';
+
+-- ALERTS
+SET @iHandler := (SELECT `id` FROM `sys_alerts_handlers` WHERE `name` = 'bx_workspaces' LIMIT 1);
+DELETE FROM `sys_alerts` WHERE `handler_id` = @iHandler;
+DELETE FROM `sys_alerts_handlers` WHERE `id` = @iHandler;
+
+-- PRIVACY 
+DELETE FROM `sys_objects_privacy` WHERE `object` IN ('bx_workspaces_allow_view_to', 'bx_workspaces_allow_post_to', 'bx_workspaces_allow_contact_to');
+
+-- EMAIL TEMPLATES
+DELETE FROM `sys_email_templates` WHERE `Module` = 'bx_workspaces';
+
+-- UPLOADERS
+DELETE FROM `sys_objects_uploader` WHERE `object` IN ('bx_workspaces_cover_crop', 'bx_workspaces_picture_crop');

+ 563 - 0
modules/boonex/workspaces/install/sql/enable.sql

@@ -0,0 +1,563 @@
+
+-- 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_workspaces', '_bx_workspaces', 'bx_workspaces@modules/boonex/workspaces/|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_workspaces', '_bx_workspaces', 1);
+SET @iCategId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
+('bx_workspaces_autoapproval', 'on', @iCategId, '_bx_workspaces_option_autoapproval', 'select', 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:22:"get_options_activation";}', '', '', 1),
+('bx_workspaces_default_acl_level', '3', @iCategId, '_bx_workspaces_option_default_acl_level', 'select', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:15:"get_memberships";s:6:"params";a:4:{s:11:"purchasable";b:0;s:6:"active";b:1;s:9:"translate";b:1;s:22:"filter_out_auto_levels";b:1;}s:5:"class";s:16:"TemplAclServices";}', '', '', 2),
+('bx_workspaces_redirect_aadd', 'profile', @iCategId, '_bx_workspaces_option_redirect_aadd', 'select', 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:30:"get_options_redirect_after_add";}', '', '', 3),
+('bx_workspaces_redirect_aadd_custom_url', '', @iCategId, '_bx_workspaces_option_redirect_aadd_custom_url', 'digit', '', '', '', 4),
+('bx_workspaces_num_connections_quick', '6', @iCategId, '_bx_workspaces_option_num_connections_quick', 'digit', '', '', '', 10),
+('bx_workspaces_per_page_browse', '24', @iCategId, '_bx_workspaces_option_per_page_browse', 'digit', '', '', '', 11),
+('bx_workspaces_num_rss', '10', @iCategId, '_bx_workspaces_option_num_rss', 'digit', '', '', '', 12),
+('bx_workspaces_per_page_browse_showcase', '32', @iCategId, '_sys_option_per_page_browse_showcase', 'digit', '', '', '', 15),
+('bx_workspaces_per_page_browse_recommended', '10', @iCategId, '_sys_option_per_page_browse_recommended', 'digit', '', '', '', 16),
+('bx_workspaces_searchable_fields', 'fullname,description', @iCategId, '_bx_workspaces_option_searchable_fields', 'list', 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:21:"get_searchable_fields";}', '', '', 20),
+('bx_workspaces_friends', 'on', @iCategId, '_bx_workspaces_option_friends', 'checkbox', '', '', '', 30),
+('bx_workspaces_public_subscriptions', '', @iCategId, '_bx_workspaces_option_public_subscriptions', 'checkbox', '', '', '', 35),
+('bx_workspaces_public_subscribed_me', '', @iCategId, '_bx_workspaces_option_public_subscribed_me', 'checkbox', '', '', '', 36),
+('bx_workspaces_enable_profile_activation_letter', 'on', @iCategId, '_bx_workspaces_option_enable_profile_activation_letter', 'checkbox', '', '', '', 40);
+
+-- 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_workspaces_create_profile', 'create-workspaces-profile', '_bx_workspaces_page_title_sys_create_profile', '_bx_workspaces_page_title_create_profile', 'bx_workspaces', 5, 2147483647, 1, 'page.php?i=create-workspaces-profile', '', '', '', 0, 1, 0, '', '');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_workspaces_create_profile', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_choose_type', 11, 2147483647, 'menu', 'sys_add_profile_vertical', 0, 1, 0, 0),
+('bx_workspaces_create_profile', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_create_profile', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:13:\"entity_create\";}', 0, 1, 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_workspaces_view_profile', 'view-workspaces-profile', '_bx_workspaces_page_title_sys_view_profile', '_bx_workspaces_page_title_view_profile', 'bx_workspaces', 7, 2147483647, 1, 'page.php?i=view-workspaces-profile', '', '', '', 0, 1, 0, 'BxWorkspacesPageEntry', 'modules/boonex/workspaces/classes/BxWorkspacesPageEntry.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_workspaces_view_profile', 0, 'bx_workspaces', '_bx_workspaces_page_block_title_sys_cover_block', '_bx_workspaces_page_block_title_cover_block', 3, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:12:\"entity_cover\";}', 0, 0, 1, 0),
+('bx_workspaces_view_profile', 0, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_friends_mutual', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:22:\"profile_friends_mutual\";}', 0, 0, 1, 0),
+('bx_workspaces_view_profile', 2, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_subscriptions', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:21:\"profile_subscriptions\";}', 0, 1, 0, 0),
+('bx_workspaces_view_profile', 2, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_subscribed_me', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:21:\"profile_subscribed_me\";}', 0, 1, 0, 0),
+('bx_workspaces_view_profile', 2, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_related_me', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:18:"profile_related_me";}', 0, 1, 0, 0),
+('bx_workspaces_view_profile', 2, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_comments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 0, 0),
+('bx_workspaces_view_profile', 2, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_description', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:17:\"entity_text_block\";}', 0, 0, 1, 1),
+('bx_workspaces_view_profile', 2, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_friends', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:15:\"profile_friends\";}', 0, 1, 1, 2),
+('bx_workspaces_view_profile', 2, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_relations', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:17:"profile_relations";}', 0, 1, 1, 3),
+('bx_workspaces_view_profile', 2, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_calendar', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:15:\"entity_calendar\";}', 0, 0, 0, 4),
+('bx_workspaces_view_profile', 3, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_location', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:15:\"entity_location\";}', 0, 0, 0, 0),
+('bx_workspaces_view_profile', 3, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_info', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:11:\"entity_info\";}', 0, 0, 1, 1),
+('bx_workspaces_view_profile', 3, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_all_actions', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:18:"entity_all_actions";}', 0, 0, 0, 0),
+('bx_workspaces_view_profile', 3, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_membership', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:18:\"profile_membership\";}', 0, 0, 1, 2),
+('bx_workspaces_view_profile', 3, 'bx_workspaces', '', '_bx_workspaces_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:13:\"bx_workspaces\";i:1;s:12:\"{content_id}\";}s:5:\"class\";s:20:\"TemplServiceMetatags\";}', 0, 0, 1, 3),
+('bx_workspaces_view_profile', 2, 'bx_workspaces', '', '_bx_workspaces_page_block_title_entry_reports', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";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_workspaces_view_profile_closed', 'view-workspace-profile-closed', '_bx_workspaces_page_title_sys_view_profile_closed', '_bx_workspaces_page_title_view_profile', 'bx_workspaces', 10, 2147483647, 1, 'page.php?i=view-workspace-profile', '', '', '', 0, 1, 0, 'BxWorkspacesPageEntry', 'modules/boonex/workspaces/classes/BxWorkspacesPageEntry.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_workspaces_view_profile_closed', 1, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_private', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:19:\"private_profile_msg\";}', 0, 1, 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_workspaces_edit_profile', 'edit-workspaces-profile', '_bx_workspaces_page_title_sys_edit_profile', '_bx_workspaces_page_title_edit_profile', 'bx_workspaces', 5, 2147483647, 1, 'page.php?i=edit-workspaces-profile', '', '', '', 0, 1, 0, 'BxWorkspacesPageEntry', 'modules/boonex/workspaces/classes/BxWorkspacesPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_workspaces_edit_profile', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_edit_profile', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:11:\"entity_edit\";}', 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_workspaces_delete_profile', 'delete-workspaces-profile', '_bx_workspaces_page_title_sys_delete_profile', '_bx_workspaces_page_title_delete_profile', 'bx_workspaces', 5, 2147483647, 1, 'page.php?i=delete-workspaces-profile', '', '', '', 0, 1, 0, 'BxWorkspacesPageEntry', 'modules/boonex/workspaces/classes/BxWorkspacesPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_workspaces_delete_profile', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_delete_profile', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:13:\"entity_delete\";}', 0, 0, 0);
+
+-- PAGE: profile info
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_workspaces_profile_info', 'workspaces-profile-info', '_bx_workspaces_page_title_sys_profile_info', '_bx_workspaces_page_title_profile_info', 'bx_workspaces', 5, 2147483647, 1, 'page.php?i=workspaces-profile-info', '', '', '', 0, 1, 0, 'BxWorkspacesPageEntry', 'modules/boonex/workspaces/classes/BxWorkspacesPageEntry.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_workspaces_profile_info', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_system_profile_info', '_bx_workspaces_page_block_title_profile_info_link', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:16:\"entity_info_full\";}', 0, 0, 1, 1),
+('bx_workspaces_profile_info', 1, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_description', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:17:\"entity_text_block\";}', 0, 0, 1, 2);
+
+-- PAGE: profile friends
+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_workspaces_profile_friends', 'workspaces-profile-friends', '_bx_workspaces_page_title_sys_profile_friends', '_bx_workspaces_page_title_profile_friends', 'bx_workspaces', 5, 2147483647, 1, 'page.php?i=workspaces-profile-friends', '', '', '', 0, 1, 0, 'BxWorkspacesPageEntry', 'modules/boonex/workspaces/classes/BxWorkspacesPageEntry.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_workspaces_profile_friends', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_system_profile_friends', '_bx_workspaces_page_block_title_profile_friends_link', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:17:"connections_table";s:6:"params";a:1:{i:0;s:12:"{profile_id}";}s:5:"class";s:23:"TemplServiceConnections";}', 0, 0, 1, 1);
+
+-- PAGE: profile friend requests
+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_workspaces_friend_requests', 'workspaces-friend-requests', '_bx_workspaces_page_title_sys_friend_requests', '_bx_workspaces_page_title_friend_requests', 'bx_workspaces', 5, 2147483647, 1, 'page.php?i=workspaces-friend-requests', '', '', '', 0, 1, 0, 'BxWorkspacesPageEntry', 'modules/boonex/workspaces/classes/BxWorkspacesPageEntry.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_workspaces_friend_requests', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_system_friend_requests', '_bx_workspaces_page_block_title_friend_requests_link', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:25:\"connections_request_table\";s:5:\"class\";s:23:\"TemplServiceConnections\";}', 0, 0, 1, 1);
+
+-- PAGE: profile favorites
+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_workspaces_profile_favorites', 'workspaces-profile-favorites', '_bx_workspaces_page_title_sys_profile_favorites', '_bx_workspaces_page_title_profile_favorites', 'bx_workspaces', 5, 2147483647, 1, 'page.php?i=workspaces-profile-favorites', '', '', '', 0, 1, 0, 'BxWorkspacesPageBrowse', 'modules/boonex/workspaces/classes/BxWorkspacesPageBrowse.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_workspaces_profile_favorites', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_system_profile_favorites', '_bx_workspaces_page_block_title_profile_favorites', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:15:"browse_favorite";}', 0, 1, 1, 1);
+
+-- PAGE: profile subscriptions
+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_workspaces_profile_subscriptions', 'workspaces-profile-subscriptions', '_bx_workspaces_page_title_sys_profile_subscriptions', '_bx_workspaces_page_title_profile_subscriptions', 'bx_workspaces', 5, 2147483647, 1, 'page.php?i=workspaces-profile-subscriptions', '', '', '', 0, 1, 0, 'BxWorkspacesPageEntry', 'modules/boonex/workspaces/classes/BxWorkspacesPageEntry.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_workspaces_profile_subscriptions', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_system_profile_subscriptions', '_bx_workspaces_page_block_title_profile_subscriptions', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:19:\"subscriptions_table\";s:5:\"class\";s:23:\"TemplServiceConnections\";}', 0, 0, 1, 1),
+('bx_workspaces_profile_subscriptions', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_system_profile_subscribed_me', '_bx_workspaces_page_block_title_profile_subscribed_me', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:19:\"subscribed_me_table\";s:5:\"class\";s:23:\"TemplServiceConnections\";}', 0, 0, 1, 2);
+
+-- PAGE: profile relations
+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_workspaces_profile_relations', 'workspaces-profile-relations', '_bx_workspaces_page_title_sys_profile_relations', '_bx_workspaces_page_title_profile_relations', 'bx_workspaces', 5, 2147483647, 1, 'page.php?i=workspaces-profile-relations', '', '', '', 0, 1, 0, 'BxWorkspacesPageEntry', 'modules/boonex/workspaces/classes/BxWorkspacesPageEntry.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_workspaces_profile_relations', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_system_profile_relations', '_bx_workspaces_page_block_title_profile_relations', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:6:"system";s:6:"method";s:15:"relations_table";s:5:"class";s:23:"TemplServiceConnections";}', 0, 0, 1, 1),
+('bx_workspaces_profile_relations', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_system_profile_related_me', '_bx_workspaces_page_block_title_profile_related_me', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:6:"system";s:6:"method";s:16:"related_me_table";s:5:"class";s:23:"TemplServiceConnections";}', 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_workspaces_profile_comments', '_bx_workspaces_page_title_sys_profile_comments', '_bx_workspaces_page_title_profile_comments', 'bx_workspaces', 5, 2147483647, 1, 'workspaces-profile-comments', '', '', '', '', 0, 1, 0, 'BxWorkspacesPageEntry', 'modules/boonex/workspaces/classes/BxWorkspacesPageEntry.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_workspaces_profile_comments', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_profile_comments', '_bx_workspaces_page_block_title_profile_comments_link', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";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_workspaces_home', '_bx_workspaces_page_title_sys_recent', '_bx_workspaces_page_title_recent', 'bx_workspaces', 5, 2147483647, 1, 'workspaces-home', 'page.php?i=workspaces-home', '', '', '', 0, 1, 0, 'BxWorkspacesPageBrowse', 'modules/boonex/workspaces/classes/BxWorkspacesPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_workspaces_home', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_featured_profiles', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:15:"browse_featured";s:6:"params";a:1:{i:0;s:7:"gallery";}}', 0, 1, 0),
+('bx_workspaces_home', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_latest_profiles', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:22:\"browse_recent_profiles\";s:6:"params";a:1:{i:0;b:1;}}', 0, 1, 1);
+
+-- PAGE: active 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_workspaces_active', '_bx_workspaces_page_title_sys_active', '_bx_workspaces_page_title_active', 'bx_workspaces', 5, 2147483647, 1, 'workspaces-active', 'page.php?i=workspaces-active', '', '', '', 0, 1, 0, 'BxWorkspacesPageBrowse', 'modules/boonex/workspaces/classes/BxWorkspacesPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_workspaces_active', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_active_profiles', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:22:"browse_active_profiles";s:6:"params";a:2:{s:9:"unit_view";s:7:"gallery";s:13:"empty_message";b:1;}}', 0, 1, 0);
+
+-- PAGE: online 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_workspaces_online', '_bx_workspaces_page_title_sys_online', '_bx_workspaces_page_title_online', 'bx_workspaces', 5, 2147483647, 1, 'workspaces-online', 'page.php?i=workspaces-online', '', '', '', 0, 1, 0, 'BxWorkspacesPageBrowse', 'modules/boonex/workspaces/classes/BxWorkspacesPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_workspaces_online', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_online_profiles', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:22:\"browse_online_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_workspaces_search', '_bx_workspaces_page_title_sys_entries_search', '_bx_workspaces_page_title_entries_search', 'bx_workspaces', 5, 2147483647, 1, 'workspaces-search', 'page.php?i=workspaces-search', '', '', '', 0, 1, 0, 'BxWorkspacesPageBrowse', 'modules/boonex/workspaces/classes/BxWorkspacesPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_workspaces_search', 1, 'bx_workspaces', '_bx_workspaces_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:13:"bx_workspaces";}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 1, 1),
+('bx_workspaces_search', 1, 'bx_workspaces', '_bx_workspaces_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:13:"bx_workspaces";s:10:"show_empty";b:1;}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 1, 2),
+('bx_workspaces_search', 1, 'bx_workspaces', '_bx_workspaces_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:18:"bx_workspaces_cmts";}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 0, 3),
+('bx_workspaces_search', 1, 'bx_workspaces', '_bx_workspaces_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:18:"bx_workspaces_cmts";s:10:"show_empty";b:1;}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 0, 4);
+
+-- PAGE: module manage own
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_workspaces_manage', '_bx_workspaces_page_title_sys_manage', '_bx_workspaces_page_title_manage', 'bx_workspaces', 5, 2147483647, 1, 'workspaces-manage', 'page.php?i=workspaces-manage', '', '', '', 0, 1, 0, 'BxWorkspacesPageBrowse', 'modules/boonex/workspaces/classes/BxWorkspacesPageBrowse.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_workspaces_manage', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_system_manage', '_bx_workspaces_page_block_title_manage', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";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_workspaces_administration', '_bx_workspaces_page_title_sys_manage_administration', '_bx_workspaces_page_title_manage', 'bx_workspaces', 5, 192, 1, 'workspaces-administration', 'page.php?i=workspaces-administration', '', '', '', 0, 1, 0, 'BxWorkspacesPageBrowse', 'modules/boonex/workspaces/classes/BxWorkspacesPageBrowse.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_workspaces_administration', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_system_manage_administration', '_bx_workspaces_page_block_title_manage', 11, 192, 'service', 'a:3:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:12:\"manage_tools\";s:6:\"params\";a:1:{i:0;s:14:\"administration\";}}', 0, 1, 0);
+
+-- 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_workspaces', '' , '_bx_workspaces_page_block_title_latest_profiles', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:22:"browse_recent_profiles";}', 1, 0, 0, IFNULL(@iBlockOrder, 0) + 1),
+('sys_home', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_sys_recommended_entries_view_showcase', '_bx_workspaces_page_block_title_recommended_entries_view_showcase', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:13:\"bx_workspaces\";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;}}', 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_workspaces', '_bx_workspaces_page_block_title_sys_featured_entries_view_showcase', '_bx_workspaces_page_block_title_featured_entries_view_showcase', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:13:\"bx_workspaces\";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) + 1),
+('', 0, 'bx_workspaces', '_bx_workspaces_page_block_title_sys_recommended_entries_view_showcase', '_bx_workspaces_page_block_title_recommended_entries_view_showcase', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:13:\"bx_workspaces\";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) + 2),
+('', 0, 'bx_workspaces', '_bx_workspaces_page_block_title_sys_active_entries_view_showcase', '_bx_workspaces_page_block_title_active_entries_view_showcase', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:22:\"browse_active_profiles\";s:6:\"params\";a:3:{s:9:\"unit_view\";s:16:\"showcase_wo_info\";s:13:\"empty_message\";b:0;s:13:\"ajax_paginate\";b:0;}}', 0, 1, 1, IFNULL(@iBlockOrder, 0) + 3),
+('', 0, 'bx_workspaces', '_bx_workspaces_page_block_title_sys_active_profiles', '_bx_workspaces_page_block_title_active_profiles', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:22:\"browse_active_profiles\";s:6:\"params\";a:3:{s:9:\"unit_view\";s:12:\"unit_wo_info\";s:13:\"empty_message\";b:0;s:13:\"ajax_paginate\";b:0;}}', 0, 1, 1, IFNULL(@iBlockOrder, 0) + 4),
+('', 0, 'bx_workspaces', '_bx_workspaces_page_block_title_sys_familiar_profiles', '_bx_workspaces_page_block_title_familiar_profiles', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:24:\"browse_familiar_profiles\";s:6:\"params\";a:4:{s:10:\"connection\";s:20:\"sys_profiles_friends\";s:9:\"unit_view\";s:4:\"unit\";s:13:\"empty_message\";b:0;s:13:\"ajax_paginate\";b:1;}}', 0, 1, 1, IFNULL(@iBlockOrder, 0) + 5);
+
+-- 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_workspaces', 'workspaces-home', '_bx_workspaces_menu_item_title_system_entries_home', '_bx_workspaces_menu_item_title_entries_home', 'page.php?i=workspaces-home', '', '', 'user col-blue3', 'bx_workspaces_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_workspaces', 'workspaces-home', '_bx_workspaces_menu_item_title_system_entries_home', '_bx_workspaces_menu_item_title_entries_home', 'page.php?i=workspaces-home', '', '', 'user col-blue3', 'bx_workspaces_submenu', 2147483647, 1, 1, IFNULL(@iHomepageMenuOrder, 0) + 1);
+
+-- SET @iCreateProfileMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_profiles_create' 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_profiles_create', 'bx_workspaces', 'create-workspace-profile', '_bx_workspaces_menu_item_title_system_profile_type', '_bx_workspaces_menu_item_title_profile_type', 'page.php?i=create-workspaces-profile', '', '', 'user', '', 2147483647, 1, 1, IFNULL(@iCreateProfileMenuOrder, 0) + 1);
+
+SET @iAddMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_add_profile_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_profile_links', 'bx_workspaces', 'create-workspaces-profile', '_bx_workspaces_menu_item_title_system_create_profile', '_bx_workspaces_menu_item_title_create_profile', 'page.php?i=create-workspaces-profile', '', '', 'user col-blue3', '', 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_workspaces_view_actions', '_bx_workspaces_menu_title_view_profile_actions', 'bx_workspaces_view_actions', 'bx_workspaces', 9, 0, 1, 'BxWorkspacesMenuViewActions', 'modules/boonex/workspaces/classes/BxWorkspacesMenuViewActions.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_workspaces_view_actions', 'bx_workspaces', '_bx_workspaces_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`, `order`) VALUES 
+('bx_workspaces_view_actions', 'bx_workspaces', 'profile-friend-add', '_bx_workspaces_menu_item_title_system_befriend', '{title_add_friend}', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_friends\', \'add\', \'{profile_id}\')', '', 'user-plus', '', 0, 2147483647, '', 1, 0, 10),
+('bx_workspaces_view_actions', 'bx_workspaces', 'profile-friend-remove', '_bx_workspaces_menu_item_title_system_unfriend', '{title_remove_friend}', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_friends\', \'remove\', \'{profile_id}\')', '', 'user-times', '', 0, 2147483647, '', 1, 0, 11),
+('bx_workspaces_view_actions', 'bx_workspaces', 'profile-relation-add', '_bx_workspaces_menu_item_title_system_relation_add', '_bx_workspaces_menu_item_title_relation_add', 'javascript:void(0)', 'bx_menu_popup(''sys_add_relation'', window, {}, {profile_id: {profile_id}});', '', 'sync', '', 0, 2147483647, '', 1, 0, 15),
+('bx_workspaces_view_actions', 'bx_workspaces', 'profile-relation-remove', '_bx_workspaces_menu_item_title_system_relation_delete', '_bx_workspaces_menu_item_title_relation_delete', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_relations\', \'remove\', \'{profile_id}\')', '', 'sync', '', 0, 2147483647, '', 1, 0, 16),
+('bx_workspaces_view_actions', 'bx_workspaces', 'profile-subscribe-add', '_bx_workspaces_menu_item_title_system_subscribe', '_bx_workspaces_menu_item_title_subscribe', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_subscriptions\', \'add\', \'{profile_id}\')', '', 'check', '', 0, 2147483647, '', 1, 0, 20),
+('bx_workspaces_view_actions', 'bx_workspaces', 'profile-subscribe-remove', '_bx_workspaces_menu_item_title_system_unsubscribe', '_bx_workspaces_menu_item_title_unsubscribe', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_subscriptions\', \'remove\', \'{profile_id}\')', '', 'check', '', 0, 2147483647, '', 1, 0, 21),
+('bx_workspaces_view_actions', 'bx_workspaces', 'profile-set-acl-level', '_sys_menu_item_title_system_set_acl_level', '_sys_menu_item_title_set_acl_level', 'javascript:void(0)', 'bx_menu_popup(''sys_set_acl_level'', window, {id:{value:''sys_acl_set_{profile_id}'', force:true}, closeOnOuterClick: false, removeOnClose: true, displayMode: ''box'', cssClass: ''''}, {profile_id: {profile_id}});', '', 'certificate', '', 0, 2147483647, '', 1, 0, 30),
+('bx_workspaces_view_actions', 'bx_workspaces', '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_workspaces'', content_id: {content_id}});', '', 'check-circle', '', 0, 192, 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:19:"is_badges_avaliable";}', 1, 0, 30),
+('bx_workspaces_view_actions', 'bx_workspaces', 'profile-actions-more', '_bx_workspaces_menu_item_title_system_more_actions', '_bx_workspaces_menu_item_title_more_actions', 'javascript:void(0)', 'bx_menu_popup(''bx_workspaces_view_actions_more'', this, {}, {profile_id:{profile_id}});', '', 'cog', 'bx_workspaces_view_actions_more', 1, 2147483647, '', 1, 0, 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_workspaces_view_actions_more', '_bx_workspaces_menu_title_view_profile_actions_more', 'bx_workspaces_view_actions_more', 'bx_workspaces', 6, 0, 1, 'BxWorkspacesMenuViewActions', 'modules/boonex/workspaces/classes/BxWorkspacesMenuViewActions.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_workspaces_view_actions_more', 'bx_workspaces', '_bx_workspaces_menu_set_title_view_profile_actions_more', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('bx_workspaces_view_actions_more', 'bx_workspaces', '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', '', 192, 1, 0, 10),
+('bx_workspaces_view_actions_more', 'bx_workspaces', 'audit', '_sys_menu_item_title_system_va_audit', '_sys_menu_item_title_va_audit', 'page.php?i=dashboard-audit&module=bx_workspaces&content_id={content_id}', '', '', 'history', '', 192, 1, 0, 20),
+('bx_workspaces_view_actions_more', 'bx_workspaces', 'edit-workspaces-profile', '_bx_workspaces_menu_item_title_system_edit_profile', '_bx_workspaces_menu_item_title_edit_profile', 'page.php?i=edit-workspaces-profile&id={content_id}', '', '', 'pencil-alt', '', 2147483647, 1, 0, 30),
+('bx_workspaces_view_actions_more', 'bx_workspaces', 'delete-workspaces-profile', '_bx_workspaces_menu_item_title_system_delete_profile', '_bx_workspaces_menu_item_title_delete_profile', 'page.php?i=delete-workspaces-profile&id={content_id}', '', '', 'remove', '', 2147483647, 1, 0, 40),
+('bx_workspaces_view_actions_more', 'bx_workspaces', 'delete-workspaces-account', '_bx_workspaces_menu_item_title_system_delete_account', '_bx_workspaces_menu_item_title_delete_account', 'page.php?i=account-settings-delete&id={account_id}&content=0', '', '', 'user-times', '', 128, 1, 0, 50),
+('bx_workspaces_view_actions_more', 'bx_workspaces', 'delete-workspaces-account-content', '_bx_workspaces_menu_item_title_system_delete_account_content', '_bx_workspaces_menu_item_title_delete_account_content', 'page.php?i=account-settings-delete&id={account_id}&content=1', '', '', 'trash', '', 128, 1, 0, 60);
+
+-- MENU: all actions menu for view entry 
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `persistent`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_workspaces_view_actions_all', '_sys_menu_title_view_actions', 'bx_workspaces_view_actions_all', 'bx_workspaces', 15, 1, 0, 1, 'BxWorkspacesMenuViewActionsAll', 'modules/boonex/workspaces/classes/BxWorkspacesMenuViewActionsAll.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_workspaces_view_actions_all', 'bx_workspaces', '_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_workspaces_view_actions_all', 'bx_workspaces', 'profile-friend-add', '_bx_workspaces_menu_item_title_system_befriend', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 10),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'profile-friend-remove', '_bx_workspaces_menu_item_title_system_unfriend', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 20),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'profile-relation-add', '_bx_workspaces_menu_item_title_system_relation_add', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 23),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'profile-relation-remove', '_bx_workspaces_menu_item_title_system_relation_delete', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 27),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'profile-subscribe-add', '_bx_workspaces_menu_item_title_system_subscribe', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 30),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'profile-subscribe-remove', '_bx_workspaces_menu_item_title_system_unsubscribe', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 40),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'profile-set-acl-level', '_sys_menu_item_title_system_set_acl_level', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 50),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'profile-set-badges', '_sys_menu_item_title_system_set_badges', '', '', '', '', '', '', '', 0, 192, 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:19:"is_badges_avaliable";}', 1, 0, 60),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'comment', '_sys_menu_item_title_system_va_comment', '', '', '', '', '', '', '', 0, 2147483647, '', 0, 0, 200),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'view', '_sys_menu_item_title_system_va_view', '', '', '', '', '', '', '', 0, 2147483647, '', 0, 0, 210),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'vote', '_sys_menu_item_title_system_va_vote', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 215),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'reaction', '_sys_menu_item_title_system_va_reaction', '', '', '', '', '', '', '', 0, 2147483647, '', 0, 0, 217),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'score', '_sys_menu_item_title_system_va_score', '', '', '', '', '', '', '', 0, 2147483647, '', 0, 0, 220),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'favorite', '_sys_menu_item_title_system_va_favorite', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 230),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'feature', '_sys_menu_item_title_system_va_feature', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 240),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'report', '_sys_menu_item_title_system_va_report', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 250),
+('bx_workspaces_view_actions_all', 'bx_workspaces', '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_workspaces_view_meta', '_bx_workspaces_menu_title_view_profile_meta', 'bx_workspaces_view_meta', 'bx_workspaces', 15, 0, 1, 'BxWorkspacesMenuViewMeta', 'modules/boonex/workspaces/classes/BxWorkspacesMenuViewMeta.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_workspaces_view_meta', 'bx_workspaces', '_bx_workspaces_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_workspaces_view_meta', 'bx_workspaces', 'membership', '_sys_menu_item_title_system_vm_membership', '_sys_menu_item_title_vm_membership', '', '', '', '', '', 0, 2147483647, '', 1, 0, 10),
+('bx_workspaces_view_meta', 'bx_workspaces', 'badges', '_sys_menu_item_title_system_vm_badges', '_sys_menu_item_title_vm_badges', '', '', '', '', '', 0, 2147483647, '', 1, 0, 20),
+('bx_workspaces_view_meta', 'bx_workspaces', 'friends', '_sys_menu_item_title_system_sm_friends', '_sys_menu_item_title_sm_friends', '', '', '', '', '', 0, 2147483647, '', 1, 0, 23),
+('bx_workspaces_view_meta', 'bx_workspaces', 'subscribers', '_sys_menu_item_title_system_sm_subscribers', '_sys_menu_item_title_sm_subscribers', '', '', '', '', '', 0, 2147483647, '', 1, 0, 25),
+('bx_workspaces_view_meta', 'bx_workspaces', 'relations', '_sys_menu_item_title_system_sm_relations', '_sys_menu_item_title_sm_relations', '', '', '', '', '', 0, 2147483647, '', 0, 0, 27),
+('bx_workspaces_view_meta', 'bx_workspaces', 'views', '_sys_menu_item_title_system_sm_views', '_sys_menu_item_title_sm_views', '', '', '', '', '', 0, 2147483647, '', 1, 0, 30),
+('bx_workspaces_view_meta', 'bx_workspaces', 'votes', '_sys_menu_item_title_system_sm_votes', '_sys_menu_item_title_sm_votes', '', '', '', '', '', 0, 2147483647, '', 1, 0, 40),
+('bx_workspaces_view_meta', 'bx_workspaces', 'reactions', '_sys_menu_item_title_system_sm_reactions', '_sys_menu_item_title_sm_reactions', '', '', '', '', '', 0, 2147483647, '', 0, 0, 43),
+('bx_workspaces_view_meta', 'bx_workspaces', 'scores', '_sys_menu_item_title_system_sm_scores', '_sys_menu_item_title_sm_scores', '', '', '', '', '', 0, 2147483647, '', 0, 0, 46),
+('bx_workspaces_view_meta', 'bx_workspaces', 'comments', '_sys_menu_item_title_system_sm_comments', '_sys_menu_item_title_sm_comments', '', '', '', '', '', 0, 2147483647, '', 1, 0, 50);
+
+-- 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_workspaces_submenu', '_bx_workspaces_menu_title_submenu', 'bx_workspaces_submenu', 'bx_workspaces', 8, 0, 1, '', '');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_workspaces_submenu', 'bx_workspaces', '_bx_workspaces_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_workspaces_submenu', 'bx_workspaces', 'workspaces-home', '_bx_workspaces_menu_item_title_system_entries_recent', '_bx_workspaces_menu_item_title_entries_recent', 'page.php?i=workspaces-home', '', '', '', '', 2147483647, 1, 1, 1),
+('bx_workspaces_submenu', 'bx_workspaces', 'workspaces-active', '_bx_workspaces_menu_item_title_system_entries_active', '_bx_workspaces_menu_item_title_entries_active', 'page.php?i=workspaces-active', '', '', '', '', 2147483647, 1, 1, 2),
+('bx_workspaces_submenu', 'bx_workspaces', 'workspaces-online', '_bx_workspaces_menu_item_title_system_entries_online', '_bx_workspaces_menu_item_title_entries_online', 'page.php?i=workspaces-online', '', '', '', '', 2147483647, 1, 1, 3),
+('bx_workspaces_submenu', 'bx_workspaces', 'workspaces-search', '_bx_workspaces_menu_item_title_system_entries_search', '_bx_workspaces_menu_item_title_entries_search', 'page.php?i=workspaces-search', '', '', '', '', 2147483647, 1, 1, 4),
+('bx_workspaces_submenu', 'bx_workspaces', 'workspaces-manage', '_bx_workspaces_menu_item_title_system_entries_manage', '_bx_workspaces_menu_item_title_entries_manage', 'page.php?i=workspaces-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_workspaces_view_submenu', '_bx_workspaces_menu_title_view_profile_submenu', 'bx_workspaces_view_submenu', 'bx_workspaces', 18, 0, 1, 'BxWorkspacesMenuView', 'modules/boonex/workspaces/classes/BxWorkspacesMenuView.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_workspaces_view_submenu', 'bx_workspaces', '_bx_workspaces_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_workspaces_view_submenu', 'bx_workspaces', 'view-workspaces-profile', '_bx_workspaces_menu_item_title_system_view_profile_view', '_bx_workspaces_menu_item_title_view_profile_view', 'page.php?i=view-workspaces-profile&id={content_id}', '', '', 'user col-blue3', '', '', 0, 2147483647, 1, 0, 1),
+('bx_workspaces_view_submenu', 'bx_workspaces', 'workspaces-profile-info', '_bx_workspaces_menu_item_title_system_view_profile_info', '_bx_workspaces_menu_item_title_view_profile_info', 'page.php?i=workspaces-profile-info&id={content_id}', '', '', 'info-circle col-gray', '', '', 0, 2147483647, 1, 0, 2),
+('bx_workspaces_view_submenu', 'bx_workspaces', 'workspaces-profile-friends', '_bx_workspaces_menu_item_title_system_view_profile_friends', '_bx_workspaces_menu_item_title_view_profile_friends', 'page.php?i=workspaces-profile-friends&profile_id={profile_id}', '', '', 'users col-blue3', '', '', 0, 2147483647, 1, 0, 3),
+('bx_workspaces_view_submenu', 'bx_workspaces', 'workspaces-profile-relations', '_bx_workspaces_menu_item_title_system_view_profile_relations', '_bx_workspaces_menu_item_title_view_profile_relations', 'page.php?i=workspaces-profile-relations&profile_id={profile_id}', '', '', 'sync col-blue3', '', '', 0, 2147483647, 1, 0, 4),
+('bx_workspaces_view_submenu', 'bx_workspaces', 'workspaces-profile-subscriptions', '_bx_workspaces_menu_item_title_system_view_profile_subscriptions', '_bx_workspaces_menu_item_title_view_profile_subscriptions', 'page.php?i=workspaces-profile-subscriptions&profile_id={profile_id}', '', '', 'check col-blue3', '', '', 0, 2147483647, 1, 0, 5),
+('bx_workspaces_view_submenu', 'bx_workspaces', 'workspaces-profile-comments', '_bx_workspaces_menu_item_title_system_view_profile_comments', '_bx_workspaces_menu_item_title_view_profile_comments', 'page.php?i=workspaces-profile-comments&id={content_id}', '', '', '', '', '', 0, 2147483647, 0, 0, 6),
+('bx_workspaces_view_submenu', 'bx_workspaces', 'more-auto', '_bx_workspaces_menu_item_title_system_view_profile_more_auto', '_bx_workspaces_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_workspaces_snippet_meta', '_sys_menu_title_snippet_meta', 'bx_workspaces_snippet_meta', 'bx_workspaces', 15, 0, 1, 'BxWorkspacesMenuSnippetMeta', 'modules/boonex/workspaces/classes/BxWorkspacesMenuSnippetMeta.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_workspaces_snippet_meta', 'bx_workspaces', '_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`, `hidden_on_cxt`, `active`, `copyable`, `editable`, `order`) VALUES
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'friends-mutual', '_sys_menu_item_title_system_sm_friends_mutual', '_sys_menu_item_title_sm_friends_mutual', '', '', '', '', '', 2147483647, 'all!recom_friends', 1, 0, 1, 0),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'date', '_sys_menu_item_title_system_sm_date', '_sys_menu_item_title_sm_date', '', '', '', '', '', 2147483647, '', 0, 0, 1, 5),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'tags', '_sys_menu_item_title_system_sm_tags', '_sys_menu_item_title_sm_tags', '', '', '', '', '', 2147483647, '', 0, 0, 1, 10),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'views', '_sys_menu_item_title_system_sm_views', '_sys_menu_item_title_sm_views', '', '', '', '', '', 2147483647, '', 0, 0, 1, 15),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'votes', '_sys_menu_item_title_system_sm_votes', '_sys_menu_item_title_sm_votes', '', '', '', '', '', 2147483647, '', 0, 0, 1, 16),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'reactions', '_sys_menu_item_title_system_sm_reactions', '_sys_menu_item_title_sm_reactions', '', '', '', '', '', 2147483647, '', 0, 0, 1, 17),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'scores', '_sys_menu_item_title_system_sm_scores', '_sys_menu_item_title_sm_scores', '', '', '', '', '', 2147483647, '', 0, 0, 1, 18),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'comments', '_sys_menu_item_title_system_sm_comments', '_sys_menu_item_title_sm_comments', '', '', '', '', '', 2147483647, '', 0, 0, 1, 20),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'friends', '_sys_menu_item_title_system_sm_friends', '_sys_menu_item_title_sm_friends', '', '', '', '', '', 2147483647, 'recom_friends,recom_subscriptions', 1, 0, 1, 30),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'subscribers', '_sys_menu_item_title_system_sm_subscribers', '_sys_menu_item_title_sm_subscribers', '', '', '', '', '', 2147483647, 'recom_friends', 1, 0, 1, 40),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'membership', '_sys_menu_item_title_system_sm_membership', '_sys_menu_item_title_sm_membership', '', '', '', '', '', 2147483647, '', 0, 0, 1, 50),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'nl', '_sys_menu_item_title_system_sm_nl', '_sys_menu_item_title_sm_nl', '', '', '', '', '', 2147483647, '', 1, 0, 1, 55),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'befriend', '_sys_menu_item_title_system_sm_befriend', '_sys_menu_item_title_sm_befriend', '', '', '', '', '', 2147483647, 'recom_subscriptions', 1, 0, 1, 60),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'unfriend', '_sys_menu_item_title_system_sm_unfriend', '_sys_menu_item_title_sm_unfriend', '', '', '', '', '', 2147483647, 'recom_friends,recom_subscriptions', 1, 0, 1, 65),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'subscribe', '_sys_menu_item_title_system_sm_subscribe', '_sys_menu_item_title_sm_subscribe', '', '', '', '', '', 2147483647, 'recom_friends', 1, 0, 1, 70),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'unsubscribe', '_sys_menu_item_title_system_sm_unsubscribe', '_sys_menu_item_title_sm_unsubscribe', '', '', '', '', '', 2147483647, 'recom_friends,recom_subscriptions', 1, 0, 1, 75),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'ignore-befriend', '_sys_menu_item_title_system_sm_ignore_befriend', '_sys_menu_item_title_sm_ignore', '', '', '', '', '', 2147483647, 'all!recom_friends', 1, 0, 1, 80),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'ignore-subscribe', '_sys_menu_item_title_system_sm_ignore_subscribe', '_sys_menu_item_title_sm_ignore', '', '', '', '', '', 2147483647, 'all!recom_subscriptions', 1, 0, 1, 85);
+
+-- MENU: notifications menu in account popup
+SET @iNotifMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name` = 'sys_account_notifications' 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`, `addon`, `submenu_object`, `visible_for_levels`, `visibility_custom`, `active`, `copyable`, `order`) VALUES
+('sys_account_notifications', 'bx_workspaces', 'notifications-friend-requests', '_bx_workspaces_menu_item_title_system_friends', '_bx_workspaces_menu_item_title_friends', 'page.php?i=workspaces-profile-friends&profile_id={member_id}', '', '', 'users col-blue3', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:31:"get_unconfirmed_connections_num";s:6:"params";a:1:{i:0;s:20:"sys_profiles_friends";}s:5:"class";s:23:"TemplServiceConnections";}', '', 2147483646, 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:17:"is_enable_friends";}', 1, 0, @iNotifMenuOrder + 1),
+('sys_account_notifications', 'bx_workspaces', 'notifications-relation-requests', '_bx_workspaces_menu_item_title_system_relations', '_bx_workspaces_menu_item_title_relations', 'page.php?i=workspaces-profile-relations&profile_id={member_id}', '', '', 'sync col-blue3', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:31:"get_unconfirmed_connections_num";s:6:"params";a:1:{i:0;s:22:"sys_profiles_relations";}s:5:"class";s:23:"TemplServiceConnections";}', '', 2147483646, 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:19:"is_enable_relations";}', 1, 0, @iNotifMenuOrder + 2);
+
+-- 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`, `visibility_custom`, `active`, `copyable`, `order`) VALUES
+('sys_profile_stats', 'bx_workspaces', 'profile-stats-friend-requests', '_bx_workspaces_menu_item_title_system_friend_requests', '_bx_workspaces_menu_item_title_friend_requests', 'page.php?i=workspaces-profile-friends&profile_id={member_id}', '', '', 'users col-blue3', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:31:"get_unconfirmed_connections_num";s:6:"params";a:1:{i:0;s:20:"sys_profiles_friends";}s:5:"class";s:23:"TemplServiceConnections";}', '', 2147483646, 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:17:"is_enable_friends";}', 0, 0, @iNotifMenuOrder + 1),
+('sys_profile_stats', 'bx_workspaces', 'profile-stats-manage-profiles', '_bx_workspaces_menu_item_title_system_manage_my_profiles', '_bx_workspaces_menu_item_title_manage_my_profiles', 'page.php?i=workspaces-manage', '', '_self', 'users col-blue3', 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:41:"get_menu_addon_manage_tools_profile_stats";}', '', 2147483646, '', 1, 0, @iNotifMenuOrder + 2),
+('sys_profile_stats', 'bx_workspaces', 'profile-stats-favorite-workspaces', '_bx_workspaces_menu_item_title_system_favorites', '_bx_workspaces_menu_item_title_favorites', 'page.php?i=workspaces-profile-favorites&profile_id={member_id}', '', '', 'star col-blue3', 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:38:"get_menu_addon_favorites_profile_stats";}', '', 2147483646, '', 1, 0, @iNotifMenuOrder + 3);
+
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `addon_cache`, `submenu_object`, `visible_for_levels`, `visibility_custom`, `active`, `copyable`, `order`) VALUES
+('sys_profile_stats', 'bx_workspaces', 'profile-stats-subscriptions', '_bx_workspaces_menu_item_title_system_subscriptions', '_bx_workspaces_menu_item_title_subscriptions', 'page.php?i=workspaces-profile-subscriptions&profile_id={member_id}#subscriptions', '', '_self', 'rss col-blue3', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:25:"get_connected_content_num";s:6:"params";a:1:{i:0;s:26:"sys_profiles_subscriptions";}s:5:"class";s:23:"TemplServiceConnections";}', 0, '', 2147483646, '', 0, 0, @iNotifMenuOrder + 4),
+('sys_profile_stats', 'bx_workspaces', 'profile-stats-subscribed-me', '_bx_workspaces_menu_item_title_system_subscribed_me', '_bx_workspaces_menu_item_title_subscribed_me', 'page.php?i=workspaces-profile-subscriptions&profile_id={member_id}#subscribers', '', '_self', 'rss col-blue3', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:28:"get_connected_initiators_num";s:6:"params";a:1:{i:0;s:26:"sys_profiles_subscriptions";}s:5:"class";s:23:"TemplServiceConnections";}', 1, '', 2147483646, '', 0, 0, @iNotifMenuOrder + 5);
+
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `visibility_custom`, `active`, `copyable`, `order`) VALUES
+('sys_profile_stats', 'bx_workspaces', 'profile-stats-relations', '_bx_workspaces_menu_item_title_system_relations', '_bx_workspaces_menu_item_title_relations', 'page.php?i=workspaces-profile-relations&profile_id={member_id}#relations', '', '_self', 'sync col-blue3', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:25:"get_connected_content_num";s:6:"params";a:3:{i:0;s:22:"sys_profiles_relations";i:1;i:0;i:2;i:1;}s:5:"class";s:23:"TemplServiceConnections";}', '', 2147483646, 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:19:"is_enable_relations";}', 1, 0, @iNotifMenuOrder + 6),
+('sys_profile_stats', 'bx_workspaces', 'profile-stats-related-me', '_bx_workspaces_menu_item_title_system_related_me', '_bx_workspaces_menu_item_title_related_me', 'page.php?i=workspaces-profile-relations&profile_id={member_id}#related-me', '', '_self', 'sync col-blue3', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:28:"get_connected_initiators_num";s:6:"params";a:3:{i:0;s:22:"sys_profiles_relations";i:1;i:0;i:2;i:1;}s:5:"class";s:23:"TemplServiceConnections";}', '', 2147483646, 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:19:"is_enable_relations";}', 1, 0, @iNotifMenuOrder + 7);
+
+-- 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_workspaces', 'workspaces', '_bx_workspaces_menu_item_title_system_followings', '_bx_workspaces_menu_item_title_followings', 'javascript:void(0)', '', '_self', 'users col-blue3', '', '', 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_workspaces_menu_manage_tools', '_bx_workspaces_menu_title_manage_tools', 'bx_workspaces_menu_manage_tools', 'bx_workspaces', 6, 0, 1, 'BxWorkspacesMenuManageTools', 'modules/boonex/workspaces/classes/BxWorkspacesMenuManageTools.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_workspaces_menu_manage_tools', 'bx_workspaces', '_bx_workspaces_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_workspaces_menu_manage_tools', 'bx_workspaces', 'clear-reports', '_bx_workspaces_menu_item_title_system_clear_reports', '_bx_workspaces_menu_item_title_clear_reports', 'javascript:void(0)', 'javascript:{js_object}.onClickClearReports({content_id});', '_self', 'eraser', '', 2147483647, 1, 0, 1),
+('bx_workspaces_menu_manage_tools', 'bx_workspaces', 'manage-cf', '_bx_workspaces_menu_item_title_system_manage_cf', '_bx_workspaces_menu_item_title_manage_cf', 'javascript:void(0)', 'javascript:{js_object}.onClickManageCf({content_id});', '_self', 'filter', '', 2147483647, 1, 0, 6),
+('bx_workspaces_menu_manage_tools', 'bx_workspaces', 'delete-with-content', '_bx_workspaces_menu_item_title_system_delete_with_content', '_bx_workspaces_menu_item_title_delete_with_content', 'javascript:void(0)', 'javascript:{js_object}.onClickDeleteWithContent({content_id});', '_self', 'far trash-alt', '', 2147483647, 1, 0, 99);
+
+-- 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_workspaces', 'workspaces-administration', '_bx_workspaces_menu_item_title_system_admt_workspaces', '_bx_workspaces_menu_item_title_admt_workspaces', 'page.php?i=workspaces-administration', '', '_self', 'user', 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:27:"get_menu_addon_manage_tools";}', '', 192, 1, 0, @iManageMenuOrder + 1);
+
+
+-- ACL
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_workspaces', 'create entry', NULL, '_bx_workspaces_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_workspaces', 'delete entry', NULL, '_bx_workspaces_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_workspaces', 'view entry', NULL, '_bx_workspaces_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_workspaces', 'edit any entry', NULL, '_bx_workspaces_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_workspaces', 'delete any entry', NULL, '_bx_workspaces_acl_action_delete_any_profile', '', 1, 3);
+SET @iIdActionProfileDeleteAny = LAST_INSERT_ID();
+
+SET @iUnauthenticated = 1;
+SET @iAccount = 2;
+SET @iStandard = 3;
+SET @iUnconfirmed = 4;
+SET @iPending = 5;
+SET @iSuspended = 6;
+SET @iModerator = 7;
+SET @iAdministrator = 8;
+SET @iPremium = 9;
+
+
+INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
+
+-- profile create
+(@iAccount, @iIdActionProfileCreate),
+(@iStandard, @iIdActionProfileCreate),
+(@iUnconfirmed, @iIdActionProfileCreate),
+(@iPending, @iIdActionProfileCreate),
+(@iModerator, @iIdActionProfileCreate),
+(@iAdministrator, @iIdActionProfileCreate),
+(@iPremium, @iIdActionProfileCreate),
+
+-- profile delete
+(@iAccount, @iIdActionProfileDelete),
+(@iStandard, @iIdActionProfileDelete),
+(@iUnconfirmed, @iIdActionProfileDelete),
+(@iPending, @iIdActionProfileDelete),
+(@iModerator, @iIdActionProfileDelete),
+(@iAdministrator, @iIdActionProfileDelete),
+(@iPremium, @iIdActionProfileDelete),
+
+-- profile view
+(@iUnauthenticated, @iIdActionProfileView),
+(@iAccount, @iIdActionProfileView),
+(@iStandard, @iIdActionProfileView),
+(@iUnconfirmed, @iIdActionProfileView),
+(@iPending, @iIdActionProfileView),
+(@iModerator, @iIdActionProfileView),
+(@iAdministrator, @iIdActionProfileView),
+(@iPremium, @iIdActionProfileView),
+
+-- any profile edit
+(@iModerator, @iIdActionProfileEditAny),
+(@iAdministrator, @iIdActionProfileEditAny),
+
+-- any profile delete
+(@iAdministrator, @iIdActionProfileDeleteAny);
+
+-- SEARCH
+SET @iSearchOrder = (SELECT IFNULL(MAX(`Order`), 0) FROM `sys_objects_search`);
+INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `Order`, `ClassName`, `ClassPath`) VALUES
+('bx_workspaces', '_bx_workspaces', @iSearchOrder + 1, 'BxWorkspacesSearchResult', 'modules/boonex/workspaces/classes/BxWorkspacesSearchResult.php'),
+('bx_workspaces_cmts', '_bx_workspaces_cmts', @iSearchOrder + 2, 'BxWorkspacesCmtsSearchResult', 'modules/boonex/workspaces/classes/BxWorkspacesCmtsSearchResult.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_workspaces', 'bx_workspaces', '_bx_workspaces', 'page.php?i=workspaces-home', 'user col-blue3', 'SELECT COUNT(*) FROM `bx_workspaces_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id` = `tp`.`content_id` AND `tp`.`type`=''bx_workspaces'' 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_workspaces_growth', '_bx_workspaces_chart_growth', 'bx_workspaces_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_workspaces'' WHERE 1 AND `tp`.`status`=''active'' {where_inteval} GROUP BY `period` ORDER BY {table}.{field_date} ASC', 1, @iMaxOrderCharts + 1, 'BxDolChartGrowth', ''),
+('bx_workspaces_growth_speed', '_bx_workspaces_chart_growth_speed', 'bx_workspaces_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_workspaces'' WHERE 1 AND `tp`.`status`=''active'' {where_inteval} GROUP BY `period` ORDER BY {table}.{field_date} ASC', 1, @iMaxOrderCharts + 2, 'BxDolChartGrowthSpeed', '');
+
+-- 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_workspaces_administration', 'Sql', 'SELECT `td`.*, `ta`.`email` AS `account`, `ta`.`logged` AS `last_online`, `tp`.`status` AS `status`, `tp`.`id` as `profile_id` FROM `bx_workspaces_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id`=`tp`.`content_id` AND `tp`.`type`=''bx_workspaces'' LEFT JOIN `sys_accounts` AS `ta` ON `tp`.`account_id`=`ta`.`id` WHERE 1 ', 'bx_workspaces_data', 'id', 'last_online', 'status', '', 20, NULL, 'start', '', 'fullname,email', '', 'like', 'reports', '', 192, 'BxWorkspacesGridAdministration', 'modules/boonex/workspaces/classes/BxWorkspacesGridAdministration.php'),
+('bx_workspaces_common', 'Sql', 'SELECT `td`.*, `ta`.`email` AS `account`, `ta`.`logged` AS `last_online`, `tp`.`status` AS `status` FROM `bx_workspaces_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id`=`tp`.`content_id` AND `tp`.`type`=''bx_workspaces'' LEFT JOIN `sys_accounts` AS `ta` ON `tp`.`account_id`=`ta`.`id` WHERE 1 ', 'bx_workspaces_data', 'id', 'last_online', 'status', '', 20, NULL, 'start', '', 'fullname', '', 'like', '', '', 2147483647, 'BxWorkspacesGridCommon', 'modules/boonex/workspaces/classes/BxWorkspacesGridCommon.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('bx_workspaces_administration', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
+('bx_workspaces_administration', 'switcher', '_bx_workspaces_grid_column_title_adm_active', '8%', 0, '', '', 2),
+('bx_workspaces_administration', 'reports', '_sys_txt_reports_title', '5%', 0, '', '', 3),
+('bx_workspaces_administration', 'fullname', '_bx_workspaces_grid_column_title_adm_fullname', '25%', 0, '', '', 4),
+('bx_workspaces_administration', 'last_online', '_bx_workspaces_grid_column_title_adm_last_online', '20%', 1, '25', '', 5),
+('bx_workspaces_administration', 'account', '_bx_workspaces_grid_column_title_adm_account', '20%', 0, '25', '', 6),
+('bx_workspaces_administration', 'actions', '', '20%', 0, '', '', 7),
+
+('bx_workspaces_common', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
+('bx_workspaces_common', 'fullname', '_bx_workspaces_grid_column_title_adm_fullname', '48%', 0, '', '', 2),
+('bx_workspaces_common', 'last_online', '_bx_workspaces_grid_column_title_adm_last_online', '30%', 1, '25', '', 3),
+('bx_workspaces_common', 'actions', '', '20%', 0, '', '', 4);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon_only`, `confirm`, `order`) VALUES
+('bx_workspaces_administration', 'bulk', 'set_acl_level', '_bx_workspaces_grid_action_title_adm_set_acl_level', '', 0, 0, 1),
+('bx_workspaces_administration', 'bulk', 'delete_with_content', '_bx_workspaces_grid_action_title_adm_delete_with_content', '', 0, 1, 2),
+('bx_workspaces_administration', 'bulk', 'clear_reports', '_bx_workspaces_grid_action_title_adm_clear_reports', '', 0, 1, 3),
+('bx_workspaces_administration', 'single', 'set_acl_level', '_bx_workspaces_grid_action_title_adm_set_acl_level', 'certificate', 1, 0, 1),
+('bx_workspaces_administration', 'single', 'settings', '_bx_workspaces_grid_action_title_adm_more_actions', 'cog', 1, 0, 2),
+('bx_workspaces_administration', 'single', 'audit_content', '_bx_workspaces_grid_action_title_adm_audit_content', 'search', 1, 0, 3),
+('bx_workspaces_administration', 'single', 'audit_profile', '_bx_workspaces_grid_action_title_adm_audit_profile', 'search-location', 1, 0, 4),
+
+('bx_workspaces_common', 'bulk', 'delete_with_content', '_bx_workspaces_grid_action_title_adm_delete_with_content', '', 0, 1, 1),
+('bx_workspaces_common', 'single', 'settings', '_bx_workspaces_grid_action_title_adm_more_actions', 'cog', 1, 0, 1);
+
+-- LIVE UPDATES
+INSERT INTO `sys_objects_live_updates`(`name`, `frequency`, `service_call`, `active`) VALUES
+('bx_workspaces_friend_requests', 1, 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:40:"get_live_updates_unconfirmed_connections";s:6:"params";a:5:{i:0;s:13:"bx_workspaces";i:1;s:20:"sys_profiles_friends";i:2;a:2:{s:11:"menu_object";s:18:"sys_toolbar_member";s:9:"menu_item";s:7:"account";}i:3;a:2:{s:11:"menu_object";s:25:"sys_account_notifications";s:9:"menu_item";s:29:"notifications-friend-requests";}i:4;s:7:"{count}";}s:5:"class";s:23:"TemplServiceConnections";}', 1),
+('bx_workspaces_friend_requests_new', 1, 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:44:"get_live_updates_unconfirmed_connections_new";s:6:"params";a:5:{i:0;s:13:"bx_workspaces";i:1;s:20:"sys_profiles_friends";i:2;a:0:{}i:3;a:0:{}i:4;s:7:"{count}";}s:5:"class";s:23:"TemplServiceConnections";}', 1);
+
+-- ALERTS
+INSERT INTO `sys_alerts_handlers` (`name`, `class`, `file`, `service_call`) VALUES 
+('bx_workspaces', 'BxWorkspacesAlertsResponse', 'modules/boonex/workspaces/classes/BxWorkspacesAlertsResponse.php', '');
+SET @iHandler := LAST_INSERT_ID();
+
+INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
+('system', 'save_setting', @iHandler),
+('sys_profiles_friends', 'connection_added', @iHandler),
+('bx_timeline', 'post_common', @iHandler),
+('bx_workspaces_pictures', 'file_deleted', @iHandler),
+('bx_workspaces', 'timeline_view', @iHandler),
+('bx_workspaces', 'timeline_post', @iHandler),
+('bx_workspaces', 'timeline_delete', @iHandler),
+('bx_workspaces', 'timeline_comment', @iHandler),
+('bx_workspaces', 'timeline_vote', @iHandler),
+('bx_workspaces', 'timeline_score', @iHandler),
+('bx_workspaces', 'timeline_report', @iHandler),
+('bx_workspaces', 'timeline_repost', @iHandler),
+('bx_workspaces', 'timeline_pin', @iHandler),
+('bx_workspaces', '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_workspaces_allow_view_to', 'bx_workspaces', 'view', '_bx_workspaces_form_profile_input_allow_view_to', '3', '', 'bx_workspaces_data', 'id', 'author', 'BxWorkspacesPrivacy', 'modules/boonex/workspaces/classes/BxWorkspacesPrivacy.php'),
+('bx_workspaces_allow_post_to', 'bx_workspaces', 'post', '_bx_workspaces_form_profile_input_allow_post_to', '5', '', 'bx_workspaces_data', 'id', 'author', 'BxWorkspacesPrivacyPost', 'modules/boonex/workspaces/classes/BxWorkspacesPrivacyPost.php'),
+('bx_workspaces_allow_contact_to', 'bx_workspaces', 'contact', '_bx_workspaces_form_profile_input_allow_contact_to', '3', '', 'bx_workspaces_data', 'id', 'author', 'BxWorkspacesPrivacyContact', 'modules/boonex/workspaces/classes/BxWorkspacesPrivacyContact.php');
+
+-- EMAIL TEMPLATES
+INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `Body`) VALUES
+('bx_workspaces', '_bx_workspaces_email_friend_request', 'bx_workspaces_friend_request', '_bx_workspaces_email_friend_request_subject', '_bx_workspaces_email_friend_request_body');
+
+-- UPLOADERS
+INSERT INTO `sys_objects_uploader` (`object`, `active`, `override_class_name`, `override_class_file`) VALUES
+('bx_workspaces_cover_crop', 1, 'BxWorkspacesUploaderCoverCrop', 'modules/boonex/workspaces/classes/BxWorkspacesUploaderCoverCrop.php'),
+('bx_workspaces_picture_crop', 1, 'BxWorkspacesUploaderPictureCrop', 'modules/boonex/workspaces/classes/BxWorkspacesUploaderPictureCrop.php');

+ 245 - 0
modules/boonex/workspaces/install/sql/install.sql

@@ -0,0 +1,245 @@
+
+SET @sStorageEngine = (SELECT `value` FROM `sys_options` WHERE `name` = 'sys_storage_default');
+
+-- TABLE: PROFILES
+CREATE TABLE IF NOT EXISTS `bx_workspaces_data` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `author` int(10) unsigned NOT NULL,
+  `added` int(11) NOT NULL,
+  `changed` int(11) NOT NULL,
+  `views` int(11) NOT NULL default '0',
+  `rate` float NOT NULL default '0',
+  `votes` int(11) NOT NULL default '0',
+  `rrate` float NOT NULL default '0',
+  `rvotes` int(11) NOT NULL default '0',
+  `score` int(11) NOT NULL default '0',
+  `sc_up` int(11) NOT NULL default '0',
+  `sc_down` int(11) NOT NULL default '0',
+  `favorites` int(11) NOT NULL default '0',
+  `comments` int(11) NOT NULL default '0',
+  `reports` int(11) NOT NULL default '0',
+  `featured` int(11) NOT NULL default '0',
+  `allow_view_to` varchar(16) NOT NULL DEFAULT '3',
+  `allow_post_to` varchar(16) NOT NULL DEFAULT '5',
+  `allow_contact_to` varchar(16) NOT NULL DEFAULT '3',
+  `settings` text NOT NULL,
+  PRIMARY KEY (`id`)
+);
+
+-- TABLE: VIEWS
+CREATE TABLE IF NOT EXISTS `bx_workspaces_views_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `viewer_id` int(11) NOT NULL default '0',
+  `viewer_nip` int(11) unsigned NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
+);
+
+-- TABLE: VOTES
+CREATE TABLE IF NOT EXISTS `bx_workspaces_votes` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `count` int(11) NOT NULL default '0',
+  `sum` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `object_id` (`object_id`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_workspaces_votes_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `author_nip` int(11) unsigned NOT NULL default '0',
+  `value` tinyint(4) NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `vote` (`object_id`, `author_nip`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_workspaces_reactions` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `reaction` varchar(32) NOT NULL default '',
+  `count` int(11) NOT NULL default '0',
+  `sum` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `reaction` (`object_id`, `reaction`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_workspaces_reactions_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `author_nip` int(11) unsigned NOT NULL default '0',
+  `reaction` varchar(32) NOT NULL default '',
+  `value` tinyint(4) NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `vote` (`object_id`, `author_nip`)
+);
+
+-- TABLE: favorites
+CREATE TABLE IF NOT EXISTS `bx_workspaces_favorites_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `id` (`object_id`,`author_id`)
+);
+
+-- TABLE: reports
+CREATE TABLE IF NOT EXISTS `bx_workspaces_reports` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `count` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `object_id` (`object_id`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_workspaces_reports_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `author_nip` int(11) unsigned NOT NULL default '0',
+  `type` varchar(32) NOT NULL default '',
+  `text` text NOT NULL default '',
+  `date` int(11) NOT NULL default '0',
+  `checked_by` int(11) NOT NULL default '0',
+  `status` tinyint(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `report` (`object_id`, `author_nip`)
+);
+
+-- TABLE: scores
+CREATE TABLE IF NOT EXISTS `bx_workspaces_scores` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `count_up` int(11) NOT NULL default '0',
+  `count_down` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `object_id` (`object_id`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_workspaces_scores_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `author_nip` int(11) unsigned NOT NULL default '0',
+  `type` varchar(8) NOT NULL default '',
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `vote` (`object_id`, `author_nip`)
+);
+
+-- FORMS
+INSERT INTO `sys_objects_form`(`object`, `module`, `title`, `action`, `form_attrs`, `table`, `key`, `uri`, `uri_title`, `submit_name`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`, `parent_form`) VALUES 
+('bx_workspace', 'bx_workspaces', '_bx_workspaces_form_profile', '', 'a:1:{s:7:\"enctype\";s:19:\"multipart/form-data\";}', 'bx_workspaces_data', 'id', '', '', 'do_submit', '', 0, 1, 'BxWorkspacesFormEntry', 'modules/boonex/workspaces/classes/BxWorkspacesFormEntry.php', '');
+
+INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES 
+('bx_workspace', 'bx_workspace_add', 'bx_workspaces', 0, '_bx_workspaces_form_profile_display_add'),
+('bx_workspace', 'bx_workspace_delete', 'bx_workspaces', 0, '_bx_workspaces_form_profile_display_delete'),
+('bx_workspace', 'bx_workspace_edit', 'bx_workspaces', 0, '_bx_workspaces_form_profile_display_edit'),
+('bx_workspace', 'bx_workspace_view', 'bx_workspaces', 1, '_bx_workspaces_form_profile_display_view'),
+('bx_workspace', 'bx_workspace_view_full', 'bx_workspaces', 1, '_bx_workspaces_form_profile_display_view_full');
+
+INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`, `rateable`) VALUES 
+('bx_workspace', 'bx_workspaces', 'allow_view_to', 3, '', 0, 'custom', '_bx_workspaces_form_profile_input_sys_allow_view_to', '_bx_workspaces_form_profile_input_allow_view_to', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0, ''),
+('bx_workspace', 'bx_workspaces', 'allow_post_to', 5, '', 0, 'custom', '_bx_workspaces_form_profile_input_sys_allow_post_to', '_bx_workspaces_form_profile_input_allow_post_to', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0, ''),
+('bx_workspace', 'bx_workspaces', 'allow_contact_to', 3, '', 0, 'custom', '_bx_workspaces_form_profile_input_sys_allow_contact_to', '_bx_workspaces_form_profile_input_allow_contact_to', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0, ''),
+('bx_workspace', 'bx_workspaces', 'delete_confirm', 1, '', 0, 'checkbox', '_bx_workspaces_form_profile_input_sys_delete_confirm', '_bx_workspaces_form_profile_input_delete_confirm', '_bx_workspaces_form_profile_input_delete_confirm_info', 1, 0, 0, '', '', '', 'Avail', '', '_bx_workspaces_form_profile_input_delete_confirm_error', '', '', 1, 0, ''),
+('bx_workspace', 'bx_workspaces', 'do_submit', '_bx_workspaces_form_profile_input_submit', '', 0, 'submit', '_bx_workspaces_form_profile_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0, ''),
+('bx_workspace', 'bx_workspaces', 'do_cancel', '_sys_form_input_cancel', '', 0, 'button', '_sys_form_input_sys_cancel', '', '', 0, 0, 0, 'a:2:{s:7:"onclick";s:41:"window.open(''{edit_cancel_url}'', ''_self'')";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 0, 0, ''),
+('bx_workspace', 'bx_workspaces', 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '_sys_form_input_sys_controls', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0, ''),
+('bx_workspace', 'bx_workspaces', 'profile_email', '', '', 0, 'text', '_bx_workspaces_form_profile_input_sys_profile_email', '_bx_workspaces_form_profile_input_profile_email', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0, ''),
+('bx_workspace', 'bx_workspaces', 'profile_status', '', '', 0, 'text', '_bx_workspaces_form_profile_input_sys_profile_status', '_bx_workspaces_form_profile_input_profile_status', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0, ''),
+('bx_workspace', 'bx_workspaces', 'profile_ip', '', '', 0, 'text', '_bx_workspaces_form_profile_input_sys_profile_ip', '_bx_workspaces_form_profile_input_profile_ip', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0, ''),
+('bx_workspace', 'bx_workspaces', 'profile_last_active', '', '', 0, 'text', '_bx_workspaces_form_profile_input_sys_profile_last_active', '_bx_workspaces_form_profile_input_profile_last_active', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0, ''),
+('bx_workspace', 'bx_workspaces', 'added', '', '', 0, 'datetime', '_bx_workspaces_form_profile_input_sys_date_added', '_bx_workspaces_form_profile_input_date_added', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0, ''),
+('bx_workspace', 'bx_workspaces', 'changed', '', '', 0, 'datetime', '_bx_workspaces_form_profile_input_sys_date_changed', '_bx_workspaces_form_profile_input_date_changed', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0, ''),
+('bx_workspace', 'bx_workspaces', 'friends_count', '', '', 0, 'text', '_bx_workspaces_form_profile_input_sys_friends_count', '_bx_workspaces_form_profile_input_friends_count', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0, ''),
+('bx_workspace', 'bx_workspaces', 'followers_count', '', '', 0, 'text', '_bx_workspaces_form_profile_input_sys_followers_count', '_bx_workspaces_form_profile_input_followers_count', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0, '');
+
+INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES 
+('bx_workspace_add', 'allow_view_to', 2147483647, 1, 8),
+('bx_workspace_add', 'allow_post_to', 2147483647, 1, 9),
+('bx_workspace_add', 'allow_contact_to', 2147483647, 1, 10),
+('bx_workspace_add', 'do_submit', 2147483647, 1, 11),
+
+('bx_workspace_delete', 'delete_confirm', 2147483647, 1, 0),
+('bx_workspace_delete', 'do_submit', 2147483647, 1, 1),
+
+('bx_workspace_edit', 'allow_view_to', 2147483647, 1, 8),
+('bx_workspace_edit', 'allow_post_to', 2147483647, 1, 9),
+('bx_workspace_edit', 'allow_contact_to', 2147483647, 1, 10),
+('bx_workspace_edit', 'controls', 2147483647, 1, 11),
+('bx_workspace_edit', 'do_submit', 2147483647, 1, 12),
+('bx_workspace_edit', 'do_cancel', 2147483647, 1, 13),
+
+('bx_workspace_view', 'profile_email', 192, 1, 5),
+('bx_workspace_view', 'profile_status', 192, 1, 6),
+('bx_workspace_view', 'profile_ip', 192, 1, 7),
+('bx_workspace_view', 'profile_last_active', 192, 1, 8),
+('bx_workspace_view', 'added', 192, 1, 9),
+('bx_workspace_view', 'changed', 192, 1, 10),
+('bx_workspace_view', 'friends_count', 2147483647, 1, 11),
+('bx_workspace_view', 'followers_count', 2147483647, 1, 12),
+
+('bx_workspace_view_full', 'profile_email', 192, 1, 6),
+('bx_workspace_view_full', 'profile_status', 192, 1, 7),
+('bx_workspace_view_full', 'profile_last_active', 192, 1, 8);
+
+-- COMMENTS
+INSERT INTO `sys_objects_cmts` (`Name`, `Module`, `Table`, `CharsPostMin`, `CharsPostMax`, `CharsDisplayMax`, `Html`, `PerView`, `PerViewReplies`, `BrowseType`, `IsBrowseSwitch`, `PostFormPosition`, `NumberOfLevels`, `IsDisplaySwitch`, `IsRatable`, `ViewingThreshold`, `IsOn`, `RootStylePrefix`, `BaseUrl`, `ObjectVote`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldTitle`, `TriggerFieldComments`, `ClassName`, `ClassFile`) VALUES
+('bx_workspaces', 'bx_workspaces', 'bx_workspaces_cmts', 1, 5000, 1000, 3, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-workspaces-profile&id={object_id}', '', 'bx_workspaces_data', 'id', 'author', 'fullname', 'comments', 'BxWorkspacesCmts', 'modules/boonex/workspaces/classes/BxWorkspacesCmts.php'),
+('bx_workspaces_notes', 'bx_workspaces', 'bx_workspaces_cmts_notes', 1, 5000, 1000, 0, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-post&id={object_id}', '', 'bx_workspaces_data', 'id', 'author', 'fullname', '', 'BxTemplCmtsNotes', '');
+
+-- VIEWS
+INSERT INTO `sys_objects_view` (`name`, `module`, `table_track`, `period`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_workspaces', 'bx_workspaces', 'bx_workspaces_views_track', '86400', '1', 'bx_workspaces_data', 'id', 'author', 'views', '', '');
+
+-- VOTES
+INSERT INTO `sys_objects_vote` (`Name`, `Module`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES 
+('bx_workspaces', 'bx_workspaces', 'bx_workspaces_votes', 'bx_workspaces_votes_track', '604800', '1', '1', '0', '1', 'bx_workspaces_data', 'id', '', 'rate', 'votes', 'BxWorkspacesVote', 'modules/boonex/workspaces/classes/BxWorkspacesVote.php'),
+('bx_workspaces_reactions', 'bx_workspaces', 'bx_workspaces_reactions', 'bx_workspaces_reactions_track', '604800', '1', '1', '1', '1', 'bx_workspaces_data', 'id', 'author', 'rrate', 'rvotes', 'BxTemplVoteReactions', '');
+
+-- SCORES
+INSERT INTO `sys_objects_score` (`name`, `module`, `table_main`, `table_track`, `post_timeout`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_score`, `trigger_field_cup`, `trigger_field_cdown`, `class_name`, `class_file`) VALUES 
+('bx_workspaces', 'bx_workspaces', 'bx_workspaces_scores', 'bx_workspaces_scores_track', '604800', '1', 'bx_workspaces_data', 'id', 'author', 'score', 'sc_up', 'sc_down', '', '');
+
+-- FAFORITES
+INSERT INTO `sys_objects_favorite` (`name`, `table_track`, `is_on`, `is_undo`, `is_public`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_workspaces', 'bx_workspaces_favorites_track', '1', '1', '0', 'page.php?i=view-workspaces-profile&id={object_id}', 'bx_workspaces_data', 'id', 'author', 'favorites', 'BxWorkspacesFavorite', 'modules/boonex/workspaces/classes/BxWorkspacesFavorite.php');
+
+-- FEATURED
+INSERT INTO `sys_objects_feature` (`name`, `module`, `is_on`, `is_undo`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_flag`, `class_name`, `class_file`) VALUES 
+('bx_workspaces', 'bx_workspaces', '1', '1', 'page.php?i=view-workspaces-profile&id={object_id}', 'bx_workspaces_data', 'id', 'author', 'featured', '', '');
+
+-- REPORTS
+INSERT INTO `sys_objects_report` (`name`, `module`, `table_main`, `table_track`, `is_on`, `base_url`, `object_comment`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_workspaces', 'bx_workspaces', 'bx_workspaces_reports', 'bx_workspaces_reports_track', '1', 'page.php?i=view-workspaces-profile&id={object_id}', 'bx_workspaces_notes', 'bx_workspaces_data', 'id', 'author', 'reports', 'BxWorkspacesReport', 'modules/boonex/workspaces/classes/BxWorkspacesReport.php');
+
+-- CONTENT INFO
+INSERT INTO `sys_objects_content_info` (`name`, `title`, `alert_unit`, `alert_action_add`, `alert_action_update`, `alert_action_delete`, `class_name`, `class_file`) VALUES
+('bx_workspaces', '_bx_workspaces', 'bx_workspaces', 'added', 'edited', 'deleted', '', ''),
+('bx_workspaces_cmts', '_bx_workspaces_cmts', 'bx_workspaces', 'commentPost', 'commentUpdated', 'commentRemoved', 'BxDolContentInfoCmts', '');
+
+INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`, `condition`, `selection`) VALUES
+('bx_workspaces', 'bx_workspaces_administration', 'td`.`id', '', ''),
+('bx_workspaces', 'bx_workspaces_common', 'td`.`id', '', '');
+
+
+-- STUDIO PAGE & WIDGET
+INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
+(3, 'bx_workspaces', '_bx_workspaces', '_bx_workspaces', 'bx_workspaces@modules/boonex/workspaces/|std-icon.svg');
+SET @iPageId = LAST_INSERT_ID();
+
+SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
+SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
+INSERT INTO `sys_std_widgets` (`page_id`, `module`, `type`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
+(@iPageId, 'bx_workspaces', 'users', '{url_studio}module.php?name=bx_workspaces', '', 'bx_workspaces@modules/boonex/workspaces/|std-icon.svg', '_bx_workspaces', '', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:18:"TemplStudioModules";}');
+INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
+(@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));
+

+ 43 - 0
modules/boonex/workspaces/install/sql/uninstall.sql

@@ -0,0 +1,43 @@
+
+-- TABLES
+DROP TABLE IF EXISTS `bx_workspaces_data`, `bx_workspaces_cmts`, `bx_workspaces_cmts_notes`, `bx_workspaces_views_track`, `bx_workspaces_votes`, `bx_workspaces_votes_track`, `bx_workspaces_reactions`, `bx_workspaces_reactions_track`, `bx_workspaces_favorites_track`, `bx_workspaces_reports`, `bx_workspaces_reports_track`, `bx_workspaces_scores`, `bx_workspaces_scores_track`;
+
+-- PROFILES
+DELETE FROM sys_profiles WHERE `type` = 'bx_workspaces';
+
+-- FORMS
+DELETE FROM `sys_objects_form` WHERE `module` = 'bx_workspaces';
+DELETE FROM `sys_form_displays` WHERE `module` = 'bx_workspaces';
+DELETE FROM `sys_form_inputs` WHERE `module` = 'bx_workspaces';
+DELETE FROM `sys_form_display_inputs` WHERE `display_name` IN('bx_workspace_add', 'bx_workspace_delete', 'bx_workspace_edit', 'bx_workspace_edit_cover', 'bx_workspace_view', 'bx_workspace_view_full', 'bx_workspace_skills', 'bx_workspace_skills_view');
+
+-- COMMENTS
+DELETE FROM `sys_objects_cmts` WHERE `Name` LIKE 'bx_workspaces%';
+
+-- VIEWS
+DELETE FROM `sys_objects_view` WHERE `name` = 'bx_workspaces';
+
+-- VOTES
+DELETE FROM `sys_objects_vote` WHERE `Name` IN ('bx_workspaces', 'bx_workspaces_reactions');
+
+-- SCORES
+DELETE FROM `sys_objects_score` WHERE `name` = 'bx_workspaces';
+
+-- FAFORITES
+DELETE FROM `sys_objects_favorite` WHERE `name` = 'bx_workspaces';
+
+-- FEATURED
+DELETE FROM `sys_objects_feature` WHERE `name` = 'bx_workspaces';
+
+-- REPORTS
+DELETE FROM `sys_objects_report` WHERE `name` = 'bx_workspaces';
+
+-- CONTENT INFO
+DELETE FROM `sys_objects_content_info` WHERE `name` IN ('bx_workspaces', 'bx_workspaces_cmts');
+
+DELETE FROM `sys_content_info_grids` WHERE `object` IN ('bx_workspaces');
+
+-- STUDIO PAGE & WIDGET
+DELETE FROM `tp`, `tw`, `twb`, `tpw` 
+USING `sys_std_pages` AS `tp` LEFT JOIN `sys_std_widgets` AS `tw` ON `tp`.`id` = `tw`.`page_id` LEFT JOIN `sys_std_widgets_bookmarks` AS `twb` ON `tw`.`id` = `twb`.`widget_id` LEFT JOIN `sys_std_pages_widgets` AS `tpw` ON `tw`.`id` = `tpw`.`widget_id`
+WHERE  `tp`.`name` = 'bx_workspaces';

+ 57 - 0
modules/boonex/workspaces/install/sql2/disable.sql

@@ -0,0 +1,57 @@
+
+-- SETTINGS
+
+SET @iTypeId = (SELECT `ID` FROM `sys_options_types` WHERE `name` = 'bx_workspaces' LIMIT 1);
+SET @iCategId = (SELECT `ID` FROM `sys_options_categories` WHERE `type_id` = @iTypeId LIMIT 1);
+DELETE FROM `sys_options` WHERE `category_id` = @iCategId;
+DELETE FROM `sys_options_categories` WHERE `type_id` = @iTypeId;
+DELETE FROM `sys_options_types` WHERE `id` = @iTypeId;
+
+-- PAGES
+
+DELETE FROM `sys_objects_page` WHERE `module` = 'bx_workspaces';
+DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_workspaces' OR `object` IN('bx_workspaces_create_profile', 'bx_workspaces_delete_profile', 'bx_workspaces_edit_profile', 'bx_workspaces_edit_profile_cover', 'bx_workspaces_view_profile', 'bx_workspaces_view_profile_closed', 'bx_workspaces_profile_info', 'bx_workspaces_profile_friends', 'bx_workspaces_friend_requests', 'bx_workspaces_profile_favorites', 'bx_workspaces_profile_subscriptions', 'bx_workspaces_profile_comments', 'bx_workspaces_home', 'bx_workspaces_search', 'bx_workspaces_manage');
+
+-- MENU
+
+DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_workspaces';
+DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_workspaces';
+DELETE FROM `sys_menu_items` WHERE `module` = 'bx_workspaces' OR `set_name` IN('bx_workspaces_view_submenu', 'bx_workspaces_submenu', 'bx_workspaces_view_actions', 'bx_workspaces_view_actions_more', 'bx_workspaces_view_actions_all', 'bx_workspaces_view_meta', 'bx_workspaces_snippet_meta', 'bx_workspaces_menu_manage_tools');
+
+-- ACL
+DELETE `sys_acl_actions`, `sys_acl_matrix` FROM `sys_acl_actions`, `sys_acl_matrix` WHERE `sys_acl_matrix`.`IDAction` = `sys_acl_actions`.`ID` AND `sys_acl_actions`.`Module` = 'bx_workspaces';
+DELETE FROM `sys_acl_actions` WHERE `Module` = 'bx_workspaces';
+
+-- METATAGS
+DELETE FROM `sys_objects_metatags` WHERE `object` = 'bx_workspaces';
+
+-- SEARCH
+DELETE FROM `sys_objects_search` WHERE `ObjectName` IN ('bx_workspaces', 'bx_workspaces_cmts');
+
+-- STATS
+DELETE FROM `sys_statistics` WHERE `name` LIKE 'bx_workspaces%';
+
+-- CHARTS
+DELETE FROM `sys_objects_chart` WHERE `object` LIKE 'bx_workspaces%';
+
+-- GRIDS
+DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_workspaces_administration', 'bx_workspaces_common');
+DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_workspaces_administration', 'bx_workspaces_common');
+DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_workspaces_administration', 'bx_workspaces_common');
+
+-- LIVE UPDATES
+DELETE FROM `sys_objects_live_updates` WHERE `name` LIKE 'bx_workspaces%';
+
+-- ALERTS
+SET @iHandler := (SELECT `id` FROM `sys_alerts_handlers` WHERE `name` = 'bx_workspaces' LIMIT 1);
+DELETE FROM `sys_alerts` WHERE `handler_id` = @iHandler;
+DELETE FROM `sys_alerts_handlers` WHERE `id` = @iHandler;
+
+-- PRIVACY 
+DELETE FROM `sys_objects_privacy` WHERE `object` IN ('bx_workspaces_allow_view_to', 'bx_workspaces_allow_post_to', 'bx_workspaces_allow_contact_to');
+
+-- EMAIL TEMPLATES
+DELETE FROM `sys_email_templates` WHERE `Module` = 'bx_workspaces';
+
+-- UPLOADERS
+DELETE FROM `sys_objects_uploader` WHERE `object` IN ('bx_workspaces_cover_crop', 'bx_workspaces_picture_crop');

+ 457 - 0
modules/boonex/workspaces/install/sql2/enable.sql

@@ -0,0 +1,457 @@
+
+-- 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_workspaces', '_bx_workspaces', 'bx_workspaces@modules/boonex/workspaces/|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_workspaces', '_bx_workspaces', 1);
+SET @iCategId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
+('bx_workspaces_autoapproval', 'on', @iCategId, '_bx_workspaces_option_autoapproval', 'select', 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:22:"get_options_activation";}', '', '', 1),
+('bx_workspaces_default_acl_level', '3', @iCategId, '_bx_workspaces_option_default_acl_level', 'select', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:15:"get_memberships";s:6:"params";a:4:{s:11:"purchasable";b:0;s:6:"active";b:1;s:9:"translate";b:1;s:22:"filter_out_auto_levels";b:1;}s:5:"class";s:16:"TemplAclServices";}', '', '', 2),
+('bx_workspaces_num_connections_quick', '6', @iCategId, '_bx_workspaces_option_num_connections_quick', 'digit', '', '', '', 10),
+('bx_workspaces_searchable_fields', '', @iCategId, '_bx_workspaces_option_searchable_fields', 'list', 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:21:"get_searchable_fields";}', '', '', 20),
+('bx_workspaces_friends', 'on', @iCategId, '_bx_workspaces_option_friends', 'checkbox', '', '', '', 30),
+('bx_workspaces_public_subscriptions', '', @iCategId, '_bx_workspaces_option_public_subscriptions', 'checkbox', '', '', '', 35),
+('bx_workspaces_public_subscribed_me', '', @iCategId, '_bx_workspaces_option_public_subscribed_me', 'checkbox', '', '', '', 36),
+('bx_workspaces_enable_profile_activation_letter', 'on', @iCategId, '_bx_workspaces_option_enable_profile_activation_letter', 'checkbox', '', '', '', 40);
+
+-- PAGES
+
+-- 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_workspaces_view_profile', 'view-workspaces-profile', '_bx_workspaces_page_title_sys_view_profile', '_bx_workspaces_page_title_view_profile', 'bx_workspaces', 7, 2147483647, 1, 'page.php?i=view-workspaces-profile', '', '', '', 0, 1, 0, 'BxWorkspacesPageEntry', 'modules/boonex/workspaces/classes/BxWorkspacesPageEntry.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_workspaces_view_profile', 0, 'bx_workspaces', '_bx_workspaces_page_block_title_sys_cover_block', '_bx_workspaces_page_block_title_cover_block', 3, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:12:\"entity_cover\";}', 0, 0, 1, 0),
+('bx_workspaces_view_profile', 0, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_friends_mutual', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:22:\"profile_friends_mutual\";}', 0, 0, 1, 0),
+('bx_workspaces_view_profile', 2, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_subscriptions', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:21:\"profile_subscriptions\";}', 0, 1, 0, 0),
+('bx_workspaces_view_profile', 2, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_subscribed_me', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:21:\"profile_subscribed_me\";}', 0, 1, 0, 0),
+('bx_workspaces_view_profile', 2, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_related_me', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:18:"profile_related_me";}', 0, 1, 0, 0),
+('bx_workspaces_view_profile', 2, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_comments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 0, 0),
+('bx_workspaces_view_profile', 2, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_description', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:17:\"entity_text_block\";}', 0, 0, 1, 1),
+('bx_workspaces_view_profile', 2, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_friends', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:15:\"profile_friends\";}', 0, 1, 1, 2),
+('bx_workspaces_view_profile', 2, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_relations', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:17:"profile_relations";}', 0, 1, 1, 3),
+('bx_workspaces_view_profile', 2, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_calendar', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:15:\"entity_calendar\";}', 0, 0, 0, 4),
+('bx_workspaces_view_profile', 3, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_location', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:15:\"entity_location\";}', 0, 0, 0, 0),
+('bx_workspaces_view_profile', 3, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_info', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:11:\"entity_info\";}', 0, 0, 1, 1),
+('bx_workspaces_view_profile', 3, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_all_actions', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:18:"entity_all_actions";}', 0, 0, 0, 0),
+('bx_workspaces_view_profile', 3, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_membership', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:18:\"profile_membership\";}', 0, 0, 1, 2),
+('bx_workspaces_view_profile', 3, 'bx_workspaces', '', '_bx_workspaces_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:13:\"bx_workspaces\";i:1;s:12:\"{content_id}\";}s:5:\"class\";s:20:\"TemplServiceMetatags\";}', 0, 0, 1, 3),
+('bx_workspaces_view_profile', 2, 'bx_workspaces', '', '_bx_workspaces_page_block_title_entry_reports', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";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_workspaces_view_profile_closed', 'view-workspace-profile-closed', '_bx_workspaces_page_title_sys_view_profile_closed', '_bx_workspaces_page_title_view_profile', 'bx_workspaces', 10, 2147483647, 1, 'page.php?i=view-workspace-profile', '', '', '', 0, 1, 0, 'BxWorkspacesPageEntry', 'modules/boonex/workspaces/classes/BxWorkspacesPageEntry.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_workspaces_view_profile_closed', 1, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_private', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:19:\"private_profile_msg\";}', 0, 1, 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_workspaces_edit_profile', 'edit-workspaces-profile', '_bx_workspaces_page_title_sys_edit_profile', '_bx_workspaces_page_title_edit_profile', 'bx_workspaces', 5, 2147483647, 1, 'page.php?i=edit-workspaces-profile', '', '', '', 0, 1, 0, 'BxWorkspacesPageEntry', 'modules/boonex/workspaces/classes/BxWorkspacesPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_workspaces_edit_profile', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_edit_profile', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:11:\"entity_edit\";}', 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_workspaces_delete_profile', 'delete-workspaces-profile', '_bx_workspaces_page_title_sys_delete_profile', '_bx_workspaces_page_title_delete_profile', 'bx_workspaces', 5, 2147483647, 1, 'page.php?i=delete-workspaces-profile', '', '', '', 0, 1, 0, 'BxWorkspacesPageEntry', 'modules/boonex/workspaces/classes/BxWorkspacesPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_workspaces_delete_profile', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_delete_profile', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:13:\"entity_delete\";}', 0, 0, 0);
+
+-- PAGE: profile info
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_workspaces_profile_info', 'workspaces-profile-info', '_bx_workspaces_page_title_sys_profile_info', '_bx_workspaces_page_title_profile_info', 'bx_workspaces', 5, 2147483647, 1, 'page.php?i=workspaces-profile-info', '', '', '', 0, 1, 0, 'BxWorkspacesPageEntry', 'modules/boonex/workspaces/classes/BxWorkspacesPageEntry.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_workspaces_profile_info', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_system_profile_info', '_bx_workspaces_page_block_title_profile_info_link', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:16:\"entity_info_full\";}', 0, 0, 1, 1),
+('bx_workspaces_profile_info', 1, 'bx_workspaces', '', '_bx_workspaces_page_block_title_profile_description', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:17:\"entity_text_block\";}', 0, 0, 1, 2);
+
+-- PAGE: profile friends
+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_workspaces_profile_friends', 'workspaces-profile-friends', '_bx_workspaces_page_title_sys_profile_friends', '_bx_workspaces_page_title_profile_friends', 'bx_workspaces', 5, 2147483647, 1, 'page.php?i=workspaces-profile-friends', '', '', '', 0, 1, 0, 'BxWorkspacesPageEntry', 'modules/boonex/workspaces/classes/BxWorkspacesPageEntry.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_workspaces_profile_friends', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_system_profile_friends', '_bx_workspaces_page_block_title_profile_friends_link', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:17:"connections_table";s:6:"params";a:1:{i:0;s:12:"{profile_id}";}s:5:"class";s:23:"TemplServiceConnections";}', 0, 0, 1, 1);
+
+-- PAGE: profile friend requests
+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_workspaces_friend_requests', 'workspaces-friend-requests', '_bx_workspaces_page_title_sys_friend_requests', '_bx_workspaces_page_title_friend_requests', 'bx_workspaces', 5, 2147483647, 1, 'page.php?i=workspaces-friend-requests', '', '', '', 0, 1, 0, 'BxWorkspacesPageEntry', 'modules/boonex/workspaces/classes/BxWorkspacesPageEntry.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_workspaces_friend_requests', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_system_friend_requests', '_bx_workspaces_page_block_title_friend_requests_link', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:25:\"connections_request_table\";s:5:\"class\";s:23:\"TemplServiceConnections\";}', 0, 0, 1, 1);
+
+-- PAGE: profile favorites
+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_workspaces_profile_favorites', 'workspaces-profile-favorites', '_bx_workspaces_page_title_sys_profile_favorites', '_bx_workspaces_page_title_profile_favorites', 'bx_workspaces', 5, 2147483647, 1, 'page.php?i=workspaces-profile-favorites', '', '', '', 0, 1, 0, 'BxWorkspacesPageBrowse', 'modules/boonex/workspaces/classes/BxWorkspacesPageBrowse.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_workspaces_profile_favorites', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_system_profile_favorites', '_bx_workspaces_page_block_title_profile_favorites', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:15:"browse_favorite";}', 0, 1, 1, 1);
+
+-- PAGE: profile subscriptions
+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_workspaces_profile_subscriptions', 'workspaces-profile-subscriptions', '_bx_workspaces_page_title_sys_profile_subscriptions', '_bx_workspaces_page_title_profile_subscriptions', 'bx_workspaces', 5, 2147483647, 1, 'page.php?i=workspaces-profile-subscriptions', '', '', '', 0, 1, 0, 'BxWorkspacesPageEntry', 'modules/boonex/workspaces/classes/BxWorkspacesPageEntry.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_workspaces_profile_subscriptions', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_system_profile_subscriptions', '_bx_workspaces_page_block_title_profile_subscriptions', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:19:\"subscriptions_table\";s:5:\"class\";s:23:\"TemplServiceConnections\";}', 0, 0, 1, 1),
+('bx_workspaces_profile_subscriptions', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_system_profile_subscribed_me', '_bx_workspaces_page_block_title_profile_subscribed_me', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:19:\"subscribed_me_table\";s:5:\"class\";s:23:\"TemplServiceConnections\";}', 0, 0, 1, 2);
+
+-- PAGE: profile relations
+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_workspaces_profile_relations', 'workspaces-profile-relations', '_bx_workspaces_page_title_sys_profile_relations', '_bx_workspaces_page_title_profile_relations', 'bx_workspaces', 5, 2147483647, 1, 'page.php?i=workspaces-profile-relations', '', '', '', 0, 1, 0, 'BxWorkspacesPageEntry', 'modules/boonex/workspaces/classes/BxWorkspacesPageEntry.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_workspaces_profile_relations', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_system_profile_relations', '_bx_workspaces_page_block_title_profile_relations', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:6:"system";s:6:"method";s:15:"relations_table";s:5:"class";s:23:"TemplServiceConnections";}', 0, 0, 1, 1),
+('bx_workspaces_profile_relations', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_system_profile_related_me', '_bx_workspaces_page_block_title_profile_related_me', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:6:"system";s:6:"method";s:16:"related_me_table";s:5:"class";s:23:"TemplServiceConnections";}', 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_workspaces_profile_comments', '_bx_workspaces_page_title_sys_profile_comments', '_bx_workspaces_page_title_profile_comments', 'bx_workspaces', 5, 2147483647, 1, 'workspaces-profile-comments', '', '', '', '', 0, 1, 0, 'BxWorkspacesPageEntry', 'modules/boonex/workspaces/classes/BxWorkspacesPageEntry.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_workspaces_profile_comments', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_profile_comments', '_bx_workspaces_page_block_title_profile_comments_link', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 0, 1);
+
+-- 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_workspaces_manage', '_bx_workspaces_page_title_sys_manage', '_bx_workspaces_page_title_manage', 'bx_workspaces', 5, 2147483647, 1, 'workspaces-manage', 'page.php?i=workspaces-manage', '', '', '', 0, 1, 0, 'BxWorkspacesPageBrowse', 'modules/boonex/workspaces/classes/BxWorkspacesPageBrowse.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_workspaces_manage', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_system_manage', '_bx_workspaces_page_block_title_manage', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:13:\"bx_workspaces\";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_workspaces_administration', '_bx_workspaces_page_title_sys_manage_administration', '_bx_workspaces_page_title_manage', 'bx_workspaces', 5, 192, 1, 'workspaces-administration', 'page.php?i=workspaces-administration', '', '', '', 0, 1, 0, 'BxWorkspacesPageBrowse', 'modules/boonex/workspaces/classes/BxWorkspacesPageBrowse.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_workspaces_administration', 1, 'bx_workspaces', '_bx_workspaces_page_block_title_system_manage_administration', '_bx_workspaces_page_block_title_manage', 11, 192, 'service', 'a:3:{s:6:\"module\";s:13:\"bx_workspaces\";s:6:\"method\";s:12:\"manage_tools\";s:6:\"params\";a:1:{i:0;s:14:\"administration\";}}', 0, 1, 0);
+
+-- MENU
+
+-- 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_workspaces_view_actions', '_bx_workspaces_menu_title_view_profile_actions', 'bx_workspaces_view_actions', 'bx_workspaces', 9, 0, 1, 'BxWorkspacesMenuViewActions', 'modules/boonex/workspaces/classes/BxWorkspacesMenuViewActions.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_workspaces_view_actions', 'bx_workspaces', '_bx_workspaces_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`, `order`) VALUES 
+('bx_workspaces_view_actions', 'bx_workspaces', 'profile-friend-add', '_bx_workspaces_menu_item_title_system_befriend', '{title_add_friend}', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_friends\', \'add\', \'{profile_id}\')', '', 'user-plus', '', 0, 2147483647, '', 1, 0, 10),
+('bx_workspaces_view_actions', 'bx_workspaces', 'profile-friend-remove', '_bx_workspaces_menu_item_title_system_unfriend', '{title_remove_friend}', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_friends\', \'remove\', \'{profile_id}\')', '', 'user-times', '', 0, 2147483647, '', 1, 0, 11),
+('bx_workspaces_view_actions', 'bx_workspaces', 'profile-relation-add', '_bx_workspaces_menu_item_title_system_relation_add', '_bx_workspaces_menu_item_title_relation_add', 'javascript:void(0)', 'bx_menu_popup(''sys_add_relation'', window, {}, {profile_id: {profile_id}});', '', 'sync', '', 0, 2147483647, '', 1, 0, 15),
+('bx_workspaces_view_actions', 'bx_workspaces', 'profile-relation-remove', '_bx_workspaces_menu_item_title_system_relation_delete', '_bx_workspaces_menu_item_title_relation_delete', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_relations\', \'remove\', \'{profile_id}\')', '', 'sync', '', 0, 2147483647, '', 1, 0, 16),
+('bx_workspaces_view_actions', 'bx_workspaces', 'profile-subscribe-add', '_bx_workspaces_menu_item_title_system_subscribe', '_bx_workspaces_menu_item_title_subscribe', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_subscriptions\', \'add\', \'{profile_id}\')', '', 'check', '', 0, 2147483647, '', 1, 0, 20),
+('bx_workspaces_view_actions', 'bx_workspaces', 'profile-subscribe-remove', '_bx_workspaces_menu_item_title_system_unsubscribe', '_bx_workspaces_menu_item_title_unsubscribe', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_subscriptions\', \'remove\', \'{profile_id}\')', '', 'check', '', 0, 2147483647, '', 1, 0, 21),
+('bx_workspaces_view_actions', 'bx_workspaces', 'profile-set-acl-level', '_sys_menu_item_title_system_set_acl_level', '_sys_menu_item_title_set_acl_level', 'javascript:void(0)', 'bx_menu_popup(''sys_set_acl_level'', window, {id:{value:''sys_acl_set_{profile_id}'', force:true}, closeOnOuterClick: false, removeOnClose: true, displayMode: ''box'', cssClass: ''''}, {profile_id: {profile_id}});', '', 'certificate', '', 0, 2147483647, '', 1, 0, 30),
+('bx_workspaces_view_actions', 'bx_workspaces', '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_workspaces'', content_id: {content_id}});', '', 'check-circle', '', 0, 192, 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:19:"is_badges_avaliable";}', 1, 0, 30),
+('bx_workspaces_view_actions', 'bx_workspaces', 'profile-actions-more', '_bx_workspaces_menu_item_title_system_more_actions', '_bx_workspaces_menu_item_title_more_actions', 'javascript:void(0)', 'bx_menu_popup(''bx_workspaces_view_actions_more'', this, {}, {profile_id:{profile_id}});', '', 'cog', 'bx_workspaces_view_actions_more', 1, 2147483647, '', 1, 0, 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_workspaces_view_actions_more', '_bx_workspaces_menu_title_view_profile_actions_more', 'bx_workspaces_view_actions_more', 'bx_workspaces', 6, 0, 1, 'BxWorkspacesMenuViewActions', 'modules/boonex/workspaces/classes/BxWorkspacesMenuViewActions.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_workspaces_view_actions_more', 'bx_workspaces', '_bx_workspaces_menu_set_title_view_profile_actions_more', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('bx_workspaces_view_actions_more', 'bx_workspaces', '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', '', 192, 1, 0, 10),
+('bx_workspaces_view_actions_more', 'bx_workspaces', 'audit', '_sys_menu_item_title_system_va_audit', '_sys_menu_item_title_va_audit', 'page.php?i=dashboard-audit&module=bx_workspaces&content_id={content_id}', '', '', 'history', '', 192, 1, 0, 20),
+('bx_workspaces_view_actions_more', 'bx_workspaces', 'edit-workspaces-profile', '_bx_workspaces_menu_item_title_system_edit_profile', '_bx_workspaces_menu_item_title_edit_profile', 'page.php?i=edit-workspaces-profile&id={content_id}', '', '', 'pencil-alt', '', 2147483647, 1, 0, 30),
+('bx_workspaces_view_actions_more', 'bx_workspaces', 'delete-workspaces-profile', '_bx_workspaces_menu_item_title_system_delete_profile', '_bx_workspaces_menu_item_title_delete_profile', 'page.php?i=delete-workspaces-profile&id={content_id}', '', '', 'remove', '', 2147483647, 1, 0, 40),
+('bx_workspaces_view_actions_more', 'bx_workspaces', 'delete-workspaces-account', '_bx_workspaces_menu_item_title_system_delete_account', '_bx_workspaces_menu_item_title_delete_account', 'page.php?i=account-settings-delete&id={account_id}&content=0', '', '', 'user-times', '', 128, 1, 0, 50),
+('bx_workspaces_view_actions_more', 'bx_workspaces', 'delete-workspaces-account-content', '_bx_workspaces_menu_item_title_system_delete_account_content', '_bx_workspaces_menu_item_title_delete_account_content', 'page.php?i=account-settings-delete&id={account_id}&content=1', '', '', 'trash', '', 128, 1, 0, 60);
+
+-- MENU: all actions menu for view entry 
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `persistent`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_workspaces_view_actions_all', '_sys_menu_title_view_actions', 'bx_workspaces_view_actions_all', 'bx_workspaces', 15, 1, 0, 1, 'BxWorkspacesMenuViewActionsAll', 'modules/boonex/workspaces/classes/BxWorkspacesMenuViewActionsAll.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_workspaces_view_actions_all', 'bx_workspaces', '_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_workspaces_view_actions_all', 'bx_workspaces', 'profile-friend-add', '_bx_workspaces_menu_item_title_system_befriend', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 10),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'profile-friend-remove', '_bx_workspaces_menu_item_title_system_unfriend', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 20),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'profile-relation-add', '_bx_workspaces_menu_item_title_system_relation_add', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 23),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'profile-relation-remove', '_bx_workspaces_menu_item_title_system_relation_delete', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 27),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'profile-subscribe-add', '_bx_workspaces_menu_item_title_system_subscribe', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 30),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'profile-subscribe-remove', '_bx_workspaces_menu_item_title_system_unsubscribe', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 40),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'profile-set-acl-level', '_sys_menu_item_title_system_set_acl_level', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 50),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'profile-set-badges', '_sys_menu_item_title_system_set_badges', '', '', '', '', '', '', '', 0, 192, 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:19:"is_badges_avaliable";}', 1, 0, 60),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'comment', '_sys_menu_item_title_system_va_comment', '', '', '', '', '', '', '', 0, 2147483647, '', 0, 0, 200),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'view', '_sys_menu_item_title_system_va_view', '', '', '', '', '', '', '', 0, 2147483647, '', 0, 0, 210),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'vote', '_sys_menu_item_title_system_va_vote', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 215),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'reaction', '_sys_menu_item_title_system_va_reaction', '', '', '', '', '', '', '', 0, 2147483647, '', 0, 0, 217),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'score', '_sys_menu_item_title_system_va_score', '', '', '', '', '', '', '', 0, 2147483647, '', 0, 0, 220),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'favorite', '_sys_menu_item_title_system_va_favorite', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 230),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'feature', '_sys_menu_item_title_system_va_feature', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 240),
+('bx_workspaces_view_actions_all', 'bx_workspaces', 'report', '_sys_menu_item_title_system_va_report', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 250),
+('bx_workspaces_view_actions_all', 'bx_workspaces', '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_workspaces_view_meta', '_bx_workspaces_menu_title_view_profile_meta', 'bx_workspaces_view_meta', 'bx_workspaces', 15, 0, 1, 'BxWorkspacesMenuViewMeta', 'modules/boonex/workspaces/classes/BxWorkspacesMenuViewMeta.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_workspaces_view_meta', 'bx_workspaces', '_bx_workspaces_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_workspaces_view_meta', 'bx_workspaces', 'membership', '_sys_menu_item_title_system_vm_membership', '_sys_menu_item_title_vm_membership', '', '', '', '', '', 0, 2147483647, '', 1, 0, 10),
+('bx_workspaces_view_meta', 'bx_workspaces', 'badges', '_sys_menu_item_title_system_vm_badges', '_sys_menu_item_title_vm_badges', '', '', '', '', '', 0, 2147483647, '', 1, 0, 20),
+('bx_workspaces_view_meta', 'bx_workspaces', 'friends', '_sys_menu_item_title_system_sm_friends', '_sys_menu_item_title_sm_friends', '', '', '', '', '', 0, 2147483647, '', 1, 0, 23),
+('bx_workspaces_view_meta', 'bx_workspaces', 'subscribers', '_sys_menu_item_title_system_sm_subscribers', '_sys_menu_item_title_sm_subscribers', '', '', '', '', '', 0, 2147483647, '', 1, 0, 25),
+('bx_workspaces_view_meta', 'bx_workspaces', 'relations', '_sys_menu_item_title_system_sm_relations', '_sys_menu_item_title_sm_relations', '', '', '', '', '', 0, 2147483647, '', 0, 0, 27),
+('bx_workspaces_view_meta', 'bx_workspaces', 'views', '_sys_menu_item_title_system_sm_views', '_sys_menu_item_title_sm_views', '', '', '', '', '', 0, 2147483647, '', 1, 0, 30),
+('bx_workspaces_view_meta', 'bx_workspaces', 'votes', '_sys_menu_item_title_system_sm_votes', '_sys_menu_item_title_sm_votes', '', '', '', '', '', 0, 2147483647, '', 1, 0, 40),
+('bx_workspaces_view_meta', 'bx_workspaces', 'reactions', '_sys_menu_item_title_system_sm_reactions', '_sys_menu_item_title_sm_reactions', '', '', '', '', '', 0, 2147483647, '', 0, 0, 43),
+('bx_workspaces_view_meta', 'bx_workspaces', 'scores', '_sys_menu_item_title_system_sm_scores', '_sys_menu_item_title_sm_scores', '', '', '', '', '', 0, 2147483647, '', 0, 0, 46),
+('bx_workspaces_view_meta', 'bx_workspaces', 'comments', '_sys_menu_item_title_system_sm_comments', '_sys_menu_item_title_sm_comments', '', '', '', '', '', 0, 2147483647, '', 1, 0, 50);
+
+-- 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_workspaces_view_submenu', '_bx_workspaces_menu_title_view_profile_submenu', 'bx_workspaces_view_submenu', 'bx_workspaces', 18, 0, 1, 'BxWorkspacesMenuView', 'modules/boonex/workspaces/classes/BxWorkspacesMenuView.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_workspaces_view_submenu', 'bx_workspaces', '_bx_workspaces_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_workspaces_view_submenu', 'bx_workspaces', 'view-workspaces-profile', '_bx_workspaces_menu_item_title_system_view_profile_view', '_bx_workspaces_menu_item_title_view_profile_view', 'page.php?i=view-workspaces-profile&id={content_id}', '', '', 'user col-blue3', '', '', 0, 2147483647, 1, 0, 1),
+('bx_workspaces_view_submenu', 'bx_workspaces', 'workspaces-profile-info', '_bx_workspaces_menu_item_title_system_view_profile_info', '_bx_workspaces_menu_item_title_view_profile_info', 'page.php?i=workspaces-profile-info&id={content_id}', '', '', 'info-circle col-gray', '', '', 0, 2147483647, 1, 0, 2),
+('bx_workspaces_view_submenu', 'bx_workspaces', 'workspaces-profile-friends', '_bx_workspaces_menu_item_title_system_view_profile_friends', '_bx_workspaces_menu_item_title_view_profile_friends', 'page.php?i=workspaces-profile-friends&profile_id={profile_id}', '', '', 'users col-blue3', '', '', 0, 2147483647, 1, 0, 3),
+('bx_workspaces_view_submenu', 'bx_workspaces', 'workspaces-profile-relations', '_bx_workspaces_menu_item_title_system_view_profile_relations', '_bx_workspaces_menu_item_title_view_profile_relations', 'page.php?i=workspaces-profile-relations&profile_id={profile_id}', '', '', 'sync col-blue3', '', '', 0, 2147483647, 1, 0, 4),
+('bx_workspaces_view_submenu', 'bx_workspaces', 'workspaces-profile-subscriptions', '_bx_workspaces_menu_item_title_system_view_profile_subscriptions', '_bx_workspaces_menu_item_title_view_profile_subscriptions', 'page.php?i=workspaces-profile-subscriptions&profile_id={profile_id}', '', '', 'check col-blue3', '', '', 0, 2147483647, 1, 0, 5),
+('bx_workspaces_view_submenu', 'bx_workspaces', 'workspaces-profile-comments', '_bx_workspaces_menu_item_title_system_view_profile_comments', '_bx_workspaces_menu_item_title_view_profile_comments', 'page.php?i=workspaces-profile-comments&id={content_id}', '', '', '', '', '', 0, 2147483647, 0, 0, 6),
+('bx_workspaces_view_submenu', 'bx_workspaces', 'more-auto', '_bx_workspaces_menu_item_title_system_view_profile_more_auto', '_bx_workspaces_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_workspaces_snippet_meta', '_sys_menu_title_snippet_meta', 'bx_workspaces_snippet_meta', 'bx_workspaces', 15, 0, 1, 'BxWorkspacesMenuSnippetMeta', 'modules/boonex/workspaces/classes/BxWorkspacesMenuSnippetMeta.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_workspaces_snippet_meta', 'bx_workspaces', '_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`, `hidden_on_cxt`, `active`, `copyable`, `editable`, `order`) VALUES
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'friends-mutual', '_sys_menu_item_title_system_sm_friends_mutual', '_sys_menu_item_title_sm_friends_mutual', '', '', '', '', '', 2147483647, 'all!recom_friends', 1, 0, 1, 0),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'date', '_sys_menu_item_title_system_sm_date', '_sys_menu_item_title_sm_date', '', '', '', '', '', 2147483647, '', 0, 0, 1, 5),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'tags', '_sys_menu_item_title_system_sm_tags', '_sys_menu_item_title_sm_tags', '', '', '', '', '', 2147483647, '', 0, 0, 1, 10),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'views', '_sys_menu_item_title_system_sm_views', '_sys_menu_item_title_sm_views', '', '', '', '', '', 2147483647, '', 0, 0, 1, 15),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'votes', '_sys_menu_item_title_system_sm_votes', '_sys_menu_item_title_sm_votes', '', '', '', '', '', 2147483647, '', 0, 0, 1, 16),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'reactions', '_sys_menu_item_title_system_sm_reactions', '_sys_menu_item_title_sm_reactions', '', '', '', '', '', 2147483647, '', 0, 0, 1, 17),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'scores', '_sys_menu_item_title_system_sm_scores', '_sys_menu_item_title_sm_scores', '', '', '', '', '', 2147483647, '', 0, 0, 1, 18),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'comments', '_sys_menu_item_title_system_sm_comments', '_sys_menu_item_title_sm_comments', '', '', '', '', '', 2147483647, '', 0, 0, 1, 20),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'friends', '_sys_menu_item_title_system_sm_friends', '_sys_menu_item_title_sm_friends', '', '', '', '', '', 2147483647, 'recom_friends,recom_subscriptions', 1, 0, 1, 30),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'subscribers', '_sys_menu_item_title_system_sm_subscribers', '_sys_menu_item_title_sm_subscribers', '', '', '', '', '', 2147483647, 'recom_friends', 1, 0, 1, 40),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'membership', '_sys_menu_item_title_system_sm_membership', '_sys_menu_item_title_sm_membership', '', '', '', '', '', 2147483647, '', 0, 0, 1, 50),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'nl', '_sys_menu_item_title_system_sm_nl', '_sys_menu_item_title_sm_nl', '', '', '', '', '', 2147483647, '', 1, 0, 1, 55),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'befriend', '_sys_menu_item_title_system_sm_befriend', '_sys_menu_item_title_sm_befriend', '', '', '', '', '', 2147483647, 'recom_subscriptions', 1, 0, 1, 60),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'unfriend', '_sys_menu_item_title_system_sm_unfriend', '_sys_menu_item_title_sm_unfriend', '', '', '', '', '', 2147483647, 'recom_friends,recom_subscriptions', 1, 0, 1, 65),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'subscribe', '_sys_menu_item_title_system_sm_subscribe', '_sys_menu_item_title_sm_subscribe', '', '', '', '', '', 2147483647, 'recom_friends', 1, 0, 1, 70),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'unsubscribe', '_sys_menu_item_title_system_sm_unsubscribe', '_sys_menu_item_title_sm_unsubscribe', '', '', '', '', '', 2147483647, 'recom_friends,recom_subscriptions', 1, 0, 1, 75),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'ignore-befriend', '_sys_menu_item_title_system_sm_ignore_befriend', '_sys_menu_item_title_sm_ignore', '', '', '', '', '', 2147483647, 'all!recom_friends', 1, 0, 1, 80),
+('bx_workspaces_snippet_meta', 'bx_workspaces', 'ignore-subscribe', '_sys_menu_item_title_system_sm_ignore_subscribe', '_sys_menu_item_title_sm_ignore', '', '', '', '', '', 2147483647, 'all!recom_subscriptions', 1, 0, 1, 85);
+
+-- MENU: notifications menu in account popup
+SET @iNotifMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name` = 'sys_account_notifications' 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`, `addon`, `submenu_object`, `visible_for_levels`, `visibility_custom`, `active`, `copyable`, `order`) VALUES
+('sys_account_notifications', 'bx_workspaces', 'notifications-friend-requests', '_bx_workspaces_menu_item_title_system_friends', '_bx_workspaces_menu_item_title_friends', 'page.php?i=workspaces-profile-friends&profile_id={member_id}', '', '', 'users col-blue3', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:31:"get_unconfirmed_connections_num";s:6:"params";a:1:{i:0;s:20:"sys_profiles_friends";}s:5:"class";s:23:"TemplServiceConnections";}', '', 2147483646, 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:17:"is_enable_friends";}', 1, 0, @iNotifMenuOrder + 1),
+('sys_account_notifications', 'bx_workspaces', 'notifications-relation-requests', '_bx_workspaces_menu_item_title_system_relations', '_bx_workspaces_menu_item_title_relations', 'page.php?i=workspaces-profile-relations&profile_id={member_id}', '', '', 'sync col-blue3', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:31:"get_unconfirmed_connections_num";s:6:"params";a:1:{i:0;s:22:"sys_profiles_relations";}s:5:"class";s:23:"TemplServiceConnections";}', '', 2147483646, 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:19:"is_enable_relations";}', 1, 0, @iNotifMenuOrder + 2);
+
+-- 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`, `visibility_custom`, `active`, `copyable`, `order`) VALUES
+('sys_profile_stats', 'bx_workspaces', 'profile-stats-friend-requests', '_bx_workspaces_menu_item_title_system_friend_requests', '_bx_workspaces_menu_item_title_friend_requests', 'page.php?i=workspaces-profile-friends&profile_id={member_id}', '', '', 'users col-blue3', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:31:"get_unconfirmed_connections_num";s:6:"params";a:1:{i:0;s:20:"sys_profiles_friends";}s:5:"class";s:23:"TemplServiceConnections";}', '', 2147483646, 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:17:"is_enable_friends";}', 0, 0, @iNotifMenuOrder + 1),
+('sys_profile_stats', 'bx_workspaces', 'profile-stats-manage-profiles', '_bx_workspaces_menu_item_title_system_manage_my_profiles', '_bx_workspaces_menu_item_title_manage_my_profiles', 'page.php?i=workspaces-manage', '', '_self', 'users col-blue3', 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:41:"get_menu_addon_manage_tools_profile_stats";}', '', 2147483646, '', 1, 0, @iNotifMenuOrder + 2),
+('sys_profile_stats', 'bx_workspaces', 'profile-stats-favorite-workspaces', '_bx_workspaces_menu_item_title_system_favorites', '_bx_workspaces_menu_item_title_favorites', 'page.php?i=workspaces-profile-favorites&profile_id={member_id}', '', '', 'star col-blue3', 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:38:"get_menu_addon_favorites_profile_stats";}', '', 2147483646, '', 1, 0, @iNotifMenuOrder + 3);
+
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `addon_cache`, `submenu_object`, `visible_for_levels`, `visibility_custom`, `active`, `copyable`, `order`) VALUES
+('sys_profile_stats', 'bx_workspaces', 'profile-stats-subscriptions', '_bx_workspaces_menu_item_title_system_subscriptions', '_bx_workspaces_menu_item_title_subscriptions', 'page.php?i=workspaces-profile-subscriptions&profile_id={member_id}#subscriptions', '', '_self', 'rss col-blue3', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:25:"get_connected_content_num";s:6:"params";a:1:{i:0;s:26:"sys_profiles_subscriptions";}s:5:"class";s:23:"TemplServiceConnections";}', 0, '', 2147483646, '', 0, 0, @iNotifMenuOrder + 4),
+('sys_profile_stats', 'bx_workspaces', 'profile-stats-subscribed-me', '_bx_workspaces_menu_item_title_system_subscribed_me', '_bx_workspaces_menu_item_title_subscribed_me', 'page.php?i=workspaces-profile-subscriptions&profile_id={member_id}#subscribers', '', '_self', 'rss col-blue3', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:28:"get_connected_initiators_num";s:6:"params";a:1:{i:0;s:26:"sys_profiles_subscriptions";}s:5:"class";s:23:"TemplServiceConnections";}', 1, '', 2147483646, '', 0, 0, @iNotifMenuOrder + 5);
+
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `visibility_custom`, `active`, `copyable`, `order`) VALUES
+('sys_profile_stats', 'bx_workspaces', 'profile-stats-relations', '_bx_workspaces_menu_item_title_system_relations', '_bx_workspaces_menu_item_title_relations', 'page.php?i=workspaces-profile-relations&profile_id={member_id}#relations', '', '_self', 'sync col-blue3', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:25:"get_connected_content_num";s:6:"params";a:3:{i:0;s:22:"sys_profiles_relations";i:1;i:0;i:2;i:1;}s:5:"class";s:23:"TemplServiceConnections";}', '', 2147483646, 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:19:"is_enable_relations";}', 1, 0, @iNotifMenuOrder + 6),
+('sys_profile_stats', 'bx_workspaces', 'profile-stats-related-me', '_bx_workspaces_menu_item_title_system_related_me', '_bx_workspaces_menu_item_title_related_me', 'page.php?i=workspaces-profile-relations&profile_id={member_id}#related-me', '', '_self', 'sync col-blue3', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:28:"get_connected_initiators_num";s:6:"params";a:3:{i:0;s:22:"sys_profiles_relations";i:1;i:0;i:2;i:1;}s:5:"class";s:23:"TemplServiceConnections";}', '', 2147483646, 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:19:"is_enable_relations";}', 1, 0, @iNotifMenuOrder + 7);
+
+-- 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_workspaces', 'workspaces', '_bx_workspaces_menu_item_title_system_followings', '_bx_workspaces_menu_item_title_followings', 'javascript:void(0)', '', '_self', 'users col-blue3', '', '', 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_workspaces_menu_manage_tools', '_bx_workspaces_menu_title_manage_tools', 'bx_workspaces_menu_manage_tools', 'bx_workspaces', 6, 0, 1, 'BxWorkspacesMenuManageTools', 'modules/boonex/workspaces/classes/BxWorkspacesMenuManageTools.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_workspaces_menu_manage_tools', 'bx_workspaces', '_bx_workspaces_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_workspaces_menu_manage_tools', 'bx_workspaces', 'clear-reports', '_bx_workspaces_menu_item_title_system_clear_reports', '_bx_workspaces_menu_item_title_clear_reports', 'javascript:void(0)', 'javascript:{js_object}.onClickClearReports({content_id});', '_self', 'eraser', '', 2147483647, 1, 0, 1),
+('bx_workspaces_menu_manage_tools', 'bx_workspaces', 'manage-cf', '_bx_workspaces_menu_item_title_system_manage_cf', '_bx_workspaces_menu_item_title_manage_cf', 'javascript:void(0)', 'javascript:{js_object}.onClickManageCf({content_id});', '_self', 'filter', '', 2147483647, 1, 0, 6),
+('bx_workspaces_menu_manage_tools', 'bx_workspaces', 'delete-with-content', '_bx_workspaces_menu_item_title_system_delete_with_content', '_bx_workspaces_menu_item_title_delete_with_content', 'javascript:void(0)', 'javascript:{js_object}.onClickDeleteWithContent({content_id});', '_self', 'far trash-alt', '', 2147483647, 1, 0, 99);
+
+-- 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_workspaces', 'workspaces-administration', '_bx_workspaces_menu_item_title_system_admt_workspaces', '_bx_workspaces_menu_item_title_admt_workspaces', 'page.php?i=workspaces-administration', '', '_self', 'user', 'a:2:{s:6:"module";s:13:"bx_workspaces";s:6:"method";s:27:"get_menu_addon_manage_tools";}', '', 192, 1, 0, @iManageMenuOrder + 1);
+
+
+-- ACL
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_workspaces', 'create entry', NULL, '_bx_workspaces_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_workspaces', 'delete entry', NULL, '_bx_workspaces_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_workspaces', 'view entry', NULL, '_bx_workspaces_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_workspaces', 'edit any entry', NULL, '_bx_workspaces_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_workspaces', 'delete any entry', NULL, '_bx_workspaces_acl_action_delete_any_profile', '', 1, 3);
+SET @iIdActionProfileDeleteAny = LAST_INSERT_ID();
+
+SET @iUnauthenticated = 1;
+SET @iAccount = 2;
+SET @iStandard = 3;
+SET @iUnconfirmed = 4;
+SET @iPending = 5;
+SET @iSuspended = 6;
+SET @iModerator = 7;
+SET @iAdministrator = 8;
+SET @iPremium = 9;
+
+
+INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
+
+-- profile create
+(@iAccount, @iIdActionProfileCreate),
+(@iStandard, @iIdActionProfileCreate),
+(@iUnconfirmed, @iIdActionProfileCreate),
+(@iPending, @iIdActionProfileCreate),
+(@iModerator, @iIdActionProfileCreate),
+(@iAdministrator, @iIdActionProfileCreate),
+(@iPremium, @iIdActionProfileCreate),
+
+-- profile delete
+(@iAccount, @iIdActionProfileDelete),
+(@iStandard, @iIdActionProfileDelete),
+(@iUnconfirmed, @iIdActionProfileDelete),
+(@iPending, @iIdActionProfileDelete),
+(@iModerator, @iIdActionProfileDelete),
+(@iAdministrator, @iIdActionProfileDelete),
+(@iPremium, @iIdActionProfileDelete),
+
+-- profile view
+(@iUnauthenticated, @iIdActionProfileView),
+(@iAccount, @iIdActionProfileView),
+(@iStandard, @iIdActionProfileView),
+(@iUnconfirmed, @iIdActionProfileView),
+(@iPending, @iIdActionProfileView),
+(@iModerator, @iIdActionProfileView),
+(@iAdministrator, @iIdActionProfileView),
+(@iPremium, @iIdActionProfileView),
+
+-- any profile edit
+(@iModerator, @iIdActionProfileEditAny),
+(@iAdministrator, @iIdActionProfileEditAny),
+
+-- any profile delete
+(@iAdministrator, @iIdActionProfileDeleteAny);
+
+-- SEARCH
+SET @iSearchOrder = (SELECT IFNULL(MAX(`Order`), 0) FROM `sys_objects_search`);
+INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `Order`, `ClassName`, `ClassPath`) VALUES
+('bx_workspaces', '_bx_workspaces', @iSearchOrder + 1, 'BxWorkspacesSearchResult', 'modules/boonex/workspaces/classes/BxWorkspacesSearchResult.php'),
+('bx_workspaces_cmts', '_bx_workspaces_cmts', @iSearchOrder + 2, 'BxWorkspacesCmtsSearchResult', 'modules/boonex/workspaces/classes/BxWorkspacesCmtsSearchResult.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_workspaces', 'bx_workspaces', '_bx_workspaces', 'page.php?i=workspaces-home', 'user col-blue3', 'SELECT COUNT(*) FROM `bx_workspaces_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id` = `tp`.`content_id` AND `tp`.`type`=''bx_workspaces'' 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_workspaces_growth', '_bx_workspaces_chart_growth', 'bx_workspaces_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_workspaces'' WHERE 1 AND `tp`.`status`=''active'' {where_inteval} GROUP BY `period` ORDER BY {table}.{field_date} ASC', 1, @iMaxOrderCharts + 1, 'BxDolChartGrowth', ''),
+('bx_workspaces_growth_speed', '_bx_workspaces_chart_growth_speed', 'bx_workspaces_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_workspaces'' WHERE 1 AND `tp`.`status`=''active'' {where_inteval} GROUP BY `period` ORDER BY {table}.{field_date} ASC', 1, @iMaxOrderCharts + 2, 'BxDolChartGrowthSpeed', '');
+
+-- 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_workspaces_administration', 'Sql', 'SELECT `td`.*, `ta`.`email` AS `account`, `ta`.`logged` AS `last_online`, `tp`.`status` AS `status`, `tp`.`id` as `profile_id` FROM `bx_workspaces_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id`=`tp`.`content_id` AND `tp`.`type`=''bx_workspaces'' LEFT JOIN `sys_accounts` AS `ta` ON `tp`.`account_id`=`ta`.`id` WHERE 1 ', 'bx_workspaces_data', 'id', 'last_online', 'status', '', 20, NULL, 'start', '', 'fullname,email', '', 'like', 'reports', '', 192, 'BxWorkspacesGridAdministration', 'modules/boonex/workspaces/classes/BxWorkspacesGridAdministration.php'),
+('bx_workspaces_common', 'Sql', 'SELECT `td`.*, `ta`.`email` AS `account`, `ta`.`logged` AS `last_online`, `tp`.`status` AS `status` FROM `bx_workspaces_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id`=`tp`.`content_id` AND `tp`.`type`=''bx_workspaces'' LEFT JOIN `sys_accounts` AS `ta` ON `tp`.`account_id`=`ta`.`id` WHERE 1 ', 'bx_workspaces_data', 'id', 'last_online', 'status', '', 20, NULL, 'start', '', 'fullname', '', 'like', '', '', 2147483647, 'BxWorkspacesGridCommon', 'modules/boonex/workspaces/classes/BxWorkspacesGridCommon.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('bx_workspaces_administration', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
+('bx_workspaces_administration', 'switcher', '_bx_workspaces_grid_column_title_adm_active', '8%', 0, '', '', 2),
+('bx_workspaces_administration', 'reports', '_sys_txt_reports_title', '5%', 0, '', '', 3),
+('bx_workspaces_administration', 'fullname', '_bx_workspaces_grid_column_title_adm_fullname', '25%', 0, '', '', 4),
+('bx_workspaces_administration', 'last_online', '_bx_workspaces_grid_column_title_adm_last_online', '20%', 1, '25', '', 5),
+('bx_workspaces_administration', 'account', '_bx_workspaces_grid_column_title_adm_account', '20%', 0, '25', '', 6),
+('bx_workspaces_administration', 'actions', '', '20%', 0, '', '', 7),
+
+('bx_workspaces_common', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
+('bx_workspaces_common', 'fullname', '_bx_workspaces_grid_column_title_adm_fullname', '48%', 0, '', '', 2),
+('bx_workspaces_common', 'last_online', '_bx_workspaces_grid_column_title_adm_last_online', '30%', 1, '25', '', 3),
+('bx_workspaces_common', 'actions', '', '20%', 0, '', '', 4);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon_only`, `confirm`, `order`) VALUES
+('bx_workspaces_administration', 'bulk', 'set_acl_level', '_bx_workspaces_grid_action_title_adm_set_acl_level', '', 0, 0, 1),
+('bx_workspaces_administration', 'bulk', 'delete_with_content', '_bx_workspaces_grid_action_title_adm_delete_with_content', '', 0, 1, 2),
+('bx_workspaces_administration', 'bulk', 'clear_reports', '_bx_workspaces_grid_action_title_adm_clear_reports', '', 0, 1, 3),
+('bx_workspaces_administration', 'single', 'set_acl_level', '_bx_workspaces_grid_action_title_adm_set_acl_level', 'certificate', 1, 0, 1),
+('bx_workspaces_administration', 'single', 'settings', '_bx_workspaces_grid_action_title_adm_more_actions', 'cog', 1, 0, 2),
+('bx_workspaces_administration', 'single', 'audit_content', '_bx_workspaces_grid_action_title_adm_audit_content', 'search', 1, 0, 3),
+('bx_workspaces_administration', 'single', 'audit_profile', '_bx_workspaces_grid_action_title_adm_audit_profile', 'search-location', 1, 0, 4),
+
+('bx_workspaces_common', 'bulk', 'delete_with_content', '_bx_workspaces_grid_action_title_adm_delete_with_content', '', 0, 1, 1),
+('bx_workspaces_common', 'single', 'settings', '_bx_workspaces_grid_action_title_adm_more_actions', 'cog', 1, 0, 1);
+
+-- LIVE UPDATES
+INSERT INTO `sys_objects_live_updates`(`name`, `frequency`, `service_call`, `active`) VALUES
+('bx_workspaces_friend_requests', 1, 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:40:"get_live_updates_unconfirmed_connections";s:6:"params";a:5:{i:0;s:13:"bx_workspaces";i:1;s:20:"sys_profiles_friends";i:2;a:2:{s:11:"menu_object";s:18:"sys_toolbar_member";s:9:"menu_item";s:7:"account";}i:3;a:2:{s:11:"menu_object";s:25:"sys_account_notifications";s:9:"menu_item";s:29:"notifications-friend-requests";}i:4;s:7:"{count}";}s:5:"class";s:23:"TemplServiceConnections";}', 1),
+('bx_workspaces_friend_requests_new', 1, 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:44:"get_live_updates_unconfirmed_connections_new";s:6:"params";a:5:{i:0;s:13:"bx_workspaces";i:1;s:20:"sys_profiles_friends";i:2;a:0:{}i:3;a:0:{}i:4;s:7:"{count}";}s:5:"class";s:23:"TemplServiceConnections";}', 1);
+
+-- ALERTS
+INSERT INTO `sys_alerts_handlers` (`name`, `class`, `file`, `service_call`) VALUES 
+('bx_workspaces', 'BxWorkspacesAlertsResponse', 'modules/boonex/workspaces/classes/BxWorkspacesAlertsResponse.php', '');
+SET @iHandler := LAST_INSERT_ID();
+
+INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
+('system', 'save_setting', @iHandler),
+('sys_profiles_friends', 'connection_added', @iHandler),
+('bx_timeline', 'post_common', @iHandler),
+('bx_workspaces', 'timeline_view', @iHandler),
+('bx_workspaces', 'timeline_post', @iHandler),
+('bx_workspaces', 'timeline_delete', @iHandler),
+('bx_workspaces', 'timeline_comment', @iHandler),
+('bx_workspaces', 'timeline_vote', @iHandler),
+('bx_workspaces', 'timeline_score', @iHandler),
+('bx_workspaces', 'timeline_report', @iHandler),
+('bx_workspaces', 'timeline_repost', @iHandler),
+('bx_workspaces', 'timeline_pin', @iHandler),
+('bx_workspaces', '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_workspaces_allow_view_to', 'bx_workspaces', 'view', '_bx_workspaces_form_profile_input_allow_view_to', '3', '', 'bx_workspaces_data', 'id', 'author', 'BxWorkspacesPrivacy', 'modules/boonex/workspaces/classes/BxWorkspacesPrivacy.php'),
+('bx_workspaces_allow_post_to', 'bx_workspaces', 'post', '_bx_workspaces_form_profile_input_allow_post_to', '5', '', 'bx_workspaces_data', 'id', 'author', 'BxWorkspacesPrivacyPost', 'modules/boonex/workspaces/classes/BxWorkspacesPrivacyPost.php'),
+('bx_workspaces_allow_contact_to', 'bx_workspaces', 'contact', '_bx_workspaces_form_profile_input_allow_contact_to', '3', '', 'bx_workspaces_data', 'id', 'author', 'BxWorkspacesPrivacyContact', 'modules/boonex/workspaces/classes/BxWorkspacesPrivacyContact.php');
+
+-- EMAIL TEMPLATES
+INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `Body`) VALUES
+('bx_workspaces', '_bx_workspaces_email_friend_request', 'bx_workspaces_friend_request', '_bx_workspaces_email_friend_request_subject', '_bx_workspaces_email_friend_request_body');
+

+ 451 - 0
modules/boonex/workspaces/install/sql2/install.sql

@@ -0,0 +1,451 @@
+
+SET @sStorageEngine = (SELECT `value` FROM `sys_options` WHERE `name` = 'sys_storage_default');
+
+-- TABLE: PROFILES
+CREATE TABLE IF NOT EXISTS `bx_workspaces_data` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `author` int(10) unsigned NOT NULL,
+  `added` int(11) NOT NULL,
+  `changed` int(11) NOT NULL,
+  `picture` int(11) NOT NULL,
+  `cover` int(11) NOT NULL,
+  `cover_data` varchar(50) NOT NULL,
+  `fullname` varchar(255) NOT NULL,
+  `last_name` varchar(255) NOT NULL,
+  `description` text NOT NULL,
+  `gender` varchar(255) DEFAULT NULL,
+  `birthday` date DEFAULT NULL,
+  `labels` text NOT NULL,
+  `location` text NOT NULL,
+  `views` int(11) NOT NULL default '0',
+  `rate` float NOT NULL default '0',
+  `votes` int(11) NOT NULL default '0',
+  `rrate` float NOT NULL default '0',
+  `rvotes` int(11) NOT NULL default '0',
+  `score` int(11) NOT NULL default '0',
+  `sc_up` int(11) NOT NULL default '0',
+  `sc_down` int(11) NOT NULL default '0',
+  `favorites` int(11) NOT NULL default '0',
+  `comments` int(11) NOT NULL default '0',
+  `reports` int(11) NOT NULL default '0',
+  `featured` int(11) NOT NULL default '0',
+  `allow_view_to` varchar(16) NOT NULL DEFAULT '3',
+  `allow_post_to` varchar(16) NOT NULL DEFAULT '5',
+  `allow_contact_to` varchar(16) NOT NULL DEFAULT '3',
+  `settings` text NOT NULL,
+  PRIMARY KEY (`id`),
+  FULLTEXT KEY `search_fields` (`fullname`,`description`)
+);
+
+-- TABLE: STORAGES & TRANSCODERS
+CREATE TABLE IF NOT EXISTS `bx_workspaces_pictures` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `profile_id` int(10) unsigned NOT NULL,
+  `remote_id` varchar(128) NOT NULL,
+  `path` varchar(255) NOT NULL,
+  `file_name` varchar(255) NOT NULL,
+  `mime_type` varchar(128) NOT NULL,
+  `ext` varchar(32) NOT NULL,
+  `size` bigint(20) NOT NULL,
+  `dimensions` varchar(12) NOT NULL,
+  `added` int(11) NOT NULL,
+  `modified` int(11) NOT NULL,
+  `private` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `remote_id` (`remote_id`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_workspaces_pictures_resized` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `profile_id` int(10) unsigned NOT NULL,
+  `remote_id` varchar(128) NOT NULL,
+  `path` varchar(255) NOT NULL,
+  `file_name` varchar(255) NOT NULL,
+  `mime_type` varchar(128) NOT NULL,
+  `ext` varchar(32) NOT NULL,
+  `size` bigint(20) NOT NULL,
+  `added` int(11) NOT NULL,
+  `modified` int(11) NOT NULL,
+  `private` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `remote_id` (`remote_id`)
+);
+
+-- TABLE: comments
+CREATE TABLE IF NOT EXISTS `bx_workspaces_cmts` (
+  `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
+  `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_object_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_author_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_level` int(11) NOT NULL DEFAULT '0',
+  `cmt_text` text NOT NULL,
+  `cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
+  `cmt_rate` int(11) NOT NULL DEFAULT '0',
+  `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
+  `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
+  `cmt_replies` int(11) NOT NULL DEFAULT '0',
+  `cmt_pinned` int(11) NOT NULL default '0',
+  `cmt_cf` int(11) NOT NULL default '1',
+  PRIMARY KEY (`cmt_id`),
+  KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
+  FULLTEXT KEY `search_fields` (`cmt_text`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_workspaces_cmts_notes` (
+  `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
+  `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_object_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_author_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_level` int(11) NOT NULL DEFAULT '0',
+  `cmt_text` text NOT NULL,
+  `cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
+  `cmt_rate` int(11) NOT NULL DEFAULT '0',
+  `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
+  `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
+  `cmt_replies` int(11) NOT NULL DEFAULT '0',
+  `cmt_pinned` int(11) NOT NULL default '0',
+  PRIMARY KEY (`cmt_id`),
+  KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
+  FULLTEXT KEY `search_fields` (`cmt_text`)
+);
+
+-- TABLE: VIEWS
+CREATE TABLE IF NOT EXISTS `bx_workspaces_views_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `viewer_id` int(11) NOT NULL default '0',
+  `viewer_nip` int(11) unsigned NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
+);
+
+-- TABLE: VOTES
+CREATE TABLE IF NOT EXISTS `bx_workspaces_votes` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `count` int(11) NOT NULL default '0',
+  `sum` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `object_id` (`object_id`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_workspaces_votes_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `author_nip` int(11) unsigned NOT NULL default '0',
+  `value` tinyint(4) NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `vote` (`object_id`, `author_nip`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_workspaces_reactions` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `reaction` varchar(32) NOT NULL default '',
+  `count` int(11) NOT NULL default '0',
+  `sum` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `reaction` (`object_id`, `reaction`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_workspaces_reactions_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `author_nip` int(11) unsigned NOT NULL default '0',
+  `reaction` varchar(32) NOT NULL default '',
+  `value` tinyint(4) NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `vote` (`object_id`, `author_nip`)
+);
+
+-- TABLE: favorites
+CREATE TABLE IF NOT EXISTS `bx_workspaces_favorites_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `id` (`object_id`,`author_id`)
+);
+
+-- TABLE: reports
+CREATE TABLE IF NOT EXISTS `bx_workspaces_reports` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `count` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `object_id` (`object_id`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_workspaces_reports_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `author_nip` int(11) unsigned NOT NULL default '0',
+  `type` varchar(32) NOT NULL default '',
+  `text` text NOT NULL default '',
+  `date` int(11) NOT NULL default '0',
+  `checked_by` int(11) NOT NULL default '0',
+  `status` tinyint(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `report` (`object_id`, `author_nip`)
+);
+
+-- TABLE: metas
+CREATE TABLE IF NOT EXISTS `bx_workspaces_meta_keywords` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(10) unsigned NOT NULL,
+  `keyword` varchar(255) NOT NULL,
+  PRIMARY KEY (`id`),
+  KEY `object_id` (`object_id`),
+  KEY `keyword` (`keyword`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_workspaces_meta_locations` (
+  `object_id` int(10) unsigned NOT NULL,
+  `lat` double NOT NULL,
+  `lng` double NOT NULL,
+  `country` varchar(2) NOT NULL,
+  `state` varchar(255) NOT NULL,
+  `city` varchar(255) NOT NULL,
+  `zip` varchar(255) NOT NULL,
+  `street` varchar(255) NOT NULL,
+  `street_number` varchar(255) NOT NULL,
+  PRIMARY KEY (`object_id`),
+  KEY `country_state_city` (`country`,`state`(8),`city`(8))
+);
+
+CREATE TABLE `bx_workspaces_meta_mentions` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(10) unsigned NOT NULL,
+  `profile_id` int(10) unsigned NOT NULL,
+  PRIMARY KEY (`id`),
+  KEY `object_id` (`object_id`),
+  KEY `profile_id` (`profile_id`)
+);
+
+-- TABLE: scores
+CREATE TABLE IF NOT EXISTS `bx_workspaces_scores` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `count_up` int(11) NOT NULL default '0',
+  `count_down` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `object_id` (`object_id`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_workspaces_scores_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `author_nip` int(11) unsigned NOT NULL default '0',
+  `type` varchar(8) NOT NULL default '',
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `vote` (`object_id`, `author_nip`)
+);
+
+CREATE TABLE `bx_workspaces_skills` (
+  `skill_id` int(11) NOT NULL AUTO_INCREMENT,
+  `skill_name` varchar(500) DEFAULT NULL,
+  `content_id` int(11) NOT NULL,
+  PRIMARY KEY (`skill_id`),
+  KEY `content_id` (`content_id`)
+);
+
+
+-- STORAGES & TRANSCODERS
+INSERT INTO `sys_objects_storage` (`object`, `engine`, `params`, `token_life`, `cache_control`, `levels`, `table_files`, `ext_mode`, `ext_allow`, `ext_deny`, `quota_size`, `current_size`, `quota_number`, `current_number`, `max_file_size`, `ts`) VALUES
+('bx_workspaces_pictures', @sStorageEngine, '', 360, 2592000, 3, 'bx_workspaces_pictures', 'allow-deny', '{image}', '', 0, 0, 0, 0, 0, 0),
+('bx_workspaces_pictures_resized', @sStorageEngine, '', 360, 2592000, 3, 'bx_workspaces_pictures_resized', 'allow-deny', '{image}', '', 0, 0, 0, 0, 0, 0);
+
+INSERT INTO `sys_objects_transcoder` (`object`, `storage_object`, `source_type`, `source_params`, `private`, `atime_tracking`, `atime_pruning`, `ts`) VALUES 
+('bx_workspaces_icon', 'bx_workspaces_pictures_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_workspaces_pictures";}', 'no', '1', '2592000', '0'),
+('bx_workspaces_thumb', 'bx_workspaces_pictures_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_workspaces_pictures";}', 'no', '1', '2592000', '0'),
+('bx_workspaces_avatar', 'bx_workspaces_pictures_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_workspaces_pictures";}', 'no', '1', '2592000', '0'),
+('bx_workspaces_avatar_big', 'bx_workspaces_pictures_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_workspaces_pictures";}', 'no', '1', '2592000', '0'),
+('bx_workspaces_picture', 'bx_workspaces_pictures_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_workspaces_pictures";}', 'no', '1', '2592000', '0'),
+('bx_workspaces_cover', 'bx_workspaces_pictures_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_workspaces_pictures";}', 'no', '1', '2592000', '0'),
+('bx_workspaces_cover_thumb', 'bx_workspaces_pictures_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_workspaces_pictures";}', 'no', '1', '2592000', '0'),
+('bx_workspaces_gallery', 'bx_workspaces_pictures_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_workspaces_pictures";}', 'no', '1', '2592000', '0');
+
+INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES 
+('bx_workspaces_icon', 'Resize', 'a:3:{s:1:"w";s:2:"30";s:1:"h";s:2:"30";s:13:"square_resize";s:1:"1";}', '0'),
+('bx_workspaces_thumb', 'Resize', 'a:3:{s:1:"w";s:2:"50";s:1:"h";s:2:"50";s:13:"square_resize";s:1:"1";}', '0'),
+('bx_workspaces_avatar', 'Resize', 'a:3:{s:1:"w";s:3:"100";s:1:"h";s:3:"100";s:13:"square_resize";s:1:"1";}', '0'),
+('bx_workspaces_avatar_big', 'Resize', 'a:3:{s:1:"w";s:3:"200";s:1:"h";s:3:"200";s:13:"square_resize";s:1:"1";}', '0'),
+('bx_workspaces_picture', 'Resize', 'a:3:{s:1:"w";s:4:"1024";s:1:"h";s:4:"1024";s:13:"square_resize";s:1:"0";}', '0'),
+('bx_workspaces_cover', 'Resize', 'a:2:{s:1:"w";s:3:"960";s:1:"h";s:3:"480";}', '0'),
+('bx_workspaces_cover_thumb', 'Resize', 'a:3:{s:1:"w";s:2:"48";s:1:"h";s:2:"48";s:13:"square_resize";s:1:"1";}', '0'),
+('bx_workspaces_gallery', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0');
+
+-- FORMS
+INSERT INTO `sys_objects_form`(`object`, `module`, `title`, `action`, `form_attrs`, `table`, `key`, `uri`, `uri_title`, `submit_name`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`, `parent_form`) VALUES 
+('bx_workspace', 'bx_workspaces', '_bx_workspaces_form_profile', '', 'a:1:{s:7:\"enctype\";s:19:\"multipart/form-data\";}', 'bx_workspaces_data', 'id', '', '', 'do_submit', '', 0, 1, 'BxWorkspacesFormEntry', 'modules/boonex/workspaces/classes/BxWorkspacesFormEntry.php', ''),
+('bx_workspace_skills', 'bx_workspaces', '_bx_workspaces_skills_form_profile', '', 'a:1:{s:7:\"enctype\";s:19:\"multipart/form-data\";}', 'bx_workspaces_skills', 'skill_id', '', '', 'do_submit', '', 0, 1, 'BxDolFormNested', 'inc/classes/BxDolFormNested.php', 'bx_workspace');
+
+INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES 
+('bx_workspace', 'bx_workspace_add', 'bx_workspaces', 0, '_bx_workspaces_form_profile_display_add'),
+('bx_workspace', 'bx_workspace_delete', 'bx_workspaces', 0, '_bx_workspaces_form_profile_display_delete'),
+('bx_workspace', 'bx_workspace_edit', 'bx_workspaces', 0, '_bx_workspaces_form_profile_display_edit'),
+('bx_workspace', 'bx_workspace_edit_cover', 'bx_workspaces', 0, '_bx_workspaces_form_profile_display_edit_cover'),
+('bx_workspace', 'bx_workspace_view', 'bx_workspaces', 1, '_bx_workspaces_form_profile_display_view'),
+('bx_workspace', 'bx_workspace_view_full', 'bx_workspaces', 1, '_bx_workspaces_form_profile_display_view_full'),
+('bx_workspace_skills', 'bx_workspace_skills', 'bx_workspaces', 0, '_bx_workspaces_skills_form_profile_display_add'),
+('bx_workspace_skills', 'bx_workspace_skills_view', 'bx_workspaces', 1, '_bx_workspaces_skills_form_profile_display_view');
+
+INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`, `rateable`) VALUES 
+('bx_workspace', 'bx_workspaces', 'allow_view_to', 3, '', 0, 'custom', '_bx_workspaces_form_profile_input_sys_allow_view_to', '_bx_workspaces_form_profile_input_allow_view_to', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0, ''),
+('bx_workspace', 'bx_workspaces', 'allow_post_to', 5, '', 0, 'custom', '_bx_workspaces_form_profile_input_sys_allow_post_to', '_bx_workspaces_form_profile_input_allow_post_to', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0, ''),
+('bx_workspace', 'bx_workspaces', 'allow_contact_to', 3, '', 0, 'custom', '_bx_workspaces_form_profile_input_sys_allow_contact_to', '_bx_workspaces_form_profile_input_allow_contact_to', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0, ''),
+('bx_workspace', 'bx_workspaces', 'delete_confirm', 1, '', 0, 'checkbox', '_bx_workspaces_form_profile_input_sys_delete_confirm', '_bx_workspaces_form_profile_input_delete_confirm', '_bx_workspaces_form_profile_input_delete_confirm_info', 1, 0, 0, '', '', '', 'Avail', '', '_bx_workspaces_form_profile_input_delete_confirm_error', '', '', 1, 0, ''),
+('bx_workspace', 'bx_workspaces', 'do_submit', '_bx_workspaces_form_profile_input_submit', '', 0, 'submit', '_bx_workspaces_form_profile_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0, ''),
+('bx_workspace', 'bx_workspaces', 'do_cancel', '_sys_form_input_cancel', '', 0, 'button', '_sys_form_input_sys_cancel', '', '', 0, 0, 0, 'a:2:{s:7:"onclick";s:41:"window.open(''{edit_cancel_url}'', ''_self'')";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 0, 0, ''),
+('bx_workspace', 'bx_workspaces', 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '_sys_form_input_sys_controls', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0, ''),
+('bx_workspace', 'bx_workspaces', 'description', '', '', 0, 'textarea', '_bx_workspaces_form_profile_input_sys_desc', '_bx_workspaces_form_profile_input_desc', '', 0, 0, 1, '', '', '', '', '', '', 'XssHtml', '', 1, 1, ''),
+('bx_workspace', 'bx_workspaces', 'fullname', '', '', 0, 'text', '_bx_workspaces_form_profile_input_sys_fullname', '_bx_workspaces_form_profile_input_fullname', '', 1, 0, 0, '', '', '', 'ProfileName', '', '_bx_workspaces_form_profile_input_fullname_err', 'Xss', '', 1, 0, ''),
+('bx_workspace', 'bx_workspaces', 'last_name', '', '', 0, 'text', '_bx_workspaces_form_profile_input_sys_last_name', '_bx_workspaces_form_profile_input_last_name', '', 1, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0, ''),
+('bx_workspace', 'bx_workspaces', 'cover', 'a:1:{i:0;s:24:"bx_workspaces_cover_crop";}', 'a:1:{s:24:"bx_workspaces_cover_crop";s:24:"_sys_uploader_crop_title";}', 0, 'files', '_bx_workspaces_form_profile_input_sys_cover', '_bx_workspaces_form_profile_input_cover', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0, ''),
+('bx_workspace', 'bx_workspaces', 'picture', 'a:1:{i:0;s:27:"bx_workspaces_picture_crop";}', 'a:1:{s:27:"bx_workspaces_picture_crop";s:24:"_sys_uploader_crop_title";}', 0, 'files', '_bx_workspaces_form_profile_input_sys_picture', '_bx_workspaces_form_profile_input_picture', '', 0, 0, 0, '', '', '', '', '', '_bx_workspaces_form_profile_input_picture_err', '', '', 1, 0, ''),
+('bx_workspace', 'bx_workspaces', 'location', '', '', 0, 'location', '_sys_form_input_sys_location', '_sys_form_input_location', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0, ''),
+('bx_workspace', 'bx_workspaces', 'birthday', '0', '', 0, 'datepicker', '_bx_workspaces_form_profile_input_sys_birthday', '_bx_workspaces_form_profile_input_birthday', '', 1, 0, 0, '', '', '', 'date_range', 'a:3:{s:3:"min";i:18;s:3:"max";i:99;s:8:"required";b:0;}', '_bx_workspaces_form_profile_input_birthday_err', 'Date', '', 1, 0, ''),
+('bx_workspace', 'bx_workspaces', 'gender', '', '#!Sex', 0, 'select', '_bx_workspaces_form_profile_input_sys_gender', '_bx_workspaces_form_profile_input_gender', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0, ''),
+('bx_workspace', 'bx_workspaces', 'profile_email', '', '', 0, 'text', '_bx_workspaces_form_profile_input_sys_profile_email', '_bx_workspaces_form_profile_input_profile_email', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0, ''),
+('bx_workspace', 'bx_workspaces', 'profile_status', '', '', 0, 'text', '_bx_workspaces_form_profile_input_sys_profile_status', '_bx_workspaces_form_profile_input_profile_status', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0, ''),
+('bx_workspace', 'bx_workspaces', 'profile_ip', '', '', 0, 'text', '_bx_workspaces_form_profile_input_sys_profile_ip', '_bx_workspaces_form_profile_input_profile_ip', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0, ''),
+('bx_workspace', 'bx_workspaces', 'profile_last_active', '', '', 0, 'text', '_bx_workspaces_form_profile_input_sys_profile_last_active', '_bx_workspaces_form_profile_input_profile_last_active', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0, ''),
+('bx_workspace', 'bx_workspaces', 'labels', '', '', 0, 'custom', '_sys_form_input_sys_labels', '_sys_form_input_labels', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0, ''),
+('bx_workspace', 'bx_workspaces', 'skills', 'bx_workspace_skills', '', 0, 'nested_form', '_bx_workspaces_form_profile_input_sys_skills', '_bx_workspaces_form_profile_input_skills', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0, 'sys_form_fields_votes'),
+('bx_workspace', 'bx_workspaces', 'added', '', '', 0, 'datetime', '_bx_workspaces_form_profile_input_sys_date_added', '_bx_workspaces_form_profile_input_date_added', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0, ''),
+('bx_workspace', 'bx_workspaces', 'changed', '', '', 0, 'datetime', '_bx_workspaces_form_profile_input_sys_date_changed', '_bx_workspaces_form_profile_input_date_changed', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0, ''),
+('bx_workspace', 'bx_workspaces', 'friends_count', '', '', 0, 'text', '_bx_workspaces_form_profile_input_sys_friends_count', '_bx_workspaces_form_profile_input_friends_count', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0, ''),
+('bx_workspace', 'bx_workspaces', 'followers_count', '', '', 0, 'text', '_bx_workspaces_form_profile_input_sys_followers_count', '_bx_workspaces_form_profile_input_followers_count', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0, ''),
+('bx_workspace_skills', 'bx_workspaces', 'skill_name', '', '', 0, 'text', '_bx_workspaces_skills_form_profile_input_sys_skill_name', '_bx_workspaces_skills_form_profile_input_skill_name', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_workspaces_skills_form_profile_input_skill_name_err', 'Xss', '', 1, 0, '');
+
+INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES 
+('bx_workspace_add', 'picture', 2147483647, 1, 1),
+('bx_workspace_add', 'gender', 2147483647, 1, 2),
+('bx_workspace_add', 'birthday', 2147483647, 1, 3),
+('bx_workspace_add', 'fullname', 2147483647, 1, 4),
+('bx_workspace_add', 'last_name', 2147483647, 0, 5),
+('bx_workspace_add', 'description', 2147483647, 1, 6),
+('bx_workspace_add', 'location', 2147483647, 1, 7),
+('bx_workspace_add', 'allow_view_to', 2147483647, 1, 8),
+('bx_workspace_add', 'allow_post_to', 2147483647, 1, 9),
+('bx_workspace_add', 'allow_contact_to', 2147483647, 1, 10),
+('bx_workspace_add', 'do_submit', 2147483647, 1, 11),
+
+('bx_workspace_delete', 'cover', 2147483647, 0, 0),
+('bx_workspace_delete', 'picture', 2147483647, 0, 0),
+('bx_workspace_delete', 'delete_confirm', 2147483647, 1, 0),
+('bx_workspace_delete', 'do_submit', 2147483647, 1, 1),
+('bx_workspace_delete', 'fullname', 2147483647, 0, 2),
+
+('bx_workspace_edit', 'picture', 2147483647, 1, 1),
+('bx_workspace_edit', 'gender', 2147483647, 1, 2),
+('bx_workspace_edit', 'birthday', 2147483647, 1, 3),
+('bx_workspace_edit', 'fullname', 2147483647, 1, 4),
+('bx_workspace_edit', 'last_name', 2147483647, 0, 5),
+('bx_workspace_edit', 'description', 2147483647, 1, 6),
+('bx_workspace_edit', 'location', 2147483647, 1, 7),
+('bx_workspace_edit', 'allow_view_to', 2147483647, 1, 8),
+('bx_workspace_edit', 'allow_post_to', 2147483647, 1, 9),
+('bx_workspace_edit', 'allow_contact_to', 2147483647, 1, 10),
+('bx_workspace_edit', 'controls', 2147483647, 1, 11),
+('bx_workspace_edit', 'do_submit', 2147483647, 1, 12),
+('bx_workspace_edit', 'do_cancel', 2147483647, 1, 13),
+
+('bx_workspace_edit_cover', 'delete_confirm', 2147483647, 0, 1),
+('bx_workspace_edit_cover', 'fullname', 2147483647, 0, 2),
+('bx_workspace_edit_cover', 'picture', 2147483647, 0, 3),
+('bx_workspace_edit_cover', 'cover', 2147483647, 1, 7),
+('bx_workspace_edit_cover', 'do_submit', 2147483647, 1, 8),
+
+('bx_workspace_view', 'gender', 2147483647, 1, 1),
+('bx_workspace_view', 'birthday', 2147483647, 1, 2),
+('bx_workspace_view', 'fullname', 2147483647, 1, 3),
+('bx_workspace_view', 'last_name', 2147483647, 0, 4),
+('bx_workspace_view', 'profile_email', 192, 1, 5),
+('bx_workspace_view', 'profile_status', 192, 1, 6),
+('bx_workspace_view', 'profile_ip', 192, 1, 7),
+('bx_workspace_view', 'profile_last_active', 192, 1, 8),
+('bx_workspace_view', 'added', 192, 1, 9),
+('bx_workspace_view', 'changed', 192, 1, 10),
+('bx_workspace_view', 'friends_count', 2147483647, 1, 11),
+('bx_workspace_view', 'followers_count', 2147483647, 1, 12),
+
+('bx_workspace_view_full', 'gender', 2147483647, 1, 1),
+('bx_workspace_view_full', 'birthday', 2147483647, 1, 2),
+('bx_workspace_view_full', 'fullname', 2147483647, 1, 3),
+('bx_workspace_view_full', 'last_name', 2147483647, 0, 4),
+('bx_workspace_view_full', 'description', 2147483647, 0, 5),
+('bx_workspace_view_full', 'profile_email', 192, 1, 6),
+('bx_workspace_view_full', 'profile_status', 192, 1, 7),
+('bx_workspace_view_full', 'profile_last_active', 192, 1, 8),
+
+('bx_workspace_skills', 'skill_name', 2147483647, 1, 1),
+('bx_workspace_skills_view', 'skill_name', 2147483647, 1, 1);
+
+-- COMMENTS
+INSERT INTO `sys_objects_cmts` (`Name`, `Module`, `Table`, `CharsPostMin`, `CharsPostMax`, `CharsDisplayMax`, `Html`, `PerView`, `PerViewReplies`, `BrowseType`, `IsBrowseSwitch`, `PostFormPosition`, `NumberOfLevels`, `IsDisplaySwitch`, `IsRatable`, `ViewingThreshold`, `IsOn`, `RootStylePrefix`, `BaseUrl`, `ObjectVote`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldTitle`, `TriggerFieldComments`, `ClassName`, `ClassFile`) VALUES
+('bx_workspaces', 'bx_workspaces', 'bx_workspaces_cmts', 1, 5000, 1000, 3, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-workspaces-profile&id={object_id}', '', 'bx_workspaces_data', 'id', 'author', 'fullname', 'comments', 'BxWorkspacesCmts', 'modules/boonex/workspaces/classes/BxWorkspacesCmts.php'),
+('bx_workspaces_notes', 'bx_workspaces', 'bx_workspaces_cmts_notes', 1, 5000, 1000, 0, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-post&id={object_id}', '', 'bx_workspaces_data', 'id', 'author', 'fullname', '', 'BxTemplCmtsNotes', '');
+
+-- VIEWS
+INSERT INTO `sys_objects_view` (`name`, `module`, `table_track`, `period`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_workspaces', 'bx_workspaces', 'bx_workspaces_views_track', '86400', '1', 'bx_workspaces_data', 'id', 'author', 'views', '', '');
+
+-- VOTES
+INSERT INTO `sys_objects_vote` (`Name`, `Module`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES 
+('bx_workspaces', 'bx_workspaces', 'bx_workspaces_votes', 'bx_workspaces_votes_track', '604800', '1', '1', '0', '1', 'bx_workspaces_data', 'id', '', 'rate', 'votes', 'BxWorkspacesVote', 'modules/boonex/workspaces/classes/BxWorkspacesVote.php'),
+('bx_workspaces_reactions', 'bx_workspaces', 'bx_workspaces_reactions', 'bx_workspaces_reactions_track', '604800', '1', '1', '1', '1', 'bx_workspaces_data', 'id', 'author', 'rrate', 'rvotes', 'BxTemplVoteReactions', '');
+
+-- SCORES
+INSERT INTO `sys_objects_score` (`name`, `module`, `table_main`, `table_track`, `post_timeout`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_score`, `trigger_field_cup`, `trigger_field_cdown`, `class_name`, `class_file`) VALUES 
+('bx_workspaces', 'bx_workspaces', 'bx_workspaces_scores', 'bx_workspaces_scores_track', '604800', '1', 'bx_workspaces_data', 'id', 'author', 'score', 'sc_up', 'sc_down', '', '');
+
+-- FAFORITES
+INSERT INTO `sys_objects_favorite` (`name`, `table_track`, `is_on`, `is_undo`, `is_public`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_workspaces', 'bx_workspaces_favorites_track', '1', '1', '0', 'page.php?i=view-workspaces-profile&id={object_id}', 'bx_workspaces_data', 'id', 'author', 'favorites', 'BxWorkspacesFavorite', 'modules/boonex/workspaces/classes/BxWorkspacesFavorite.php');
+
+-- FEATURED
+INSERT INTO `sys_objects_feature` (`name`, `module`, `is_on`, `is_undo`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_flag`, `class_name`, `class_file`) VALUES 
+('bx_workspaces', 'bx_workspaces', '1', '1', 'page.php?i=view-workspaces-profile&id={object_id}', 'bx_workspaces_data', 'id', 'author', 'featured', '', '');
+
+-- REPORTS
+INSERT INTO `sys_objects_report` (`name`, `module`, `table_main`, `table_track`, `is_on`, `base_url`, `object_comment`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_workspaces', 'bx_workspaces', 'bx_workspaces_reports', 'bx_workspaces_reports_track', '1', 'page.php?i=view-workspaces-profile&id={object_id}', 'bx_workspaces_notes', 'bx_workspaces_data', 'id', 'author', 'reports', 'BxWorkspacesReport', 'modules/boonex/workspaces/classes/BxWorkspacesReport.php');
+
+-- CONTENT INFO
+INSERT INTO `sys_objects_content_info` (`name`, `title`, `alert_unit`, `alert_action_add`, `alert_action_update`, `alert_action_delete`, `class_name`, `class_file`) VALUES
+('bx_workspaces', '_bx_workspaces', 'bx_workspaces', 'added', 'edited', 'deleted', '', ''),
+('bx_workspaces_cmts', '_bx_workspaces_cmts', 'bx_workspaces', 'commentPost', 'commentUpdated', 'commentRemoved', 'BxDolContentInfoCmts', '');
+
+INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`, `condition`, `selection`) VALUES
+('bx_workspaces', 'bx_workspaces_administration', 'td`.`id', '', ''),
+('bx_workspaces', 'bx_workspaces_common', 'td`.`id', '', '');
+
+-- SEARCH EXTENDED
+INSERT INTO `sys_objects_search_extended` (`object`, `object_content_info`, `module`, `title`, `active`, `class_name`, `class_file`) VALUES
+('bx_workspaces', 'bx_workspaces', 'bx_workspaces', '_bx_workspaces_search_extended', 1, '', ''),
+('bx_workspaces_cmts', 'bx_workspaces_cmts', 'bx_workspaces', '_bx_workspaces_search_extended_cmts', 1, 'BxTemplSearchExtendedCmts', '');
+
+-- STUDIO PAGE & WIDGET
+INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
+(3, 'bx_workspaces', '_bx_workspaces', '_bx_workspaces', 'bx_workspaces@modules/boonex/workspaces/|std-icon.svg');
+SET @iPageId = LAST_INSERT_ID();
+
+SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
+SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
+INSERT INTO `sys_std_widgets` (`page_id`, `module`, `type`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
+(@iPageId, 'bx_workspaces', 'users', '{url_studio}module.php?name=bx_workspaces', '', 'bx_workspaces@modules/boonex/workspaces/|std-icon.svg', '_bx_workspaces', '', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:18:"TemplStudioModules";}');
+INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
+(@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));
+

+ 56 - 0
modules/boonex/workspaces/install/sql2/uninstall.sql

@@ -0,0 +1,56 @@
+
+-- TABLES
+DROP TABLE IF EXISTS `bx_workspaces_data`,`bx_workspaces_pictures`, `bx_workspaces_pictures_resized`, `bx_workspaces_cmts`, `bx_workspaces_cmts_notes`, `bx_workspaces_views_track`, `bx_workspaces_votes`, `bx_workspaces_votes_track`, `bx_workspaces_reactions`, `bx_workspaces_reactions_track`, `bx_workspaces_favorites_track`, `bx_workspaces_reports`, `bx_workspaces_reports_track`, `bx_workspaces_meta_keywords`, `bx_workspaces_meta_locations`, `bx_workspaces_meta_mentions`, `bx_workspaces_scores`, `bx_workspaces_scores_track`, `bx_workspaces_skills`;
+
+-- PROFILES
+DELETE FROM sys_profiles WHERE `type` = 'bx_workspaces';
+
+-- STORAGES & TRANSCODERS
+DELETE FROM `sys_objects_storage` WHERE `object` IN('bx_workspaces_pictures', 'bx_workspaces_pictures_resized');
+DELETE FROM `sys_storage_tokens` WHERE `object` IN('bx_workspaces_pictures', 'bx_workspaces_pictures_resized');
+
+DELETE FROM `sys_objects_transcoder` WHERE `object` IN('bx_workspaces_icon', 'bx_workspaces_thumb', 'bx_workspaces_avatar', 'bx_workspaces_avatar_big', 'bx_workspaces_picture', 'bx_workspaces_cover', 'bx_workspaces_cover_thumb', 'bx_workspaces_gallery');
+DELETE FROM `sys_transcoder_filters` WHERE `transcoder_object` IN('bx_workspaces_icon', 'bx_workspaces_thumb', 'bx_workspaces_avatar', 'bx_workspaces_avatar_big', 'bx_workspaces_picture', 'bx_workspaces_cover', 'bx_workspaces_cover_thumb', 'bx_workspaces_gallery');
+DELETE FROM `sys_transcoder_images_files` WHERE `transcoder_object` IN('bx_workspaces_icon', 'bx_workspaces_thumb', 'bx_workspaces_avatar', 'bx_workspaces_avatar_big', 'bx_workspaces_picture', 'bx_workspaces_cover', 'bx_workspaces_cover_thumb', 'bx_workspaces_gallery');
+
+-- FORMS
+DELETE FROM `sys_objects_form` WHERE `module` = 'bx_workspaces';
+DELETE FROM `sys_form_displays` WHERE `module` = 'bx_workspaces';
+DELETE FROM `sys_form_inputs` WHERE `module` = 'bx_workspaces';
+DELETE FROM `sys_form_display_inputs` WHERE `display_name` IN('bx_workspace_add', 'bx_workspace_delete', 'bx_workspace_edit', 'bx_workspace_edit_cover', 'bx_workspace_view', 'bx_workspace_view_full', 'bx_workspace_skills', 'bx_workspace_skills_view');
+
+-- COMMENTS
+DELETE FROM `sys_objects_cmts` WHERE `Name` LIKE 'bx_workspaces%';
+
+-- VIEWS
+DELETE FROM `sys_objects_view` WHERE `name` = 'bx_workspaces';
+
+-- VOTES
+DELETE FROM `sys_objects_vote` WHERE `Name` IN ('bx_workspaces', 'bx_workspaces_reactions');
+
+-- SCORES
+DELETE FROM `sys_objects_score` WHERE `name` = 'bx_workspaces';
+
+-- FAFORITES
+DELETE FROM `sys_objects_favorite` WHERE `name` = 'bx_workspaces';
+
+-- FEATURED
+DELETE FROM `sys_objects_feature` WHERE `name` = 'bx_workspaces';
+
+-- REPORTS
+DELETE FROM `sys_objects_report` WHERE `name` = 'bx_workspaces';
+
+-- CONTENT INFO
+DELETE FROM `sys_objects_content_info` WHERE `name` IN ('bx_workspaces', 'bx_workspaces_cmts');
+
+DELETE FROM `sys_content_info_grids` WHERE `object` IN ('bx_workspaces');
+
+
+-- SEARCH EXTENDED
+DELETE FROM `sys_objects_search_extended` WHERE `module` = 'bx_workspaces';
+
+
+-- STUDIO PAGE & WIDGET
+DELETE FROM `tp`, `tw`, `twb`, `tpw` 
+USING `sys_std_pages` AS `tp` LEFT JOIN `sys_std_widgets` AS `tw` ON `tp`.`id` = `tw`.`page_id` LEFT JOIN `sys_std_widgets_bookmarks` AS `twb` ON `tw`.`id` = `twb`.`widget_id` LEFT JOIN `sys_std_pages_widgets` AS `tpw` ON `tw`.`id` = `tpw`.`widget_id`
+WHERE  `tp`.`name` = 'bx_workspaces';

+ 77 - 0
modules/boonex/workspaces/js/manage_tools.js

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

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

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

+ 25 - 0
modules/boonex/workspaces/template/images/icons/std-icon.svg

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="606px" height="606px" viewBox="0 0 606 606" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <defs>
+        <linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
+            <stop stop-color="#984f65" stop-opacity="1" offset="0%"></stop>
+            <stop stop-color="#691c35" stop-opacity="1" offset="100%"></stop>
+        </linearGradient>
+        <path d="M552.268958,552.268958 C600,504.537813 600,431.458333 600,300 C600,168.541667 600,95.4621875 552.268958,47.7310417 C504.537813,0 431.458333,0 300,0 C168.541667,0 95.4621875,0 47.7310417,47.7310417 C0,95.4621875 0,168.541667 0,300 C0,431.458333 0,504.537813 47.7310417,552.268958 C95.4621875,600 168.541667,600 300,600 C431.458333,600 504.537813,600 552.268958,552.268958 Z" id="path-2"></path>
+    </defs>
+    <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="una-connect" transform="translate(3.000000, 3.000000)">
+            <g id="Squircle2-Copy-6">
+                <g id="Shape">
+                    <use fill="#FFFFFF" xlink:href="#path-2"></use>
+                    <use stroke="#000000" stroke-width="4.04" fill="url(#linearGradient-1)" xlink:href="#path-2"></use>
+                </g>
+            </g>
+            <g>
+                <text x="50%" y="55%" style="text-anchor: middle; fill: #ffffff; stroke: #000000; font-size: 100px;">
+                    Workspaces
+                </text>
+            </g>
+        </g>
+    </g>
+</svg>

BIN
modules/boonex/workspaces/template/images/no-picture.png


+ 5 - 0
modules/boonex/workspaces/template/images/no-picture.svg

@@ -0,0 +1,5 @@
+<svg width="240" height="240" viewBox="0 0 240 240" fill="none" xmlns="http://www.w3.org/2000/svg">
+<rect width="240" height="240" fill="#0EA5E9"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M105.52 117.175C100.878 115.666 95.889 114.847 91.2833 116.464C71.9306 123.259 55.6889 136.664 45.267 153.971C41.7721 159.775 42.3728 167.127 46.6909 172.347C64.1993 193.514 90.6642 207 120.279 207C149.894 207 176.359 193.514 193.867 172.347C198.185 167.127 198.786 159.775 195.291 153.971C184.869 136.664 168.627 123.259 149.274 116.464C144.668 114.847 139.68 115.666 135.037 117.174C130.39 118.684 125.429 119.5 120.278 119.5C115.128 119.5 110.168 118.684 105.52 117.175Z" fill="#7DD3FC"/>
+<circle cx="120.297" cy="72" r="40" fill="#E0F2FE"/>
+</svg>