AntonLV 9 лет назад
Родитель
Сommit
3aa090b136
100 измененных файлов с 14557 добавлено и 0 удалено
  1. 72 0
      modules/boonex/accounts/updates/9.0.3_9.0.4/source/install/config.php
  2. 62 0
      modules/boonex/accounts/updates/9.0.3_9.0.4/source/install/langs/en.xml
  3. 114 0
      modules/boonex/accounts/updates/9.0.3_9.0.4/source/js/manage_tools.js
  4. 224 0
      modules/boonex/acl/updates/9.0.3_9.0.4/source/classes/BxAclGridAdministration.php
  5. 77 0
      modules/boonex/acl/updates/9.0.3_9.0.4/source/classes/BxAclGridLevels.php
  6. 109 0
      modules/boonex/acl/updates/9.0.3_9.0.4/source/classes/BxAclGridView.php
  7. 193 0
      modules/boonex/acl/updates/9.0.3_9.0.4/source/classes/BxAclModule.php
  8. 32 0
      modules/boonex/acl/updates/9.0.3_9.0.4/source/classes/BxAclPageView.php
  9. 73 0
      modules/boonex/acl/updates/9.0.3_9.0.4/source/classes/BxAclTemplate.php
  10. 70 0
      modules/boonex/acl/updates/9.0.3_9.0.4/source/install/config.php
  11. 87 0
      modules/boonex/acl/updates/9.0.3_9.0.4/source/install/langs/en.xml
  12. 38 0
      modules/boonex/acl/updates/9.0.3_9.0.4/source/install/sql/enable.sql
  13. 114 0
      modules/boonex/acl/updates/9.0.3_9.0.4/source/install/sql/install.sql
  14. 14 0
      modules/boonex/acl/updates/9.0.3_9.0.4/source/template/css/view.css
  15. 8 0
      modules/boonex/acl/updates/9.0.3_9.0.4/source/template/level_icon.html
  16. 161 0
      modules/boonex/albums/updates/9.0.3_9.0.4/source/classes/BxAlbumsConfig.php
  17. 141 0
      modules/boonex/albums/updates/9.0.3_9.0.4/source/classes/BxAlbumsContentInfoMedia.php
  18. 146 0
      modules/boonex/albums/updates/9.0.3_9.0.4/source/classes/BxAlbumsDb.php
  19. 102 0
      modules/boonex/albums/updates/9.0.3_9.0.4/source/classes/BxAlbumsFormEntry.php
  20. 370 0
      modules/boonex/albums/updates/9.0.3_9.0.4/source/classes/BxAlbumsModule.php
  21. 130 0
      modules/boonex/albums/updates/9.0.3_9.0.4/source/install/config.php
  22. 222 0
      modules/boonex/albums/updates/9.0.3_9.0.4/source/install/langs/en.xml
  23. 57 0
      modules/boonex/albums/updates/9.0.3_9.0.4/source/install/sql/disable.sql
  24. 445 0
      modules/boonex/albums/updates/9.0.3_9.0.4/source/install/sql/enable.sql
  25. 389 0
      modules/boonex/albums/updates/9.0.3_9.0.4/source/install/sql/install.sql
  26. 56 0
      modules/boonex/albums/updates/9.0.3_9.0.4/source/js/manage_tools.js
  27. 16 0
      modules/boonex/albums/updates/9.0.3_9.0.4/source/template/unit.html
  28. 17 0
      modules/boonex/albums/updates/9.0.3_9.0.4/source/template/unit_gallery.html
  29. 73 0
      modules/boonex/antispam/updates/9.0.1_9.0.2/source/classes/BxAntispamConfig.php
  30. 20 0
      modules/boonex/antispam/updates/9.0.1_9.0.2/source/classes/BxAntispamCronUpdateDisposableEmailDomains.php
  31. 86 0
      modules/boonex/antispam/updates/9.0.1_9.0.2/source/classes/BxAntispamDisposableEmailDomains.php
  32. 323 0
      modules/boonex/antispam/updates/9.0.1_9.0.2/source/classes/BxAntispamModule.php
  33. 68 0
      modules/boonex/antispam/updates/9.0.1_9.0.2/source/install/config.php
  34. 29 0
      modules/boonex/antispam/updates/9.0.1_9.0.2/source/install/installer.php
  35. 161 0
      modules/boonex/antispam/updates/9.0.1_9.0.2/source/install/langs/en.xml
  36. 214 0
      modules/boonex/antispam/updates/9.0.1_9.0.2/source/install/sql/enable.sql
  37. 71 0
      modules/boonex/antispam/updates/9.0.1_9.0.2/source/install/sql/install.sql
  38. 9 0
      modules/boonex/antispam/updates/9.0.1_9.0.2/source/install/sql/uninstall.sql
  39. 139 0
      modules/boonex/contact/updates/9.0.2_9.0.3/source/classes/BxContactModule.php
  40. 72 0
      modules/boonex/contact/updates/9.0.2_9.0.3/source/install/config.php
  41. 47 0
      modules/boonex/contact/updates/9.0.2_9.0.3/source/install/langs/en.xml
  42. 64 0
      modules/boonex/contact/updates/9.0.2_9.0.3/source/install/sql/enable.sql
  43. 72 0
      modules/boonex/convos/updates/9.0.3_9.0.4/source/classes/BxCnvCmts.php
  44. 375 0
      modules/boonex/convos/updates/9.0.3_9.0.4/source/classes/BxCnvModule.php
  45. 104 0
      modules/boonex/convos/updates/9.0.3_9.0.4/source/install/config.php
  46. 135 0
      modules/boonex/convos/updates/9.0.3_9.0.4/source/install/langs/en.xml
  47. 48 0
      modules/boonex/convos/updates/9.0.3_9.0.4/source/install/sql/disable.sql
  48. 214 0
      modules/boonex/convos/updates/9.0.3_9.0.4/source/install/sql/enable.sql
  49. 112 0
      modules/boonex/developer/updates/9.0.3_9.0.4/source/classes/BxDevConfig.php
  50. 43 0
      modules/boonex/developer/updates/9.0.3_9.0.4/source/classes/BxDevForms.php
  51. 329 0
      modules/boonex/developer/updates/9.0.3_9.0.4/source/classes/BxDevFormsField.php
  52. 189 0
      modules/boonex/developer/updates/9.0.3_9.0.4/source/classes/BxDevFormsForms.php
  53. 162 0
      modules/boonex/developer/updates/9.0.3_9.0.4/source/classes/BxDevFormsPreValues.php
  54. 119 0
      modules/boonex/developer/updates/9.0.3_9.0.4/source/classes/BxDevFormsSearchFields.php
  55. 125 0
      modules/boonex/developer/updates/9.0.3_9.0.4/source/classes/BxDevFormsSearchForms.php
  56. 127 0
      modules/boonex/developer/updates/9.0.3_9.0.4/source/classes/BxDevNavigationItems.php
  57. 69 0
      modules/boonex/developer/updates/9.0.3_9.0.4/source/install/config.php
  58. 2 0
      modules/boonex/developer/updates/9.0.3_9.0.4/source/install/info/inst_concl.html
  59. 1 0
      modules/boonex/developer/updates/9.0.3_9.0.4/source/install/info/inst_intro.html
  60. 1 0
      modules/boonex/developer/updates/9.0.3_9.0.4/source/install/info/uninst_concl.html
  61. 1 0
      modules/boonex/developer/updates/9.0.3_9.0.4/source/install/info/uninst_intro.html
  62. 463 0
      modules/boonex/developer/updates/9.0.3_9.0.4/source/install/langs/en.xml
  63. 648 0
      modules/boonex/developer/updates/9.0.3_9.0.4/source/install/sql/install.sql
  64. 41 0
      modules/boonex/developer/updates/9.0.3_9.0.4/source/install/sql/uninstall.sql
  65. 19 0
      modules/boonex/developer/updates/9.0.3_9.0.4/source/template/form_add_search_field.html
  66. 19 0
      modules/boonex/developer/updates/9.0.3_9.0.4/source/template/form_add_search_form.html
  67. 203 0
      modules/boonex/events/updates/9.0.2_9.0.3/source/classes/BxEventsConfig.php
  68. 157 0
      modules/boonex/events/updates/9.0.2_9.0.3/source/classes/BxEventsDb.php
  69. 247 0
      modules/boonex/events/updates/9.0.2_9.0.3/source/classes/BxEventsFormEntry.php
  70. 262 0
      modules/boonex/events/updates/9.0.2_9.0.3/source/classes/BxEventsModule.php
  71. 205 0
      modules/boonex/events/updates/9.0.2_9.0.3/source/classes/BxEventsSearchResult.php
  72. 42 0
      modules/boonex/events/updates/9.0.2_9.0.3/source/classes/BxEventsTemplate.php
  73. 140 0
      modules/boonex/events/updates/9.0.2_9.0.3/source/install/config.php
  74. 404 0
      modules/boonex/events/updates/9.0.2_9.0.3/source/install/langs/en.xml
  75. 95 0
      modules/boonex/events/updates/9.0.2_9.0.3/source/install/sql/disable.sql
  76. 509 0
      modules/boonex/events/updates/9.0.2_9.0.3/source/install/sql/enable.sql
  77. 484 0
      modules/boonex/events/updates/9.0.2_9.0.3/source/install/sql/install.sql
  78. 37 0
      modules/boonex/events/updates/9.0.2_9.0.3/source/install/sql/uninstall.sql
  79. 62 0
      modules/boonex/events/updates/9.0.2_9.0.3/source/js/manage_tools.js
  80. 68 0
      modules/boonex/facebook_connect/updates/9.0.2_9.0.3/source/install/config.php
  81. 24 0
      modules/boonex/facebook_connect/updates/9.0.2_9.0.3/source/install/langs/en.xml
  82. 52 0
      modules/boonex/facebook_connect/updates/9.0.2_9.0.3/source/install/sql/enable.sql
  83. 143 0
      modules/boonex/files/updates/9.0.0_9.0.1/source/classes/BxFilesConfig.php
  84. 222 0
      modules/boonex/files/updates/9.0.0_9.0.1/source/classes/BxFilesModule.php
  85. 126 0
      modules/boonex/files/updates/9.0.0_9.0.1/source/install/config.php
  86. 207 0
      modules/boonex/files/updates/9.0.0_9.0.1/source/install/langs/en.xml
  87. 63 0
      modules/boonex/files/updates/9.0.0_9.0.1/source/install/sql/disable.sql
  88. 416 0
      modules/boonex/files/updates/9.0.0_9.0.1/source/install/sql/enable.sql
  89. 296 0
      modules/boonex/files/updates/9.0.0_9.0.1/source/install/sql/install.sql
  90. 56 0
      modules/boonex/files/updates/9.0.0_9.0.1/source/js/manage_tools.js
  91. 5 0
      modules/boonex/files/updates/9.0.0_9.0.1/source/template/timeline_post.html
  92. 88 0
      modules/boonex/forum/updates/9.0.2_9.0.3/source/classes/BxForumAlertsResponse.php
  93. 90 0
      modules/boonex/forum/updates/9.0.2_9.0.3/source/classes/BxForumCmts.php
  94. 169 0
      modules/boonex/forum/updates/9.0.2_9.0.3/source/classes/BxForumConfig.php
  95. 154 0
      modules/boonex/forum/updates/9.0.2_9.0.3/source/classes/BxForumDb.php
  96. 257 0
      modules/boonex/forum/updates/9.0.2_9.0.3/source/classes/BxForumGrid.php
  97. 61 0
      modules/boonex/forum/updates/9.0.2_9.0.3/source/classes/BxForumMenuView.php
  98. 535 0
      modules/boonex/forum/updates/9.0.2_9.0.3/source/classes/BxForumModule.php
  99. 223 0
      modules/boonex/forum/updates/9.0.2_9.0.3/source/classes/BxForumTemplate.php
  100. 122 0
      modules/boonex/forum/updates/9.0.2_9.0.3/source/install/config.php

+ 72 - 0
modules/boonex/accounts/updates/9.0.3_9.0.4/source/install/config.php

@@ -0,0 +1,72 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Accounts Accounts
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_accounts',
+    'title' => 'Accounts Manager',
+    'note' => 'Accounts Manager module.',
+    'version' => '9.0.4',
+    'vendor' => 'BoonEx',
+	'help_url' => 'http://feed.boonex.com/?section={module_name}',
+    
+
+    'compatible_with' => array(
+        '9.0.0-RC1'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/accounts/',
+    'home_uri' => 'accounts',
+
+    'db_prefix' => 'bx_accnt_',
+    'class_prefix' => 'BxAccnt',
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => 'Accounts',
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+        'execute_sql' => 1,
+        'update_languages' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'uninstall' => array (
+        'execute_sql' => 1,
+        'update_languages' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'enable' => array(
+        'execute_sql' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'disable' => array (
+        'execute_sql' => 1,
+        'clear_db_cache' => 1,
+    ),
+
+    /**
+     * Dependencies Section
+     */
+    'dependencies' => array(),
+
+);
+
+/** @} */

+ 62 - 0
modules/boonex/accounts/updates/9.0.3_9.0.4/source/install/langs/en.xml

@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+	<string name="_bx_accnt"><![CDATA[Accounts]]></string>
+	<string name="_bx_accounts"><![CDATA[Accounts]]></string>
+
+	<string name="_bx_accounts_form_display_account_settings_email_popup"><![CDATA[Edit Email]]></string>
+	<string name="_bx_accounts_form_display_account_settings_password_popup"><![CDATA[Reset Password]]></string>
+
+	<string name="_bx_accnt_page_title_sys_manage_administration"><![CDATA[Manage All Accounts]]></string>
+	<string name="_bx_accnt_page_title_manage"><![CDATA[Manage Accounts]]></string>
+	<string name="_bx_accnt_page_title_browse"><![CDATA[Accounts]]></string>
+
+	<string name="_bx_accnt_page_block_title_system_manage_administration"><![CDATA[Manage All Accounts]]></string>
+	<string name="_bx_accnt_page_block_title_manage"><![CDATA[Manage Accounts]]></string>
+
+	<string name="_bx_accnt_menu_set_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string>
+    <string name="_bx_accnt_menu_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string>
+    <string name="_bx_accnt_menu_item_title_system_resend_cemail"><![CDATA[Resend Confirmation]]></string>
+    <string name="_bx_accnt_menu_item_title_resend_cemail"><![CDATA[Resend Confirmation]]></string>
+    <string name="_bx_accnt_menu_item_title_system_edit_email"><![CDATA[Edit Email]]></string>
+    <string name="_bx_accnt_menu_item_title_edit_email"><![CDATA[Edit Email]]></string>
+    <string name="_bx_accnt_menu_item_title_system_reset_password"><![CDATA[Reset Password]]></string>
+    <string name="_bx_accnt_menu_item_title_reset_password"><![CDATA[Reset Password]]></string>
+    <string name="_bx_accnt_menu_item_title_system_delete"><![CDATA[Delete]]></string>
+    <string name="_bx_accnt_menu_item_title_delete"><![CDATA[Delete]]></string>
+    <string name="_bx_accnt_menu_item_title_system_delete_with_content"><![CDATA[Delete With Content]]></string>
+    <string name="_bx_accnt_menu_item_title_delete_with_content"><![CDATA[Delete With Content]]></string>
+    <string name="_bx_accnt_menu_item_title_system_make_operator"><![CDATA[Make Operator]]></string>
+    <string name="_bx_accnt_menu_item_title_make_operator"><![CDATA[Make Operator]]></string>
+    <string name="_bx_accnt_menu_item_title_system_unmake_operator"><![CDATA[Unmake Operator]]></string>
+    <string name="_bx_accnt_menu_item_title_unmake_operator"><![CDATA[Unmake Operator]]></string>
+	<string name="_bx_accnt_menu_item_title_system_admt_accounts"><![CDATA[Accounts]]></string>
+	<string name="_bx_accnt_menu_item_title_admt_accounts"><![CDATA[Accounts - {addon} unconfirmed]]></string>
+	<string name="_bx_accnt_menu_item_title_manage"><![CDATA[Manage]]></string>
+
+	<string name="_bx_accnt_acl_action_edit_any_account"><![CDATA[Edit Any Account]]></string>
+
+	<string name="_bx_accnt_grid_filter_item_title_adm_select_one_filter1"><![CDATA[All Statuses]]></string>
+	<string name="_bx_accnt_grid_filter_item_title_adm_active"><![CDATA[Active]]></string>
+	<string name="_bx_accnt_grid_filter_item_title_adm_pending"><![CDATA[Pending]]></string>
+	<string name="_bx_accnt_grid_filter_item_title_adm_suspended"><![CDATA[Suspended]]></string>
+	<string name="_bx_accnt_grid_column_title_adm_active"><![CDATA[Active]]></string>
+    <string name="_bx_accnt_grid_column_title_adm_name"><![CDATA[Name]]></string>
+    <string name="_bx_accnt_grid_column_title_adm_email"><![CDATA[Email]]></string>
+    <string name="_bx_accnt_grid_column_title_adm_email_confirmed"><![CDATA[Email Confirmed]]></string>
+    <string name="_bx_accnt_grid_column_title_adm_profiles"><![CDATA[Profiles]]></string>
+    <string name="_bx_accnt_grid_column_title_adm_logged"><![CDATA[Last Online]]></string>
+    <string name="_bx_accnt_grid_action_title_adm_activate"><![CDATA[Activate]]></string>
+	<string name="_bx_accnt_grid_action_title_adm_suspend"><![CDATA[Suspend]]></string>
+	<string name="_bx_accnt_grid_action_title_adm_edit_email"><![CDATA[Edit Email]]></string>
+    <string name="_bx_accnt_grid_action_title_adm_resend_cemail"><![CDATA[Resend Confirmation]]></string>
+    <string name="_bx_accnt_grid_action_title_adm_reset_password"><![CDATA[Reset Password]]></string>
+    <string name="_bx_accnt_grid_action_title_adm_delete"><![CDATA[Delete]]></string>
+    <string name="_bx_accnt_grid_action_title_adm_delete_with_content"><![CDATA[Delete With Content]]></string>
+    <string name="_bx_accnt_grid_action_title_adm_more_actions"><![CDATA[More Actions]]></string>
+    <string name="_bx_accnt_grid_action_err_delete"><![CDATA[Cannot delete the selected account(s).]]></string>
+    <string name="_bx_accnt_grid_action_err_perform"><![CDATA[Cannot perform the action for selected account(s).]]></string>
+
+	<string name="_bx_accnt_txt_more"><![CDATA[{0} more]]></string>
+	<string name="_bx_accnt_txt_see_more"><![CDATA[See more]]></string>
+	<string name="_bx_accnt_txt_copy_to_clipboard"><![CDATA[Copy to Clipboard]]></string>
+</resources>

+ 114 - 0
modules/boonex/accounts/updates/9.0.3_9.0.4/source/js/manage_tools.js

@@ -0,0 +1,114 @@
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Accounts Accounts
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+function BxAccntManageTools(oOptions) {
+    this._iSearchTimeoutId = false;
+	this._sActionsUrl = oOptions.sActionUrl;    
+	this._sObjNameGrid = oOptions.sObjNameGrid;
+    this._sObjName = oOptions.sObjName == undefined ? 'oBxAccntManageTools' : 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;
+}
+
+BxAccntManageTools.prototype.onChangeFilter = function(oFilter) {
+    var $this = this;
+	var oFilter1 = $('#bx-grid-filter1-' + this._sObjNameGrid);
+	var sValueFilter1 = oFilter1.length > 0 ? oFilter1.val() : '';
+
+	var oSearch = $('#bx-grid-search-' + this._sObjNameGrid);
+	var sValueSearch = oSearch.length > 0 ? oSearch.val() : '';
+	if(sValueSearch == _t('_sys_grid_search'))
+		sValueSearch = '';
+
+    clearTimeout($this._iSearchTimeoutId);
+    $this._iSearchTimeoutId = setTimeout(function () {
+        glGrids[$this._sObjNameGrid].setFilter(sValueFilter1 + $this._sParamsDivider + sValueSearch, true);
+    }, 500);
+};
+
+BxAccntManageTools.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')
+	});
+};
+
+BxAccntManageTools.prototype.onClickEditEmail = function(iContentId, oLink) {
+	$('.bx-popup-applied:visible').dolPopupHide();
+
+	var oGrid = glGrids[this._sObjNameGrid];
+	var oData = oGrid._checkAppend(oLink, oGrid._getActionDataForReload());
+	oGrid.actionWithId(iContentId, 'edit_email', oData, '', false, 0);
+};
+
+BxAccntManageTools.prototype.onClickResendCemail = function(iContentId, oLink) {
+	$('.bx-popup-applied:visible').dolPopupHide();
+
+	var oGrid = glGrids[this._sObjNameGrid];
+	var oData = oGrid._checkAppend(oLink, oGrid._getActionDataForReload());
+	oGrid.actionWithId(iContentId, 'resend_cemail', oData, '', false, 0);
+};
+
+BxAccntManageTools.prototype.onClickResetPassword = function(iContentId, oLink) {
+	$('.bx-popup-applied:visible').dolPopupHide();
+
+	var oGrid = glGrids[this._sObjNameGrid];
+	var oData = oGrid._checkAppend(oLink, oGrid._getActionDataForReload());
+	oGrid.actionWithId(iContentId, 'reset_password', oData, '', false, 0);
+};
+
+BxAccntManageTools.prototype.onClickDelete = function(iContentId, oLink) {
+	$('.bx-popup-applied:visible').dolPopupHide();
+
+	var oGrid = glGrids[this._sObjNameGrid];
+	var oData = oGrid._checkAppend(oLink, {});
+	oGrid.actionWithId(iContentId, 'delete', oData, '', false, 1);
+};
+
+BxAccntManageTools.prototype.onClickDeleteWithContent = function(iContentId, oLink) {
+	$('.bx-popup-applied:visible').dolPopupHide();
+
+	var oGrid = glGrids[this._sObjNameGrid];
+	var oData = oGrid._checkAppend(oLink, {});
+	oGrid.actionWithId(iContentId, 'delete_with_content', oData, '', false, 1);
+};
+
+BxAccntManageTools.prototype.onClickMakeOperator = function(iContentId, oLink) {
+	$('.bx-popup-applied:visible').dolPopupHide({
+		onHide: function(oPopup) {
+			$(oPopup).remove();
+		} 
+	});
+
+	var oGrid = glGrids[this._sObjNameGrid];
+	var oData = oGrid._checkAppend(oLink, oGrid._getActionDataForReload());
+    oGrid.actionWithId(iContentId, 'make_operator', oData, '', false, 0);
+};
+
+BxAccntManageTools.prototype.onClickUnmakeOperator = function(iContentId, oLink) {
+	$('.bx-popup-applied:visible').dolPopupHide({
+		onHide: function(oPopup) {
+			$(oPopup).remove();
+		} 
+	});
+
+	var oGrid = glGrids[this._sObjNameGrid];
+	var oData = oGrid._checkAppend(oLink, oGrid._getActionDataForReload());
+	oGrid.actionWithId(iContentId, 'unmake_operator', oData, '', false, 0);
+};
+
+/** @} */

+ 224 - 0
modules/boonex/acl/updates/9.0.3_9.0.4/source/classes/BxAclGridAdministration.php

@@ -0,0 +1,224 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    PaidLevels Paid Levels
+ * @ingroup     UnaModules
+ * 
+ * @{
+ */
+
+require_once('BxAclGridLevels.php');
+
+class BxAclGridAdministration extends BxAclGridLevels
+{
+	protected $_sParamsDivider = '#-#';
+	protected $_iLevelId = 0;
+
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+        parent::__construct ($aOptions, $oTemplate);
+
+        $iLevel = (int)bx_get('level');
+        if($iLevel > 0) {
+            $this->_iLevelId = $iLevel;
+            $this->_aQueryAppend['level'] = $this->_iLevelId;
+        }
+    }
+
+	public function performActionAdd()
+    {
+    	$CNF = &$this->_oModule->_oConfig->CNF;
+
+    	$sAction = 'add';
+
+        $sFilter = bx_get('filter');
+        if(strpos($sFilter, $this->_sParamsDivider) !== false)
+            list($this->_iLevelId, $sFilter) = explode($this->_sParamsDivider, $sFilter);
+
+        if((int)$this->_iLevelId == 0)
+            $this->_iLevelId = (int)bx_get('level_id');
+
+    	$oForm = BxDolForm::getObjectInstance($CNF['OBJECT_FORM_PRICE'], $CNF['OBJECT_FORM_PRICE_DISPLAY_ADD']);
+    	$oForm->aFormAttrs['action'] = BX_DOL_URL_ROOT . 'grid.php?o=' . $this->_sObject . '&a=' . $sAction . '&level=' . $this->_iLevelId;
+    	$oForm->aInputs['level_id']['value'] = $this->_iLevelId;
+
+        $oForm->initChecker();
+        if($oForm->isSubmittedAndValid()) {
+        	$iLevel = $oForm->getCleanValue('level_id');
+        	$iPeriod = $oForm->getCleanValue('period');
+        	$sPeriodUnit = $oForm->getCleanValue('period_unit');
+
+        	if(!empty($iPeriod) && empty($sPeriodUnit)) 
+        	    return echoJson(array('msg' => _t('_bx_acl_form_price_input_err_period_unit')));
+        	
+            $aPrice = $this->_oModule->_oDb->getPrices(array('type' => 'by_level_id_duration', 'level_id' => $iLevel, 'period' => $iPeriod, 'period_unit' => $sPeriodUnit));
+            if(!empty($aPrice) && is_array($aPrice))
+                return echoJson(array('msg' => _t('_bx_acl_err_price_duplicate')));
+
+            $aLevel = $this->_oModule->_oDb->getLevels(array('type' => 'by_id', 'value' => $iLevel));
+            $sName = uriGenerate(strtolower(_t($aLevel['name'])) . ' ' . $iPeriod . ' ' . $sPeriodUnit, $CNF['TABLE_PRICES'], 'name');
+
+            $iId = (int)$oForm->insert(array('name' => $sName, 'order' => $this->_oModule->_oDb->getPriceOrderMax($this->_iLevelId) + 1));
+            if($iId != 0) {
+            	//TODO: May be we don't need to have this 'Purchasable' flag at all or at least we shouldn't update it from here.
+                $this->_oModule->_oDb->updateLevels(array('Purchasable' => 'yes'), array('ID' => $this->_iLevelId));
+                $aRes = array('grid' => $this->getCode(false), 'blink' => $iId);
+            } 
+            else
+                $aRes = array('msg' => _t('_bx_acl_err_cannot_perform'));
+
+            echoJson($aRes);
+            return;
+        }
+
+		bx_import('BxTemplStudioFunctions');
+		$sContent = BxTemplStudioFunctions::getInstance()->popupBox($this->_oModule->_oConfig->getHtmlIds('popup_price'), _t('_bx_acl_popup_title_price_add'), $this->_oModule->_oTemplate->parseHtmlByName('popup_price.html', array(
+			'form_id' => $oForm->aFormAttrs['id'],
+			'form' => $oForm->getCode(true),
+			'object' => $this->_sObject,
+			'action' => $sAction
+		)));
+
+		echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
+    }
+
+	public function performActionEdit()
+    {
+    	$CNF = &$this->_oModule->_oConfig->CNF;
+
+        $sAction = 'edit';
+
+        $aIds = $this->_getIds();
+        if($aIds === false)
+            return echoJson(array());
+
+        $iId = $aIds[0];
+
+        $aItem = $this->_oModule->_oDb->getPrices(array('type' => 'by_id', 'value' => $iId));
+        if(!is_array($aItem) || empty($aItem)) {
+        	echoJson(array());
+			exit;
+        }
+
+        $oForm = BxDolForm::getObjectInstance($CNF['OBJECT_FORM_PRICE'], $CNF['OBJECT_FORM_PRICE_DISPLAY_EDIT']);
+    	$oForm->aFormAttrs['action'] = BX_DOL_URL_ROOT . 'grid.php?o=' . $this->_sObject . '&a=' . $sAction . '&level=' . $this->_iLevelId;
+
+        $oForm->initChecker($aItem);
+        if($oForm->isSubmittedAndValid()) {
+            if($oForm->update($aItem['id']) !== false)
+                $aRes = array('grid' => $this->getCode(false), 'blink' => $aItem['id']);
+            else
+                $aRes = array('msg' => _t('_bx_acl_err_cannot_perform'));
+
+            echoJson($aRes);
+            return;
+        }
+
+		bx_import('BxTemplStudioFunctions');
+		$sContent = BxTemplStudioFunctions::getInstance()->popupBox($this->_oModule->_oConfig->getHtmlIds('popup_price'), _t('_bx_acl_popup_title_price_edit'), $this->_oModule->_oTemplate->parseHtmlByName('popup_price.html', array(
+			'form_id' => $oForm->aFormAttrs['id'],
+			'form' => $oForm->getCode(true),
+			'object' => $this->_sObject,
+			'action' => $sAction
+		)));
+
+		$aRes = array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false)));
+
+		echoJson($aRes);
+    }
+
+	public function performActionDelete()
+    {
+    	$CNF = &$this->_oModule->_oConfig->CNF;
+
+    	$aIds = bx_get('ids');
+        if(!$aIds || !is_array($aIds)) {
+            echoJson(array());
+            return;
+        }
+
+        $iAffected = 0;
+        $aIdsAffected = array();
+        foreach($aIds as $iId)
+			if($this->_oModule->_oDb->deletePrices(array('id' => $iId))) {
+				$aIdsAffected[] = $iId;
+        		$iAffected++;
+			}
+
+		echoJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t('_bx_acl_err_cannot_perform')));
+    }
+
+    protected function _addJsCss()
+    {
+        parent::_addJsCss();
+        $this->_oModule->_oTemplate->addStudioJs(array('jquery.form.min.js', 'administration.js'));
+        $this->_oModule->_oTemplate->addStudioCss(array('administration.css'));
+
+        $oForm = new BxTemplFormView(array());
+        $oForm->addCssJs();
+    }
+
+	protected function _getActionAdd ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
+    {
+        if(empty($this->_iLevelId))
+            $isDisabled = true;
+
+        return  parent::_getActionDefault($sType, $sKey, $a, false, $isDisabled, $aRow);
+    }
+
+	protected function _getFilterControls()
+    {
+        parent::_getFilterControls();
+
+        $sContent = '';
+        $oForm = new BxTemplFormView(array());
+
+        $aInputLevels = array(
+            'type' => 'select',
+            'name' => 'level',
+            'attrs' => array(
+                'id' => 'bx-grid-level-' . $this->_sObject,
+                'onChange' => 'javascript:' . $this->_oModule->_oConfig->getJsObject('administration') . '.onChangeLevel()'
+            ),
+            'value' => $this->_iLevelId,
+            'values' => array(0 => _t('_bx_acl_txt_select_level'))
+        );
+
+        $aLevels = $this->_oModule->_oDb->getLevels(array('type' => 'for_selector'));
+        foreach($aLevels as $iId => $sTitle)
+        	$aInputLevels['values'][$iId] = _t($sTitle);
+
+        $sContent .=  $oForm->genRow($aInputLevels);
+
+        $aInputSearch = array(
+            'type' => 'text',
+            'name' => 'keyword',
+            'attrs' => array(
+                'id' => 'bx-grid-search-' . $this->_sObject,
+            ),
+            'tr_attrs' => array(
+                'style' => 'display:none;'
+            )
+        );
+        $sContent .= $oForm->genRow($aInputSearch);
+
+        return $sContent;
+    }
+
+	protected function _getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage)
+    {
+        if(empty($this->_iLevelId) && strpos($sFilter, $this->_sParamsDivider) !== false)
+            list($this->_iLevelId, $sFilter) = explode($this->_sParamsDivider, $sFilter);
+
+		if(empty($this->_iLevelId))
+            return array();
+
+        $this->_aOptions['source'] .= $this->_oModule->_oDb->prepareAsString("AND `level_id`=? ", $this->_iLevelId);
+
+        return parent::_getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage);;
+    }
+}
+
+/** @} */

+ 77 - 0
modules/boonex/acl/updates/9.0.3_9.0.4/source/classes/BxAclGridLevels.php

@@ -0,0 +1,77 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    PaidLevels Paid Levels
+ * @ingroup     UnaModules
+ * 
+ * @{
+ */
+
+
+class BxAclGridLevels extends BxTemplGrid
+{
+	protected $MODULE;
+	protected $_oModule;
+
+	protected $_aPeriodUnits;
+
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+    	$this->MODULE = 'bx_acl';
+    	$this->_oModule = BxDolModule::getInstance($this->MODULE);
+
+        parent::__construct ($aOptions, $oTemplate);
+
+        $CNF = $this->_oModule->_oConfig->CNF;
+
+        $this->_aPeriodUnits = BxDolForm::getDataItems($CNF['OBJECT_FORM_PRELISTS_PERIOD_UNITS']);
+    }
+
+	protected function _getCellPeriod($mixedValue, $sKey, $aField, $aRow)
+    {
+        if((int)$mixedValue == 0)
+            $mixedValue = _t('_bx_acl_txt_lifetime');
+        else
+            $mixedValue = _t('_bx_acl_txt_n_unit', $mixedValue, _t($this->_aPeriodUnits[$aRow['period_unit']]));
+
+    	return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow);
+    }
+
+	protected function _getCellPrice($mixedValue, $sKey, $aField, $aRow)
+    {
+        if((float)$mixedValue != 0) {
+            $aCurrency = $this->_oModule->_oConfig->getCurrency();
+
+            $mixedValue = $aCurrency['sign'] . $mixedValue;
+        }
+        else 
+            $mixedValue = _t('_bx_acl_txt_free');
+
+        return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow);
+    }
+
+	protected function _getCellTrial($mixedValue, $sKey, $aField, $aRow)
+    {
+        $mixedValue = (int)$mixedValue != 0 ? _t('_bx_acl_txt_n_unit', $mixedValue, _t($this->_aPeriodUnits['day'])) : _t('_bx_acl_txt_none');
+
+        return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow);
+    }
+
+    protected function _getIds()
+    {
+        $aIds = bx_get('ids');
+        if(!$aIds || !is_array($aIds)) {
+            $iId = (int)bx_get('id');
+            if(!$iId) 
+                return false;
+
+            $aIds = array($iId);
+        }
+
+        return $aIds;
+    }
+}
+
+/** @} */

+ 109 - 0
modules/boonex/acl/updates/9.0.3_9.0.4/source/classes/BxAclGridView.php

@@ -0,0 +1,109 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    PaidLevels Paid Levels
+ * @ingroup     UnaModules
+ * 
+ * @{
+ */
+
+require_once('BxAclGridLevels.php');
+
+class BxAclGridView extends BxAclGridLevels
+{
+	protected $_iOwner;
+	protected $_oPayment;
+	protected $_bTypeSingle;
+	protected $_bTypeRecurring;
+
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+        parent::__construct ($aOptions, $oTemplate);
+
+        $this->_iOwner = $this->_oModule->_oConfig->getOwner();
+        $this->_oPayment = BxDolPayments::getInstance();
+        $this->_bTypeSingle = $this->_oPayment->isAcceptingPayments($this->_iOwner, BX_PAYMENT_TYPE_SINGLE);
+        $this->_bTypeRecurring = $this->_oPayment->isAcceptingPayments($this->_iOwner, BX_PAYMENT_TYPE_RECURRING);
+    }
+
+    public function performActionChoose()
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        $aIds = $this->_getIds();
+        if($aIds === false)
+            return echoJson(array());
+
+        $aItem = $this->_oModule->_oDb->getPrices(array('type' => 'by_id', 'value' => $aIds[0]));
+        if(!is_array($aItem) || empty($aItem) || (float)$aItem['price'] != 0)
+        	return echoJson(array());
+
+        $aResult = array();
+        $iUserId = bx_get_logged_profile_id();
+        if(BxDolAcl::getInstance()->setMembership($iUserId, $aItem['level_id'], array('period' => $aItem['period'], 'period_unit' => $aItem['period_unit']), true))
+            $aResult = array('grid' => $this->getCode(false), 'blink' => $aItem['id'], 'msg' => _t('_bx_acl_msg_performed'));
+        else
+            $aResult = array('msg' => _t('_bx_acl_err_cannot_perform'));
+
+        return echoJson($aResult);
+    }
+
+    public function getCode($isDisplayHeader = true)
+    {
+    	return $this->_oPayment->getCartJs() . parent::getCode($isDisplayHeader);
+    }
+
+    protected function _getCellLevelIcon($mixedValue, $sKey, $aField, $aRow)
+    {
+        $mixedValue = $this->_oModule->_oTemplate->displayLevelIcon($mixedValue);
+    	return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow);
+    }
+
+    protected function _getActionChoose ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
+    {
+        if((float)$aRow['price'] != 0 || BxDolAcl::getInstance()->isMemberLevelInSet(array($aRow['level_id'])))
+            return '';
+
+        return  parent::_getActionDefault($sType, $sKey, $a, false, $isDisabled, $aRow);
+    }
+
+	protected function _getActionBuy ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
+    {
+        if((float)$aRow['price'] == 0 || !$this->_bTypeSingle || $this->_bTypeRecurring)
+            return '';
+
+    	$aJs = $this->_oPayment->getAddToCartJs($this->_iOwner, $this->MODULE, $aRow['id'], 1, true);
+    	if(!empty($aJs) && is_array($aJs)) {
+    		list($sJsCode, $sJsMethod) = $aJs;
+
+    		$a['attr'] = array(
+    		    'title' => bx_html_attribute(_t('_bx_acl_grid_action_buy_title')),
+    			'onclick' => $sJsMethod
+    		);
+    	}
+
+        return  parent::_getActionDefault($sType, $sKey, $a, false, $isDisabled, $aRow);
+    }
+
+    protected function _getActionSubscribe ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
+    {
+        if((float)$aRow['price'] == 0 || !$this->_bTypeRecurring)
+            return '';
+
+    	$aJs = $this->_oPayment->getSubscribeJs($this->_iOwner, '', $this->MODULE, $aRow['id'], 1);
+		if(!empty($aJs) && is_array($aJs)) {
+			list($sJsCode, $sJsMethod) = $aJs;
+
+    		$a['attr'] = array(
+    			'title' => bx_html_attribute(_t('_bx_acl_grid_action_subscribe_title')),
+    			'onclick' => $sJsMethod
+    		);
+		}
+
+    	return  parent::_getActionDefault($sType, $sKey, $a, false, $isDisabled, $aRow);
+    }
+}
+
+/** @} */

+ 193 - 0
modules/boonex/acl/updates/9.0.3_9.0.4/source/classes/BxAclModule.php

@@ -0,0 +1,193 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    PaidLevels Paid Levels
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+bx_import('BxDolAcl');
+
+define('BX_ACL_LICENSE_TYPE_SINGLE', 'single'); //--- one-time payment license
+define('BX_ACL_LICENSE_TYPE_RECURRING', 'recurring'); //--- recurring payment license
+
+class BxAclModule extends BxDolModule
+{
+    /**
+     * Constructor
+     */
+    function __construct($aModule)
+    {
+        parent::__construct($aModule);
+
+        $this->_oConfig->init($this->_oDb);
+    }
+
+	/**
+     * ACTION METHODS
+     */
+
+    /**
+     * SERVICE METHODS
+     */
+	public function serviceGetBlockView()
+	{
+		$sGrid = $this->_oConfig->getGridObject('view');
+		$oGrid = BxDolGrid::getObjectInstance($sGrid);
+        if(!$oGrid)
+            return '';
+
+        $this->_oTemplate->addCss(array('view.css'));
+		return array(
+            'content' => $oGrid->getCode()
+        );
+	}
+
+	public function serviceGetMembershipActions($iProfileId)
+	{
+		if($iProfileId != $this->getUserId())
+			return '';
+
+		return $this->_oTemplate->displayMembershipActions($iProfileId);
+	}
+
+	/**
+     * Integration with Payment based modules.  
+     */
+	public function serviceGetPaymentData()
+    {
+        return $this->_aModule;
+    }
+
+    public function serviceGetCartItem($iItemId)
+    {
+    	$CNF = &$this->_oConfig->CNF;
+
+        if(!$iItemId)
+			return array();
+
+		$aItem = $this->_oDb->getPrices(array('type' => 'by_id_full', 'value' => $iItemId));
+        if(empty($aItem) || !is_array($aItem))
+			return array();
+
+		return array (
+			'id' => $aItem['id'],
+			'author_id' => $this->_oConfig->getOwner(),
+			'name' => $aItem['name'],
+			'title' => _t('_bx_acl_txt_cart_item_title', _t($aItem['level_name']), $aItem['period'], $aItem['period_unit']),
+			'description' => _t($aItem['level_description']),
+			'url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_VIEW']),
+			'price_single' => $aItem['price'],
+			'price_recurring' => $aItem['price'],
+			'trial_recurring' => $aItem['trial']
+        );
+    }
+
+    public function serviceGetCartItems($iSellerId)
+    {
+    	$CNF = &$this->_oConfig->CNF;
+
+    	$iSellerId = $this->_oConfig->getOwner();
+        $aItems = $this->_oDb->getPrices(array('type' => 'all_full'));
+        $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_VIEW']);
+
+        $aResult = array();
+        foreach($aItems as $aItem)
+            $aResult[] = array(
+				'id' => $aItem['id'],
+				'author_id' => $iSellerId,
+            	'name' => $aItem['name'],
+				'title' => _t('_bx_acl_txt_cart_item_title', _t($aItem['level_name']), $aItem['period'], $aItem['period_unit']),
+				'description' => _t($aItem['level_description']),
+				'url' => $sUrl,
+				'price_single' => $aItem['price'],
+            	'price_recurring' => $aItem['price'],
+            	'trial_recurring' => $aItem['trial']
+           );
+
+        return $aResult;
+    }
+
+    public function serviceRegisterCartItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense)
+    {
+        return $this->_serviceRegisterItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense, BX_ACL_LICENSE_TYPE_SINGLE);
+    }
+
+    public function serviceRegisterSubscriptionItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense)
+    {
+		return $this->_serviceRegisterItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense, BX_ACL_LICENSE_TYPE_RECURRING);
+    }
+
+    public function serviceUnregisterCartItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense)
+    {
+        return $this->_serviceUnregisterItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense, BX_ACL_LICENSE_TYPE_SINGLE);
+    }
+
+    public function serviceUnregisterSubscriptionItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense)
+    {
+    	return $this->_serviceUnregisterItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense, BX_ACL_LICENSE_TYPE_RECURRING); 
+    }
+
+    public function serviceCancelSubscriptionItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder)
+    {
+    	//TODO: Do something if it's necessary.
+    	return true;
+    }
+
+    protected function _serviceRegisterItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense, $sType)
+    {
+    	$aItem = $this->serviceGetCartItem($iItemId);
+        if(empty($aItem) || !is_array($aItem))
+			return array();
+
+        $aItemInfo = $this->_oDb->getPrices(array('type' => 'by_id', 'value' => $iItemId));
+
+        $iPeriod = (int)$aItemInfo['period'];
+        $sPeriodUnit = $aItemInfo['period_unit'];
+		if($sType == BX_ACL_LICENSE_TYPE_RECURRING && (int)$aItemInfo['trial'] > 0) {
+		    $iPeriod = (int)$aItemInfo['trial'];
+		    $sPeriodUnit = 'day';
+		}
+
+        if(!BxDolAcl::getInstance()->setMembership($iClientId, $aItemInfo['level_id'], array('period' => $iPeriod, 'period_unit' => $sPeriodUnit), false, $sLicense))
+            return array();
+
+        return $aItem;
+    }
+
+    protected function _serviceUnregisterItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense, $sType)
+    {
+    	$aItemInfo = $this->_oDb->getPrices(array('type' => 'by_id', 'value' => $iItemId));
+    	if(empty($aItemInfo) || !is_array($aItemInfo))
+			return false;
+
+    	return BxDolAcl::getInstance()->unsetMembership($iClientId, $aItemInfo['level_id'], $sLicense);
+    }
+
+    /**
+     * COMMON METHODS
+     */
+	public function getUserId()
+    {
+        return isLogged() ? bx_get_logged_profile_id() : 0;
+    }
+
+    public function getUserInfo($iUserId = 0)
+    {
+        $oProfile = BxDolProfile::getInstance($iUserId);
+        if (!$oProfile)
+            $oProfile = BxDolProfileUndefined::getInstance();
+
+        return array(
+            $oProfile->getDisplayName(),
+            $oProfile->getUrl(),
+            $oProfile->getThumb(),
+            $oProfile->getUnit()
+        );
+    }
+}
+
+/** @} */

+ 32 - 0
modules/boonex/acl/updates/9.0.3_9.0.4/source/classes/BxAclPageView.php

@@ -0,0 +1,32 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    PaidLevels Paid Levels
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxAclPageView extends BxTemplPage
+{
+    protected $MODULE;
+
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_acl';
+
+        parent::__construct($aObject, $oTemplate);
+
+        $oMenuSubmenu = BxDolMenu::getObjectInstance('sys_site_submenu');
+        if($oMenuSubmenu) {
+            $sSubmenu = 'sys_account_settings_submenu';
+            $oMenuSubmenu->setObjectSubmenu($sSubmenu, array('title' => _t('_sys_menu_item_title_account_settings'), 'link' => '', 'icon' => ''));
+
+            BxDolMenu::getObjectInstance($sSubmenu)->setSelected($this->MODULE, 'acl-view');
+        }
+    }
+}
+
+/** @} */

+ 73 - 0
modules/boonex/acl/updates/9.0.3_9.0.4/source/classes/BxAclTemplate.php

@@ -0,0 +1,73 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    PaidLevels Paid Levels
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxAclTemplate extends BxBaseModGeneralTemplate
+{
+    function __construct(&$oConfig, &$oDb)
+    {
+        parent::__construct($oConfig, $oDb);
+    }
+
+	public function displayEmptyOwner()
+    {
+    	return MsgBox(_t('_bx_acl_msg_empty_owner'));
+    }
+
+    public function displayMembershipActions($iProfileId)
+    {
+		$this->addCss(array('pm_actions.css'));
+    	return $this->parseHtmlByName('pm_actions.html', array(
+    		'url_upgrade' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($this->_oConfig->CNF['URL_VIEW'])
+    	));
+    }
+
+    public function displayLevelIcon($mixedValue)
+    {
+        $bTmplVarsImage = $bTmplVarsIcon = false;
+        $aTmplVarsImage = $aTmplVarsIcon = array();
+        if(is_numeric($mixedValue) && (int)$mixedValue != 0) {
+            $oStorage = BxDolStorage::getObjectInstance(BX_DOL_STORAGE_OBJ_IMAGES);
+
+            $bTmplVarsImage = true;
+            $aTmplVarsImage = array(
+                'src' => $oStorage->getFileUrlById((int)$mixedValue),
+            );
+        }
+        else {
+            $bTmplVarsIcon = true;
+            $aTmplVarsIcon = array(
+                'name' => $mixedValue
+            );
+        }
+
+    	return $this->parseHtmlByName('level_icon.html', array(
+    	    'bx_if:show_image' => array(
+    	        'condition' => $bTmplVarsImage,
+    	        'content' => $aTmplVarsImage
+    	    ),
+    	    'bx_if:show_icon' => array(
+    	        'condition' => $bTmplVarsIcon,
+    	        'content' => $aTmplVarsIcon
+    	    )
+    	));
+    }
+
+	public function getJsCode($sType, $aParams = array(), $bWrap = true)
+    {
+        $aParams = array_merge(array(
+            'aHtmlIds' => $this->_oConfig->getHtmlIds()
+        ), $aParams);
+
+        return parent::getJsCode($sType, $aParams, $bWrap);
+    }
+}
+
+/** @} */

+ 70 - 0
modules/boonex/acl/updates/9.0.3_9.0.4/source/install/config.php

@@ -0,0 +1,70 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    PaidLevels Paid Levels
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_acl',
+    'title' => 'Paid Levels',
+    'note' => 'Paid Levels module.',
+    'version' => '9.0.4',
+    'vendor' => 'BoonEx',
+	'help_url' => 'http://feed.boonex.com/?section={module_name}',
+
+    'compatible_with' => array(
+        '9.0.0-RC1'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/acl/',
+    'home_uri' => 'acl',
+
+    'db_prefix' => 'bx_acl_',
+    'class_prefix' => 'BxAcl',
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => 'Paid Levels',
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+        'execute_sql' => 1,
+        'update_languages' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'uninstall' => array (
+        'execute_sql' => 1,
+        'update_languages' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'enable' => array(
+        'execute_sql' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'disable' => array (
+        'execute_sql' => 1,
+        'clear_db_cache' => 1,
+    ),
+
+    /**
+     * Dependencies Section
+     */
+    'dependencies' => array(),
+);
+
+/** @} */

+ 87 - 0
modules/boonex/acl/updates/9.0.3_9.0.4/source/install/langs/en.xml

@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+
+	<string name="_bx_acl"><![CDATA[Paid Levels]]></string>
+
+	<!-- Pages -->
+	<string name="_bx_acl_page_title_sys_view"><![CDATA[Membership]]></string>
+	<string name="_bx_acl_page_title_view"><![CDATA[Membership]]></string>
+	<string name="_bx_acl_page_block_title_system_view"><![CDATA[Membership]]></string>
+	<string name="_bx_acl_page_block_title_view"><![CDATA[Membership]]></string>
+
+
+	<!-- Forms -->
+	<string name="_bx_acl_form_price"><![CDATA[Price]]></string>
+	<string name="_bx_acl_form_price_display_add"><![CDATA[Add]]></string>
+	<string name="_bx_acl_form_price_display_edit"><![CDATA[Edit]]></string>
+	<string name="_bx_acl_form_price_input_sys_id"><![CDATA[ID]]></string>
+	<string name="_bx_acl_form_price_input_sys_level_id"><![CDATA[Level ID]]></string>
+	<string name="_bx_acl_form_price_input_sys_period"><![CDATA[Period]]></string>
+	<string name="_bx_acl_form_price_input_period"><![CDATA[Period]]></string>
+	<string name="_bx_acl_form_price_input_inf_period"><![CDATA[Use 0 for lifetime]]></string>
+	<string name="_bx_acl_form_price_input_sys_period_unit"><![CDATA[Period unit]]></string>
+	<string name="_bx_acl_form_price_input_period_unit"><![CDATA[Period unit]]></string>
+	<string name="_bx_acl_form_price_input_inf_period_unit"><![CDATA[Leave empty for lifetime level.]]></string>
+	<string name="_bx_acl_form_price_input_err_period_unit"><![CDATA[You need to select a period unit here.]]></string>
+	<string name="_bx_acl_form_price_input_sys_price"><![CDATA[Price]]></string>
+	<string name="_bx_acl_form_price_input_price"><![CDATA[Price]]></string>
+	<string name="_bx_acl_form_price_input_inf_price"><![CDATA[Use 0 or leave empty to create free level.]]></string>
+	<string name="_bx_acl_form_price_input_sys_trial"><![CDATA[Trial]]></string>
+    <string name="_bx_acl_form_price_input_trial"><![CDATA[Trial]]></string>
+    <string name="_bx_acl_form_price_input_inf_trial"><![CDATA[The number of days new customers should receive a free trial. Leave empty to disable trial period.]]></string>
+	<string name="_bx_acl_form_price_input_sys_do_submit"><![CDATA[Submit]]></string>
+	<string name="_bx_acl_form_price_input_do_submit"><![CDATA[Submit]]></string>
+	<string name="_bx_acl_form_price_input_sys_do_cancel"><![CDATA[Cancel]]></string>
+	<string name="_bx_acl_form_price_input_do_cancel"><![CDATA[Cancel]]></string>
+
+
+	<!-- Pre Lists -->
+	<string name="_bx_acl_pre_lists_period_units"><![CDATA[Billing Interval]]></string>
+	<string name="_bx_acl_pre_values_day"><![CDATA[day]]></string>
+	<string name="_bx_acl_pre_values_week"><![CDATA[week]]></string>
+	<string name="_bx_acl_pre_values_month"><![CDATA[month]]></string>
+	<string name="_bx_acl_pre_values_year"><![CDATA[year]]></string>
+
+
+	<!-- Grids -->
+	<string name="_bx_acl_grid_column_level_icon"><![CDATA[]]></string>
+	<string name="_bx_acl_grid_column_level_name"><![CDATA[Level]]></string>
+	<string name="_bx_acl_grid_column_name"><![CDATA[Name]]></string>
+	<string name="_bx_acl_grid_column_period"><![CDATA[Period]]></string>
+	<string name="_bx_acl_grid_column_price"><![CDATA[Price]]></string>
+	<string name="_bx_acl_grid_column_trial"><![CDATA[Trial]]></string>
+
+	<string name="_bx_acl_grid_action_add"><![CDATA[Add]]></string>
+	<string name="_bx_acl_grid_action_edit"><![CDATA[Edit]]></string>
+	<string name="_bx_acl_grid_action_delete"><![CDATA[Delete]]></string>
+	<string name="_bx_acl_grid_action_buy"><![CDATA[Buy]]></string>
+	<string name="_bx_acl_grid_action_buy_title"><![CDATA[One-time payment]]></string>
+	<string name="_bx_acl_grid_action_subscribe"><![CDATA[Rent]]></string>
+	<string name="_bx_acl_grid_action_subscribe_title"><![CDATA[Subscribe on recurring payments]]></string>
+	<string name="_bx_acl_grid_action_choose"><![CDATA[Choose]]></string>
+    <string name="_bx_acl_grid_action_choose_title"><![CDATA[Switch to the level for free]]></string>
+
+	<string name="_bx_acl_popup_title_price_add"><![CDATA[Add Pricing Plan]]></string>
+	<string name="_bx_acl_popup_title_price_edit"><![CDATA[Edit Pricing Plan]]></string>
+
+
+	<!-- Menus -->
+	<string name="_bx_acl_menu_item_title_system_acl_view"><![CDATA[Membership]]></string>
+	<string name="_bx_acl_menu_item_title_acl_view"><![CDATA[Membership]]></string>
+
+
+	<!-- Common Texts -->
+	<string name="_bx_acl_msg_empty_owner"><![CDATA['Site administrator' is empty. You need to mark some profile as 'Site administrator' in Settings of currently active Payment module.]]></string>
+	<string name="_bx_acl_msg_performed"><![CDATA[The action was successfully performed.]]></string>
+	<string name="_bx_acl_err_price_duplicate"><![CDATA[Similar pricing plan is already exists.]]></string>
+	<string name="_bx_acl_err_cannot_perform"><![CDATA[An error appeared. Please report.]]></string>
+
+	<string name="_bx_acl_txt_select_level"><![CDATA[Select level...]]></string>
+	<string name="_bx_acl_txt_cart_item_title"><![CDATA[{0} ({1} {2})]]></string>
+	<string name="_bx_acl_txt_upgrade"><![CDATA[Upgrade]]></string>
+	<string name="_bx_acl_txt_manage"><![CDATA[Manage]]></string>
+	<string name="_bx_acl_txt_n_unit"><![CDATA[{0} ({1})]]></string>
+	<string name="_bx_acl_txt_none"><![CDATA[none]]></string>
+	<string name="_bx_acl_txt_free"><![CDATA[free]]></string>
+	<string name="_bx_acl_txt_lifetime"><![CDATA[lifetime]]></string>
+</resources>

+ 38 - 0
modules/boonex/acl/updates/9.0.3_9.0.4/source/install/sql/enable.sql

@@ -0,0 +1,38 @@
+SET @sName = 'bx_acl';
+
+
+-- PAGE: view levels
+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_acl_view', '_bx_acl_page_title_sys_view', '_bx_acl_page_title_view', @sName, 5, 2147483647, 1, 'acl-view', 'page.php?i=acl-view', '', '', '', 0, 1, 0, 'BxAclPageView', 'modules/boonex/acl/classes/BxAclPageView.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_acl_view', 1, @sName, '_bx_acl_page_block_title_system_view', '_bx_acl_page_block_title_view', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:6:\"bx_acl\";s:6:\"method\";s:14:\"get_block_view\";}', 0, 1, 0);
+
+
+-- MENU: account settings menu
+SET @iMoAccountSettings = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name`='sys_account_settings' AND `order` < 9999 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`, `editable`, `order`) VALUES
+('sys_account_settings', 'bx_acl', 'acl-view', '_bx_acl_menu_item_title_system_acl_view', '_bx_acl_menu_item_title_acl_view', 'page.php?i=acl-view', '', '', 'shield col-red2', '', '', 2147483646, 1, 0, 1, @iMoAccountSettings + 1);
+
+
+-- 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', @sName, '_bx_acl', 'bx_acl@modules/boonex/acl/|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, @sName, '_bx_acl', 1);
+-- SET @iCategId = LAST_INSERT_ID();
+
+-- INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_error`, `extra`, `order`) VALUES
+-- ('bx_acl_remove_expired_for', '30', @iCategId, '_bx_acl_option_remove_expired_for', 'digit', '', '', '', 3);
+
+
+-- ALERTS
+INSERT INTO `sys_alerts_handlers`(`name`, `class`, `file`, `service_call`) VALUES 
+(@sName, 'BxAclResponse', 'modules/boonex/acl/classes/BxAclResponse.php', '');
+SET @iHandler := LAST_INSERT_ID();
+
+INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
+('system', 'page_output_block_acl_level', @iHandler);

+ 114 - 0
modules/boonex/acl/updates/9.0.3_9.0.4/source/install/sql/install.sql

@@ -0,0 +1,114 @@
+SET @sName = 'bx_acl';
+
+
+-- TABLES
+CREATE TABLE `bx_acl_level_prices` (
+  `id` int(11) NOT NULL auto_increment,
+  `level_id` int(11) unsigned NOT NULL default '0',
+  `name` varchar(128) NOT NULL default '',
+  `period` int(11) unsigned NOT NULL default '1',
+  `period_unit` varchar(32) NOT NULL default '',
+  `trial` int(11) unsigned NOT NULL default '0',
+  `price` float unsigned NOT NULL default '1',
+  `order` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `name` (`name`),
+  UNIQUE KEY `type` (`level_id`,`period`, `period_unit`)
+);
+
+
+-- FORMS
+INSERT INTO `sys_objects_form` (`object`, `module`, `title`, `action`, `form_attrs`, `submit_name`, `table`, `key`, `uri`, `uri_title`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
+('bx_acl_price', @sName, '_bx_acl_form_price', '', '', 'do_submit', 'bx_acl_level_prices', 'id', '', '', '', 0, 1, '', '');
+
+INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
+('bx_acl_price_add', @sName, 'bx_acl_price', '_bx_acl_form_price_display_add', 0),
+('bx_acl_price_edit', @sName, 'bx_acl_price', '_bx_acl_form_price_display_edit', 0);
+
+INSERT INTO `sys_form_inputs` (`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES
+('bx_acl_price', @sName, 'id', '', '', 0, 'hidden', '_bx_acl_form_price_input_sys_id', '', '', 1, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
+('bx_acl_price', @sName, 'level_id', '', '', 0, 'hidden', '_bx_acl_form_price_input_sys_level_id', '', '', 1, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
+('bx_acl_price', @sName, 'period', '', '', 0, 'text', '_bx_acl_form_price_input_sys_period', '_bx_acl_form_price_input_period', '_bx_acl_form_price_input_inf_period', 1, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
+('bx_acl_price', @sName, 'period_unit', '', '#!bx_acl_period_units', 0, 'select', '_bx_acl_form_price_input_sys_period_unit', '_bx_acl_form_price_input_period_unit', '_bx_acl_form_price_input_inf_period_unit', 1, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
+('bx_acl_price', @sName, 'trial', '', '', 0, 'text', '_bx_acl_form_price_input_sys_trial', '_bx_acl_form_price_input_trial', '_bx_acl_form_price_input_inf_trial', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
+('bx_acl_price', @sName, 'price', '', '', 0, 'text', '_bx_acl_form_price_input_sys_price', '_bx_acl_form_price_input_price', '_bx_acl_form_price_input_inf_price', 1, 0, 0, '', '', '', '', '', '', 'Float', '', 1, 0),
+('bx_acl_price', @sName, 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_acl_price', @sName, 'do_submit', '_bx_acl_form_price_input_do_submit', '', 0, 'submit', '_bx_acl_form_price_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_acl_price', @sName, 'do_cancel', '_bx_acl_form_price_input_do_cancel', '', 0, 'button', '_bx_acl_form_price_input_sys_do_cancel', '', '', 0, 0, 0, 'a:2:{s:7:"onclick";s:45:"$(''.bx-popup-applied:visible'').dolPopupHide()";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 1, 0);
+
+INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
+('bx_acl_price_add', 'id', 2147483647, 0, 1),
+('bx_acl_price_add', 'level_id', 2147483647, 1, 2),
+('bx_acl_price_add', 'price', 2147483647, 1, 3),
+('bx_acl_price_add', 'period', 2147483647, 1, 4),
+('bx_acl_price_add', 'period_unit', 2147483647, 1, 5),
+('bx_acl_price_add', 'trial', 2147483647, 1, 6),
+('bx_acl_price_add', 'controls', 2147483647, 1, 7),
+('bx_acl_price_add', 'do_submit', 2147483647, 1, 8),
+('bx_acl_price_add', 'do_cancel', 2147483647, 1, 9),
+
+('bx_acl_price_edit', 'id', 2147483647, 1, 1),
+('bx_acl_price_edit', 'level_id', 2147483647, 1, 2),
+('bx_acl_price_edit', 'price', 2147483647, 1, 3),
+('bx_acl_price_edit', 'period', 2147483647, 1, 4),
+('bx_acl_price_edit', 'trial', 2147483647, 1, 5),
+('bx_acl_price_edit', 'controls', 2147483647, 1, 6),
+('bx_acl_price_edit', 'do_submit', 2147483647, 1, 7),
+('bx_acl_price_edit', 'do_cancel', 2147483647, 1, 8);
+
+
+-- PRE-VALUES
+INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
+('bx_acl_period_units', '_bx_acl_pre_lists_period_units', 'bx_acl', '0');
+
+INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES
+('bx_acl_period_units', '', 0, '_sys_please_select', ''),
+('bx_acl_period_units', 'day', 1, '_bx_acl_pre_values_day', ''),
+('bx_acl_period_units', 'week', 2, '_bx_acl_pre_values_week', ''),
+('bx_acl_period_units', 'month', 3, '_bx_acl_pre_values_month', ''),
+('bx_acl_period_units', 'year', 4, '_bx_acl_pre_values_year', '');
+
+
+-- GRIDS
+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_acl_administration', 'Sql', 'SELECT * FROM `bx_acl_level_prices` WHERE 1 ', 'bx_acl_level_prices', 'id', 'order', '', '', 100, NULL, 'start', '', 'period,period_unit,price', '', 'like', '', '', 192, 'BxAclGridAdministration', 'modules/boonex/acl/classes/BxAclGridAdministration.php'),
+('bx_acl_view', 'Sql', 'SELECT `tlp`.*, `tl`.`Name` AS `level_name`, `tl`.`Icon` AS `level_icon` FROM `bx_acl_level_prices` AS `tlp` LEFT JOIN `sys_acl_levels` AS `tl` ON `tlp`.`level_id`=`tl`.`ID` WHERE `tl`.`Active`=''yes'' AND `tl`.`Purchasable`=''yes'' ', 'bx_acl_level_prices', 'id', 'order', '', '', 100, NULL, 'start', '', 'period,period_unit,price', 'tl`.`Name', 'like', '', '', 2147483647, 'BxAclGridView', 'modules/boonex/acl/classes/BxAclGridView.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('bx_acl_administration', 'checkbox', '_sys_select', '1%', 0, '', '', 1),
+('bx_acl_administration', 'order', '', '1%', 0, '', '', 2),
+('bx_acl_administration', 'name', '_bx_acl_grid_column_name', '33%', 0, 32, '', 3),
+('bx_acl_administration', 'price', '_bx_acl_grid_column_price', '15%', 0, 16, '', 4),
+('bx_acl_administration', 'period', '_bx_acl_grid_column_period', '15%', 0, 16, '', 5),
+('bx_acl_administration', 'trial', '_bx_acl_grid_column_trial', '15%', 0, 16, '', 6),
+('bx_acl_administration', 'actions', '', '20%', 0, '', '', 7),
+
+('bx_acl_view', 'level_icon', '_bx_acl_grid_column_level_icon', '5%', 0, 0, '', 1),
+('bx_acl_view', 'level_name', '_bx_acl_grid_column_level_name', '25%', 1, 32, '', 2),
+('bx_acl_view', 'price', '_bx_acl_grid_column_price', '10%', 0, 16, '', 3),
+('bx_acl_view', 'period', '_bx_acl_grid_column_period', '15%', 0, 16, '', 4),
+('bx_acl_view', 'trial', '_bx_acl_grid_column_trial', '15%', 0, 16, '', 5),
+('bx_acl_view', 'actions', '', '30%', 0, '', '', 6);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon_only`, `confirm`, `order`) VALUES
+('bx_acl_administration', 'independent', 'add', '_bx_acl_grid_action_add', '', 0, 0, 1),
+('bx_acl_administration', 'single', 'edit', '_bx_acl_grid_action_edit', 'pencil', 1, 0, 1),
+('bx_acl_administration', 'single', 'delete', '_bx_acl_grid_action_delete', 'remove', 1, 1, 2),
+('bx_acl_administration', 'bulk', 'delete', '_bx_acl_grid_action_delete', '', 0, 1, 1),
+
+('bx_acl_view', 'single', 'buy', '_bx_acl_grid_action_buy', 'cart-plus', 0, 0, 1),
+('bx_acl_view', 'single', 'subscribe', '_bx_acl_grid_action_subscribe', 'credit-card', 0, 0, 2),
+('bx_acl_view', 'single', 'choose', '_bx_acl_grid_action_choose', 'check-square-o', 0, 0, 3);
+
+
+-- STUDIO PAGE & WIDGET
+INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
+(3, @sName, '_bx_acl', '_bx_acl', 'bx_acl@modules/boonex/acl/|std-icon.svg');
+SET @iPageId = LAST_INSERT_ID();
+
+SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
+SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
+INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
+(@iPageId, @sName, '{url_studio}module.php?name=bx_acl', '', 'bx_acl@modules/boonex/acl/|std-icon.svg', '_bx_acl', '', '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));

+ 14 - 0
modules/boonex/acl/updates/9.0.3_9.0.4/source/template/css/view.css

@@ -0,0 +1,14 @@
+/*--- View Levels Styles ---*/
+div.bx-acl-level-icon {
+	display: inline-block;
+
+	background-color: rgba(255, 255, 255, 1.0);
+
+	text-align: center;
+	overflow: hidden;
+}
+
+div.bx-acl-level-icon .sys-icon {
+	line-height: 32px;
+	font-size: 24px;
+}

+ 8 - 0
modules/boonex/acl/updates/9.0.3_9.0.4/source/template/level_icon.html

@@ -0,0 +1,8 @@
+<div class="bx-acl-level-icon bx-def-border bx-def-round-corners bx-def-icon-size">
+    <bx_if:show_image>
+        <img class="bx-def-icon-size" src="__src__" />
+    </bx_if:show_image>
+    <bx_if:show_icon>
+        <i class="sys-icon __name__"></i>
+    </bx_if:show_icon>
+</div>

+ 161 - 0
modules/boonex/albums/updates/9.0.3_9.0.4/source/classes/BxAlbumsConfig.php

@@ -0,0 +1,161 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Albums Albums
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxAlbumsConfig extends BxBaseModTextConfig
+{
+    function __construct($aModule)
+    {
+        parent::__construct($aModule);
+
+        $aMenuItems2Methods = array (
+            'edit-album' => 'checkAllowedEdit',
+            'delete-album' => 'checkAllowedDelete',
+        );
+
+        $this->CNF = array (
+
+            // module icon
+            'ICON' => 'picture-o col-blue1',
+
+            // database tables
+            'TABLE_ENTRIES' => $aModule['db_prefix'] . 'albums',
+        	'TABLE_ENTRIES_FULLTEXT' => 'title_text',
+            'TABLE_FILES2ENTRIES' => $aModule['db_prefix'] . 'files2albums',
+            'TABLE_FILES' => $aModule['db_prefix'] . 'files',
+
+            // database fields
+            'FIELD_ID' => 'id',
+            'FIELD_AUTHOR' => 'author',
+            'FIELD_ADDED' => 'added',
+            'FIELD_CHANGED' => 'changed',
+            'FIELD_TITLE' => 'title',
+            'FIELD_TEXT' => 'text',
+            'FIELD_TEXT_ID' => 'album-desc',
+            'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
+            'FIELD_PHOTO' => 'pictures',
+            'FIELD_THUMB' => 'thumb',
+            'FIELD_COMMENTS' => 'comments',
+        	'FIELD_STATUS' => 'status',
+        	'FIELD_STATUS_ADMIN' => 'status_admin',
+            'FIELD_LOCATION_PREFIX' => 'location',
+            'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
+
+            // page URIs
+            'URI_VIEW_ENTRY' => 'view-album',
+            'URI_VIEW_MEDIA' => 'view-album-media',
+            'URI_AUTHOR_ENTRIES' => 'albums-author',
+            'URI_ADD_ENTRY' => 'create-album',
+        	'URI_EDIT_ENTRY' => 'edit-album',
+        	'URI_MANAGE_COMMON' => 'albums-manage',
+
+            'URL_HOME' => 'page.php?i=albums-home',
+            'URL_POPULAR' => 'page.php?i=albums-popular',
+            'URL_UPDATED' => 'page.php?i=albums-home',
+            'URL_POPULAR_MEDIA' => 'page.php?i=albums-popular-media',
+            'URL_RECENT_MEDIA' => 'page.php?i=albums-recent-media', // TODO: add page
+        	'URL_MANAGE_COMMON' => 'page.php?i=albums-manage',
+        	'URL_MANAGE_ADMINISTRATION' => 'page.php?i=albums-administration',
+
+            // some params
+            'PARAM_CHARS_SUMMARY' => 'bx_albums_summary_chars',
+            'PARAM_CHARS_SUMMARY_PLAIN' => 'bx_albums_plain_summary_chars',
+            'PARAM_NUM_RSS' => 'bx_albums_rss_num',
+        	'PARAM_SEARCHABLE_FIELDS' => 'bx_albums_searchable_fields',
+
+            // objects
+            'OBJECT_STORAGE' => 'bx_albums_files',
+            'OBJECT_IMAGES_TRANSCODER_PREVIEW' => 'bx_albums_proxy_preview',
+            'OBJECT_IMAGES_TRANSCODER_GALLERY' => '',
+            'OBJECT_IMAGES_TRANSCODER_BIG' => 'bx_albums_big',
+            'OBJECT_VIDEOS_TRANSCODERS' => array('poster' => 'bx_albums_video_poster_big', 'poster_preview' => 'bx_albums_video_poster_preview', 'mp4' => 'bx_albums_video_mp4', 'webm' => 'bx_albums_video_webm'),
+            'OBJECT_VIDEO_TRANSCODER_HEIGHT' => '480px',
+            'OBJECT_TRANSCODER_BROWSE' => 'bx_albums_proxy_browse',
+            'OBJECT_TRANSCODER_COVER' => 'bx_albums_proxy_cover',
+        	'OBJECT_REPORTS' => 'bx_albums',
+            'OBJECT_VIEWS' => 'bx_albums',
+            'OBJECT_VIEWS_MEDIA' => 'bx_albums_media',
+            'OBJECT_VOTES' => 'bx_albums',
+            'OBJECT_VOTES_MEDIA' => 'bx_albums_media',
+        	'OBJECT_FAVORITES' => 'bx_albums',
+            'OBJECT_FAVORITES_MEDIA' => 'bx_albums_media',
+        	'OBJECT_FEATURED' => 'bx_albums',
+        	'OBJECT_FEATURED_MEDIA' => 'bx_albums_media',
+            'OBJECT_METATAGS' => 'bx_albums',
+            'OBJECT_METATAGS_MEDIA' => 'bx_albums_media',
+            'OBJECT_METATAGS_MEDIA_CAMERA' => 'bx_albums_media_camera',
+            'OBJECT_COMMENTS' => 'bx_albums',
+            'OBJECT_COMMENTS_MEDIA' => 'bx_albums_media',
+            'OBJECT_PRIVACY_VIEW' => 'bx_albums_allow_view_to',
+            'OBJECT_FORM_ENTRY' => 'bx_albums',
+            'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_albums_entry_view',
+            'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_albums_entry_add',
+            'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_albums_entry_edit',
+            'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_albums_entry_delete',
+            'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_albums_view', // actions menu on view entry page
+            'OBJECT_MENU_ACTIONS_VIEW_MEDIA' => 'bx_albums_view_media', // actions menu on view media page
+            'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_albums_my', // actions menu on my entries page
+            'OBJECT_MENU_SUBMENU' => 'bx_albums_submenu', // main module submenu
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_albums_view_submenu', // view entry submenu
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'albums-home', // first item in view entry submenu from main module submenu
+            'OBJECT_MENU_MANAGE_TOOLS' => 'bx_albums_menu_manage_tools', //manage menu in content administration tools
+            'OBJECT_GRID_ADMINISTRATION' => 'bx_albums_administration',
+        	'OBJECT_GRID_COMMON' => 'bx_albums_common',
+        	'OBJECT_UPLOADERS' => array('bx_albums_simple', 'bx_albums_html5', 'bx_albums_crop'),
+
+            // menu items which visibility depends on custom visibility checking
+            'MENU_ITEM_TO_METHOD' => array (
+                'bx_albums_my' => array (
+                    'create-album' => 'checkAllowedAdd',
+                ),
+                'bx_albums_view' => $aMenuItems2Methods,
+            ),
+
+            // some language keys
+            'T' => array (
+                'txt_sample_single' => '_bx_albums_txt_sample_single',
+            	'txt_sample_single_with_article' => '_bx_albums_txt_sample_single_with_article',
+            	'txt_sample_comment_single' => '_bx_albums_txt_sample_comment_single',
+            	'txt_sample_vote_single' => '_bx_albums_txt_sample_vote_single',
+                'txt_media_single' => '_bx_albums_txt_media_single',
+                'txt_media_comment_single' => '_bx_albums_txt_media_comment_single',
+            	'txt_media_vote_single' => '_bx_albums_txt_media_vote_single',
+            	'form_field_author' => '_bx_albums_form_entry_input_author',
+            	'grid_action_err_delete' => '_bx_albums_grid_action_err_delete',
+            	'grid_txt_account_manager' => '_bx_albums_grid_txt_account_manager',
+				'filter_item_active' => '_bx_albums_grid_filter_item_title_adm_active',
+            	'filter_item_hidden' => '_bx_albums_grid_filter_item_title_adm_hidden',
+            	'filter_item_select_one_filter1' => '_bx_albums_grid_filter_item_title_adm_select_one_filter1',
+            	'menu_item_manage_my' => '_bx_albums_menu_item_title_manage_my',
+            	'menu_item_manage_all' => '_bx_albums_menu_item_title_manage_all',
+                'txt_all_entries_by' => '_bx_albums_txt_all_entries_by',
+            	'txt_all_entries_by_author' => '_bx_albums_page_title_browse_by_author'
+            ),
+        );
+
+        $this->_aJsClasses = array(
+        	'main' => 'BxAlbumsMain',
+        	'manage_tools' => 'BxAlbumsManageTools'
+        );
+
+        $this->_aJsObjects = array(
+        	'main' => 'oBxAlbumsMain',
+        	'manage_tools' => 'oBxAlbumsManageTools'
+        );
+
+        $this->_aGridObjects = array(
+        	'common' => $this->CNF['OBJECT_GRID_COMMON'],
+        	'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
+        	
+        );
+    }
+}
+
+/** @} */

+ 141 - 0
modules/boonex/albums/updates/9.0.3_9.0.4/source/classes/BxAlbumsContentInfoMedia.php

@@ -0,0 +1,141 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Albums Albums
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxAlbumsContentInfoMedia extends BxDolContentInfo
+{
+    protected $MODULE;
+	protected $_oModule;
+
+    protected function __construct($sSystem)
+    {
+        $this->MODULE = 'bx_albums';
+        $this->_oModule = BxDolModule::getInstance($this->MODULE);
+
+        parent::__construct($sSystem);
+    }  
+
+    public function getContentAuthor ($iContentId)
+    {
+        $aMedia = $this->_oModule->_oDb->getMediaInfoById($iContentId);
+        if(empty($aMedia) || !is_array($aMedia))
+            return 0;
+
+        return $aMedia['author'];
+    }
+
+    public function getContentDateAdded ($iContentId)
+    {
+        $aMedia = $this->_oModule->_oDb->getMediaInfoById($iContentId);
+        if(empty($aMedia) || !is_array($aMedia))
+            return 0;
+
+        return $aMedia['added'];
+    }
+
+    public function getContentDateChanged ($iContentId)
+    {
+        return 0;
+    }
+
+    public function getContentTitle ($iContentId)
+    {
+        $aMedia = $this->_oModule->_oDb->getMediaInfoById($iContentId);
+        if(empty($aMedia) || !is_array($aMedia))
+            return '';
+
+        return $aMedia['title'];
+    }
+
+    public function getContentThumb ($iContentId)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        $aMedia = $this->_oModule->_oDb->getMediaInfoById($iContentId);
+        if(empty($aMedia) || !is_array($aMedia))
+            return '';
+
+        $sTranscoder = $CNF['OBJECT_TRANSCODER_BROWSE'];
+        $oTranscoder = BxDolTranscoderImage::getObjectInstance($sTranscoder);
+        if(!$oTranscoder)
+            return '';
+
+        return $oTranscoder->getFileUrl($aMedia['file_id']);
+    }
+
+    public function getContentLink ($iContentId)
+    {
+        $aMedia = $this->_oModule->_oDb->getMediaInfoById($iContentId);
+        if(empty($aMedia) || !is_array($aMedia))
+            return '';
+
+        return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->_oModule->_oConfig->CNF['URI_VIEW_MEDIA'] . '&id=' . $iContentId);
+    }
+
+    public function getContentText ($iContentId)
+    {
+        return '';
+    }
+
+    public function getContentInfo ($iContentId, $bSearchableFieldsOnly = true)
+    {
+        $aMedia = $this->_oModule->_oDb->getMediaInfoById($iContentId);
+        if(empty($aMedia) || !is_array($aMedia))
+            return array();
+
+        return $aMedia;
+    }
+
+    public function getContentSearchResultUnit ($iContentId, $sUnitTemplate = '')
+    {
+        $aMedia = $this->_oModule->_oDb->getMediaInfoById($iContentId);
+        if(empty($aMedia) || !is_array($aMedia))
+            return '';
+
+        if(empty($sUnitTemplate))
+            $sUnitTemplate = 'unit_media.html';
+
+        return $this->_oModule->_oTemplate->unitMedia($aMedia, true, $sUnitTemplate);
+    }
+
+    public function getAll ($aParams = array())
+    {
+        if(empty($aParams) || !is_array($aParams))
+            $aParams = array('type' => 'all');
+
+        return $this->_oModule->_oDb->getMediaBy($aParams);
+    }
+
+    public function getSearchableFieldsExtended ()
+    {
+        return array(
+            'author' => array(
+            	'type' => 'text_auto', 
+            	'caption' => '_bx_albums_form_entry_input_author',
+            	'values' => '' 
+            ),
+            'title' => array(
+            	'type' => 'text', 
+            	'caption' => '_bx_albums_form_entry_file_title',
+            	'values' => '' 
+            )
+        );
+    }
+
+    public function getSearchResultExtended ($aParams)
+    {
+        if(empty($aParams) || !is_array($aParams))
+            return array();
+
+        return $this->_oModule->_oDb->getMediaBy(array('type' => 'search_ids', 'search_params' => $aParams));
+    }
+}
+
+/** @} */

+ 146 - 0
modules/boonex/albums/updates/9.0.3_9.0.4/source/classes/BxAlbumsDb.php

@@ -0,0 +1,146 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Albums Albums
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/*
+ * Module database queries
+ */
+class BxAlbumsDb extends BxBaseModTextDb
+{
+    function __construct(&$oConfig)
+    {
+        parent::__construct($oConfig);
+    }
+
+    public function associateFileWithContent($iContentId, $iFileId, $iProfileId, $sTitle, $sData = '', $sExif = '')
+    {
+        $sQuery = $this->prepare ("SELECT MAX(`order`) FROM `" . $this->_oConfig->CNF['TABLE_FILES2ENTRIES'] . "` WHERE `content_id` = ?", $iContentId);
+        $iOrder = 1 + (int)$this->getOne($sQuery);
+
+        $sQuery = $this->prepare ("INSERT INTO `" . $this->_oConfig->CNF['TABLE_FILES2ENTRIES'] . "` SET `content_id` = ?, `file_id` = ?, `author` = ?, `title` = ?, `data` = ?, `exif` = ?, `order` = ? ON DUPLICATE KEY UPDATE `title` = ?, `data` = ?, `exif` = ?", $iContentId, $iFileId, $iProfileId, $sTitle, $sData, $sExif, $iOrder, $sTitle, $sData, $sExif);
+        return $this->res($sQuery);
+    }
+
+    public function deassociateFileWithContent($iContentId, $iFileId)
+    {
+    	$aBindings = array();
+
+        $sWhere = '';
+        if ($iContentId) {
+        	$aBindings['content_id'] = $iContentId;
+
+            $sWhere .= " AND `content_id` = :content_id";
+        }
+
+        if ($iFileId) {
+        	$aBindings['file_id'] = $iFileId;
+
+            $sWhere .= " AND `file_id` = :file_id";
+        }
+
+        $sQuery = "DELETE FROM `" . $this->_oConfig->CNF['TABLE_FILES2ENTRIES'] . "` WHERE 1 " . $sWhere;
+        return $this->query($sQuery, $aBindings);
+    }
+
+    public function getFileTitle($iFileId)
+    {
+        $sQuery = $this->prepare ("SELECT `title` FROM `" . $this->_oConfig->CNF['TABLE_FILES2ENTRIES'] . "` WHERE `file_id` = ?", $iFileId);
+        return $this->getOne($sQuery);
+    }
+
+    public function getMediaInfoById($iMediaId)
+    {
+        $sQuery = $this->prepare ("SELECT `f2e`.*, `f`.`added` FROM `" . $this->_oConfig->CNF['TABLE_FILES2ENTRIES'] . "` AS `f2e` INNER JOIN `" . $this->_oConfig->CNF['TABLE_FILES'] . "` AS `f` ON (`f`.`id` = `f2e`.`file_id`) INNER JOIN `" . $this->_oConfig->CNF['TABLE_ENTRIES'] . "` AS `e` ON (`e`.`id` = `f2e`.`content_id`) WHERE `f2e`.`id` = ?", $iMediaId);
+        return $this->getRow($sQuery);
+    }
+
+    public function getMediaInfoSimpleByFileId($iFileId)
+    {
+        $sQuery = $this->prepare ("SELECT * FROM `" . $this->_oConfig->CNF['TABLE_FILES2ENTRIES'] . "` WHERE `file_id` = ?", $iFileId);
+        return $this->getRow($sQuery);
+    }
+
+    public function getMediaListByContentId($iContentId)
+    {
+        $sQuery = $this->prepare ("SELECT * FROM `" . $this->_oConfig->CNF['TABLE_FILES2ENTRIES'] . "` WHERE `content_id` = ? ORDER BY `order`", $iContentId);
+        return $this->getAll($sQuery);
+    }
+
+    function getMediaBy($aParams = array())
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+    	$aMethod = array('name' => 'getAll', 'params' => array(0 => 'query', 1 => array()));
+        $sSelectClause = $sJoinClause = $sWhereClause = $sOrderClause = $sLimitClause = "";
+
+        $sSelectClause = "`{$CNF['TABLE_FILES2ENTRIES']}`.*";
+
+        switch($aParams['type']) {
+            case 'id':
+                $aMethod['name'] = 'getRow';
+                $aMethod['params'][1]['id'] = (int)$aParams['id'];
+
+                $sWhereClause .= " AND `{$CNF['TABLE_FILES2ENTRIES']}`.`id` = :id";
+                break;
+
+            case 'search_ids':
+                $aMethod['name'] = 'getColumn';
+                
+                $sSelectClause = "`{$CNF['TABLE_FILES2ENTRIES']}`.`id`";
+
+                $sWhereConditions = "1";
+                foreach($aParams['search_params'] as $sSearchParam => $aSearchParam) {
+                    $sSearchValue = "";
+                    switch ($aSearchParam['operator']) {
+                        case 'like':
+                            $sSearchValue = " LIKE " . $this->escape("%" . $aSearchParam['value'] . "%");
+                            break;
+
+                        case 'in':
+                            $sSearchValue = " IN (" . $this->implode_escape($aSearchParam['value']) . ")";
+                            break;
+
+                        default:
+                             $sSearchValue = " " . $aSearchParam['operator'] . " :" . $sSearchParam;
+                             $aMethod['params'][1][$sSearchParam] = $aSearchParam['value'];                             
+                    }
+
+                    $sWhereConditions .= " AND `{$CNF['TABLE_FILES2ENTRIES']}`.`" . $sSearchParam . "`" . $sSearchValue;
+                }
+
+                $sWhereClause .= " AND (" . $sWhereConditions . ")"; 
+
+                $sOrderClause .=  "`{$CNF['TABLE_FILES2ENTRIES']}`.`id` ASC";
+                break;
+
+            case 'all_ids':
+                $aMethod['name'] = 'getColumn';
+
+                $sSelectClause = "`{$CNF['TABLE_FILES2ENTRIES']}`.`id`";
+                $sOrderClause .=  "`{$CNF['TABLE_FILES2ENTRIES']}`.`id` ASC";
+                break;
+
+            case 'all':
+                $sOrderClause .=  "`{$CNF['TABLE_FILES2ENTRIES']}`.`id` ASC";
+                break;
+        }
+
+        if(!empty($sOrderClause))
+            $sOrderClause = 'ORDER BY ' . $sOrderClause;
+
+        if(!empty($sLimitClause))
+            $sLimitClause = 'LIMIT ' . $sLimitClause;
+
+        $aMethod['params'][0] = "SELECT " . $sSelectClause . " FROM `{$CNF['TABLE_FILES2ENTRIES']}` " . $sJoinClause . " WHERE 1 " . $sWhereClause . " " . $sOrderClause . " " . $sLimitClause;
+		return call_user_func_array(array($this, $aMethod['name']), $aMethod['params']);
+    }
+}
+
+/** @} */

+ 102 - 0
modules/boonex/albums/updates/9.0.3_9.0.4/source/classes/BxAlbumsFormEntry.php

@@ -0,0 +1,102 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Albums Albums
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Create/Edit entry form
+ */
+class BxAlbumsFormEntry extends BxBaseModTextFormEntry
+{
+    public function __construct($aInfo, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_albums';
+        parent::__construct($aInfo, $oTemplate);
+    }
+
+    protected function _associalFileWithContent($oStorage, $iFileId, $iProfileId, $iContentId, $sPictureField = '')
+    {
+        parent::_associalFileWithContent($oStorage, $iFileId, $iProfileId, $iContentId, $sPictureField);
+
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        $sData = '';
+        $sExif = '';
+        $aExif = false;
+        $aFile = $oStorage->getFile($iFileId);
+        if (0 === strncmp('image/', $aFile['mime_type'], 6)) {
+            $oImageReize = BxDolImageResize::getInstance();
+
+            $oTranscoder = BxDolTranscoderImage::getObjectInstance($CNF['OBJECT_IMAGES_TRANSCODER_BIG']);            
+            $a = $oImageReize->getImageSize($oTranscoder->getFileUrl($iFileId));
+            $sData = isset($a['w']) && isset($a['h']) ? $a['w'] . 'x' . $a['h'] : '';
+
+            if ($aExif = $oImageReize->getExifInfo($oStorage->getFileUrlById($iFileId))) {
+                $a = array('Make', 'Model', 'FocalLength', 'ShutterSpeedValue', 'ExposureTime', 'ISOSpeedRatings', 'Orientation', 'Artist', 'Copyright', 'Flash', 'WhiteBalance', 'DateTimeOriginal', 'DateTimeDigitized', 'ExifVersion', 'COMPUTED', 'GPSLatitudeRef', 'GPSLatitude', 'GPSLongitudeRef', 'GPSLongitude', 'GPSAltitudeRef', 'GPSAltitude', 'GPSTimeStamp', 'GPSImgDirectionRef', 'GPSImgDirection', 'GPSDateStamp');
+                $aExifFiltered = array();
+                foreach ($a as $sIndex)
+                    if (isset($aExif[$sIndex]))
+                        $aExifFiltered[$sIndex] = $aExif[$sIndex];
+                $sExif = serialize($aExifFiltered);
+            }
+        }
+        
+        if (false === $this->_oModule->_oDb->associateFileWithContent ($iContentId, $iFileId, $iProfileId, $this->getCleanValue('title-' . $iFileId), $sData, $sExif))
+            return;
+
+        $aMediaInfo = $this->_oModule->_oDb->getMediaInfoSimpleByFileId($iFileId);
+
+        if ($aMediaInfo && !empty($CNF['OBJECT_METATAGS_MEDIA'])) {            
+            $oMetatags = BxDolMetatags::getObjectInstance($CNF['OBJECT_METATAGS_MEDIA']);
+            if ($oMetatags->keywordsIsEnabled())
+                $oMetatags->keywordsAdd($aMediaInfo['id'], $aMediaInfo['title']);
+        }
+
+        if ($aMediaInfo && isset($aExif['Make']) && !empty($CNF['OBJECT_METATAGS_MEDIA_CAMERA'])) {
+            $oMetatags = BxDolMetatags::getObjectInstance($CNF['OBJECT_METATAGS_MEDIA_CAMERA']);
+            if ($oMetatags->keywordsIsEnabled())
+                $oMetatags->keywordsAddOne($aMediaInfo['id'], $oMetatags->keywordsCameraModel($aExif));
+        }
+
+        bx_alert($this->_oModule->getName(), 'media_added', $aMediaInfo['id'], $iProfileId, array('media_info' => $aMediaInfo));
+    }
+
+    function _deleteFile ($iFileId, $sStorage = '')
+    {
+        if (!($bRet = parent::_deleteFile ($iFileId)))
+            return false;
+
+        $aMediaInfo = $this->_oModule->_oDb->getMediaInfoSimpleByFileId($iFileId);
+        
+        $this->_oModule->serviceDeleteFileAssociations ($iFileId);
+
+        if ($aMediaInfo)
+            bx_alert($this->_oModule->getName(), 'media_deleted', $aMediaInfo['id'], $aMediaInfo['author'], array('media_info' => $aMediaInfo));
+        
+        return true;
+    }
+
+    function delete ($iContentId, $aContentInfo = array())
+    {
+        if (!($bRet = parent::delete ($iContentId, $aContentInfo)))
+            return $bRet;
+
+        if (!($aMediaList = $this->_oModule->_oDb->getMediaListByContentId($iContentId)))
+            return $bRet;
+
+        foreach ($aMediaList as $aMediaInfo) {
+            $this->_oModule->serviceDeleteFileAssociations($aMediaInfo['file_id']);
+            bx_alert($this->_oModule->getName(), 'media_deleted', $aMediaInfo['id'], $aMediaInfo['author'], array('media_info' => $aMediaInfo));
+        }
+        
+        return $bRet;
+    }
+}
+
+/** @} */

+ 370 - 0
modules/boonex/albums/updates/9.0.3_9.0.4/source/classes/BxAlbumsModule.php

@@ -0,0 +1,370 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Albums Albums
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+bx_import('BxDolAcl');
+
+/**
+ * Albums module
+ */
+class BxAlbumsModule extends BxBaseModTextModule
+{
+    protected $_aContexts = array('popular', 'public', 'author');
+
+    function __construct(&$aModule)
+    {
+        parent::__construct($aModule);
+    }
+
+    /**
+     * Display form for adding media to the album.
+     * @param $iContentId album content id where media will be added, if it's not provided then it's determined from 'id' GET variable
+     * @return HTML string with form, all necessary CSS and JS files are automatically added to the HEAD section of the site HTML. On error false or empty string is returned.
+     */ 
+    public function serviceEntityAddFiles ($iContentId = 0)
+    {
+        return $this->_serviceEntityForm ('editDataForm', $iContentId, 'bx_albums_entry_add_images');
+    }
+
+    /**
+     * Delete file and album association, also file views, votes, comments, meta data are also deleted
+     * @param $iFileId file ID
+     * @return true on success of false on error
+     */ 
+    public function serviceDeleteFileAssociations($iFileId)
+    {        
+        $CNF = &$this->_oConfig->CNF;
+
+        if (!($aMediaInfo = $this->_oDb->getMediaInfoSimpleByFileId($iFileId))) // file is already deleted
+            return true; 
+    
+        if (!$this->_oDb->deassociateFileWithContent(0, $iFileId))
+            return false;
+
+        if (!empty($CNF['OBJECT_VIEWS_MEDIA'])) {
+            $o = BxDolView::getObjectInstance($CNF['OBJECT_VIEWS_MEDIA'], $aMediaInfo['id']);
+            if ($o) $o->onObjectDelete();
+        }
+
+        if (!empty($CNF['OBJECT_VOTES_MEDIA'])) {
+            $o = BxDolVote::getObjectInstance($CNF['OBJECT_VOTES_MEDIA'], $aMediaInfo['id']);
+            if ($o) $o->onObjectDelete();
+        }
+
+        if (!empty($CNF['OBJECT_COMMENTS_MEDIA'])) {
+            $o = BxDolCmts::getObjectInstance($CNF['OBJECT_COMMENTS_MEDIA'], $aMediaInfo['id']);
+            if ($o) $o->onObjectDelete();
+        }
+
+        if (!empty($CNF['OBJECT_METATAGS_MEDIA'])) {
+            $oMetatags = BxDolMetatags::getObjectInstance($CNF['OBJECT_METATAGS_MEDIA']);
+            $oMetatags->onDeleteContent($aMediaInfo['id']);
+        }
+
+        if (!empty($CNF['OBJECT_METATAGS_MEDIA_CAMERA'])) {
+            $oMetatags = BxDolMetatags::getObjectInstance($CNF['OBJECT_METATAGS_MEDIA_CAMERA']);
+            $oMetatags->onDeleteContent($aMediaInfo['id']);
+        }
+
+        return true;
+    }
+
+    /**
+     * Display media EXIF information.
+     * @param $iMediaId media ID, if it's omitted then it's taken from 'id' GET variable.
+     * @return HTML string with EXIF info. On error empty string is returned.
+     */ 
+    public function serviceMediaExif ($iMediaId = 0)
+    {
+        return $this->_serviceTemplateFunc ('mediaExif', $iMediaId, 'getMediaInfoById');
+    }
+
+    /**
+     * Display media comments block.
+     * @param $iMediaId media ID, if it's omitted then it's taken from 'id' GET variable.
+     * @return HTML string with comments. On error false or empty string is returned.
+     */
+    public function serviceMediaComments ($iMediaId = 0)
+    {
+        return $this->_entityComments($this->_oConfig->CNF['OBJECT_COMMENTS_MEDIA'], $iMediaId);
+    }
+
+    /**
+     * Display media author block.
+     * @param $iMediaId media ID, if it's omitted then it's taken from 'id' GET variable.
+     * @return HTML string with block content. On error false or empty string is returned.
+     */
+    public function serviceMediaAuthor ($iMediaId = 0)
+    {
+        return $this->_serviceTemplateFunc ('mediaAuthor', $iMediaId, 'getMediaInfoById');
+    }
+
+    /**
+     * Display media social sharing buttons block.
+     * @param $iMediaId media ID, if it's omitted then it's taken from 'id' GET variable.
+     * @return HTML string with block content. On error false or empty string is returned.
+     */
+    public function serviceMediaSocialSharing ($iMediaId = 0, $bEnableCommentsBtn = false, $bEnableSocialSharing = true)
+    {
+        if (!$iMediaId)
+            $iMediaId = bx_process_input(bx_get('id'), BX_DATA_INT);
+        if (!$iMediaId)
+            return false;
+        $aMediaInfo = $this->_oDb->getMediaInfoById($iMediaId);
+        if (!$aMediaInfo)
+            return false;
+
+        $CNF = &$this->_oConfig->CNF;
+        return $this->_entitySocialSharing ($iMediaId, array(
+            'id_timeline' => 0,
+        	'id_thumb' => $aMediaInfo['file_id'],
+        	'title' => $aMediaInfo['title'],
+        	'object_storage' => false,
+            'object_transcoder' => $CNF['OBJECT_IMAGES_TRANSCODER_BIG'],
+        	'object_vote' => $CNF['OBJECT_VOTES_MEDIA'],
+        	'object_favorite' => $CNF['OBJECT_FAVORITES_MEDIA'],
+        	'object_report' => '',
+        	'object_comments' => $bEnableCommentsBtn ? $CNF['OBJECT_COMMENTS_MEDIA'] : '',
+        	'object_feature' => $CNF['OBJECT_FEATURED_MEDIA'],
+        	'uri_view_entry' => $CNF['URI_VIEW_MEDIA'],
+            'social_sharing' => $bEnableSocialSharing
+        ));
+    }
+
+    /**
+     * Display media preview block.
+     * @param $iMediaId media ID, if it's omitted then it's taken from 'id' GET variable.
+     * @param $mixedContext current context to navigate to next and previous file, possible values: popular, public, author. If omitted then value from 'context' GTE variable is taken. Default context is 'album' - when nothin is specified.
+     * @return HTML string with block content. On error false or empty string is returned.
+     */
+    public function serviceMediaView ($iMediaId = 0, $mixedContext = false)
+    {
+        if (!$iMediaId)
+            $iMediaId = bx_process_input(bx_get('id'), BX_DATA_INT);
+        if (!$iMediaId)
+            return false;
+
+        if (!$mixedContext) {
+            $mixedContext = bx_process_input(bx_get('context'));
+            if (!in_array($mixedContext, $this->_aContexts)) // when no context specified, it is assumed that it is an album context
+                $mixedContext = bx_process_input($mixedContext, BX_DATA_INT); // numeric context is reserved for future use
+        }
+
+        return $this->_oTemplate->entryMediaView ($iMediaId, $mixedContext);
+    }
+
+    public function checkAllowedSetThumb ()
+    {
+        return CHECK_ACTION_RESULT_NOT_ALLOWED;
+    }
+
+    /**
+     * Display block for browsing recently uploaded media files.
+     * @param $sUnitView unit view mode: gallery
+     * @param $bDisplayEmptyMsg display 'empty' message when nothing to browse, or return empty string.
+     * @param $bAjaxPaginate use AJAX or regular paginate.
+     * @return HTML string with block content. On error false or empty string is returned.
+     */    
+    public function serviceBrowseRecentMedia ($sUnitView = false, $bDisplayEmptyMsg = true, $bAjaxPaginate = true)
+    {
+        return $this->_serviceBrowse ('recent', array('unit_view' => $sUnitView), BX_DB_PADDING_DEF, $bDisplayEmptyMsg, $bAjaxPaginate, 'SearchResultMedia');
+    }
+
+    /**
+     * Display featured media. 
+     * For the list of params @see BxAlbumsModule::serviceBrowseRecentMedia
+     */ 
+    public function serviceBrowseFeaturedMedia ($sUnitView = false, $bDisplayEmptyMsg = true, $bAjaxPaginate = true)
+    {
+        return $this->_serviceBrowse ('featured', array('unit_view' => $sUnitView), BX_DB_PADDING_DEF, $bDisplayEmptyMsg, $bAjaxPaginate, 'SearchResultMedia');
+    }
+
+    /**
+     * Display popular media. 
+     * For the list of params @see BxAlbumsModule::serviceBrowseRecentMedia
+     */     
+    public function serviceBrowsePopularMedia ($sUnitView = false, $bDisplayEmptyMsg = true, $bAjaxPaginate = true)
+    {
+        return $this->_serviceBrowse ('popular', array('unit_view' => $sUnitView), BX_DB_PADDING_DEF, $bDisplayEmptyMsg, $bAjaxPaginate, 'SearchResultMedia');
+    }
+
+    /**
+     * Display favorite media for particular profile. 
+     * @param $iProfileId profile ID, if omitted then 'profile_id' GET variable is used 
+     * @param $aParams additional params for browsing such as 'unit_view'
+     */         
+    public function serviceBrowseFavoriteMedia ($iProfileId = 0, $aParams = array())
+    {
+        $oProfile = null;
+        if((int)$iProfileId)
+            $oProfile = BxDolProfile::getInstance($iProfileId);
+        if(!$oProfile && bx_get('profile_id') !== false)
+            $oProfile = BxDolProfile:: getInstance(bx_process_input(bx_get('profile_id'), BX_DATA_INT));
+        if(!$oProfile)
+            $oProfile = BxDolProfile::getInstance();
+        if(!$oProfile)
+            return '';
+
+        return $this->_serviceBrowse ('favorite', array_merge(array('user' => $oProfile->id()), $aParams), BX_DB_PADDING_DEF, true, true, 'SearchResultMedia');
+    }
+
+    public function serviceGetNotificationsData()
+    {
+        $sModule = $this->_aModule['name'];
+
+        $sEventPrivacy = $sModule . '_allow_view_event_to';
+		if(BxDolPrivacy::getObjectInstance($sEventPrivacy) === false)
+			$sEventPrivacy = '';
+
+        $aResult = parent::serviceGetNotificationsData();
+        $aResult['handlers'] = array_merge($aResult['handlers'], array(
+            array('group' => $sModule . '_comment_media', 'type' => 'insert', 'alert_unit' => $sModule . '_media', 'alert_action' => 'commentPost', 'module_name' => $sModule, 'module_method' => 'get_notifications_comment_media', 'module_class' => 'Module', 'module_event_privacy' => $sEventPrivacy),
+            array('group' => $sModule . '_comment_media', 'type' => 'delete', 'alert_unit' => $sModule . '_media', 'alert_action' => 'commentRemoved'),
+
+            array('group' => $sModule . '_vote_media', 'type' => 'insert', 'alert_unit' => $sModule . '_media', 'alert_action' => 'doVote', 'module_name' => $sModule, 'module_method' => 'get_notifications_vote_media', 'module_class' => 'Module', 'module_event_privacy' => $sEventPrivacy),
+            array('group' => $sModule . '_vote_media', 'type' => 'delete', 'alert_unit' => $sModule . '_media', 'alert_action' => 'undoVote'),
+        ));
+
+        $aResult['alerts'] = array_merge($aResult['alerts'], array(
+            array('unit' => $sModule . '_media', 'action' => 'commentPost'),
+            array('unit' => $sModule . '_media', 'action' => 'commentRemoved'),
+
+            array('unit' => $sModule . '_media', 'action' => 'doVote'),
+            array('unit' => $sModule . '_media', 'action' => 'undoVote'),
+        ));
+
+        return $aResult; 
+    }
+
+    public function serviceGetNotificationsCommentMedia($aEvent)
+    {
+    	$CNF = &$this->_oConfig->CNF;
+
+    	$iMediaId = (int)$aEvent['object_id'];
+    	$aMediaInfo = $this->_oDb->getMediaInfoById($iMediaId);
+        if(empty($aMediaInfo) || !is_array($aMediaInfo))
+            return array();
+
+		$oComment = BxDolCmts::getObjectInstance($CNF['OBJECT_COMMENTS_MEDIA'], $iMediaId);
+        if(!$oComment || !$oComment->isEnabled())
+            return array();
+
+        $sEntryUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_MEDIA'] . '&id=' . $aMediaInfo['id']);
+        $sEntryCaption = isset($aMediaInfo['title']) ? $aMediaInfo['title'] : _t('_bx_albums_media');
+
+		return array(
+			'entry_sample' => $CNF['T']['txt_media_single'],
+			'entry_url' => $sEntryUrl,
+			'entry_caption' => $sEntryCaption,
+			'entry_author' => $aMediaInfo['author'],
+			'subentry_sample' => $CNF['T']['txt_media_comment_single'],
+			'subentry_url' => $oComment->getViewUrl((int)$aEvent['subobject_id']),
+			'lang_key' => '', //may be empty or not specified. In this case the default one from Notification module will be used.
+		);
+    }
+
+    public function serviceGetNotificationsVoteMedia($aEvent)
+    {
+    	$CNF = &$this->_oConfig->CNF;
+
+    	$iMediaId = (int)$aEvent['object_id'];
+    	$aMediaInfo = $this->_oDb->getMediaInfoById($iMediaId);
+        if(empty($aMediaInfo) || !is_array($aMediaInfo))
+            return array();
+
+		$oVote = BxDolVote::getObjectInstance($CNF['OBJECT_VOTES_MEDIA'], $iMediaId);
+        if(!$oVote || !$oVote->isEnabled())
+            return array();
+
+        $sEntryUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_MEDIA'] . '&id=' . $aMediaInfo['id']);
+        $sEntryCaption = isset($aMediaInfo['title']) ? $aMediaInfo['title'] : _t('_bx_albums_media');
+
+		return array(
+			'entry_sample' => $CNF['T']['txt_media_single'],
+			'entry_url' => $sEntryUrl,
+			'entry_caption' => $sEntryCaption,
+			'entry_author' => $aMediaInfo['author'],
+			'subentry_sample' => $CNF['T']['txt_media_vote_single'],
+			'subentry_url' => '',
+			'lang_key' => '', //may be empty or not specified. In this case the default one from Notification module will be used.
+		);
+    }
+
+    public function actionGetSiblingMedia($iMediaId, $mixedContext)
+    {
+        $aSiblings = false;
+        $sErrorMsg = false;
+        if (!($aMediaInfo = $this->_oDb->getMediaInfoById((int)$iMediaId))) 
+            $sErrorMsg = _t('_sys_txt_error_occured');
+
+        if (empty($sErrorMsg) && !($aContentInfo = $this->_oDb->getContentInfoById($aMediaInfo['content_id'])))
+            $sErrorMsg = _t('_sys_txt_error_occured');
+
+        if (empty($sErrorMsg) && (CHECK_ACTION_RESULT_ALLOWED !== ($sMsg = $this->checkAllowedView($aContentInfo))))
+            $sErrorMsg = $sMsg;
+
+        if (empty($sErrorMsg)) {
+            $aSiblings = array (
+                'next' => $this->_oTemplate->getNextPrevMedia($aMediaInfo, true, $mixedContext),
+                'prev' => $this->_oTemplate->getNextPrevMedia($aMediaInfo, false, $mixedContext),
+            );
+        }
+    
+        $a = $sErrorMsg ? array('error' => $sErrorMsg) : array('next' => $aSiblings['next'], 'prev' => $aSiblings['prev']);
+
+        $s = json_encode($a);
+
+        header('Content-type: text/html; charset=utf-8');
+        echo $s;
+    }
+
+    public function actionRssMedia ()
+    {
+        $aArgs = func_get_args();
+        $this->_rss($aArgs, 'SearchResultMedia');
+    }
+
+    protected function _buildRssParams($sMode, $aArgs)
+    {        
+        if ($aParams = parent::_buildRssParams($sMode, $aArgs))
+            return $aParams;
+
+        $sMode = bx_process_input($sMode);
+        switch ($sMode) {
+            case 'album':
+                $aParams = array('album_id' => isset($aArgs[0]) ? (int)$aArgs[0] : '');
+                break;
+        }
+
+        return $aParams;
+    }
+
+    protected function _getImagesForTimelinePost($aEvent, $aContentInfo, $sUrl)
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        if (!($aMediaList = $this->_oDb->getMediaListByContentId($aContentInfo[$CNF['FIELD_ID']])))
+            return array();
+
+        $oTranscoder = BxDolTranscoderImage::getObjectInstance($CNF['OBJECT_IMAGES_TRANSCODER_PREVIEW']);
+        $aMediaList = array_slice($aMediaList, 0, 3);
+        $aOutput = array();
+        foreach ($aMediaList as $aMedia) {
+            $aOutput[] = array (
+                'url' => $this->_oTemplate->getViewMediaUrl($CNF, $aMedia['id']), 
+                'src' => $oTranscoder->getFileUrl($aMedia['file_id']),
+            );
+        }
+
+        return $aOutput;
+    }
+}
+
+/** @} */

+ 130 - 0
modules/boonex/albums/updates/9.0.3_9.0.4/source/install/config.php

@@ -0,0 +1,130 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Albums Albums
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_albums',
+    'title' => 'Albums',
+    'note' => 'Photos & videos',
+    'version' => '9.0.4',
+    'vendor' => 'BoonEx',
+	'help_url' => 'http://feed.boonex.com/?section={module_name}',
+
+    'compatible_with' => array(
+        '9.0.0-RC1'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/albums/',
+    'home_uri' => 'albums',
+
+    'db_prefix' => 'bx_albums_',
+    'class_prefix' => 'BxAlbums',
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => 'Albums',
+
+    /**
+     * List of page triggers.
+     */
+    'page_triggers' => array (
+    	'trigger_page_profile_view_entry',
+    ),
+
+    /**
+     * Menu triggers.
+     */
+    'menu_triggers' => array(
+    	'trigger_profile_view_submenu'
+    ),
+
+    /**
+     * Storages.
+     */
+    'storages' => array(
+    	'bx_albums_files'
+    ),
+
+    /**
+     * Transcoders.
+     */
+    'transcoders' => array(
+		'bx_albums_preview',
+        'bx_albums_browse',
+        'bx_albums_big',
+        'bx_albums_video_poster_browse',
+        'bx_albums_video_poster_preview',
+        'bx_albums_video_poster_big',
+        'bx_albums_video_mp4',
+        'bx_albums_video_webm',
+    ),
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+        'execute_sql' => 1,
+        'update_languages' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'uninstall' => array (
+    	'process_storages' => 1,
+        'execute_sql' => 1,
+        'update_languages' => 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,
+    	'register_transcoders' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'disable' => array (
+        'execute_sql' => 1,
+    	'update_relations' => 1,
+    	'unregister_transcoders' => 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'
+    ),
+
+);
+
+/** @} */

+ 222 - 0
modules/boonex/albums/updates/9.0.3_9.0.4/source/install/langs/en.xml

@@ -0,0 +1,222 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+
+	<string name="_bx_albums"><![CDATA[Albums]]></string>
+	<string name="_bx_albums_cmts"><![CDATA[Albums' Comments]]></string>
+	<string name="_bx_albums_media"><![CDATA[Images]]></string>
+	<string name="_bx_albums_media_cmts"><![CDATA[Images' Comments]]></string>
+
+	<string name="_bx_albums_option_summary_chars"><![CDATA[Number of characters in auto-cropped album summary]]></string>
+	<string name="_bx_albums_option_plain_summary_chars"><![CDATA[Number of characters in plain album description when album hasn't thumb]]></string>
+	<string name="_bx_albums_option_per_page_browse"><![CDATA[Number of items per page]]></string>
+	<string name="_bx_albums_option_per_page_profile"><![CDATA[Number of items per page on profile page]]></string>
+	<string name="_bx_albums_option_rss_num"><![CDATA[Number of items in RSS feed]]></string>
+	<string name="_bx_albums_option_searchable_fields"><![CDATA[Searchable fields for keyword search]]></string>
+
+	<string name="_bx_albums_form_entry"><![CDATA[Albums]]></string>
+	<string name="_bx_albums_form_entry_display_add"><![CDATA[Add Album]]></string>
+    <string name="_bx_albums_form_entry_display_edit"><![CDATA[Edit Album]]></string>
+	<string name="_bx_albums_form_entry_display_add_images"><![CDATA[Add Images To Album]]></string>
+	<string name="_bx_albums_form_entry_display_delete"><![CDATA[Delete Album]]></string>
+	<string name="_bx_albums_form_entry_display_view"><![CDATA[View Album]]></string>
+	<string name="_bx_albums_form_entry_input_author"><![CDATA[Author]]></string>
+	<string name="_bx_albums_form_entry_input_sys_do_submit"><![CDATA[Submit]]></string>
+	<string name="_bx_albums_form_entry_input_do_submit"><![CDATA[Submit]]></string>
+	<string name="_bx_albums_form_entry_input_sys_title"><![CDATA[Caption]]></string>
+	<string name="_bx_albums_form_entry_input_title"><![CDATA[Caption]]></string>
+	<string name="_bx_albums_form_entry_input_title_err"><![CDATA[Caption is essential. Please, fill in this field]]></string>
+	<string name="_bx_albums_form_entry_input_sys_text"><![CDATA[Album Description]]></string>
+	<string name="_bx_albums_form_entry_input_text"><![CDATA[Album Description]]></string>
+	<string name="_bx_albums_form_entry_input_sys_delete_confirm"><![CDATA[Delete confirmation]]></string>
+	<string name="_bx_albums_form_entry_input_delete_confirm"><![CDATA[I am sure I want to delete this album]]></string>
+	<string name="_bx_albums_form_entry_input_delete_confirm_info"><![CDATA[This action can not be undone]]></string>
+	<string name="_bx_albums_form_entry_input_delete_confirm_error"><![CDATA[Please check this checkbox if you really want to delete the album]]></string>
+	<string name="_bx_albums_form_entry_input_sys_pictures"><![CDATA[Pictures]]></string>
+	<string name="_bx_albums_form_entry_input_pictures"><![CDATA[Pictures]]></string>
+    <string name="_bx_albums_form_entry_input_sys_allow_view_to"><![CDATA[Visibility]]></string>
+    <string name="_bx_albums_form_entry_input_allow_view_to"><![CDATA[Visibility]]></string>
+    <string name="_bx_albums_form_entry_file_title"><![CDATA[Caption]]></string>
+	<string name="_bx_albums_form_entry_input_sys_date_added"><![CDATA[Created]]></string>
+	<string name="_bx_albums_form_entry_input_date_added"><![CDATA[Created]]></string>
+	<string name="_bx_albums_form_entry_input_sys_date_changed"><![CDATA[Updated]]></string>
+    <string name="_bx_albums_form_entry_input_date_changed"><![CDATA[Updated]]></string>
+    
+	<string name="_bx_albums_acl_action_create_entry"><![CDATA[Create Album]]></string>
+	<string name="_bx_albums_acl_action_delete_entry"><![CDATA[Delete Album]]></string>
+	<string name="_bx_albums_acl_action_view_entry"><![CDATA[View Album]]></string>
+	<string name="_bx_albums_acl_action_set_thumb"><![CDATA[Set Album Cover]]></string>
+	<string name="_bx_albums_acl_action_edit_any_entry"><![CDATA[Edit Any Album]]></string>
+
+	<string name="_bx_albums_page_title_sys_create_entry"><![CDATA[New Album]]></string>
+	<string name="_bx_albums_page_title_create_entry"><![CDATA[New Album]]></string>
+	<string name="_bx_albums_page_block_title_create_entry"><![CDATA[New Album]]></string>
+	<string name="_bx_albums_page_title_sys_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_albums_page_title_edit_entry"><![CDATA[Edit]]></string>
+	<string name="_bx_albums_page_title_sys_add_images"><![CDATA[Add/Edit Pictures]]></string>
+	<string name="_bx_albums_page_title_add_images"><![CDATA[Add/Edit Pictures]]></string>
+    <string name="_bx_albums_page_block_title_edit_entry"><![CDATA[Edit]]></string>
+	<string name="_bx_albums_page_block_title_add_images"><![CDATA[Add/Edit Pictures]]></string>
+    <string name="_bx_albums_page_title_sys_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_albums_page_title_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_albums_page_block_title_delete_entry"><![CDATA[Delete]]></string>
+	<string name="_bx_albums_page_title_sys_view_entry"><![CDATA[View Album]]></string>
+	<string name="_bx_albums_page_title_view_entry"><![CDATA[{title}]]></string>
+	<string name="_bx_albums_page_title_sys_view_media"><![CDATA[View Image]]></string>
+	<string name="_bx_albums_page_title_view_media"><![CDATA[{title}]]></string>
+	<string name="_bx_albums_page_block_title_entry_view_media"><![CDATA[View Image]]></string>
+	<string name="_bx_albums_page_block_title_entry_view_media_exif"><![CDATA[EXIF]]></string>
+	<string name="_bx_albums_page_block_title_entry_attachments"><![CDATA[Attachments]]></string>
+	<string name="_bx_albums_page_block_title_entry_text"><![CDATA[Album Description]]></string>
+	<string name="_bx_albums_page_title_browse"><![CDATA[Albums]]></string>
+	<string name="_bx_albums_page_title_search_results"><![CDATA[Albums matching "{0}"]]></string>
+	<string name="_bx_albums_page_title_browse_by_author"><![CDATA[{display_name}'s Albums]]></string>
+	<string name="_bx_albums_page_title_browse_featured"><![CDATA[Featured Albums]]></string>
+	<string name="_bx_albums_page_title_browse_featured_media"><![CDATA[Featured Media]]></string>
+    <string name="_bx_albums_page_title_browse_recent"><![CDATA[Latest Albums]]></string>
+    <string name="_bx_albums_page_title_browse_popular"><![CDATA[Popular Albums]]></string>
+    <string name="_bx_albums_page_title_browse_popular_media"><![CDATA[Top Images]]></string>
+    <string name="_bx_albums_page_title_browse_recent_media"><![CDATA[Recent Images]]></string>
+    <string name="_bx_albums_page_title_browse_media_in_album"><![CDATA[Images]]></string>
+    <string name="_bx_albums_page_title_browse_updated"><![CDATA[Updated Albums]]></string>
+    <string name="_bx_albums_page_title_sys_home"><![CDATA[Albums Home]]></string>
+    <string name="_bx_albums_page_title_home"><![CDATA[Albums]]></string>
+    <string name="_bx_albums_page_block_title_featured_entries_view_extended"><![CDATA[Featured Albums]]></string>
+    <string name="_bx_albums_page_block_title_featured_entries_view_gallery_media"><![CDATA[Featured Media]]></string>
+    <string name="_bx_albums_page_block_title_recent_entries"><![CDATA[Latest Albums]]></string>
+    <string name="_bx_albums_page_block_title_entry_social_sharing"><![CDATA[Share]]></string>
+    <string name="_bx_albums_page_block_title_entry_author"><![CDATA[Author]]></string>
+    <string name="_bx_albums_page_block_title_entry_info"><![CDATA[Info]]></string>
+    <string name="_bx_albums_page_block_title_entry_actions"><![CDATA[Actions]]></string>
+    <string name="_bx_albums_page_block_title_entry_comments"><![CDATA[Comments]]></string>
+    <string name="_bx_albums_page_block_title_entry_comments_link"><![CDATA[Comments to <a href="{entry_link}">{title}</a>]]></string>
+    <string name="_bx_albums_page_block_title_entry_location"><![CDATA[Location]]></string>
+    <string name="_bx_albums_page_title_sys_entries_popular"><![CDATA[Popular]]></string>
+    <string name="_bx_albums_page_title_entries_popular"><![CDATA[Popular]]></string>
+    <string name="_bx_albums_page_title_sys_entries_popular_media"><![CDATA[Top Images]]></string>
+    <string name="_bx_albums_page_title_entries_popular_media"><![CDATA[Top Images]]></string>
+    <string name="_bx_albums_page_block_title_popular_entries"><![CDATA[Popular]]></string>
+    <string name="_bx_albums_page_block_title_popular_media"><![CDATA[Top Images]]></string>
+    <string name="_bx_albums_page_block_title_recent_media"><![CDATA[Recent Images]]></string>
+    <string name="_bx_albums_page_block_title_updated_entries"><![CDATA[Updated Albums]]></string>
+    <string name="_bx_albums_page_title_sys_view_entry_comments"><![CDATA[Comments]]></string>
+    <string name="_bx_albums_page_title_view_entry_comments"><![CDATA[Comments to {title}]]></string>
+    <string name="_bx_albums_page_title_sys_entries_of_author"><![CDATA[Albums of author]]></string>
+    <string name="_bx_albums_page_title_entries_of_author"><![CDATA[{display_name}'s albums]]></string>
+    <string name="_bx_albums_page_block_title_favorites_of_author"><![CDATA[Favorite albums by <a href="{profile_link}">{display_name}</a>]]></string>
+    <string name="_bx_albums_page_block_title_sys_favorites_of_author"><![CDATA[Favorite albums of author]]></string>
+    <string name="_bx_albums_page_block_title_favorites_of_author_media"><![CDATA[Favorite media by <a href="{profile_link}">{display_name}</a>]]></string>
+    <string name="_bx_albums_page_block_title_sys_favorites_of_author_media"><![CDATA[Favorite media of author]]></string>
+    <string name="_bx_albums_page_block_title_entries_of_author"><![CDATA[Albums by <a href="{profile_link}">{display_name}</a>]]></string>   
+    <string name="_bx_albums_page_block_title_sys_entries_of_author"><![CDATA[Albums of author]]></string>   
+    <string name="_bx_albums_page_block_title_entries_actions"><![CDATA[Albums actions]]></string>
+    <string name="_bx_albums_page_block_title_browse_cmts"><![CDATA[Albums' Comments]]></string>
+    <string name="_bx_albums_page_block_title_browse_cmts_media"><![CDATA[Images Comments]]></string>
+	<string name="_bx_albums_page_title_sys_manage"><![CDATA[Manage Own Albums]]></string>
+	<string name="_bx_albums_page_title_sys_manage_administration"><![CDATA[Manage All Albums]]></string>
+	<string name="_bx_albums_page_title_manage"><![CDATA[Manage]]></string>
+	<string name="_bx_albums_page_block_title_system_manage"><![CDATA[Manage Own Albums]]></string>
+	<string name="_bx_albums_page_block_title_system_manage_administration"><![CDATA[Manage All Albums]]></string>
+	<string name="_bx_albums_page_block_title_manage"><![CDATA[Manage]]></string>
+	<string name="_bx_albums_page_block_title_popular_keywords_albums"><![CDATA[Popular Albums Hashtags]]></string>
+	<string name="_bx_albums_page_block_title_popular_keywords_media"><![CDATA[Popular Media Hashtags]]></string>
+	<string name="_bx_albums_page_block_title_popular_keywords_media_camera"><![CDATA[Popular Cameras]]></string>
+	<string name="_bx_albums_page_block_title_my_entries"><![CDATA[My Albums]]></string>
+	<string name="_bx_albums_page_title_sys_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_albums_page_title_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_albums_page_block_title_search_form"><![CDATA[Search Form]]></string>
+    <string name="_bx_albums_page_block_title_search_results"><![CDATA[Search Results]]></string>
+    <string name="_bx_albums_page_block_title_search_form_media"><![CDATA[Images Search Form]]></string>
+    <string name="_bx_albums_page_block_title_search_results_media"><![CDATA[Images Search Results]]></string>
+    <string name="_bx_albums_page_block_title_search_form_cmts"><![CDATA[Comments Search Form]]></string>
+    <string name="_bx_albums_page_block_title_search_results_cmts"><![CDATA[Comments Search Results]]></string>
+    <string name="_bx_albums_page_block_title_search_form_media_cmts"><![CDATA[Images Comments Search Form]]></string>
+    <string name="_bx_albums_page_block_title_search_results_media_cmts"><![CDATA[Images Comments Search Results]]></string>
+
+    <string name="_bx_albums_menu_set_title_view_entry"><![CDATA[Album Actions]]></string>
+    <string name="_bx_albums_menu_title_view_entry"><![CDATA[Album Actions]]></string>
+    <string name="_bx_albums_menu_set_title_view_media"><![CDATA[Media Actions]]></string>
+    <string name="_bx_albums_menu_title_view_media"><![CDATA[Media Actions]]></string>
+    <string name="_bx_albums_menu_title_submenu"><![CDATA[Albums Submenu]]></string>
+    <string name="_bx_albums_menu_set_title_submenu"><![CDATA[Albums Submenu]]></string>
+    <string name="_bx_albums_menu_item_title_system_create_entry"><![CDATA[New Album]]></string>
+    <string name="_bx_albums_menu_item_title_create_entry"><![CDATA[New Album]]></string>
+    <string name="_bx_albums_menu_item_title_system_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_albums_menu_item_title_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_albums_menu_item_title_system_edit_album"><![CDATA[Edit Album]]></string>
+    <string name="_bx_albums_menu_item_title_edit_album"><![CDATA[Edit Album]]></string>
+    <string name="_bx_albums_menu_item_title_system_add_images"><![CDATA[Add/Edit Pictures]]></string>
+    <string name="_bx_albums_menu_item_title_add_images"><![CDATA[Add/Edit Pictures]]></string>
+    <string name="_bx_albums_menu_item_title_system_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_albums_menu_item_title_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_albums_menu_item_title_system_view_entry"><![CDATA[View Album]]></string>
+    <string name="_bx_albums_menu_item_title_system_entries_home"><![CDATA[Albums]]></string>
+    <string name="_bx_albums_menu_item_title_entries_home"><![CDATA[Albums]]></string>
+    <string name="_bx_albums_menu_item_title_system_entries_recent"><![CDATA[Latest]]></string>
+    <string name="_bx_albums_menu_item_title_entries_recent"><![CDATA[Latest]]></string>
+    <string name="_bx_albums_menu_item_title_system_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_albums_menu_item_title_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_albums_menu_item_title_system_entries_manage"><![CDATA[Manage]]></string>
+    <string name="_bx_albums_menu_item_title_entries_manage"><![CDATA[Manage]]></string>
+    <string name="_bx_albums_menu_item_title_system_entries_popular"><![CDATA[Popular]]></string>
+    <string name="_bx_albums_menu_item_title_entries_popular"><![CDATA[Popular]]></string>
+    <string name="_bx_albums_menu_item_title_system_entries_popular_media"><![CDATA[Top Images]]></string>
+    <string name="_bx_albums_menu_item_title_entries_popular_media"><![CDATA[Top Images]]></string>
+    <string name="_bx_albums_menu_title_view_entry_submenu"><![CDATA[View Album Submenu]]></string>
+    <string name="_bx_albums_menu_set_title_view_entry_submenu"><![CDATA[View Album Submenu]]></string>
+    <string name="_bx_albums_menu_item_title_view_entry_submenu_entry"><![CDATA[Album]]></string>
+    <string name="_bx_albums_menu_item_title_view_entry_submenu_comments"><![CDATA[Comments]]></string>
+    <string name="_bx_albums_menu_item_title_system_view_entry_comments"><![CDATA[Comments]]></string>
+    <string name="_bx_albums_menu_item_title_system_view_entries_author"><![CDATA[Albums]]></string>
+    <string name="_bx_albums_menu_item_title_view_entries_author"><![CDATA[Albums]]></string>
+    <string name="_bx_albums_menu_title_entries_my"><![CDATA[My Albums Action Menu]]></string>
+    <string name="_bx_albums_menu_set_title_entries_my"><![CDATA[My Albums Menu]]></string>
+	<string name="_bx_albums_menu_item_title_system_manage_my_albums"><![CDATA[My albums]]></string>
+    <string name="_bx_albums_menu_item_title_manage_my_albums"><![CDATA[{addon} albums]]></string>
+    <string name="_bx_albums_menu_set_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string>
+    <string name="_bx_albums_menu_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string>
+	<string name="_bx_albums_menu_item_title_system_admt_albums"><![CDATA[Albums]]></string>
+	<string name="_bx_albums_menu_item_title_admt_albums"><![CDATA[Albums - {addon} hidden]]></string>
+	<string name="_bx_albums_menu_item_title_manage_my"><![CDATA[My Albums]]></string>
+	<string name="_bx_albums_menu_item_title_manage_all"><![CDATA[All Albums]]></string>
+
+	<string name="_bx_albums_grid_filter_item_title_adm_select_one_filter1"><![CDATA[All Statuses]]></string>
+	<string name="_bx_albums_grid_filter_item_title_adm_active"><![CDATA[Active]]></string>
+	<string name="_bx_albums_grid_filter_item_title_adm_hidden"><![CDATA[Hidden]]></string>
+	<string name="_bx_albums_grid_column_title_adm_active"><![CDATA[Active]]></string>
+    <string name="_bx_albums_grid_column_title_adm_title"><![CDATA[Caption]]></string>
+    <string name="_bx_albums_grid_column_title_adm_added"><![CDATA[Added]]></string>
+    <string name="_bx_albums_grid_column_title_adm_author"><![CDATA[Author]]></string>
+    <string name="_bx_albums_grid_action_title_adm_edit"><![CDATA[Edit]]></string>
+    <string name="_bx_albums_grid_action_title_adm_delete"><![CDATA[Delete]]></string>
+    <string name="_bx_albums_grid_action_title_adm_more_actions"><![CDATA[More Actions]]></string>
+    <string name="_bx_albums_grid_action_err_delete"><![CDATA[Cannot delete the selected album(s).]]></string>
+    <string name="_bx_albums_grid_txt_account_manager"><![CDATA[Redirect to manage account.]]></string>
+
+    <string name="_bx_albums_chart_growth"><![CDATA[Albums: Growth]]></string>
+    <string name="_bx_albums_chart_growth_speed"><![CDATA[Albums: Growth Speed]]></string>
+    <string name="_bx_albums_chart_growth_media"><![CDATA[Images: Growth]]></string>
+    <string name="_bx_albums_chart_growth_speed_media"><![CDATA[Images: Growth Speed]]></string>
+
+    <string name="_bx_albums_search_extended"><![CDATA[Albums Search]]></string>
+    <string name="_bx_albums_search_extended_media"><![CDATA[Images Search]]></string>
+    <string name="_bx_albums_search_extended_cmts"><![CDATA[Albums Comments Search]]></string>
+    <string name="_bx_albums_search_extended_media_cmts"><![CDATA[Images Comments Search]]></string>
+
+    <string name="_bx_albums_txt_all_entries_by"><![CDATA[<a href="{0}">All Albums by {1} ({2})</a>]]></string>
+    <string name="_bx_albums_txt_sample_single"><![CDATA[album]]></string>
+    <string name="_bx_albums_txt_sample_single_with_article"><![CDATA[an album]]></string>
+    <string name="_bx_albums_txt_sample_comment_single"><![CDATA[album's comment]]></string>
+    <string name="_bx_albums_txt_sample_vote_single"><![CDATA[album's vote]]></string>
+    <string name="_bx_albums_txt_media_single"><![CDATA[image]]></string>
+    <string name="_bx_albums_txt_media_comment_single"><![CDATA[image's comment]]></string>
+    <string name="_bx_albums_txt_media_vote_single"><![CDATA[image's vote]]></string>
+	<string name="_bx_albums_txt_media_title_alt"><![CDATA[{0}'s media]]></string>
+	<string name="_bx_albums_txt_media_album_link"><![CDATA[<a href="{0}">{1}</a> album by <a href="{2}">{3}</a>]]></string>
+	<string name="_bx_albums_txt_media_album_camera"><![CDATA[Camera]]></string>
+	<string name="_bx_albums_txt_media_album_focal_length"><![CDATA[Focal length]]></string>
+	<string name="_bx_albums_txt_media_album_focal_length_value"><![CDATA[{0}mm]]></string>
+	<string name="_bx_albums_txt_media_album_aperture"><![CDATA[Aperture]]></string>
+	<string name="_bx_albums_txt_media_album_shutter_speed"><![CDATA[Exposure time]]></string>
+	<string name="_bx_albums_txt_media_album_shutter_speed_value"><![CDATA[{0}s]]></string>
+	<string name="_bx_albums_txt_media_album_iso"><![CDATA[ISO]]></string>
+</resources>

+ 57 - 0
modules/boonex/albums/updates/9.0.3_9.0.4/source/install/sql/disable.sql

@@ -0,0 +1,57 @@
+
+-- SETTINGS
+SET @iTypeId = (SELECT `ID` FROM `sys_options_types` WHERE `name` = 'bx_albums' 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_albums';
+DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_albums' OR `object` IN('bx_albums_create_entry', 'bx_albums_edit_entry', 'bx_albums_add_images', 'bx_albums_delete_entry', 'bx_albums_view_entry', 'bx_albums_view_entry_comments', 'bx_albums_home', 'bx_albums_popular', 'bx_albums_updated', 'bx_albums_author', 'bx_albums_view_media', 'bx_albums_popular_media', 'bx_albums_search', 'bx_albums_manage');
+
+-- MENU
+DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_albums';
+DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_albums';
+DELETE FROM `sys_menu_items` WHERE `module` = 'bx_albums' OR `set_name` IN('bx_albums_view', 'bx_albums_view_media', 'bx_albums_submenu', 'bx_albums_view_submenu', 'bx_albums_my');
+
+-- PRIVACY 
+DELETE FROM `sys_objects_privacy` WHERE `object` = 'bx_albums_allow_view_to';
+
+-- 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_albums';
+DELETE FROM `sys_acl_actions` WHERE `Module` = 'bx_albums';
+
+-- SEARCH
+DELETE FROM `sys_objects_search` WHERE `ObjectName` IN ('bx_albums', 'bx_albums_cmts', 'bx_albums_media', 'bx_albums_media_camera', 'bx_albums_media_cmts');
+
+-- SEARCH EXTENDED
+DELETE FROM `sys_objects_search_extended` WHERE `module` = 'bx_albums';
+
+-- METATAGS
+DELETE FROM `sys_objects_metatags` WHERE `object` IN('bx_albums', 'bx_albums_media', 'bx_albums_media_camera');
+
+-- CONTENT INFO
+DELETE FROM `sys_objects_content_info` WHERE `name` IN ('bx_albums', 'bx_albums_media', 'bx_albums_cmts', 'bx_albums_media_cmts');
+
+DELETE FROM `sys_content_info_grids` WHERE `object` IN ('bx_albums');
+
+-- STATS
+DELETE FROM `sys_statistics` WHERE `name` LIKE 'bx_albums%';
+
+-- CHARTS
+DELETE FROM `sys_objects_chart` WHERE `object` LIKE 'bx_albums%';
+
+-- GRIDS
+DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_albums_administration', 'bx_albums_common');
+DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_albums_administration', 'bx_albums_common');
+DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_albums_administration', 'bx_albums_common');
+
+-- UPLOADERS
+DELETE FROM `sys_objects_uploader` WHERE `object` IN('bx_albums_simple', 'bx_albums_html5', 'bx_albums_crop');
+
+-- ALERTS
+SET @iHandler := (SELECT `id` FROM `sys_alerts_handlers` WHERE `name` = 'bx_albums' LIMIT 1);
+DELETE FROM `sys_alerts` WHERE `handler_id` = @iHandler;
+DELETE FROM `sys_alerts_handlers` WHERE `id` = @iHandler;
+

+ 445 - 0
modules/boonex/albums/updates/9.0.3_9.0.4/source/install/sql/enable.sql

@@ -0,0 +1,445 @@
+
+-- 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_albums', '_bx_albums', 'bx_albums@modules/boonex/albums/|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_albums', '_bx_albums', 1);
+SET @iCategId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_error`, `extra`, `order`) VALUES
+('bx_albums_summary_chars', '700', @iCategId, '_bx_albums_option_summary_chars', 'digit', '', '', '', 1),
+('bx_albums_plain_summary_chars', '200', @iCategId, '_bx_albums_option_plain_summary_chars', 'digit', '', '', '', 2),
+('bx_albums_per_page_browse', '12', @iCategId, '_bx_albums_option_per_page_browse', 'digit', '', '', '', 10),
+('bx_albums_per_page_profile', '3', @iCategId, '_bx_albums_option_per_page_profile', 'digit', '', '', '', 12),
+('bx_albums_rss_num', '10', @iCategId, '_bx_albums_option_rss_num', 'digit', '', '', '', 20),
+('bx_albums_searchable_fields', 'title,text', @iCategId, '_bx_albums_option_searchable_fields', 'list', '', '', 'a:2:{s:6:"module";s:9:"bx_albums";s:6:"method";s:21:"get_searchable_fields";}', 30);
+
+-- PAGE: create entry
+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_albums_create_entry', '_bx_albums_page_title_sys_create_entry', '_bx_albums_page_title_create_entry', 'bx_albums', 5, 2147483647, 1, 'create-album', 'page.php?i=create-album', '', '', '', 0, 1, 0, 'BxAlbumsPageBrowse', 'modules/boonex/albums/classes/BxAlbumsPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_albums_create_entry', 1, 'bx_albums', '_bx_albums_page_block_title_create_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_albums";s:6:"method";s:13:"entity_create";}', 0, 1, 1);
+
+
+-- PAGE: add images
+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_albums_add_images', '_bx_albums_page_title_sys_add_images', '_bx_albums_page_title_add_images', 'bx_albums', 5, 2147483647, 1, 'add-images', '', '', '', '', 0, 1, 0, 'BxAlbumsPageEntry', 'modules/boonex/albums/classes/BxAlbumsPageEntry.php');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_albums_add_images', 1, 'bx_albums', '_bx_albums_page_block_title_add_images', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_albums";s:6:"method";s:16:"entity_add_files";}', 0, 0, 0);
+
+-- PAGE: edit entry
+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_albums_edit_entry', '_bx_albums_page_title_sys_edit_entry', '_bx_albums_page_title_edit_entry', 'bx_albums', 5, 2147483647, 1, 'edit-album', '', '', '', '', 0, 1, 0, 'BxAlbumsPageEntry', 'modules/boonex/albums/classes/BxAlbumsPageEntry.php');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_albums_edit_entry', 1, 'bx_albums', '_bx_albums_page_block_title_edit_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_albums";s:6:"method";s:11:"entity_edit";}', 0, 0, 0);
+
+
+-- PAGE: delete entry
+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_albums_delete_entry', '_bx_albums_page_title_sys_delete_entry', '_bx_albums_page_title_delete_entry', 'bx_albums', 5, 2147483647, 1, 'delete-album', '', '', '', '', 0, 1, 0, 'BxAlbumsPageEntry', 'modules/boonex/albums/classes/BxAlbumsPageEntry.php');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_albums_delete_entry', 1, 'bx_albums', '_bx_albums_page_block_title_delete_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_albums";s:6:"method";s:13:"entity_delete";}', 0, 0, 0);
+
+
+-- PAGE: view entry
+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_albums_view_entry', '_bx_albums_page_title_sys_view_entry', '_bx_albums_page_title_view_entry', 'bx_albums', 10, 2147483647, 1, 'view-album', '', '', '', '', 0, 1, 0, 'BxAlbumsPageEntry', 'modules/boonex/albums/classes/BxAlbumsPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_albums_view_entry', 4, 'bx_albums', '_bx_albums_page_block_title_entry_text', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_albums\";s:6:\"method\";s:17:\"entity_text_block\";}', 0, 0, 1, 0),
+('bx_albums_view_entry', 4, 'bx_albums', '_bx_albums_page_block_title_entry_attachments', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_albums\";s:6:\"method\";s:18:\"entity_attachments\";}', 0, 0, 1, 1),
+('bx_albums_view_entry', 4, 'bx_albums', '_bx_albums_page_block_title_entry_social_sharing', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_albums\";s:6:\"method\";s:21:\"entity_social_sharing\";}', 0, 0, 1, 2),
+('bx_albums_view_entry', 4, 'bx_albums', '_bx_albums_page_block_title_entry_comments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_albums\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 1, 3),
+('bx_albums_view_entry', 4, 'bx_albums', '_bx_albums_page_block_title_entry_location', 3, 2147483647, 'service', 'a:4:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:13:\"locations_map\";s:6:\"params\";a:2:{i:0;s:9:\"bx_albums\";i:1;s:4:\"{id}\";}s:5:\"class\";s:20:\"TemplServiceMetatags\";}', 0, 0, 1, 4),
+
+('bx_albums_view_entry', 2, 'bx_albums', '_bx_albums_page_block_title_entry_author', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_albums\";s:6:\"method\";s:13:\"entity_author\";}', 0, 0, 1, 0),
+
+('bx_albums_view_entry', 3, 'bx_albums', '_bx_albums_page_block_title_entry_info', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_albums\";s:6:\"method\";s:11:\"entity_info\";}', 0, 0, 1, 0);
+
+
+-- PAGE: view media
+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_albums_view_media', 'view-album-media', '_bx_albums_page_title_sys_view_media', '_bx_albums_page_title_view_media', 'bx_albums', 10, 2147483647, 1, '', '', '', '', 0, 1, 0, 'BxAlbumsPageMedia', 'modules/boonex/albums/classes/BxAlbumsPageMedia.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_albums_view_media', 1, 'bx_albums', '', '_bx_albums_page_block_title_entry_view_media', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_albums\";s:6:\"method\";s:10:\"media_view\";}', 0, 0, 1, 0),
+('bx_albums_view_media', 2, 'bx_albums', '', '_bx_albums_page_block_title_entry_author', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_albums\";s:6:\"method\";s:12:\"media_author\";}', 0, 0, 1, 0),
+('bx_albums_view_media', 3, 'bx_albums', '', '_bx_albums_page_block_title_entry_social_sharing', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_albums\";s:6:\"method\";s:20:\"media_social_sharing\";}', 0, 0, 1, 0),
+('bx_albums_view_media', 4, 'bx_albums', '', '_bx_albums_page_block_title_entry_comments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_albums\";s:6:\"method\";s:14:\"media_comments\";}', 0, 0, 1, 0),
+('bx_albums_view_media', 4, 'bx_albums', '', '_bx_albums_page_block_title_entry_view_media_exif', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_albums\";s:6:\"method\";s:10:\"media_exif\";}', 0, 0, 1, 1);
+
+
+-- PAGE: view entry comments
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_albums_view_entry_comments', '_bx_albums_page_title_sys_view_entry_comments', '_bx_albums_page_title_view_entry_comments', 'bx_albums', 5, 2147483647, 1, 'view-album-comments', '', '', '', '', 0, 1, 0, 'BxAlbumsPageEntry', 'modules/boonex/albums/classes/BxAlbumsPageEntry.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_albums_view_entry_comments', 1, 'bx_albums', '_bx_albums_page_block_title_entry_comments', '_bx_albums_page_block_title_entry_comments_link', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_albums\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 1);
+
+
+-- PAGE: popular albums
+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_albums_popular', '_bx_albums_page_title_sys_entries_popular', '_bx_albums_page_title_entries_popular', 'bx_albums', 5, 2147483647, 1, 'albums-popular', 'page.php?i=albums-popular', '', '', '', 0, 1, 0, 'BxAlbumsPageBrowse', 'modules/boonex/albums/classes/BxAlbumsPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_albums_popular', 1, 'bx_albums', '_bx_albums_page_block_title_popular_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_albums";s:6:"method";s:14:"browse_popular";s:6:"params";a:3:{s:9:"unit_view";s:7:"gallery";s:13:"empty_message";b:1;s:13:"ajax_paginate";b:0;}}', 0, 1, 1);
+
+-- PAGE: popular media
+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_albums_popular_media', '_bx_albums_page_title_sys_entries_popular_media', '_bx_albums_page_title_entries_popular_media', 'bx_albums', 5, 2147483647, 1, 'albums-popular-media', 'page.php?i=albums-popular-media', '', '', '', 0, 1, 0, 'BxAlbumsPageBrowseMedia', 'modules/boonex/albums/classes/BxAlbumsPageBrowseMedia.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_albums_popular_media', 1, 'bx_albums', '_bx_albums_page_block_title_popular_media', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_albums";s:6:"method";s:20:"browse_popular_media";s:6:"params";a:3:{s:9:"unit_view";s:7:"gallery";s:13:"empty_message";b:1;s:13:"ajax_paginate";b:0;}}', 0, 1, 1);
+
+-- PAGE: entries of author
+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_albums_author', 'albums-author', '_bx_albums_page_title_sys_entries_of_author', '_bx_albums_page_title_entries_of_author', 'bx_albums', 5, 2147483647, 1, '', '', '', '', 0, 1, 0, 'BxAlbumsPageAuthor', 'modules/boonex/albums/classes/BxAlbumsPageAuthor.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_albums_author', 1, 'bx_albums', '', '_bx_albums_page_block_title_entries_actions', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_albums\";s:6:\"method\";s:18:\"my_entries_actions\";}', 0, 0, 1, 1),
+('bx_albums_author', 1, 'bx_albums', '_bx_albums_page_block_title_sys_favorites_of_author', '_bx_albums_page_block_title_favorites_of_author', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:9:\"bx_albums\";s:6:\"method\";s:15:\"browse_favorite\";s:6:"params";a:1:{i:0;s:12:"{profile_id}";}}', 0, 1, 1, 2),
+('bx_albums_author', 1, 'bx_albums', '_bx_albums_page_block_title_sys_favorites_of_author_media', '_bx_albums_page_block_title_favorites_of_author_media', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:9:\"bx_albums\";s:6:\"method\";s:21:\"browse_favorite_media\";s:6:"params";a:1:{i:0;s:12:"{profile_id}";}}', 0, 1, 1, 3),
+('bx_albums_author', 1, 'bx_albums', '_bx_albums_page_block_title_sys_entries_of_author', '_bx_albums_page_block_title_entries_of_author', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_albums\";s:6:\"method\";s:13:\"browse_author\";}', 0, 0, 1, 4);
+
+-- PAGE: module home
+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_albums_home', 'albums-home', '_bx_albums_page_title_sys_home', '_bx_albums_page_title_home', 'bx_albums', 2, 2147483647, 1, 'page.php?i=albums-home', '', '', '', 0, 1, 0, 'BxAlbumsPageBrowse', 'modules/boonex/albums/classes/BxAlbumsPageBrowse.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_albums_home', 1, 'bx_albums', '', '_bx_albums_page_block_title_featured_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_albums";s:6:"method";s:15:"browse_featured";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 1, 1, 0),
+('bx_albums_home', 1, 'bx_albums', '', '_bx_albums_page_block_title_featured_entries_view_gallery_media', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_albums";s:6:"method";s:21:"browse_featured_media";s:6:"params";a:1:{i:0;s:7:"gallery";}}', 0, 1, 1, 1),
+('bx_albums_home', 1, 'bx_albums', '', '_bx_albums_page_block_title_updated_entries', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:9:\"bx_albums\";s:6:\"method\";s:14:\"browse_updated\";s:6:\"params\";a:3:{s:9:\"unit_view\";s:8:\"extended\";s:13:\"empty_message\";b:1;s:13:\"ajax_paginate\";b:0;}}', 0, 1, 1, 2),
+('bx_albums_home', 2, 'bx_albums', '', '_bx_albums_page_block_title_popular_keywords_albums', 11, 2147483647, 'service', 'a:4:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:14:\"keywords_cloud\";s:6:\"params\";a:3:{i:0;s:9:\"bx_albums\";i:1;s:9:\"bx_albums\";i:2;a:1:{s:10:\"show_empty\";b:1;}}s:5:\"class\";s:20:\"TemplServiceMetatags\";}', 1, 0, 1, 0),
+('bx_albums_home', 2, 'bx_albums', '', '_bx_albums_page_block_title_popular_keywords_media', 11, 2147483647, 'service', 'a:4:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:14:\"keywords_cloud\";s:6:\"params\";a:2:{i:0;s:15:\"bx_albums_media\";i:1;s:15:\"bx_albums_media\";}s:5:\"class\";s:20:\"TemplServiceMetatags\";}', 1, 0, 1, 1),
+('bx_albums_home', 2, 'bx_albums', '', '_bx_albums_page_block_title_popular_keywords_media_camera', 11, 2147483647, 'service', 'a:4:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:14:\"keywords_cloud\";s:6:\"params\";a:2:{i:0;s:22:\"bx_albums_media_camera\";i:1;s:22:\"bx_albums_media_camera\";}s:5:\"class\";s:20:\"TemplServiceMetatags\";}', 1, 0, 1, 2);
+
+-- 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_albums_search', '_bx_albums_page_title_sys_entries_search', '_bx_albums_page_title_entries_search', 'bx_albums', 11, 2147483647, 1, 'albums-search', 'page.php?i=albums-search', '', '', '', 0, 1, 0, 'BxAlbumsPageBrowse', 'modules/boonex/albums/classes/BxAlbumsPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_albums_search', 2, 'bx_albums', '_bx_albums_page_block_title_search_form', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:8:"get_form";s:6:"params";a:1:{i:0;a:1:{s:6:"object";s:9:"bx_albums";}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 1, 1),
+('bx_albums_search', 1, 'bx_albums', '_bx_albums_page_block_title_search_results', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_results";s:6:"params";a:1:{i:0;a:2:{s:6:"object";s:9:"bx_albums";s:10:"show_empty";b:0;}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 1, 1),
+('bx_albums_search', 3, 'bx_albums', '_bx_albums_page_block_title_search_form_media', 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:15:"bx_albums_media";}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 1, 1),
+('bx_albums_search', 1, 'bx_albums', '_bx_albums_page_block_title_search_results_media', 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:15:"bx_albums_media";s:10:"show_empty";b:0;}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 1, 2),
+('bx_albums_search', 2, 'bx_albums', '_bx_albums_page_block_title_search_form_cmts', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:8:"get_form";s:6:"params";a:1:{i:0;a:1:{s:6:"object";s:14:"bx_albums_cmts";}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 0, 2),
+('bx_albums_search', 1, 'bx_albums', '_bx_albums_page_block_title_search_results_cmts', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_results";s:6:"params";a:1:{i:0;a:2:{s:6:"object";s:14:"bx_albums_cmts";s:10:"show_empty";b:0;}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 0, 3),
+('bx_albums_search', 3, 'bx_albums', '_bx_albums_page_block_title_search_form_media_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:20:"bx_albums_media_cmts";}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 0, 2),
+('bx_albums_search', 1, 'bx_albums', '_bx_albums_page_block_title_search_results_media_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:20:"bx_albums_media_cmts";s:10:"show_empty";b:0;}}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_albums_manage', '_bx_albums_page_title_sys_manage', '_bx_albums_page_title_manage', 'bx_albums', 5, 2147483647, 1, 'albums-manage', 'page.php?i=albums-manage', '', '', '', 0, 1, 0, 'BxAlbumsPageBrowse', 'modules/boonex/albums/classes/BxAlbumsPageBrowse.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_albums_manage', 1, 'bx_albums', '_bx_albums_page_block_title_system_manage', '_bx_albums_page_block_title_manage', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_albums\";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_albums_administration', '_bx_albums_page_title_sys_manage_administration', '_bx_albums_page_title_manage', 'bx_albums', 5, 192, 1, 'albums-administration', 'page.php?i=albums-administration', '', '', '', 0, 1, 0, 'BxAlbumsPageBrowse', 'modules/boonex/albums/classes/BxAlbumsPageBrowse.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_albums_administration', 1, 'bx_albums', '_bx_albums_page_block_title_system_manage_administration', '_bx_albums_page_block_title_manage', 11, 192, 'service', 'a:3:{s:6:\"module\";s:9:\"bx_albums\";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`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('sys_home', 1, 'bx_albums', '_bx_albums_page_block_title_recent_entries', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_albums\";s:6:\"method\";s:13:\"browse_public\";}', 1, 0, 0, IFNULL(@iBlockOrder, 0) + 1),
+('sys_home', 1, 'bx_albums', '_bx_albums_page_block_title_updated_entries', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_albums\";s:6:\"method\";s:14:\"browse_updated\";}', 1, 0, 0, IFNULL(@iBlockOrder, 0) + 2);
+
+-- PAGES: add page block to profiles modules (trigger* page objects are processed separately upon modules enable/disable)
+SET @iPBCellProfile = 3;
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('trigger_page_profile_view_entry', @iPBCellProfile, 'bx_albums', '_bx_albums_page_block_title_my_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_albums";s:6:"method";s:13:"browse_author";s:6:"params";a:2:{i:0;s:12:"{profile_id}";i:1;a:1:{s:8:"per_page";s:26:"bx_albums_per_page_profile";}}}', 0, 0, 0);
+
+-- 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_albums', '', '_bx_albums_page_block_title_recent_media', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_albums";s:6:"method";s:20:"browse_popular_media";s:6:"params";a:3:{s:9:"unit_view";s:7:"gallery";s:13:"empty_message";b:1;s:13:"ajax_paginate";b:1;}}', 0, 1, 1, @iBlockOrder + 1),
+('', 0, 'bx_albums', '', '_bx_albums_page_block_title_popular_keywords_albums', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:14:"keywords_cloud";s:6:"params";a:2:{i:0;s:9:"bx_albums";i:1;s:9:"bx_albums";}s:5:"class";s:20:"TemplServiceMetatags";}', 0, 1, 1, @iBlockOrder + 2),
+('', 0, 'bx_albums', '', '_bx_albums_page_block_title_popular_keywords_media', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:14:"keywords_cloud";s:6:"params";a:2:{i:0;s:15:"bx_albums_media";i:1;s:15:"bx_albums_media";}s:5:"class";s:20:"TemplServiceMetatags";}', 0, 1, 1, @iBlockOrder + 3),
+('', 0, 'bx_albums', '', '_bx_albums_page_block_title_popular_keywords_media_camera', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:14:"keywords_cloud";s:6:"params";a:2:{i:0;s:22:"bx_albums_media_camera";i:1;s:22:"bx_albums_media_camera";}s:5:"class";s:20:"TemplServiceMetatags";}', 0, 1, 1, @iBlockOrder + 4),
+('', 0, 'bx_albums', '', '_bx_albums_page_block_title_recent_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_albums";s:6:"method";s:13:"browse_public";s:6:"params";a:3:{s:9:"unit_view";s:8:"extended";s:13:"empty_message";b:1;s:13:"ajax_paginate";b:0;}}', 0, 1, 1, @iBlockOrder + 5);
+
+
+-- MENU: add to site menu
+
+SET @iSiteMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_site' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('sys_site', 'bx_albums', 'albums-home', '_bx_albums_menu_item_title_system_entries_home', '_bx_albums_menu_item_title_entries_home', 'page.php?i=albums-home', '', '', 'picture-o col-blue1', 'bx_albums_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_albums', 'albums-home', '_bx_albums_menu_item_title_system_entries_home', '_bx_albums_menu_item_title_entries_home', 'page.php?i=albums-home', '', '', 'picture-o col-blue1', 'bx_albums_submenu', 2147483647, 1, 1, IFNULL(@iHomepageMenuOrder, 0) + 1);
+
+-- MENU: add to "add content" menu
+
+SET @iAddMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_add_content_links' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('sys_add_content_links', 'bx_albums', 'create-album', '_bx_albums_menu_item_title_system_create_entry', '_bx_albums_menu_item_title_create_entry', 'page.php?i=create-album', '', '', 'picture-o col-blue1', '', 2147483647, 1, 1, IFNULL(@iAddMenuOrder, 0) + 1);
+
+
+-- MENU: actions menu for view entry 
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_albums_view', '_bx_albums_menu_title_view_entry', 'bx_albums_view', 'bx_albums', 9, 0, 1, 'BxAlbumsMenuView', 'modules/boonex/albums/classes/BxAlbumsMenuView.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_albums_view', 'bx_albums', '_bx_albums_menu_set_title_view_entry', 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_albums_view', 'bx_albums', 'add-images-to-album', '_bx_albums_menu_item_title_system_add_images', '_bx_albums_menu_item_title_add_images', 'page.php?i=add-images&id={content_id}', '', '', 'plus', '', 2147483647, 1, 0, 10),
+('bx_albums_view', 'bx_albums', 'edit-album', '_bx_albums_menu_item_title_system_edit_entry', '_bx_albums_menu_item_title_edit_entry', 'page.php?i=edit-album&id={content_id}', '', '', 'pencil', '', 2147483647, 1, 0, 20),
+('bx_albums_view', 'bx_albums', 'delete-album', '_bx_albums_menu_item_title_system_delete_entry', '_bx_albums_menu_item_title_delete_entry', 'page.php?i=delete-album&id={content_id}', '', '', 'remove', '', 2147483647, 1, 0, 30);
+
+-- MENU: actions menu for view media
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_albums_view_media', '_bx_albums_menu_title_view_media', 'bx_albums_view_media', 'bx_albums', 9, 0, 1, 'BxAlbumsMenuView', 'modules/boonex/albums/classes/BxAlbumsMenuView.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_albums_view_media', 'bx_albums', '_bx_albums_menu_set_title_view_media', 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_albums_view_media', 'bx_albums', 'add-images-to-album', '_bx_albums_menu_item_title_system_add_images', '_bx_albums_menu_item_title_add_images', 'page.php?i=add-images&id={content_id}', '', '', 'plus', '', 2147483647, 1, 0, 10),
+('bx_albums_view_media', 'bx_albums', 'edit-album', '_bx_albums_menu_item_title_system_edit_album', '_bx_albums_menu_item_title_edit_album', 'page.php?i=edit-album&id={content_id}', '', '', 'pencil', '', 2147483647, 1, 0, 20);
+
+-- MENU: actions menu for my entries
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_albums_my', '_bx_albums_menu_title_entries_my', 'bx_albums_my', 'bx_albums', 9, 0, 1, 'BxAlbumsMenu', 'modules/boonex/albums/classes/BxAlbumsMenu.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_albums_my', 'bx_albums', '_bx_albums_menu_set_title_entries_my', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('bx_albums_my', 'bx_albums', 'create-album', '_bx_albums_menu_item_title_system_create_entry', '_bx_albums_menu_item_title_create_entry', 'page.php?i=create-album', '', '', 'plus', '', 2147483647, 1, 0, 0);
+
+
+-- MENU: module sub-menu
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_albums_submenu', '_bx_albums_menu_title_submenu', 'bx_albums_submenu', 'bx_albums', 8, 0, 1, '', '');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_albums_submenu', 'bx_albums', '_bx_albums_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_albums_submenu', 'bx_albums', 'albums-home', '_bx_albums_menu_item_title_system_entries_recent', '_bx_albums_menu_item_title_entries_recent', 'page.php?i=albums-home', '', '', '', '', 2147483647, 1, 1, 1),
+('bx_albums_submenu', 'bx_albums', 'albums-popular', '_bx_albums_menu_item_title_system_entries_popular', '_bx_albums_menu_item_title_entries_popular', 'page.php?i=albums-popular', '', '', '', '', 2147483647, 1, 1, 2),
+('bx_albums_submenu', 'bx_albums', 'albums-popular-media', '_bx_albums_menu_item_title_system_entries_popular_media', '_bx_albums_menu_item_title_entries_popular_media', 'page.php?i=albums-popular-media', '', '', '', '', 2147483647, 1, 1, 3),
+('bx_albums_submenu', 'bx_albums', 'albums-search', '_bx_albums_menu_item_title_system_entries_search', '_bx_albums_menu_item_title_entries_search', 'page.php?i=albums-search', '', '', '', '', 2147483647, 1, 1, 4),
+('bx_albums_submenu', 'bx_albums', 'albums-manage', '_bx_albums_menu_item_title_system_entries_manage', '_bx_albums_menu_item_title_entries_manage', 'page.php?i=albums-manage', '', '', '', '', 2147483646, 1, 1, 5);
+
+-- MENU: sub-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_albums_view_submenu', '_bx_albums_menu_title_view_entry_submenu', 'bx_albums_view_submenu', 'bx_albums', 8, 0, 1, 'BxAlbumsMenuView', 'modules/boonex/albums/classes/BxAlbumsMenuView.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_albums_view_submenu', 'bx_albums', '_bx_albums_menu_set_title_view_entry_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_albums_view_submenu', 'bx_albums', 'view-album', '_bx_albums_menu_item_title_system_view_entry', '_bx_albums_menu_item_title_view_entry_submenu_entry', 'page.php?i=view-album&id={content_id}', '', '', '', '', 2147483647, 1, 0, 1),
+('bx_albums_view_submenu', 'bx_albums', 'view-album-comments', '_bx_albums_menu_item_title_system_view_entry_comments', '_bx_albums_menu_item_title_view_entry_submenu_comments', 'page.php?i=view-album-comments&id={content_id}', '', '', '', '', 2147483647, 1, 0, 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`, `active`, `copyable`, `order`) VALUES
+('sys_profile_stats', 'bx_albums', 'profile-stats-manage-albums', '_bx_albums_menu_item_title_system_manage_my_albums', '_bx_albums_menu_item_title_manage_my_albums', 'page.php?i=albums-manage', '', '_self', 'picture-o col-blue1', 'a:2:{s:6:"module";s:9:"bx_albums";s:6:"method";s:41:"get_menu_addon_manage_tools_profile_stats";}', '', 2147483646, 1, 0, @iNotifMenuOrder + 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_albums_menu_manage_tools', '_bx_albums_menu_title_manage_tools', 'bx_albums_menu_manage_tools', 'bx_albums', 6, 0, 1, 'BxAlbumsMenuManageTools', 'modules/boonex/albums/classes/BxAlbumsMenuManageTools.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_albums_menu_manage_tools', 'bx_albums', '_bx_albums_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_albums_menu_manage_tools', 'bx_albums', 'delete-with-content', '_bx_albums_menu_item_title_system_delete_with_content', '_bx_albums_menu_item_title_delete_with_content', 'javascript:void(0)', 'javascript:{js_object}.onClickDeleteWithContent({content_id});', '_self', 'trash-o', '', 128, 1, 0, 0);
+
+-- 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_albums', 'albums-administration', '_bx_albums_menu_item_title_system_admt_albums', '_bx_albums_menu_item_title_admt_albums', 'page.php?i=albums-administration', '', '_self', '', 'a:2:{s:6:"module";s:9:"bx_albums";s:6:"method";s:27:"get_menu_addon_manage_tools";}', '', 192, 1, 0, @iManageMenuOrder + 1);
+
+-- MENU: add menu item to profiles modules (trigger* menu sets are processed separately upon modules enable/disable)
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('trigger_profile_view_submenu', 'bx_albums', 'albums-author', '_bx_albums_menu_item_title_system_view_entries_author', '_bx_albums_menu_item_title_view_entries_author', 'page.php?i=albums-author&profile_id={profile_id}', '', '', 'picture-o col-blue1', '', 2147483647, 1, 0, 0);
+
+
+-- PRIVACY 
+
+INSERT INTO `sys_objects_privacy` (`object`, `module`, `action`, `title`, `default_group`, `table`, `table_field_id`, `table_field_author`, `override_class_name`, `override_class_file`) VALUES
+('bx_albums_allow_view_to', 'bx_albums', 'view', '_bx_albums_form_entry_input_allow_view_to', '3', 'bx_albums_albums', 'id', 'author', '', '');
+
+
+-- ACL
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_albums', 'create entry', NULL, '_bx_albums_acl_action_create_entry', '', 1, 3);
+SET @iIdActionEntryCreate = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_albums', 'delete entry', NULL, '_bx_albums_acl_action_delete_entry', '', 1, 3);
+SET @iIdActionEntryDelete = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_albums', 'view entry', NULL, '_bx_albums_acl_action_view_entry', '', 1, 0);
+SET @iIdActionEntryView = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_albums', 'set thumb', NULL, '_bx_albums_acl_action_set_thumb', '', 1, 3);
+SET @iIdActionSetThumb = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_albums', 'edit any entry', NULL, '_bx_albums_acl_action_edit_any_entry', '', 1, 3);
+SET @iIdActionEntryEditAny = 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
+
+-- entry create
+(@iStandard, @iIdActionEntryCreate),
+(@iModerator, @iIdActionEntryCreate),
+(@iAdministrator, @iIdActionEntryCreate),
+(@iPremium, @iIdActionEntryCreate),
+
+-- entry delete
+(@iStandard, @iIdActionEntryDelete),
+(@iModerator, @iIdActionEntryDelete),
+(@iAdministrator, @iIdActionEntryDelete),
+(@iPremium, @iIdActionEntryDelete),
+
+-- entry view
+(@iUnauthenticated, @iIdActionEntryView),
+(@iAccount, @iIdActionEntryView),
+(@iStandard, @iIdActionEntryView),
+(@iUnconfirmed, @iIdActionEntryView),
+(@iPending, @iIdActionEntryView),
+(@iModerator, @iIdActionEntryView),
+(@iAdministrator, @iIdActionEntryView),
+(@iPremium, @iIdActionEntryView),
+
+-- set entry thumb
+(@iStandard, @iIdActionSetThumb),
+(@iModerator, @iIdActionSetThumb),
+(@iAdministrator, @iIdActionSetThumb),
+(@iPremium, @iIdActionSetThumb),
+
+-- edit any entry
+(@iModerator, @iIdActionEntryEditAny),
+(@iAdministrator, @iIdActionEntryEditAny);
+
+
+-- SEARCH
+SET @iSearchOrder = (SELECT IFNULL(MAX(`Order`), 0) FROM `sys_objects_search`);
+INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `Order`, `GlobalSearch`, `ClassName`, `ClassPath`) VALUES
+('bx_albums', '_bx_albums', @iSearchOrder + 1, 1, 'BxAlbumsSearchResult', 'modules/boonex/albums/classes/BxAlbumsSearchResult.php'),
+('bx_albums_cmts', '_bx_albums_cmts', @iSearchOrder + 2, 1, 'BxAlbumsCmtsSearchResult', 'modules/boonex/albums/classes/BxAlbumsCmtsSearchResult.php'),
+('bx_albums_media', '_bx_albums_media', @iSearchOrder + 3, 1, 'BxAlbumsSearchResultMedia', 'modules/boonex/albums/classes/BxAlbumsSearchResultMedia.php'),
+('bx_albums_media_cmts', '_bx_albums_media_cmts', @iSearchOrder + 4, 1, 'BxAlbumsCmtsSearchResultMedia', 'modules/boonex/albums/classes/BxAlbumsCmtsSearchResultMedia.php'),
+('bx_albums_media_camera', '_bx_albums_media', @iSearchOrder + 5, 0, 'BxAlbumsSearchResultMediaCamera', 'modules/boonex/albums/classes/BxAlbumsSearchResultMediaCamera.php');
+
+-- SEARCH EXTENDED
+INSERT INTO `sys_objects_search_extended` (`object`, `object_content_info`, `module`, `title`, `active`, `class_name`, `class_file`) VALUES
+('bx_albums', 'bx_albums', 'bx_albums', '_bx_albums_search_extended', 1, '', ''),
+('bx_albums_media', 'bx_albums_media', 'bx_albums', '_bx_albums_search_extended_media', 1, '', ''),
+('bx_albums_cmts', 'bx_albums_cmts', 'bx_albums', '_bx_albums_search_extended_cmts', 1, 'BxTemplSearchExtendedCmts', ''),
+('bx_albums_media_cmts', 'bx_albums_media_cmts', 'bx_albums', '_bx_albums_search_extended_media_cmts', 1, 'BxTemplSearchExtendedCmts', '');
+
+-- METATAGS
+INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_albums', 'bx_albums_meta_keywords', 'bx_albums_meta_locations', '', '', ''),
+('bx_albums_media', 'bx_albums_meta_keywords_media', '', '', '', ''),
+('bx_albums_media_camera', 'bx_albums_meta_keywords_media_camera', '', '', '', '');
+
+-- 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_albums', '_bx_albums', 'bx_albums', 'added', 'edited', 'deleted', '', ''),
+('bx_albums_media', '_bx_albums_media', 'bx_albums', 'media_added', '', 'media_deleted', 'BxAlbumsContentInfoMedia', 'modules/boonex/albums/classes/BxAlbumsContentInfoMedia.php'),
+('bx_albums_cmts', '_bx_albums_cmts', 'bx_albums', 'commentPost', 'commentUpdated', 'commentRemoved', 'BxDolContentInfoCmts', ''),
+('bx_albums_media_cmts', '_bx_albums_media_cmts', 'bx_albums_media', 'commentPost', 'commentUpdated', 'commentRemoved', 'BxDolContentInfoCmts', '');
+
+INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`, `condition`, `selection`) VALUES
+('bx_albums', 'bx_albums_administration', 'id', '', ''),
+('bx_albums', 'bx_albums_common', 'id', '', '');
+
+-- STATS
+SET @iMaxOrderStats = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_statistics`);
+INSERT INTO `sys_statistics` (`module`, `name`, `title`, `link`, `icon`, `query`, `order`) VALUES 
+('bx_albums', 'bx_albums', '_bx_albums', 'page.php?i=albums-home', 'picture-o col-blue1', 'SELECT COUNT(*) FROM `bx_albums_albums` WHERE 1 AND `status` = ''active'' AND `status_admin` = ''active''', @iMaxOrderStats + 1),
+('bx_albums', 'bx_albums_media', '_bx_albums_media', '', 'picture-o col-blue1', 'SELECT COUNT(*) FROM `bx_albums_files` WHERE 1', @iMaxOrderStats + 2);
+
+-- 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_albums_growth', '_bx_albums_chart_growth', 'bx_albums_albums', 'added', '', 'status,status_admin', '', 1, @iMaxOrderCharts + 1, 'BxDolChartGrowth', ''),
+('bx_albums_growth_speed', '_bx_albums_chart_growth_speed', 'bx_albums_albums', 'added', '', 'status,status_admin', '', 1, @iMaxOrderCharts + 2, 'BxDolChartGrowthSpeed', ''),
+('bx_albums_growth_media', '_bx_albums_chart_growth_media', 'bx_albums_files', 'added', '', '', '', 1, @iMaxOrderCharts + 3, 'BxDolChartGrowth', ''),
+('bx_albums_growth_speed_media', '_bx_albums_chart_growth_speed_media', 'bx_albums_files', 'added', '', '', '', 1, @iMaxOrderCharts + 4, 'BxDolChartGrowthSpeed', '');
+
+-- GRIDS: moderation tools
+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_albums_administration', 'Sql', 'SELECT * FROM `bx_albums_albums` WHERE 1 ', 'bx_albums_albums', 'id', 'added', 'status_admin', '', 20, NULL, 'start', '', 'title,text', '', 'like', '', '', 192, 'BxAlbumsGridAdministration', 'modules/boonex/albums/classes/BxAlbumsGridAdministration.php'),
+('bx_albums_common', 'Sql', 'SELECT * FROM `bx_albums_albums` WHERE 1 ', 'bx_albums_albums', 'id', 'added', 'status', '', 20, NULL, 'start', '', 'title,text', '', 'like', '', '', 2147483647, 'BxAlbumsGridCommon', 'modules/boonex/albums/classes/BxAlbumsGridCommon.php');
+
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('bx_albums_administration', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
+('bx_albums_administration', 'switcher', '_bx_albums_grid_column_title_adm_active', '8%', 0, '', '', 2),
+('bx_albums_administration', 'title', '_bx_albums_grid_column_title_adm_title', '25%', 0, '', '', 3),
+('bx_albums_administration', 'added', '_bx_albums_grid_column_title_adm_added', '20%', 1, '25', '', 4),
+('bx_albums_administration', 'author', '_bx_albums_grid_column_title_adm_author', '25%', 0, '25', '', 5),
+('bx_albums_administration', 'actions', '', '20%', 0, '', '', 6),
+('bx_albums_common', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
+('bx_albums_common', 'switcher', '', '8%', 0, '', '', 2),
+('bx_albums_common', 'title', '_bx_albums_grid_column_title_adm_title', '40%', 0, '', '', 3),
+('bx_albums_common', 'added', '_bx_albums_grid_column_title_adm_added', '30%', 1, '25', '', 4),
+('bx_albums_common', 'actions', '', '20%', 0, '', '', 5);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon_only`, `confirm`, `order`) VALUES
+('bx_albums_administration', 'bulk', 'delete', '_bx_albums_grid_action_title_adm_delete', '', 0, 1, 1),
+('bx_albums_administration', 'single', 'edit', '_bx_albums_grid_action_title_adm_edit', 'pencil', 1, 0, 1),
+('bx_albums_administration', 'single', 'delete', '_bx_albums_grid_action_title_adm_delete', 'remove', 1, 1, 2),
+('bx_albums_administration', 'single', 'settings', '_bx_albums_grid_action_title_adm_more_actions', 'cog', 1, 0, 3),
+('bx_albums_common', 'bulk', 'delete', '_bx_albums_grid_action_title_adm_delete', '', 0, 1, 1),
+('bx_albums_common', 'single', 'edit', '_bx_albums_grid_action_title_adm_edit', 'pencil', 1, 0, 1),
+('bx_albums_common', 'single', 'delete', '_bx_albums_grid_action_title_adm_delete', 'remove', 1, 1, 2),
+('bx_albums_common', 'single', 'settings', '_bx_albums_grid_action_title_adm_more_actions', 'cog', 1, 0, 3);
+
+-- UPLOADERS
+INSERT INTO `sys_objects_uploader` (`object`, `active`, `override_class_name`, `override_class_file`) VALUES
+('bx_albums_simple', 1, 'BxAlbumsUploaderSimple', 'modules/boonex/albums/classes/BxAlbumsUploaderSimple.php'),
+('bx_albums_html5', 1, 'BxAlbumsUploaderHTML5', 'modules/boonex/albums/classes/BxAlbumsUploaderHTML5.php'),
+('bx_albums_crop', 1, 'BxAlbumsUploaderCrop', 'modules/boonex/albums/classes/BxAlbumsUploaderCrop.php');
+
+-- ALERTS
+INSERT INTO `sys_alerts_handlers` (`name`, `class`, `file`, `service_call`) VALUES 
+('bx_albums', 'BxAlbumsAlertsResponse', 'modules/boonex/albums/classes/BxAlbumsAlertsResponse.php', '');
+SET @iHandler := LAST_INSERT_ID();
+
+INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
+('system', 'save_setting', @iHandler),
+('bx_albums_files', 'file_deleted', @iHandler),
+('profile', 'delete', @iHandler);

+ 389 - 0
modules/boonex/albums/updates/9.0.3_9.0.4/source/install/sql/install.sql

@@ -0,0 +1,389 @@
+
+SET @sStorageEngine = (SELECT `value` FROM `sys_options` WHERE `name` = 'sys_storage_default');
+
+-- TABLE: entries
+
+CREATE TABLE IF NOT EXISTS `bx_albums_albums` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `author` int(10) unsigned NOT NULL,
+  `added` int(11) NOT NULL,
+  `changed` int(11) NOT NULL,
+  `thumb` int(11) NOT NULL,
+  `title` varchar(255) NOT NULL,
+  `text` text NOT NULL,
+  `views` int(11) NOT NULL default '0',
+  `rate` float NOT NULL default '0',
+  `votes` 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` int(11) NOT NULL DEFAULT '3',
+  `status` enum('active','hidden') NOT NULL DEFAULT 'active',
+  `status_admin` enum('active','hidden') NOT NULL DEFAULT 'active',
+  PRIMARY KEY (`id`),
+  FULLTEXT KEY `title_text` (`title`,`text`)
+);
+
+-- TABLE: storages & transcoders
+
+CREATE TABLE IF NOT EXISTS `bx_albums_files` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `profile_id` int(10) unsigned NOT NULL,
+  `remote_id` varchar(128) NOT NULL,
+  `path` varchar(255) NOT NULL,
+  `file_name` varchar(255) NOT NULL,
+  `mime_type` varchar(128) NOT NULL,
+  `ext` varchar(32) NOT NULL,
+  `size` int(11) NOT NULL,
+  `added` int(11) NOT NULL,
+  `modified` int(11) NOT NULL,
+  `private` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `remote_id` (`remote_id`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_albums_photos_resized` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `profile_id` int(10) unsigned NOT NULL,
+  `remote_id` varchar(128) NOT NULL,
+  `path` varchar(255) NOT NULL,
+  `file_name` varchar(255) NOT NULL,
+  `mime_type` varchar(128) NOT NULL,
+  `ext` varchar(32) NOT NULL,
+  `size` int(11) NOT NULL,
+  `added` int(11) NOT NULL,
+  `modified` int(11) NOT NULL,
+  `private` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `remote_id` (`remote_id`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_albums_files2albums` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `content_id` int(10) unsigned NOT NULL,
+  `file_id` int(11) NOT NULL,
+  `author` int(10) unsigned NOT NULL,
+  `title` varchar(255) NOT NULL,
+  `views` int(11) NOT NULL,
+  `rate` float NOT NULL,
+  `votes` int(11) NOT NULL,
+  `favorites` int(11) NOT NULL default '0',
+  `comments` int(11) NOT NULL,
+  `featured` int(11) NOT NULL default '0',
+  `data` text NOT NULL,
+  `exif` text NOT NULL,
+  `order` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `file_content` (`file_id`,`content_id`),
+  KEY `content_id` (`content_id`),
+  FULLTEXT KEY `search_fields` (`title`)
+);
+
+-- TABLE: comments
+CREATE TABLE IF NOT EXISTS `bx_albums_cmts` (
+  `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
+  `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_object_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_author_id` int(10) unsigned NOT NULL DEFAULT '0',
+  `cmt_level` int(11) NOT NULL DEFAULT '0',
+  `cmt_text` text NOT NULL,
+  `cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
+  `cmt_rate` int(11) NOT NULL DEFAULT '0',
+  `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
+  `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
+  `cmt_replies` int(11) NOT NULL DEFAULT '0',
+  PRIMARY KEY (`cmt_id`),
+  KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
+  FULLTEXT KEY `search_fields` (`cmt_text`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_albums_cmts_media` (
+  `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
+  `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_object_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_author_id` int(10) unsigned NOT NULL DEFAULT '0',
+  `cmt_level` int(11) NOT NULL DEFAULT '0',
+  `cmt_text` text NOT NULL,
+  `cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
+  `cmt_rate` int(11) NOT NULL DEFAULT '0',
+  `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
+  `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
+  `cmt_replies` int(11) NOT NULL DEFAULT '0',
+  PRIMARY KEY (`cmt_id`),
+  KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
+  FULLTEXT KEY `search_fields` (`cmt_text`)
+);
+
+-- TABLE: votes
+
+CREATE TABLE IF NOT EXISTS `bx_albums_votes` (
+  `object_id` int(11) NOT NULL default '0',
+  `count` int(11) NOT NULL default '0',
+  `sum` int(11) NOT NULL default '0',
+  UNIQUE KEY `object_id` (`object_id`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `bx_albums_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`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `bx_albums_votes_media` (
+  `object_id` int(11) NOT NULL default '0',
+  `count` int(11) NOT NULL default '0',
+  `sum` int(11) NOT NULL default '0',
+  UNIQUE KEY `object_id` (`object_id`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `bx_albums_votes_media_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`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+-- TABLE: views
+
+CREATE TABLE `bx_albums_views_track` (
+  `object_id` int(11) NOT NULL default '0',
+  `viewer_id` int(11) NOT NULL default '0',
+  `viewer_nip` int(11) unsigned NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE `bx_albums_views_media_track` (
+  `object_id` int(11) NOT NULL default '0',
+  `viewer_id` int(11) NOT NULL default '0',
+  `viewer_nip` int(11) unsigned NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- TABLE: metas
+
+CREATE TABLE `bx_albums_meta_keywords` (
+  `object_id` int(10) unsigned NOT NULL,
+  `keyword` varchar(255) NOT NULL,
+  KEY `object_id` (`object_id`),
+  KEY `keyword` (`keyword`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE `bx_albums_meta_keywords_media` (
+  `object_id` int(10) unsigned NOT NULL,
+  `keyword` varchar(255) NOT NULL,
+  KEY `object_id` (`object_id`),
+  KEY `keyword` (`keyword`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE `bx_albums_meta_keywords_media_camera` (
+  `object_id` int(10) unsigned NOT NULL,
+  `keyword` varchar(255) NOT NULL,
+  KEY `object_id` (`object_id`),
+  KEY `keyword` (`keyword`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE `bx_albums_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))
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- TABLE: reports
+CREATE TABLE IF NOT EXISTS `bx_albums_reports` (
+  `object_id` int(11) NOT NULL default '0',
+  `count` int(11) NOT NULL default '0',
+  UNIQUE KEY `object_id` (`object_id`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `bx_albums_reports_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `author_nip` int(11) unsigned NOT NULL default '0',
+  `type` varchar(32) NOT NULL default '',
+  `text` text NOT NULL default '',
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `report` (`object_id`, `author_nip`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+-- TABLE: favorites
+CREATE TABLE `bx_albums_favorites_track` (
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  KEY `id` (`object_id`,`author_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE `bx_albums_favorites_media_track` (
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  KEY `id` (`object_id`,`author_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+
+-- 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_albums_files', @sStorageEngine, '', 360, 2592000, 3, 'bx_albums_files', 'allow-deny', 'jpg,jpeg,jpe,gif,png,avi,flv,mpg,mpeg,wmv,mp4,m4v,mov,qt,divx,xvid,3gp,3g2,webm,mkv,ogv,ogg,rm,rmvb,asf,drc', '', 0, 0, 0, 0, 0, 0),
+('bx_albums_photos_resized', @sStorageEngine, '', 360, 2592000, 3, 'bx_albums_photos_resized', 'allow-deny', 'jpg,jpeg,jpe,gif,png,avi,flv,mpg,mpeg,wmv,mp4,m4v,mov,qt,divx,xvid,3gp,3g2,webm,mkv,ogv,ogg,rm,rmvb,asf,drc', '', 0, 0, 0, 0, 0, 0);
+
+INSERT INTO `sys_objects_transcoder` (`object`, `storage_object`, `source_type`, `source_params`, `private`, `atime_tracking`, `atime_pruning`, `ts`, `override_class_name`, `override_class_file`) VALUES
+('bx_albums_preview', 'bx_albums_photos_resized', 'Storage', 'a:1:{s:6:"object";s:15:"bx_albums_files";}', 'no', '1', '2592000', '0', '', ''),
+('bx_albums_browse', 'bx_albums_photos_resized', 'Storage', 'a:1:{s:6:"object";s:15:"bx_albums_files";}', 'no', '1', '2592000', '0', '', ''),
+('bx_albums_big', 'bx_albums_photos_resized', 'Storage', 'a:1:{s:6:"object";s:15:"bx_albums_files";}', 'no', '1', '2592000', '0', '', ''),
+('bx_albums_video_poster_browse', 'bx_albums_photos_resized', 'Storage', 'a:1:{s:6:"object";s:15:"bx_albums_files";}', 'no', 0, 0, 0, 'BxDolTranscoderVideo', ''),
+('bx_albums_video_poster_preview', 'bx_albums_photos_resized', 'Storage', 'a:1:{s:6:"object";s:15:"bx_albums_files";}', 'no', 0, 0, 0, 'BxDolTranscoderVideo', ''),
+('bx_albums_video_poster_big', 'bx_albums_photos_resized', 'Storage', 'a:1:{s:6:"object";s:15:"bx_albums_files";}', 'no', 0, 0, 0, 'BxDolTranscoderVideo', ''),
+('bx_albums_video_mp4', 'bx_albums_photos_resized', 'Storage', 'a:1:{s:6:"object";s:15:"bx_albums_files";}', 'no', 0, 0, 0, 'BxDolTranscoderVideo', ''),
+('bx_albums_video_webm', 'bx_albums_photos_resized', 'Storage', 'a:1:{s:6:"object";s:15:"bx_albums_files";}', 'no', 0, 0, 0, 'BxDolTranscoderVideo', ''),
+('bx_albums_proxy_preview', 'bx_albums_photos_resized', 'Proxy', 'a:4:{s:6:"object";s:15:"bx_albums_files";s:5:"image";s:17:"bx_albums_preview";s:12:"video_poster";s:30:"bx_albums_video_poster_preview";s:5:"video";a:4:{i:0;s:19:"bx_albums_video_mp4";i:1;s:20:"bx_albums_video_webm";i:2;s:29:"bx_albums_video_poster_browse";i:3;s:26:"bx_albums_video_poster_big";}}', 'no', 0, 0, 0, 'BxDolTranscoderProxy', ''),
+('bx_albums_proxy_browse', 'bx_albums_photos_resized', 'Proxy', 'a:4:{s:6:"object";s:15:"bx_albums_files";s:5:"image";s:16:"bx_albums_browse";s:12:"video_poster";s:29:"bx_albums_video_poster_browse";s:5:"video";a:2:{i:0;s:19:"bx_albums_video_mp4";i:1;s:20:"bx_albums_video_webm";}}', 'no', 0, 0, 0, 'BxDolTranscoderProxy', ''),
+('bx_albums_proxy_cover', 'bx_albums_photos_resized', 'Proxy', 'a:4:{s:6:"object";s:15:"bx_albums_files";s:5:"image";s:13:"bx_albums_big";s:12:"video_poster";s:26:"bx_albums_video_poster_big";s:5:"video";a:2:{i:0;s:19:"bx_albums_video_mp4";i:1;s:20:"bx_albums_video_webm";}}', 'no', 0, 0, 0, 'BxDolTranscoderProxy', '');
+
+INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES 
+('bx_albums_preview', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"300";s:13:"square_resize";s:1:"1";}', '0'),
+('bx_albums_browse', 'Resize', 'a:1:{s:1:"h";s:3:"180";}', '0'),
+('bx_albums_big', 'Resize', 'a:2:{s:1:"w";s:4:"1280";s:1:"h";s:4:"1280";}', '0'),
+('bx_albums_video_poster_browse', 'Poster', 'a:2:{s:1:"h";s:3:"180";s:10:"force_type";s:3:"jpg";}', 0),
+('bx_albums_video_poster_preview', 'Poster', 'a:2:{s:1:"h";s:3:"480";s:10:"force_type";s:3:"jpg";}', 0),
+('bx_albums_video_poster_preview', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"300";s:13:"square_resize";s:1:"1";}', 10),
+('bx_albums_video_poster_big', 'Poster', 'a:2:{s:1:"h";s:3:"480";s:10:"force_type";s:3:"jpg";}', 0),
+('bx_albums_video_mp4', 'Mp4', 'a:2:{s:1:"h";s:3:"480";s:10:"force_type";s:3:"mp4";}', 0),
+('bx_albums_video_webm', 'Webm', 'a:2:{s:1:"h";s:3:"480";s:10:"force_type";s:4:"webm";}', 0);
+
+
+
+-- FORMS
+
+INSERT INTO `sys_objects_form`(`object`, `module`, `title`, `action`, `form_attrs`, `table`, `key`, `uri`, `uri_title`, `submit_name`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_albums', 'bx_albums', '_bx_albums_form_entry', '', 'a:1:{s:7:\"enctype\";s:19:\"multipart/form-data\";}', 'bx_albums_albums', 'id', '', '', 'do_submit', '', 0, 1, 'BxAlbumsFormEntry', 'modules/boonex/albums/classes/BxAlbumsFormEntry.php');
+
+INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES 
+('bx_albums', 'bx_albums_entry_add', 'bx_albums', 0, '_bx_albums_form_entry_display_add'),
+('bx_albums', 'bx_albums_entry_edit', 'bx_albums', 0, '_bx_albums_form_entry_display_edit'),
+('bx_albums', 'bx_albums_entry_add_images', 'bx_albums', 0, '_bx_albums_form_entry_display_add_images'),
+('bx_albums', 'bx_albums_entry_delete', 'bx_albums', 0, '_bx_albums_form_entry_display_delete'),
+('bx_albums', 'bx_albums_entry_view', 'bx_albums', 1, '_bx_albums_form_entry_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`) VALUES 
+('bx_albums', 'bx_albums', 'delete_confirm', 1, '', 0, 'checkbox', '_bx_albums_form_entry_input_sys_delete_confirm', '_bx_albums_form_entry_input_delete_confirm', '_bx_albums_form_entry_input_delete_confirm_info', 1, 0, 0, '', '', '', 'Avail', '', '_bx_albums_form_entry_input_delete_confirm_error', '', '', 1, 0),
+('bx_albums', 'bx_albums', 'do_submit', '_bx_albums_form_entry_input_do_submit', '', 0, 'submit', '_bx_albums_form_entry_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_albums', 'bx_albums', 'title', '', '', 0, 'text', '_bx_albums_form_entry_input_sys_title', '_bx_albums_form_entry_input_title', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_albums_form_entry_input_title_err', 'Xss', '', 1, 0),
+('bx_albums', 'bx_albums', 'text', '', '', 0, 'textarea', '_bx_albums_form_entry_input_sys_text', '_bx_albums_form_entry_input_text', '', 0, 0, 2, '', '', '', '', '', '', 'XssHtml', '', 1, 0),
+('bx_albums', 'bx_albums', 'pictures', 'a:2:{i:0;s:15:"bx_albums_html5";i:1;s:14:"bx_albums_crop";}', 'a:3:{s:16:"bx_albums_simple";s:26:"_sys_uploader_simple_title";s:15:"bx_albums_html5";s:25:"_sys_uploader_html5_title";s:14:"bx_albums_crop";s:24:"_sys_uploader_crop_title";}', 0, 'files', '_bx_albums_form_entry_input_sys_pictures', '_bx_albums_form_entry_input_pictures', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_albums', 'bx_albums', 'allow_view_to', '', '', 0, 'custom', '_bx_albums_form_entry_input_sys_allow_view_to', '_bx_albums_form_entry_input_allow_view_to', '', 1, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_albums', 'bx_albums', 'location', '', '', 0, 'location', '_sys_form_input_sys_location', '_sys_form_input_location', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_albums', 'bx_albums', 'added', '', '', 0, 'datetime', '_bx_albums_form_entry_input_sys_date_added', '_bx_albums_form_entry_input_date_added', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_albums', 'bx_albums', 'changed', '', '', 0, 'datetime', '_bx_albums_form_entry_input_sys_date_changed', '_bx_albums_form_entry_input_date_changed', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0);
+
+
+INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
+('bx_albums_entry_add', 'delete_confirm', 2147483647, 0, 1),
+('bx_albums_entry_add', 'title', 2147483647, 1, 2),
+('bx_albums_entry_add', 'text', 2147483647, 1, 3),
+('bx_albums_entry_add', 'pictures', 2147483647, 1, 4),
+('bx_albums_entry_add', 'allow_view_to', 2147483647, 1, 5),
+('bx_albums_entry_add', 'location', 2147483647, 1, 6),
+('bx_albums_entry_add', 'do_submit', 2147483647, 1, 7),
+
+('bx_albums_entry_edit', 'delete_confirm', 2147483647, 0, 1),
+('bx_albums_entry_edit', 'title', 2147483647, 1, 2),
+('bx_albums_entry_edit', 'text', 2147483647, 1, 3),
+('bx_albums_entry_edit', 'pictures', 2147483647, 0, 4),
+('bx_albums_entry_edit', 'allow_view_to', 2147483647, 1, 5),
+('bx_albums_entry_edit', 'location', 2147483647, 1, 6),
+('bx_albums_entry_edit', 'do_submit', 2147483647, 1, 7),
+
+('bx_albums_entry_add_images', 'delete_confirm', 2147483647, 0, 1),
+('bx_albums_entry_add_images', 'title', 2147483647, 0, 2),
+('bx_albums_entry_add_images', 'text', 2147483647, 0, 3),
+('bx_albums_entry_add_images', 'allow_view_to', 2147483647, 0, 4),
+('bx_albums_entry_add_images', 'location', 2147483647, 0, 5),
+('bx_albums_entry_add_images', 'pictures', 2147483647, 1, 6),
+('bx_albums_entry_add_images', 'do_submit', 2147483647, 1, 7),
+
+('bx_albums_entry_view', 'delete_confirm', 2147483647, 0, 0),
+('bx_albums_entry_view', 'allow_view_to', 2147483647, 0, 0),
+('bx_albums_entry_view', 'do_submit', 2147483647, 0, 0),
+('bx_albums_entry_view', 'text', 2147483647, 0, 0),
+('bx_albums_entry_view', 'title', 2147483647, 0, 0),
+('bx_albums_entry_view', 'pictures', 2147483647, 0, 0),
+('bx_albums_entry_view', 'added', 2147483647, 1, 1),
+('bx_albums_entry_view', 'changed', 2147483647, 1, 2),
+
+('bx_albums_entry_delete', 'delete_confirm', 2147483647, 1, 1),
+('bx_albums_entry_delete', 'do_submit', 2147483647, 1, 2),
+('bx_albums_entry_delete', 'allow_view_to', 2147483647, 0, 0),
+('bx_albums_entry_delete', 'pictures', 2147483647, 0, 0),
+('bx_albums_entry_delete', 'text', 2147483647, 0, 0),
+('bx_albums_entry_delete', 'title', 2147483647, 0, 0);
+
+-- COMMENTS
+
+INSERT INTO `sys_objects_cmts` (`Name`, `Module`, `Table`, `CharsPostMin`, `CharsPostMax`, `CharsDisplayMax`, `Nl2br`, `PerView`, `PerViewReplies`, `BrowseType`, `IsBrowseSwitch`, `PostFormPosition`, `NumberOfLevels`, `IsDisplaySwitch`, `IsRatable`, `ViewingThreshold`, `IsOn`, `RootStylePrefix`, `BaseUrl`, `ObjectVote`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldTitle`, `TriggerFieldComments`, `ClassName`, `ClassFile`) VALUES
+('bx_albums', 'bx_albums', 'bx_albums_cmts', 1, 5000, 1000, 1, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-album&id={object_id}', '', 'bx_albums_albums', 'id', 'author', 'title', 'comments', '', ''),
+('bx_albums_media', 'bx_albums', 'bx_albums_cmts_media', 1, 5000, 1000, 1, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-album-media&id={object_id}', '', 'bx_albums_files2albums', 'id', 'author', 'title', 'comments', '', '');
+
+-- VOTES
+
+INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES 
+('bx_albums', 'bx_albums_votes', 'bx_albums_votes_track', '604800', '1', '1', '0', '1', 'bx_albums_albums', 'id', 'author', 'rate', 'votes', '', ''),
+('bx_albums_media', 'bx_albums_votes_media', 'bx_albums_votes_media_track', '604800', '1', '1', '0', '1', 'bx_albums_files2albums', 'id', 'author', 'rate', 'votes', '', '');
+
+-- REPORTS
+
+INSERT INTO `sys_objects_report` (`name`, `table_main`, `table_track`, `is_on`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_albums', 'bx_albums_reports', 'bx_albums_reports_track', '1', 'page.php?i=view-album&id={object_id}', 'bx_albums_albums', 'id', 'author', 'reports', '', '');
+
+-- VIEWS
+
+INSERT INTO `sys_objects_view` (`name`, `table_track`, `period`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_albums', 'bx_albums_views_track', '86400', '1', 'bx_albums_albums', 'id', '', 'views', '', ''),
+('bx_albums_media', 'bx_albums_views_media_track', '86400', '1', 'bx_albums_files2albums', 'id', 'author', 'views', '', '');
+
+-- 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_albums', 'bx_albums_favorites_track', '1', '1', '1', 'page.php?i=view-album&id={object_id}', 'bx_albums_albums', 'id', 'author', 'favorites', '', ''),
+('bx_albums_media', 'bx_albums_favorites_media_track', '1', '1', '1', 'page.php?i=view-album-media&id={object_id}', 'bx_albums_files2albums', 'id', '', 'favorites', '', '');
+
+-- FEATURED
+INSERT INTO `sys_objects_feature` (`name`, `is_on`, `is_undo`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_flag`, `class_name`, `class_file`) VALUES 
+('bx_albums', '1', '1', 'page.php?i=view-album&id={object_id}', 'bx_albums_albums', 'id', 'author', 'featured', '', ''),
+('bx_albums_media', '1', '1', 'page.php?i=view-album-media&id={object_id}', 'bx_albums_files2albums', 'id', '', 'featured', '', '');
+
+
+-- STUDIO: page & widget
+INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
+(3, 'bx_albums', '_bx_albums', '_bx_albums', 'bx_albums@modules/boonex/albums/|std-icon.svg');
+SET @iPageId = LAST_INSERT_ID();
+
+SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
+SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
+INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
+(@iPageId, 'bx_albums', '{url_studio}module.php?name=bx_albums', '', 'bx_albums@modules/boonex/albums/|std-icon.svg', '_bx_albums', '', '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/albums/updates/9.0.3_9.0.4/source/js/manage_tools.js

@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Albums Albums
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+function BxAlbumsManageTools(oOptions) {
+	this._iSearchTimeoutId = false;
+	this._sActionsUrl = oOptions.sActionUrl;
+	this._sObjNameGrid = oOptions.sObjNameGrid;
+    this._sObjName = oOptions.sObjName == undefined ? 'oBxAlbumsManageTools' : 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;
+}
+
+BxAlbumsManageTools.prototype.onChangeFilter = function(oFilter) {
+	var $this = this;
+	var oFilter1 = $('#bx-grid-filter1-' + this._sObjNameGrid);
+	var sValueFilter1 = oFilter1.length > 0 ? oFilter1.val() : '';
+
+	var oSearch = $('#bx-grid-search-' + this._sObjNameGrid);
+	var sValueSearch = oSearch.length > 0 ? oSearch.val() : '';
+	if(sValueSearch == _t('_sys_grid_search'))
+		sValueSearch = '';
+
+	clearTimeout($this._iSearchTimeoutId);
+    $this._iSearchTimeoutId = setTimeout(function () {
+        glGrids[$this._sObjNameGrid].setFilter(sValueFilter1 + $this._sParamsDivider + sValueSearch, true);
+    }, 500);
+};
+
+BxAlbumsManageTools.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')
+	});
+};
+
+BxAlbumsManageTools.prototype.onClickDelete = function(iContentId) {
+	$('.bx-popup-applied:visible').dolPopupHide();
+
+	glGrids[this._sObjNameGrid].actionWithId(iContentId, 'delete', {}, '', false, 1);
+};
+
+/** @} */

+ 16 - 0
modules/boonex/albums/updates/9.0.3_9.0.4/source/template/unit.html

@@ -0,0 +1,16 @@
+<div class="bx-base-text-unit bx-base-text-unit-ext bx-def-box bx-def-round-corners bx-def-color-bg-box bx-def-margin-bottom">
+	<div class="bx-albums-unit-text-cont bx-def-padding-top bx-def-padding-sec-bottom bx-def-padding-leftright">
+	    <h2 class="bx-base-text-unit-title"><a href="__content_url__">__title__</a></h2>
+	    <div class="bx-base-text-unit-info bx-def-margin-thd-top bx-def-margin-sec-bottom">
+	        <span class="bx-def-font-grayed">__entry_posting_date__</span>
+	        <span class="bx-base-text-unit-info-div bx-def-font-grayed">&#183;</span>
+	        <a class="bx-base-text-unit-author" href="__author_url__">__author__</a>
+	    </div>
+	    <div class="bx-base-text-unit-summary bx-clearfix">__summary__</div> 
+	</div>
+    <div class="bx-albums-unit-images-cont bx-def-padding-thd-leftright bx-def-padding-bottom">
+        <div class="bx-albums-unit-images bx-clearfix">
+            <bx_repeat:browse><a class="bx-albums-unit-image" title="__title_attr__" href="__url__"><img alt="__title_attr__" src="__img_url__" /></a></bx_repeat:browse>
+        </div> 
+    </div> 
+</div>

+ 17 - 0
modules/boonex/albums/updates/9.0.3_9.0.4/source/template/unit_gallery.html

@@ -0,0 +1,17 @@
+<div class="bx-base-text-unit bx-base-text-unit-gallery bx-def-gal-unit-size bx-def-padding-sec">
+	<div class="bx-base-text-unit-cnt bx-def-box bx-def-round-corners bx-def-color-bg-box">
+		<div class="bx-albums-unit-text-cont bx-def-padding-sec-topbottom bx-def-padding-thd-leftright bx-def-font-align-center">
+		    <h2 class="bx-base-text-unit-title"><a href="__content_url__">__title__</a></h2>
+		    <div class="bx-base-text-unit-info">
+		        <span class="bx-def-font-grayed">__entry_posting_date__</span>
+		        <span class="bx-base-text-unit-info-div bx-def-font-grayed">&#183;</span>
+		        <a class="bx-base-text-unit-author" href="__author_url__">__author__</a>
+		    </div>
+		</div>
+	    <div class="bx-albums-unit-images-cont bx-def-padding-thd-leftright bx-def-padding-sec-bottom">
+	        <div class="bx-albums-unit-images bx-clearfix">
+	            <bx_repeat:browse><a class="bx-albums-unit-image" title="__title_attr__" href="__url__"><img alt="__title_attr__" src="__img_url__" /></a></bx_repeat:browse>
+	        </div> 
+	    </div>
+	</div>
+</div>

+ 73 - 0
modules/boonex/antispam/updates/9.0.1_9.0.2/source/classes/BxAntispamConfig.php

@@ -0,0 +1,73 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Antispam Antispam
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxAntispamConfig extends BxDolModuleConfig
+{
+    /**
+     * map system options to the local options names
+     */
+    protected $_aOptionsMap = array (
+        'antispam_block' => 'bx_antispam_block',
+        'antispam_report' => 'bx_antispam_report',
+        'dnsbl_enable' => 'bx_antispam_dnsbl_enable',
+        'uridnsbl_enable' => 'bx_antispam_uridnsbl_enable',
+        'dnsbl_behaviour_login' => 'bx_antispam_dnsbl_behaviour_login',
+        'dnsbl_behaviour_join' => 'bx_antispam_dnsbl_behaviour_join',
+        'akismet_enable' => 'bx_antispam_akismet_enable',
+        'disposable_email_domains_mode' => 'bx_antispam_disposable_email_domains_mode',
+        'disposable_email_domains_behaviour_join' => 'bx_antispam_disposable_email_domains_behaviour_join',
+    );
+    /**
+     * default local options, it is filled in with real system options in class contructor, @see restoreAntispamOptions
+     */
+    protected $_aOptions = array (
+        'antispam_block' => '',
+        'antispam_report' => '',
+        'dnsbl_enable' => '',
+        'uridnsbl_enable' => '',
+        'dnsbl_behaviour_login' => 'block',
+        'dnsbl_behaviour_join' => 'approval',
+        'akismet_enable' => '',
+    );
+
+    public function __construct($aModule)
+    {
+        parent::__construct($aModule);
+        $this->restoreAntispamOptions ();
+    }
+
+    /**
+     * Set local option value, system value stays intact, useful for testing and debugging
+     */
+    public function setAntispamOption ($sOption, $mixedVal)
+    {
+        $this->_aOptions[$sOption] = $mixedVal;
+    }
+
+    /**
+     * Get an option, local value
+     */
+    public function getAntispamOption ($sOption)
+    {
+        return $this->_aOptions[$sOption];
+    }
+
+    /**
+     * set local options values from system options
+     */
+    public function restoreAntispamOptions ()
+    {
+        foreach ($this->_aOptionsMap as $sNameLocal => $sNameParam)
+            $this->setAntispamOption($sNameLocal, getParam($sNameParam));
+    }
+}
+
+/** @} */

+ 20 - 0
modules/boonex/antispam/updates/9.0.1_9.0.2/source/classes/BxAntispamCronUpdateDisposableEmailDomains.php

@@ -0,0 +1,20 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Antispam Antispam
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxAntispamCronUpdateDisposableEmailDomains extends BxDolCron
+{
+    function processing()
+    {
+        BxDolService::call('bx_antispam', 'update_disposable_domains_lists');
+    }
+}
+
+/** @} */

+ 86 - 0
modules/boonex/antispam/updates/9.0.1_9.0.2/source/classes/BxAntispamDisposableEmailDomains.php

@@ -0,0 +1,86 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Antispam Antispam
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+
+/**
+ *  Check for disposable email domain
+ */
+class BxAntispamDisposableEmailDomains extends BxDol
+{
+    protected $oDb;
+
+    public function __construct()
+    {
+        parent::__construct();
+        $this->oDb = BxDolDb::getInstance();
+    }
+
+    public function isWhitelisted($sEmail)
+    {
+        return $this->isEmailInList($sEmail, 'custom_whitelist');
+    }
+
+    public function isBlacklisted($sEmail)
+    {
+        return !$this->isEmailInList($sEmail, 'whitelist') && ($this->isEmailInList($sEmail, 'blacklist') || $this->isEmailInList($sEmail, 'custom_blacklist'));
+    }
+
+    public function isEmailInList($sEmail, $sList)
+    {
+        $a = explode('@', $sEmail);
+        if (!isset($a[1]))
+            return false;
+        $sEmailDomain = $a[1];
+        return $this->oDb->getOne("SELECT `id` FROM `bx_antispam_disposable_email_domains` WHERE `list` = ? AND `domain` = ?", array($sList, $sEmailDomain));
+    }
+
+    public function updateList ($sList, $sUrl)
+    {
+        if (!($aDomains = file($sUrl, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES)))
+            return false;
+
+        $this->oDb->query("DELETE FROM `bx_antispam_disposable_email_domains` WHERE `list` = ?", array($sList));
+        foreach ($aDomains as $sDomain)
+            $this->oDb->query("INSERT INTO `bx_antispam_disposable_email_domains` SET `list` = ?, `domain` = ?", array($sList, $sDomain));
+
+        return true;
+    }
+
+    public function getJoinBehaviourValues ()
+    {
+        return array (
+            'block' => _t('_bx_antispam_disposable_email_domains_behaviour_join_block'),
+            'approval' => _t('_bx_antispam_disposable_email_domains_behaviour_join_approval'),
+        );
+    }
+
+    public function getJoinBehaviourModes ()
+    {
+        return array (
+            'disable' => _t('_bx_antispam_disposable_email_domains_mode_disable'),
+            'blacklist' => _t('_bx_antispam_disposable_email_domains_mode_blacklist'),
+            // TODO: uncomment after adding interface for whitelisting
+            // 'whitelist' => _t('_bx_antispam_disposable_email_domains_mode_whitelist'),             
+        );
+    }
+
+    public function getErrorMessageBlacklisted ()
+    {
+        return _t('_bx_antispam_disposable_email_domains_msg_blacklisted');
+    }
+
+    public function getErrorMessageNotWhitelisted ()
+    {
+        return $this->getErrorMessageBlacklisted ();
+    }    
+}
+
+/** @} */

+ 323 - 0
modules/boonex/antispam/updates/9.0.1_9.0.2/source/classes/BxAntispamModule.php

@@ -0,0 +1,323 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Antispam Antispam
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxAntispamModule extends BxDolModule
+{
+    public function __construct(&$aModule)
+    {
+        parent::__construct($aModule);
+    }
+
+    public function serviceUpdateDisposableDomainsLists ()
+    {
+        $o = bx_instance('BxAntispamDisposableEmailDomains', array(), 'bx_antispam');
+
+        $o->updateList('blacklist', 'https://raw.githubusercontent.com/martenson/disposable-email-domains/master/disposable_email_blacklist.conf');
+
+        // TODO: uncomment after adding interface for whitelisting
+        // $o->updateList('whitelist', 'https://raw.githubusercontent.com/martenson/disposable-email-domains/master/whitelist.conf');
+    }
+    
+    public function serviceIpTable ()
+    {
+        $o = bx_instance('BxAntispamIP', array(), $this->_aModule);
+        $s = _t('_bx_antispam_ip_table_status', mb_strtolower($o->getIpTableConfigTitle((int)getParam('bx_antispam_ip_list_type'))));
+        $s .= $this->_grid('bx_antispam_grid_ip_table');
+        return $s;
+    }
+
+    public function serviceDnsblList ()
+    {
+        $s = _t('_bx_antispam_dnsbl_status',
+             BxTemplFunctions::getInstance()->statusOnOff((bool)$this->_oConfig->getAntispamOption('dnsbl_enable'), true),
+             BxTemplFunctions::getInstance()->statusOnOff((bool)$this->_oConfig->getAntispamOption('uridnsbl_enable'), true),
+             mb_strtolower(_t('_bx_antispam_dnsbl_behaviour_login_' . $this->_oConfig->getAntispamOption('dnsbl_behaviour_login'))),
+             mb_strtolower(_t('_bx_antispam_dnsbl_behaviour_join_' . $this->_oConfig->getAntispamOption('dnsbl_behaviour_join')))
+        );
+        $s .= $this->_grid('bx_antispam_grid_dnsbl');
+        return $s;
+    }
+
+    public function serviceBlockLog ()
+    {
+        return $this->_grid('bx_antispam_grid_block_log');
+    }
+
+    /**
+     * Check text for spam.
+     * First it check if IP is whitelisted(or under cron execution or user is admin) - for whitelisted IPs check for spam isn't performed,
+     * then it checks URLs found in text for DNSURI black lists (@see BxAntispamDNSURIBlacklists),
+     * then it checks text in Akismet service (@see BxAntispamAkismet).
+     * It can send report if spam is found or tries to inform caller to block the content (depending on configuration).
+     *
+     * @param $sContent content to check for spam
+     * @param $sIp IP address of content poster
+     * @param $isStripSlashes slashes parameter:
+     *          BX_SLASHES_AUTO - automatically detect magic_quotes_gpc setting
+     *          BX_SLASHES_NO_ACTION - do not perform any action with slashes
+     * @return true if spam detected and content shouln't be recorded, false if content should be processed as usual.
+     */
+    public function serviceIsSpam ($sContent, $sIp = '', $isStripSlashes = BX_SLASHES_AUTO)
+    {
+        if (defined('BX_DOL_CRON_EXECUTE') || isAdmin())
+            return false;
+
+        if ($this->serviceIsIpWhitelisted($sIp))
+            return false;
+
+        if (get_magic_quotes_gpc() && $isStripSlashes == BX_SLASHES_AUTO)
+            $sContent = stripslashes($sContent);
+
+        $bRet = false;
+        if ('on' == $this->_oConfig->getAntispamOption('uridnsbl_enable')) {
+            $oDNSURIBlacklists = bx_instance('BxAntispamDNSURIBlacklists', array(), $this->_aModule);
+            if ($oDNSURIBlacklists->isSpam($sContent)) {
+                $oDNSURIBlacklists->onPositiveDetection($sContent);
+                $bRet = true;
+            }
+        }
+
+        if (!$bRet && 'on' == $this->_oConfig->getAntispamOption('akismet_enable')) {
+            $oAkismet = bx_instance('BxAntispamAkismet', array(), $this->_aModule);
+            if ($oAkismet->isSpam($sContent)) {
+                $oAkismet->onPositiveDetection($sContent);
+                $bRet = true;
+            }
+        }
+
+        if ($bRet && 'on' == $this->_oConfig->getAntispamOption('antispam_report')) {
+
+            $oProfile = BxDolProfile::getInstance();
+            $aPlus = array(
+                'SpammerUrl' => $oProfile->getUrl(),
+                'SpammerNickName' => $oProfile->getDisplayName(),
+                'Page' => htmlspecialchars_adv($_SERVER['PHP_SELF']),
+                'Get' => print_r($_GET, true),
+                'Post' => print_r($_POST, true),
+                'SpamContent' => htmlspecialchars_adv($sContent),
+            );
+
+            $aTemplate = BxDolEmailTemplates::getInstance()->parseTemplate('bx_antispam_spam_report', $aPlus);
+            if (!$aTemplate)
+                trigger_error('Email template or translation missing: bx_antispam_spam_report', E_USER_ERROR);
+
+            sendMail(getParam('site_email'), $aTemplate['Subject'], $aTemplate['Body']);
+        }
+
+        if ($bRet && 'on' == $this->_oConfig->getAntispamOption('antispam_block'))
+            return true;
+
+        return false;
+    }
+
+    /**
+     * Perform complex check if user is allowed to login.
+     * First it checks if IP is directly blocked (@see serviceIsIpBlocked),
+     * then it checks in DNS black lists (@see serviceIsIpDnsBlacklisted).
+     *
+     * @param $sIp IP to check, or empty for current IP
+     * @return empty string - if join should be allowed, error message - if join should be blocked
+     */
+    public function serviceCheckLogin ($sIp = '')
+    {
+        $bLoginBlock = ('block' == $this->_oConfig->getAntispamOption('dnsbl_behaviour_login'));
+        $sErrorMsg = '';
+        $sNote = $bLoginBlock ? 'login block' : 'login log';
+
+        if (!$sIp)
+            $sIp = getVisitorIP();
+
+        if (!$sErrorMsg && $this->serviceIsIpBlocked($sIp))
+            $sErrorMsg = $this->getErrorMessageIpBlocked();
+
+        if (!$sErrorMsg && 'on' == $this->_oConfig->getAntispamOption('dnsbl_enable') && $this->serviceIsIpDnsBlacklisted($sIp, $sNote) && $bLoginBlock)
+            $sErrorMsg = $this->getErrorMessageSpam();
+
+        return $sErrorMsg;
+    }
+
+    /**
+     * Perform complex check if user is allowed to join.
+     * First it checks if IP is directly blocked (@see serviceIsIpBlocked),
+     * then it checks in DNS black lists (@see serviceIsIpDnsBlacklisted),
+     * then it checks in StopForumSpam service (@see BxAntispamStopForumSpam).
+     *
+     * @param $sCurIP IP to check, or empty for current IP
+     * @return empty string - if join should be allowed, error message - if join should be blocked
+     */
+    public function serviceCheckJoin ($sEmail, &$bApproval, $sIp = '')
+    {
+        $bJoinBlock = ('block' == $this->_oConfig->getAntispamOption('dnsbl_behaviour_join'));
+        $bApproval = false;
+        $sErrorMsg = '';
+        $sNote = $bJoinBlock ? 'join block' : 'join approval';
+
+        if (!$sIp)
+            $sIp = getVisitorIP();
+
+        // check if IP is blocked
+        if (!$sErrorMsg && $this->serviceIsIpBlocked($sIp))
+            $sErrorMsg = $this->getErrorMessageIpBlocked();
+
+        // check in DNSBL lists
+        if (!$sErrorMsg && 'on' == $this->_oConfig->getAntispamOption('dnsbl_enable') && $this->serviceIsIpDnsBlacklisted($sIp, $sNote)) {
+            if ('approval' == $this->_oConfig->getAntispamOption('dnsbl_behaviour_join'))
+                $bApproval = true;
+            else
+                $sErrorMsg = $this->getErrorMessageSpam();
+        }
+
+        // check in StopForumSpam service
+        if (!$sErrorMsg) {
+            $oStopForumSpam = bx_instance('BxAntispamStopForumSpam', array(), $this->_aModule);
+            if ($oStopForumSpam->isSpammer(array('email' => $sEmail, 'ip' => $sIp), $sNote))
+                $sErrorMsg = $this->getErrorMessageSpam();
+        }
+
+        // check for disposable email domains
+        if (!$sErrorMsg && 'disable' != ($sMode = $this->_oConfig->getAntispamOption('disposable_email_domains_mode'))) {
+
+            $bDisposableEmailDomainsBehaviour = $this->_oConfig->getAntispamOption('disposable_email_domains_behaviour_join');
+            $oDisposableEmailDomains = bx_instance('BxAntispamDisposableEmailDomains', array(), 'bx_antispam');
+            
+            if ('blacklist' == $sMode && $oDisposableEmailDomains->isBlacklisted($sEmail)) {
+                if ('approval' == $bDisposableEmailDomainsBehaviour)
+                    $bApproval = true;
+                else
+                    $sErrorMsg = $oDisposableEmailDomains->getErrorMessageBlacklisted();
+            }
+            elseif ('whitelist' == $sMode && !$oDisposableEmailDomains->isWhitelisted($sEmail)) {
+                if ('approval' == $bDisposableEmailDomainsBehaviour)
+                    $bApproval = true;
+                else
+                    $sErrorMsg = $oDisposableEmailDomains->getErrorMessageNotWhitelisted();
+            }
+
+        }
+
+        return $sErrorMsg;
+    }
+
+    /**
+     * Check if IP is blacklisted in some DNS chain (@see BxAntispamDNSBlacklists).
+     *
+     * @param $sCurIP IP to check, or empty for current IP
+     * @param $sNote [optional] place where checking is performed, for example 'join', 'login'
+     * @return true if IP blacklisted and not whiteloisted, or false if under cron execution or if IP isn't blacklisted
+     */
+    public function serviceIsIpDnsBlacklisted($sCurIP = '', $sNote = '')
+    {
+        if (defined('BX_DOL_CRON_EXECUTE'))
+            return false;
+
+        if (!$sCurIP)
+            $sCurIP = getVisitorIP();
+
+        if ($this->serviceIsIpWhitelisted($sCurIP))
+            return false;
+
+        $o = bx_instance('BxAntispamDNSBlacklists', array(), $this->_aModule);
+
+        if (BX_DOL_DNSBL_POSITIVE == $o->dnsbl_lookup_ip(BX_DOL_DNSBL_CHAIN_SPAMMERS, $sCurIP) && BX_DOL_DNSBL_POSITIVE != $o->dnsbl_lookup_ip(BX_DOL_DNSBL_CHAIN_WHITELIST, $sCurIP)) {
+            $o->onPositiveDetection ($sCurIP, $sNote);
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * @see BxAntispamIP::isIpWhitelisted
+     */
+    public function serviceIsIpWhitelisted($sIp = '')
+    {
+        $o = bx_instance('BxAntispamIP', array(), $this->_aModule);
+        return $o->isIpWhitelisted($sIp);
+    }
+
+    /**
+     * @see BxAntispamIP::isIpBlocked
+     */
+    public function serviceIsIpBlocked($sIp = '')
+    {
+        $o = bx_instance('BxAntispamIP', array(), $this->_aModule);
+        return $o->isIpBlocked($sIp);
+    }
+
+    /**
+     * @see BxAntispamIP::blockIp
+     */
+    public function serviceBlockIp($mixedIP, $iExpirationInSec = 86400, $sComment = '')
+    {
+        $o = bx_instance('BxAntispamIP', array(), $this->_aModule);
+        return $o->blockIp($mixedIP, $iExpirationInSec, $sComment);
+    }
+
+    /**
+     * @see BxAntispamIP::pruning
+     */
+    public function servicePruning()
+    {
+        $o = bx_instance('BxAntispamIP', array(), $this->_aModule);
+        return $o->pruning();
+    }
+
+    /**
+     * @see BxAntispamIP::pruning
+     */
+    public function serviceConfigValues($s)
+    {
+        switch ($s) {
+            case 'ip_table':
+                $o = bx_instance('BxAntispamIP', array(), $this->_aModule);
+                return $o->getIpTableConfigValues();
+            case 'dnsbl_login':
+                $o = bx_instance('BxAntispamDNSBlacklists', array(), $this->_aModule);
+                return $o->getDNSBLConfigValues();
+            case 'dnsbl_join';
+                $o = bx_instance('BxAntispamDNSURIBlacklists', array(), $this->_aModule);
+                return $o->getURIDNSBLConfigValues();
+            case 'disposable_email_domains_join';
+                $o = bx_instance('BxAntispamDisposableEmailDomains', array(), $this->_aModule);
+                return $o->getJoinBehaviourValues();                
+            case 'disposable_email_domains_mode';
+                $o = bx_instance('BxAntispamDisposableEmailDomains', array(), $this->_aModule);
+                return $o->getJoinBehaviourModes();                
+        }
+    }
+
+    protected function getErrorMessageIpBlocked ()
+    {
+        bx_import('BxDolLanguages');
+        return _t('_bx_antispam_ip_blocked', $this->getErrorMessageSubmitFalsePositiveReport());
+    }
+
+    protected function getErrorMessageSpam ()
+    {
+        bx_import('BxDolLanguages');
+        return _t('_bx_antispam_spam_detected', $this->getErrorMessageSubmitFalsePositiveReport());
+    }
+
+    protected function getErrorMessageSubmitFalsePositiveReport ()
+    {
+        if (BxDolRequest::serviceExists('bx_contact', 'get_contact_page_url') && ($sUrl = BxDolService::call('bx_contact', 'get_contact_page_url')))
+            return _t('_bx_antispam_submit_false_positive_report', $sUrl);
+        return '';
+    }
+
+    protected function _grid ($sObjectGrid)
+    {
+        $oGrid = BxDolGrid::getObjectInstance($sObjectGrid);
+        return $oGrid ? $oGrid->getCode() : '';
+    }
+}
+
+/** @} */

+ 68 - 0
modules/boonex/antispam/updates/9.0.1_9.0.2/source/install/config.php

@@ -0,0 +1,68 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Antispam Antispam
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_antispam',
+    'title' => 'Antispam',
+    'note' => 'Antispam tools',
+    'version' => '9.0.2',
+    'vendor' => 'BoonEx',
+	'help_url' => 'http://feed.boonex.com/?section={module_name}',
+
+    'compatible_with' => array(
+        '9.0.0-RC1'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/antispam/',
+    'home_uri' => 'antispam',
+
+    'db_prefix' => 'bx_antispam_',
+    'class_prefix' => 'BxAntispam',
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => 'Antispam',
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+        'execute_sql' => 1,
+        'update_languages' => 1,
+    ),
+    'uninstall' => array (
+        'execute_sql' => 1,
+        'update_languages' => 1,
+    ),
+    'enable' => array(
+        'execute_sql' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'disable' => array(
+        'execute_sql' => 1,
+        'clear_db_cache' => 1,
+    ),
+
+    /**
+     * Dependencies Section
+     */
+    'dependencies' => array(),
+);
+
+/** @} */

+ 29 - 0
modules/boonex/antispam/updates/9.0.1_9.0.2/source/install/installer.php

@@ -0,0 +1,29 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Antispam Antispam
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxAntispamInstaller extends BxDolStudioInstaller
+{
+    function __construct($aConfig)
+    {
+        parent::__construct($aConfig);
+    }
+
+    public function enable($aParams)
+    {
+        $aResult = parent::enable($aParams);
+        if ($aResult['result'])
+            BxDolService::call('bx_antispam', 'update_disposable_domains_lists');
+
+        return $aResult;
+    }    
+}
+
+/** @} */

+ 161 - 0
modules/boonex/antispam/updates/9.0.1_9.0.2/source/install/langs/en.xml

@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+
+	<string name="_bx_antispam"><![CDATA[Antispam]]></string>
+    <string name="_bx_antispam_help"><![CDATA[Help]]></string>
+    <string name="_bx_antispam_help_text"><![CDATA[This module allows to limit spam on the site, there are different build-in tools for this:
+<ul>
+    <li><b>IP table</b> - manual IP blocking/whitelisting</li>
+    <li><b>DNSBL</b> - automatic blocking by IP from different block lists</li>
+    <li><b>URI DNSBL</b> - automatic blocking of spam content by spam URLs in the text</li>
+    <li><b>Akismet</b> - automatic spam content blocking using <a target="_blank" href="http://akismet.com">Akismet service</a></li>
+    <li><b>StopForumSpam</b> - automatic spam content blocking using <a target="_blank" href="http://www.stopforumspam.com">StopForumSpam service</a></li>
+</ul>
+]]></string>
+    <string name="_bx_antispam_help_dnsbl"><![CDATA[
+DNSBL - <a href="http://en.wikipedia.org/wiki/DNSBL">Domain Name Service Block Lists</a>.
+This functionality allows to block by IP address if it exists in one of available blocklists.
+<br /><br />
+A URI DNSBL is a DNSBL that lists the domain names and IP addresses which are found in the "clickable" links contained in the body of spams, but generally not found inside legitimate messages.
+This antispam method scan submitted content for the URLs and check them if any of them is a link to spam site. If such URL detected in the text then content is not submitted.
+<br /><br />
+<button class="bx-btn" style="float:none;" onclick ="$('.bx-popup-applied:visible').dolPopupHide();">Close</button>
+]]></string>
+    <string name="_bx_antispam_dnsbl_status"><![CDATA[
+<table style="width:100%;"><tr>
+    <td>DNSBL: {0}</td>
+    <td>URI DNSBL: {1}</td>
+    <td>Login behavior: {2}</td>
+    <td>Join behavior: {3}</td>
+</tr></table>
+]]></string>
+    <string name="_bx_antispam_ip_table_status"><![CDATA[IP table mode: {0}]]></string>
+    <string name="_bx_antispam_ip_blocked"><![CDATA[IP address is blocked. {0}]]></string>
+    <string name="_bx_antispam_spam_detected"><![CDATA[Spam detected. {0}]]></string>
+    <string name="_bx_antispam_submit_false_positive_report"><![CDATA[If you believe that this is a mistake, please submit a false positive report here: {0}]]></string>
+	<string name="_bx_antispam_ip_allow"><![CDATA[Allow]]></string>
+	<string name="_bx_antispam_ip_deny"><![CDATA[Deny]]></string>
+	<string name="_bx_antispam_ip_table"><![CDATA[IP table]]></string>
+	<string name="_bx_antispam_dnsbl_list"><![CDATA[DNSBL list]]></string>
+	<string name="_bx_antispam_block_log"><![CDATA[Block log]]></string>
+	<string name="_bx_antispam_chain_whitelist"><![CDATA[IP whitelist]]></string>
+	<string name="_bx_antispam_chain_spammers"><![CDATA[IP blacklist]]></string>
+	<string name="_bx_antispam_chain_uridns"><![CDATA[Spam text]]></string>
+	<string name="_bx_antispam_rule_note_country"><![CDATA[Country: {0}]]></string>
+	<string name="_bx_antispam_rule_note_spamhaus_org"><![CDATA[Detect spammer IPs]]></string>
+	<string name="_bx_antispam_rule_note_zomgbl_spameatingmonkey_net"><![CDATA[Everything is blacklisted, <u>use it only if something is whitelisted!</u>]]></string>
+	<string name="_bx_antispam_rule_note_surbl_org"><![CDATA[Detect spammer URLs from SURBLs (lists of web sites that have appeared in unsolicited messages)]]></string>
+	<string name="_bx_antispam_rule_note_dnsbl_tornevall_org"><![CDATA[Detect anonymous/elite proxies and abuse IPs]]></string>
+	<string name="_bx_antispam_dnsbl"><![CDATA[DNSBL]]></string>
+	<string name="_bx_antispam_uri_dnsbl"><![CDATA[URI DNSBL]]></string>
+	<string name="_bx_antispam_type_dnsbl"><![CDATA[DNSBL]]></string>
+	<string name="_bx_antispam_type_dnsbluri"><![CDATA[URI DNSBL]]></string>
+	<string name="_bx_antispam_type_akismet"><![CDATA[Akismet]]></string>
+	<string name="_bx_antispam_type_stopforumspam"><![CDATA[StopForumSpam]]></string>
+	<string name="_bx_antispam_ip_table_disabled"><![CDATA[Disabled]]></string>
+	<string name="_bx_antispam_ip_table_all_allowed_except_listed"><![CDATA[All allowed except listed]]></string>
+	<string name="_bx_antispam_ip_table_all_blocked_except_listed"><![CDATA[All blocked except listed]]></string>
+	<string name="_bx_antispam_dnsbl_behaviour_login_block"><![CDATA[Block]]></string>
+	<string name="_bx_antispam_dnsbl_behaviour_login_log"><![CDATA[Log]]></string>
+	<string name="_bx_antispam_dnsbl_behaviour_join_block"><![CDATA[Block]]></string>
+    <string name="_bx_antispam_dnsbl_behaviour_join_approval"><![CDATA[Approval]]></string>
+	<string name="_bx_antispam_disposable_email_domains_mode_disable"><![CDATA[Disable]]></string>
+	<string name="_bx_antispam_disposable_email_domains_mode_whitelist"><![CDATA[Allow whitelisted only]]></string>
+	<string name="_bx_antispam_disposable_email_domains_mode_blacklist"><![CDATA[Disallow blacklisted]]></string>
+	<string name="_bx_antispam_disposable_email_domains_behaviour_join_block"><![CDATA[Block]]></string>
+	<string name="_bx_antispam_disposable_email_domains_behaviour_join_approval"><![CDATA[Approval]]></string>
+    <string name="_bx_antispam_disposable_email_domains_msg_blacklisted"><![CDATA[Your email domain isn't allowed for registration on this site]]></string>
+
+	<string name="_bx_antispam_popup_help"><![CDATA[DNSBL help]]></string>
+	<string name="_bx_antispam_popup_dnsbl_recheck"><![CDATA[Recheck IP/URL in DNSBL/URIDNSBL]]></string>
+	<string name="_bx_antispam_popup_dnsbl_add"><![CDATA[Add country based rule]]></string>
+	<string name="_bx_antispam_popup_block_log"><![CDATA[Block log]]></string>
+
+	<string name="_bx_antispam_page_title_sys_ip_table"><![CDATA[IP table]]></string>
+	<string name="_bx_antispam_page_title_ip_table"><![CDATA[IP table]]></string>
+	<string name="_bx_antispam_page_title_sys_dnsbl_list"><![CDATA[DNSBL list]]></string>
+	<string name="_bx_antispam_page_title_dnsbl_list"><![CDATA[DNSBL list]]></string>
+	<string name="_bx_antispam_page_title_sys_block_log"><![CDATA[Block log]]></string>
+	<string name="_bx_antispam_page_title_block_log"><![CDATA[Block log]]></string>
+
+	<string name="_bx_antispam_page_block_title_ip_table"><![CDATA[IP table]]></string>
+	<string name="_bx_antispam_page_block_title_dnsbl_list"><![CDATA[DNSBL list]]></string>
+	<string name="_bx_antispam_page_block_title_block_log"><![CDATA[Block log]]></string>
+
+	<string name="_bx_antispam_grid_action_delete"><![CDATA[Delete]]></string>
+	<string name="_bx_antispam_grid_action_add"><![CDATA[Add]]></string>
+	<string name="_bx_antispam_grid_action_log"><![CDATA[Log]]></string>
+	<string name="_bx_antispam_grid_action_recheck"><![CDATA[Re-check]]></string>
+	<string name="_bx_antispam_grid_action_help"><![CDATA[Help]]></string>
+
+	<string name="_bx_antispam_field_id"><![CDATA[ID]]></string>
+	<string name="_bx_antispam_field_ip"><![CDATA[IP]]></string>
+	<string name="_bx_antispam_field_ip_from"><![CDATA[IP from]]></string>
+	<string name="_bx_antispam_field_ip_to"><![CDATA[IP to]]></string>
+	<string name="_bx_antispam_field_action"><![CDATA[Action]]></string>
+	<string name="_bx_antispam_field_expiration"><![CDATA[Expiration]]></string>
+	<string name="_bx_antispam_field_note"><![CDATA[Note]]></string>
+	<string name="_bx_antispam_field_chain"><![CDATA[Rule]]></string>
+	<string name="_bx_antispam_field_ip_url"><![CDATA[IP for DNSBL or URL for URI DNSBL]]></string>
+	<string name="_bx_antispam_field_dnsbl_uridnsbl"><![CDATA[Check in]]></string>
+	<string name="_bx_antispam_field_profile_id"><![CDATA[Profile]]></string>
+	<string name="_bx_antispam_field_type"><![CDATA[Type]]></string>
+	<string name="_bx_antispam_field_when"><![CDATA[When]]></string>
+	<string name="_bx_antispam_field_country"><![CDATA[Country]]></string>
+	<string name="_bx_antispam_field_zonedomain"><![CDATA[ZONE domain]]></string>
+
+    <string name="_bx_antispam_form_ip_table"><![CDATA[IP table directive]]></string>
+    <string name="_bx_antispam_form_ip_table_add"><![CDATA[Add IP table directive]]></string>
+    <string name="_bx_antispam_form_ip_table_edit"><![CDATA[Edit IP table directive]]></string>
+    <string name="_bx_antispam_form_buttons"><![CDATA[Form buttons]]></string>
+
+    <string name="_bx_antispam_field_ip_err_msg"><![CDATA[Please enter correct IP address, for example 192.168.4.5]]></string>
+    <string name="_bx_antispam_field_expiration_err_msg"><![CDATA[Please enter correct date time value]]></string>
+
+    <string name="_bx_antispam_data_list_ip_table_actions"><![CDATA[IP table actions]]></string>
+
+    <string name="_bx_antispam_adm_stg_cpt_type"><![CDATA[Antispam]]></string>
+    <string name="_bx_antispam_adm_stg_cpt_category_general"><![CDATA[General]]></string>
+    <string name="_bx_antispam_adm_stg_cpt_category_ip_table"><![CDATA[IP table]]></string>
+    <string name="_bx_antispam_adm_stg_cpt_category_dnsbl"><![CDATA[DNSBL]]></string>
+    <string name="_bx_antispam_adm_stg_cpt_category_akismet"><![CDATA[Akismet]]></string>
+    <string name="_bx_antispam_adm_stg_cpt_category_stopforumspam"><![CDATA[StopForumSpam]]></string>
+    <string name="_bx_antispam_adm_stg_cpt_category_disposable_email_domains"><![CDATA[Disposable email domains]]></string>
+    
+	<string name="_bx_antispam_option_block"><![CDATA[Total block all spam content]]></string>
+	<string name="_bx_antispam_option_report"><![CDATA[Send report to admin if spam content discovered]]></string>
+	<string name="_bx_antispam_option_ip_list_type"><![CDATA[IP table mode]]></string>
+	<string name="_bx_antispam_option_dnsbl_enable"><![CDATA[Enable DNS Block Lists]]></string>
+	<string name="_bx_antispam_option_dnsbl_behaviour_login"><![CDATA[User login behaviour if listed in DNS Block Lists]]></string>
+	<string name="_bx_antispam_option_dnsbl_behaviour_join"><![CDATA[User join behaviour if listed in DNS Block Lists]]></string>
+	<string name="_bx_antispam_option_uridnsbl_enable"><![CDATA[Enable URI DNS Block Lists]]></string>
+	<string name="_bx_antispam_option_akismet_enable"><![CDATA[Enable Akismet]]></string>
+	<string name="_bx_antispam_option_akismet_api_key"><![CDATA[Akismet API Key]]></string>
+	<string name="_bx_antispam_option_stopforumspam_enable"><![CDATA[Enable "Stop Forum Spam"]]></string>
+    <string name="_bx_antispam_option_stopforumspam_api_key"><![CDATA["Stop Forum Spam" API Key]]></string> 
+	<string name="_bx_antispam_option_disposable_email_domains_mode"><![CDATA[Mode]]></string>
+	<string name="_bx_antispam_option_disposable_email_domains_behaviour_join"><![CDATA[Join behaviour]]></string>
+    
+    <string name="_bx_antispam_spam_report_name"><![CDATA[Spam report message]]></string>
+    <string name="_bx_antispam_spam_report_subject"><![CDATA[Automatic spam report]]></string>
+    <string name="_bx_antispam_spam_report_body"><![CDATA[{email_header}
+<b>Profile:</b> <a href="{SpammerUrl}">{SpammerNickName}</a><br />
+
+<b>Page:</b> {Page}<br /><br />
+
+<b>GET variables:</b>
+<pre>
+{Get}
+</pre>
+
+<b>POST variables:</b>
+<pre>
+{Post}
+</pre>
+
+<b>Spam content:</b>
+<pre>
+{SpamContent}
+</pre>
+{email_footer}]]></string>
+</resources>

+ 214 - 0
modules/boonex/antispam/updates/9.0.1_9.0.2/source/install/sql/enable.sql

@@ -0,0 +1,214 @@
+
+-- 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_antispam', '_bx_antispam_adm_stg_cpt_type', 'bx_antispam@modules/boonex/antispam/|std-icon.svg', IF(NOT ISNULL(@iTypeOrder), @iTypeOrder + 1, 1));
+SET @iTypeId = LAST_INSERT_ID();
+
+
+
+INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
+VALUES (@iTypeId, 'bx_antispam_general', '_bx_antispam_adm_stg_cpt_category_general', 1);
+SET @iCategoryId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
+(@iCategoryId, 'bx_antispam_block', '_bx_antispam_option_block', '', 'checkbox', '', '', '', 10),
+(@iCategoryId, 'bx_antispam_report', '_bx_antispam_option_report', 'on', 'checkbox', '', '', '', 20);
+
+
+
+INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
+VALUES (@iTypeId, 'bx_antispam_ip_table', '_bx_antispam_adm_stg_cpt_category_ip_table', 2);
+SET @iCategoryId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
+(@iCategoryId, 'bx_antispam_ip_list_type', '_bx_antispam_option_ip_list_type', '0', 'select', 'a:3:{s:6:"module";s:11:"bx_antispam";s:6:"method";s:13:"config_values";s:6:"params";a:1:{i:0;s:8:"ip_table";}}', '', '', 10);
+
+
+
+INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
+VALUES (@iTypeId, 'bx_antispam_dnsbl', '_bx_antispam_adm_stg_cpt_category_dnsbl', 3);
+SET @iCategoryId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
+(@iCategoryId, 'bx_antispam_dnsbl_enable', '_bx_antispam_option_dnsbl_enable', 'on', 'checkbox', '', '', '', 10),
+(@iCategoryId, 'bx_antispam_dnsbl_behaviour_login', '_bx_antispam_option_dnsbl_behaviour_login', 'block', 'select', 'a:3:{s:6:"module";s:11:"bx_antispam";s:6:"method";s:13:"config_values";s:6:"params";a:1:{i:0;s:11:"dnsbl_login";}}', '', '', 20),
+(@iCategoryId, 'bx_antispam_dnsbl_behaviour_join', '_bx_antispam_option_dnsbl_behaviour_join', 'approval', 'select', 'a:3:{s:6:"module";s:11:"bx_antispam";s:6:"method";s:13:"config_values";s:6:"params";a:1:{i:0;s:10:"dnsbl_join";}}', '', '', 30),
+(@iCategoryId, 'bx_antispam_uridnsbl_enable', '_bx_antispam_option_uridnsbl_enable', 'on', 'checkbox', '', '', '', 40);
+
+
+
+INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
+VALUES (@iTypeId, 'bx_antispam_akismet', '_bx_antispam_adm_stg_cpt_category_akismet', 4);
+SET @iCategoryId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
+(@iCategoryId, 'bx_antispam_akismet_enable', '_bx_antispam_option_akismet_enable', '', 'checkbox', '', '', '', 10),
+(@iCategoryId, 'bx_antispam_akismet_api_key', '_bx_antispam_option_akismet_api_key', '', 'digit', '', '', '', 20);
+
+
+
+INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
+VALUES (@iTypeId, 'bx_antispam_stopforumspam', '_bx_antispam_adm_stg_cpt_category_stopforumspam', 5);
+SET @iCategoryId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
+(@iCategoryId, 'bx_antispam_stopforumspam_enable', '_bx_antispam_option_stopforumspam_enable', 'on', 'checkbox', '', '', '', 10),
+(@iCategoryId, 'bx_antispam_stopforumspam_api_key', '_bx_antispam_option_stopforumspam_api_key', '', 'digit', '', '', '', 20);
+
+INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
+VALUES (@iTypeId, 'bx_antispam_disposable_email_domains', '_bx_antispam_adm_stg_cpt_category_disposable_email_domains', 6);
+SET @iCategoryId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
+(@iCategoryId, 'bx_antispam_disposable_email_domains_mode', '_bx_antispam_option_disposable_email_domains_mode', 'blacklist', 'select', 'a:3:{s:6:"module";s:11:"bx_antispam";s:6:"method";s:13:"config_values";s:6:"params";a:1:{i:0;s:29:"disposable_email_domains_mode";}}', '', '', 10),
+(@iCategoryId, 'bx_antispam_disposable_email_domains_behaviour_join', '_bx_antispam_option_disposable_email_domains_behaviour_join', 'block', 'select', 'a:3:{s:6:"module";s:11:"bx_antispam";s:6:"method";s:13:"config_values";s:6:"params";a:1:{i:0;s:29:"disposable_email_domains_join";}}', '', '', 20);
+
+
+-- page: DNSBL list
+
+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_antispam_dnsbl', 'antispam-dnsbl-list', '_bx_antispam_page_title_sys_dnsbl_list', '_bx_antispam_page_title_dnsbl_list', 'bx_antispam', 5, 128, 1, 'page.php?i=antispam-dnsbl-list', '', '', '', 0, 1, 0, 'BxAntispamPage', 'modules/boonex/antispam/classes/BxAntispamPage.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_antispam_dnsbl', 1, 'bx_antispam', '_bx_antispam_page_block_title_dnsbl_list', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:11:\"bx_antispam\";s:6:\"method\";s:10:\"dnsbl_list\";}', 0, 1, 1, 1);
+
+-- page: ip table
+
+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_antispam_ip_table', 'antispam-ip-table', '_bx_antispam_page_title_sys_ip_table', '_bx_antispam_page_title_ip_table', 'bx_antispam', 5, 128, 1, 'page.php?i=antispam-ip-table', '', '', '', 0, 1, 0, 'BxAntispamPage', 'modules/boonex/antispam/classes/BxAntispamPage.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_antispam_ip_table', 1, 'bx_antispam', '_bx_antispam_page_block_title_ip_table', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:11:\"bx_antispam\";s:6:\"method\";s:8:\"ip_table\";}', 0, 1, 1, 1);
+
+-- page: block log
+
+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_antispam_block_log', 'antispam-block-log', '_bx_antispam_page_title_sys_block_log', '_bx_antispam_page_title_block_log', 'bx_antispam', 5, 192, 1, 'page.php?i=antispam-block-log', '', '', '', 0, 1, 0, 'BxAntispamPage', 'modules/boonex/antispam/classes/BxAntispamPage.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_antispam_block_log', 1, 'bx_antispam', '_bx_antispam_page_block_title_block_log', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:11:\"bx_antispam\";s:6:\"method\";s:9:\"block_log\";}', 0, 1, 1, 1);
+
+-- grid: DNSBL
+
+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_antispam_grid_dnsbl', 'Sql', 'SELECT `id`, `chain`, `zonedomain`, `postvresp`, `url`, `recheck`, `comment`, `added`, `active` FROM `bx_antispam_dnsbl_rules`', 'bx_antispam_dnsbl_rules', 'id', 'added', 'active', '', 16, NULL, 'start', '', 'chain,zonedomain,url,recheck', 'comment', 'auto', 'chain,zonedomain', 'comment', 128, 'BxAntispamGridDNSBL', 'modules/boonex/antispam/classes/BxAntispamGridDNSBL.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('bx_antispam_grid_dnsbl', 'switcher', '_sys_active', '10%', 0, 0, '', 1),
+('bx_antispam_grid_dnsbl', 'chain', '_bx_antispam_field_chain', '15%', 0, 0, '', 2),
+('bx_antispam_grid_dnsbl', 'zonedomain', '_bx_antispam_field_zonedomain', '15%', 0, 0, '', 3),
+('bx_antispam_grid_dnsbl', 'comment', '_bx_antispam_field_note', '55%', 0, 0, '', 4),
+('bx_antispam_grid_dnsbl', 'actions', '_sys_actions', '5%', 0, 0, '', 5);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `confirm`, `order`) VALUES
+('bx_antispam_grid_dnsbl', 'independent', 'log', '_bx_antispam_grid_action_log', '', 0, 1),
+('bx_antispam_grid_dnsbl', 'independent', 'recheck', '_bx_antispam_grid_action_recheck', '', 0, 2),
+('bx_antispam_grid_dnsbl', 'independent', 'add', '_bx_antispam_grid_action_add', '', 0, 3),
+('bx_antispam_grid_dnsbl', 'independent', 'help', '_bx_antispam_grid_action_help', '', 0, 4),
+('bx_antispam_grid_dnsbl', 'single', 'delete', '', 'remove',  1, 1);
+
+-- grid: ip table
+
+INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_mode`, `sorting_fields`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
+('bx_antispam_grid_ip_table', 'Sql', 'SELECT `ID`, `From`, `To`, `Type`, `LastDT`, `Desc` FROM `bx_antispam_ip_table`', 'bx_antispam_ip_table', 'ID', '', '', 10, NULL, 'start', '', 'From,To,Desc', 'auto', 'From,To,Type,LastDT,Desc', 128, 'BxAntispamGridIpTable', 'modules/boonex/antispam/classes/BxAntispamGridIpTable.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `params`, `order`) VALUES
+('bx_antispam_grid_ip_table', 'checkbox', '_sys_select', '2%', '', 1),
+('bx_antispam_grid_ip_table', 'From', '_bx_antispam_field_ip_from', '15%', '', 2),
+('bx_antispam_grid_ip_table', 'To', '_bx_antispam_field_ip_to', '15%', '', 3),
+('bx_antispam_grid_ip_table', 'Type', '_bx_antispam_field_action', '15%', '', 4),
+('bx_antispam_grid_ip_table', 'LastDT', '_bx_antispam_field_expiration', '15%', '', 5),
+('bx_antispam_grid_ip_table', 'Desc', '_bx_antispam_field_note', '26%', '', 6),
+('bx_antispam_grid_ip_table', 'actions', '_sys_actions', '12%', '', 7);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `confirm`, `order`) VALUES
+('bx_antispam_grid_ip_table', 'bulk', 'delete', '_bx_antispam_grid_action_delete', '', 1, 1),
+('bx_antispam_grid_ip_table', 'single', 'edit', '', 'pencil', 0, 1),
+('bx_antispam_grid_ip_table', 'single', 'delete', '', 'remove',  1, 2),
+('bx_antispam_grid_ip_table', 'independent', 'add', '_bx_antispam_grid_action_add', '', 0, 1);
+
+-- grid: block log
+
+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_antispam_grid_block_log', 'Sql', 'SELECT `id`, `ip`, `profile_id`, `type`, `extra`, `added` FROM `bx_antispam_block_log`', 'bx_antispam_block_log', 'id', 'id', '', '', 8, NULL, 'start', '', 'type,extra', '', 'auto', 'ip,profile_id,type,extra,added', '', 192, 'BxAntispamGridBlockLog', 'modules/boonex/antispam/classes/BxAntispamGridBlockLog.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('bx_antispam_grid_block_log', 'ip', '_bx_antispam_field_ip', '20%', 0, 0, '', 1),
+('bx_antispam_grid_block_log', 'profile_id', '_bx_antispam_field_profile_id', '20%', 0, 0, '', 2),
+('bx_antispam_grid_block_log', 'type', '_bx_antispam_field_type', '15%', 0, 0, '', 3),
+('bx_antispam_grid_block_log', 'extra', '_bx_antispam_field_note', '15%', 0, 8, '', 4),
+('bx_antispam_grid_block_log', 'added', '_bx_antispam_field_when', '30%', 0, 0, '', 5);
+
+-- data list: ip table actions
+
+INSERT INTO `sys_form_pre_lists`(`module`, `key`, `title`, `use_for_sets`) VALUES 
+('bx_antispam', 'bx_antispam_ip_table_actions', '_bx_antispam_data_list_ip_table_actions', 0);
+
+INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `LKey`, `LKey2`, `Order`) VALUES 
+('bx_antispam_ip_table_actions', 'allow', '_bx_antispam_ip_allow', '', 0),
+('bx_antispam_ip_table_actions', 'deny', '_bx_antispam_ip_deny', '', 0);
+
+-- form: IP table add/edit
+
+INSERT INTO `sys_objects_form`(`object`, `module`, `title`, `action`, `form_attrs`, `table`, `key`, `uri`, `uri_title`, `submit_name`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_antispam_ip_table_form', 'bx_antispam', '_bx_antispam_form_ip_table', 'grid.php?o={grid_object}&a={grid_action}', '', 'bx_antispam_ip_table', 'ID', '', '', 'bx_antispam_ip_table_submit', '', 0, 1, '', '');
+
+INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES 
+('bx_antispam_ip_table_form', 'bx_antispam_ip_table_form_add', 'bx_antispam', 0, '_bx_antispam_form_ip_table_add'),
+('bx_antispam_ip_table_form', 'bx_antispam_ip_table_form_edit', 'bx_antispam', 0, '_bx_antispam_form_ip_table_edit');
+
+INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES 
+('bx_antispam_ip_table_form', 'bx_antispam', 'ID', '', '', 0, 'hidden', '_bx_antispam_field_id', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
+('bx_antispam_ip_table_form', 'bx_antispam', 'From', '', '', 0, 'text', '_bx_antispam_field_ip_from', '_bx_antispam_field_ip_from', '', 1, 0, 0, '', '', '', 'preg', 'a:1:{s:4:\"preg\";s:20:\"#\\d+\\.\\d+\\.\\d+\\.\\d+#\";}', '_bx_antispam_field_ip_err_msg', 'Xss', '', 1, 0),
+('bx_antispam_ip_table_form', 'bx_antispam', 'To', '', '', 0, 'text', '_bx_antispam_field_ip_to', '_bx_antispam_field_ip_to', '', 1, 0, 0, '', '', '', 'preg', 'a:1:{s:4:\"preg\";s:20:\"#\\d+\\.\\d+\\.\\d+\\.\\d+#\";}', '_bx_antispam_field_ip_err_msg', 'Xss', '', 1, 0),
+('bx_antispam_ip_table_form', 'bx_antispam', 'Type', 'allow', '#!bx_antispam_ip_table_actions', 0, 'select', '_bx_antispam_field_action', '_bx_antispam_field_action', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
+('bx_antispam_ip_table_form', 'bx_antispam', 'LastDT', '', '', 0, 'datetime', '_bx_antispam_field_expiration', '_bx_antispam_field_expiration', '', 1, 0, 0, '', '', '', 'date_time', '', '_bx_antispam_field_expiration_err_msg', 'DateTimeTs', '', 1, 0),
+('bx_antispam_ip_table_form', 'bx_antispam', 'Desc', '', '', 0, 'text', '_bx_antispam_field_note', '_bx_antispam_field_note', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
+('bx_antispam_ip_table_form', 'bx_antispam', 'bx_antispam_ip_table_submit', '_sys_submit', '', 0, 'submit', '_sys_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_antispam_ip_table_form', 'bx_antispam', 'close', '_sys_close', '', 0, 'reset', '_sys_close', '', '', 0, 0, 0, 'a:2:{s:7:\"onclick\";s:46:\"$(\'.bx-popup-applied:visible\').dolPopupHide();\";s:5:\"class\";s:22:\"bx-def-margin-sec-left\";}', '', '', '', '', '', '', '', 1, 0),
+('bx_antispam_ip_table_form', 'bx_antispam', 'buttons', '', 'bx_antispam_ip_table_submit,close', 0, 'input_set', '_bx_antispam_form_buttons', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0);
+
+INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES 
+('bx_antispam_ip_table_form_add', 'ID', 2147483647, 0, 0),
+('bx_antispam_ip_table_form_add', 'From', 2147483647, 1, 1),
+('bx_antispam_ip_table_form_add', 'To', 2147483647, 1, 2),
+('bx_antispam_ip_table_form_add', 'Type', 2147483647, 1, 3),
+('bx_antispam_ip_table_form_add', 'LastDT', 2147483647, 1, 4),
+('bx_antispam_ip_table_form_add', 'Desc', 2147483647, 1, 5),
+('bx_antispam_ip_table_form_add', 'bx_antispam_ip_table_submit', 2147483647, 1, 6),
+('bx_antispam_ip_table_form_add', 'close', 2147483647, 1, 7),
+('bx_antispam_ip_table_form_add', 'buttons', 2147483647, 1, 8),
+('bx_antispam_ip_table_form_edit', 'ID', 2147483647, 1, 0),
+('bx_antispam_ip_table_form_edit', 'From', 2147483647, 1, 1),
+('bx_antispam_ip_table_form_edit', 'To', 2147483647, 1, 2),
+('bx_antispam_ip_table_form_edit', 'Type', 2147483647, 1, 3),
+('bx_antispam_ip_table_form_edit', 'LastDT', 2147483647, 1, 4),
+('bx_antispam_ip_table_form_edit', 'Desc', 2147483647, 1, 5),
+('bx_antispam_ip_table_form_edit', 'bx_antispam_ip_table_submit', 2147483647, 1, 6),
+('bx_antispam_ip_table_form_edit', 'close', 2147483647, 1, 7),
+('bx_antispam_ip_table_form_edit', 'buttons', 2147483647, 1, 8);
+
+-- alerts
+
+INSERT INTO `sys_alerts_handlers` (`name`, `class`, `file`, `service_call`) VALUES 
+('bx_antispam', 'BxAntispamAlertsResponse', 'modules/boonex/antispam/classes/BxAntispamAlertsResponse.php', '');
+SET @iHandler := LAST_INSERT_ID();
+
+INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
+('account', 'check_login', @iHandler),
+('account', 'check_join', @iHandler),
+('system', 'check_spam', @iHandler);
+
+-- email templates
+
+INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `Body`) VALUES
+('bx_antispam', '_bx_antispam_spam_report_name', 'bx_antispam_spam_report', '_bx_antispam_spam_report_subject', '_bx_antispam_spam_report_body');
+
+-- cron
+
+INSERT INTO `sys_cron_jobs` (`name`, `time`, `class`, `file`, `service_call`) VALUES
+('bx_antispam_pruning', '0 0 * * *', 'BxAntispamCronPruning', 'modules/boonex/antispam/classes/BxAntispamCronPruning.php', ''),
+('bx_antispam_update_disposable_email_domains', '0 0 */14 * *', 'BxAntispamCronUpdateDisposableEmailDomains', 'modules/boonex/antispam/classes/BxAntispamCronUpdateDisposableEmailDomains.php', '');
+

+ 71 - 0
modules/boonex/antispam/updates/9.0.1_9.0.2/source/install/sql/install.sql

@@ -0,0 +1,71 @@
+
+CREATE TABLE `bx_antispam_ip_table` (
+  `ID` int(11) NOT NULL auto_increment,
+  `From` int(10) unsigned NOT NULL,
+  `To` int(10) unsigned NOT NULL,
+  `Type` enum('allow','deny') NOT NULL default 'deny',
+  `LastDT` int(11) unsigned NOT NULL,
+  `Desc` varchar(128) NOT NULL,
+  PRIMARY KEY  (`ID`),
+  KEY `From` (`From`),
+  KEY `To` (`To`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+
+CREATE TABLE `bx_antispam_dnsbl_rules` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `chain` enum('spammers','whitelist','uridns') NOT NULL,
+  `zonedomain` varchar(255) NOT NULL,
+  `postvresp` varchar(32) NOT NULL,
+  `url` varchar(255) NOT NULL,
+  `recheck` varchar(255) NOT NULL,
+  `comment` varchar(255) NOT NULL,
+  `added` int(11) NOT NULL,
+  `active` tinyint(4) NOT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
+
+INSERT INTO `bx_antispam_dnsbl_rules` (`chain`, `zonedomain`, `postvresp`, `url`, `recheck`, `comment`, `added`, `active`) VALUES
+('spammers', 'sbl.spamhaus.org.', 'any', 'http://www.spamhaus.org/sbl/', 'http://www.spamhaus.org/query/bl?ip=%s', '_bx_antispam_rule_note_spamhaus_org', 0, 1),
+('spammers', 'dnsbl.tornevall.org.', '230', 'http://dnsbl.tornevall.org/', '', '_bx_antispam_rule_note_dnsbl_tornevall_org', 0, 0),
+('uridns', 'multi.surbl.org.', 'any', 'http://www.surbl.org/', 'http://george.surbl.org/lookup.html', '_bx_antispam_rule_note_surbl_org', 0, 1),
+('spammers', 'zomgbl.spameatingmonkey.net.', 'any', 'http://spameatingmonkey.com/index.html', '', '_bx_antispam_rule_note_zomgbl_spameatingmonkey_net', 0, 0);
+
+CREATE TABLE `bx_antispam_dnsbluri_zones` (
+  `level` tinyint(4) NOT NULL,
+  `zone` varchar(64) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `bx_antispam_disposable_email_domains` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `domain` varchar(255) NOT NULL,
+  `list` enum('blacklist','custom_blacklist','whitelist','custom_whitelist') NOT NULL DEFAULT 'custom_blacklist',
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `domain` (`domain`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE `bx_antispam_block_log` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `ip` int(10) unsigned NOT NULL,
+  `profile_id` int(10) unsigned NOT NULL,
+  `type` varchar(32) NOT NULL,
+  `extra` text NOT NULL,
+  `added` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  KEY `ip` (`ip`),
+  KEY `profile_id` (`profile_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- Studio page and widget
+
+INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
+(3, 'bx_antispam', '_bx_antispam', '_bx_antispam', 'bx_antispam@modules/boonex/antispam/|std-icon.svg');
+SET @iPageId = LAST_INSERT_ID();
+
+SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
+SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
+INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
+(@iPageId, 'bx_antispam', '{url_studio}module.php?name=bx_antispam', '', 'bx_antispam@modules/boonex/antispam/|std-icon.svg', '_bx_antispam', '', '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));
+

+ 9 - 0
modules/boonex/antispam/updates/9.0.1_9.0.2/source/install/sql/uninstall.sql

@@ -0,0 +1,9 @@
+
+DROP TABLE IF EXISTS `bx_antispam_ip_table`, `bx_antispam_dnsbl_rules`, `bx_antispam_dnsbluri_zones`, `bx_antispam_disposable_email_domains`, `bx_antispam_block_log`;
+
+-- Studio page and widget
+
+DELETE FROM `tp`, `tw`, `tpw`
+USING `sys_std_pages` AS `tp`, `sys_std_widgets` AS `tw`, `sys_std_pages_widgets` AS `tpw`
+WHERE `tp`.`id` = `tw`.`page_id` AND `tw`.`id` = `tpw`.`widget_id` AND `tp`.`name` = 'bx_antispam';
+

+ 139 - 0
modules/boonex/contact/updates/9.0.2_9.0.3/source/classes/BxContactModule.php

@@ -0,0 +1,139 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Contact Contact
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+bx_import('BxDolAcl');
+
+class BxContactModule extends BxDolModule
+{
+    /**
+     * Constructor
+     */
+    function __construct($aModule)
+    {
+        parent::__construct($aModule);
+
+        $this->_oConfig->init($this->_oDb);
+    }
+
+    /**
+     * SERVICE METHODS
+     */
+    public function serviceGetBlockForm()
+    {
+        $aDefaultFields = array('name', 'email', 'subject', 'body', 'do_submit');
+
+        $mixedAllowed = $this->isAllowedContact();
+        if($mixedAllowed !== true)
+            return array(
+                'content' => MsgBox($mixedAllowed)
+            );
+
+        $sResult = '';
+
+        $oForm = BxDolForm::getObjectInstance($this->_oConfig->getObject('form_contact'), $this->_oConfig->getObject('form_display_contact_send'), $this->_oTemplate);
+
+        $oForm->initChecker();
+        if($oForm->isSubmittedAndValid()) {
+            $iId = $oForm->insert(array(
+                'uri' => $oForm->generateUri(),
+                'date' => time()
+            ));
+
+            if($iId !== false) {
+                $sCustomFields = '';
+                $aCustomFields = array();
+                foreach($oForm->aInputs as $aInput) {
+                    if(in_array($aInput['name'], $aDefaultFields))
+                        continue;
+
+                    $aCustomFields[$aInput['name']] = bx_process_output($oForm->getCleanValue($aInput['name']));
+                    $sCustomFields .= $aInput['caption'] . ': ' . $aCustomFields[$aInput['name']] . '<br />';
+                }
+
+                $aTemplateKeys = array(
+                    'SenderName' => bx_process_output($oForm->getCleanValue('name')),
+                    'SenderEmail' => bx_process_output($oForm->getCleanValue('email')),
+                    'MessageSubject' => bx_process_output($oForm->getCleanValue('subject')),
+                    'MessageBody' => bx_process_output(nl2br($oForm->getCleanValue('body')), BX_DATA_TEXT_MULTILINE),
+                    'CustomFields' => $sCustomFields,
+                );
+                $aTemplateKeys = array_merge($aTemplateKeys, $aCustomFields);
+
+                $aMessage = BxDolEmailTemplates::getInstance()->parseTemplate('bx_contact_contact_form_message', $aTemplateKeys);
+
+                $sResult = '';
+                $sRecipientEmail = $this->_oConfig->getEmail();
+                $aCustomHeaders = array();
+                if (getParam('bx_contact_send_from_senders_email')) {
+                    $aCustomHeaders = array(
+                        'From' => $oForm->getCleanValue('name') . ' <' . bx_process_output($oForm->getCleanValue('email')) . '>',
+                        'Sender' => trim(getParam('bx_smtp_from_email')) ? trim(getParam('bx_smtp_from_email')) : getParam('site_email_notify'),
+                    );
+                }
+                
+                if(sendMail($sRecipientEmail, $aMessage['Subject'], $aMessage['Body'], 0, array(), BX_EMAIL_SYSTEM, 'html', false, $aCustomHeaders)) {
+                    $this->onContact();
+
+                    foreach($oForm->aInputs as $iKey => $aInput) 
+                        if(in_array($aInput['type'], array('text', 'textarea')))
+                            $oForm->aInputs[$iKey]['value'] = '';
+
+                    $sResult = '_ADM_PROFILE_SEND_MSG';
+                } else
+                    $sResult = '_Email sent failed';
+
+                $sResult = MsgBox(_t($sResult));
+            }
+        }
+
+        return array(
+            'content' => $sResult . $oForm->getCode()
+        );
+    }
+
+    public function serviceGetContactPageUrl()
+    {
+        //if (true !== $this->isAllowedContact())
+        //    return false;
+
+        return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=contact');
+    }
+
+    /*
+     * COMMON METHODS
+     */
+    public function getUserId()
+    {
+        return isLogged() ? bx_get_logged_profile_id() : 0;
+    }
+
+    protected function onContact()
+    {
+        $iUserId = $this->getUserId();
+
+        $this->isAllowedContact(true);
+
+        //--- Event -> Contact for Alerts Engine ---//
+        $oAlert = new BxDolAlerts($this->_oConfig->getObject('alert'), 'contact', 0, $iUserId);
+        $oAlert->alert();
+        //--- Event -> Contact for Alerts Engine ---//
+    }
+
+    protected function isAllowedContact($bPerform = false)
+    {
+        $iUserId = $this->getUserId();
+
+        $aCheckResult = checkActionModule($iUserId, 'contact', $this->getName(), $bPerform);
+        return $aCheckResult[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED ? $aCheckResult[CHECK_ACTION_MESSAGE] : true;
+    }
+}
+
+/** @} */

+ 72 - 0
modules/boonex/contact/updates/9.0.2_9.0.3/source/install/config.php

@@ -0,0 +1,72 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Contact Contact
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_contact',
+    'title' => 'Contact',
+    'note' => 'Contact module.',
+    'version' => '9.0.3',
+    'vendor' => 'BoonEx',
+	'help_url' => 'http://feed.boonex.com/?section={module_name}',
+    
+
+    'compatible_with' => array(
+        '9.0.0-RC1'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/contact/',
+    'home_uri' => 'contact',
+
+    'db_prefix' => 'bx_contact_',
+    'class_prefix' => 'BxContact',
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => 'Contact',
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+        'execute_sql' => 1,
+        'update_languages' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'uninstall' => array (
+        'execute_sql' => 1,
+        'update_languages' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'enable' => array(
+        'execute_sql' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'disable' => array (
+        'execute_sql' => 1,
+        'clear_db_cache' => 1,
+    ),
+
+    /**
+     * Dependencies Section
+     */
+    'dependencies' => array(),
+
+);
+
+/** @} */

+ 47 - 0
modules/boonex/contact/updates/9.0.2_9.0.3/source/install/langs/en.xml

@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+
+	<string name="_bx_contact"><![CDATA[Contact]]></string>
+
+	<string name="_bx_contact_form_contact"><![CDATA[Contact]]></string>
+	<string name="_bx_contact_form_contact_display_send"><![CDATA[Send]]></string>
+	<string name="_bx_contact_form_contact_input_sys_name"><![CDATA[Your Name]]></string>
+	<string name="_bx_contact_form_contact_input_name"><![CDATA[Your Name]]></string>
+	<string name="_bx_contact_form_contact_input_name_err"><![CDATA[You need to type your name here.]]></string>
+	<string name="_bx_contact_form_contact_input_sys_email"><![CDATA[Your email]]></string>
+	<string name="_bx_contact_form_contact_input_email"><![CDATA[Your email]]></string>
+	<string name="_bx_contact_form_contact_input_email_err"><![CDATA[You need to type the correct email here.]]></string>
+	<string name="_bx_contact_form_contact_input_sys_subject"><![CDATA[Message subject]]></string>
+	<string name="_bx_contact_form_contact_input_subject"><![CDATA[Message subject]]></string>
+	<string name="_bx_contact_form_contact_input_subject_err"><![CDATA[You need to type message's subject here.]]></string>
+	<string name="_bx_contact_form_contact_input_sys_body"><![CDATA[Message text]]></string>
+	<string name="_bx_contact_form_contact_input_body"><![CDATA[Message text]]></string>
+	<string name="_bx_contact_form_contact_input_body_err"><![CDATA[You need to type message's body here.]]></string>
+	<string name="_bx_contact_form_contact_input_sys_captcha"><![CDATA[Captcha]]></string>
+	<string name="_bx_contact_form_contact_input_captcha"><![CDATA[Security Image]]></string>
+	<string name="_bx_contact_form_contact_input_captcha_err"><![CDATA[Security image input failed. Please, try again.]]></string>
+	<string name="_bx_contact_form_contact_input_sys_do_submit"><![CDATA[Send]]></string>
+	<string name="_bx_contact_form_contact_input_do_submit"><![CDATA[Send]]></string>
+
+	<string name="_bx_contact_page_title_sys_contact"><![CDATA[Contact Us]]></string>
+	<string name="_bx_contact_page_title_contact"><![CDATA[Contact Us]]></string>
+	<string name="_bx_contact_page_block_title_form"><![CDATA[Contact Us]]></string>
+
+    <string name="_bx_contact_menu_item_title_system_contact"><![CDATA[Contact]]></string>
+    <string name="_bx_contact_menu_item_title_contact"><![CDATA[Contact]]></string>
+
+	<string name="_bx_contact_option_email"><![CDATA[Email address to receive messages (if empty, site's email will be used)]]></string>
+	<string name="_bx_contact_option_send_from_senders_email"><![CDATA[Send messages from sender's email address]]></string>
+
+	<string name="_bx_contact_acl_action_contact"><![CDATA[Contact]]></string>
+
+	<string name="_bx_contact_et_contact_form_message"><![CDATA[Contact form message.]]></string>
+	<string name="_bx_contact_et_contact_form_message_subject"><![CDATA[Contact form message.]]></string>
+	<string name="_bx_contact_et_contact_form_message_body"><![CDATA[{email_header}
+<p><b>Dear Administrator</b>,</p>
+<p>You were contacted by <u>{SenderName}</u> with email <u>{SenderEmail}</u></p>
+<hr />
+<p><b>{MessageSubject}</b></p>
+<p>{MessageBody}</p>
+{email_footer}]]></string>
+</resources>

+ 64 - 0
modules/boonex/contact/updates/9.0.2_9.0.3/source/install/sql/enable.sql

@@ -0,0 +1,64 @@
+SET @sName = 'bx_contact';
+
+
+-- PAGES & BLOCKS
+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_contact_contact', '_bx_contact_page_title_sys_contact', '_bx_contact_page_title_contact', @sName, 5, 2147483647, 1, 'contact', 'page.php?i=contact', '', '', '', 0, 1, 0, '', '');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_contact_contact', 1, @sName, '_bx_contact_page_block_title_form', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_contact";s:6:"method";s:14:"get_block_form";}', 0, 1, 1);
+
+
+-- MENU: FOOTER
+SET @iMIOrder = (SELECT MAX(`order`) FROM `sys_menu_items` WHERE `set_name`='sys_footer' AND `order` < 9999 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_footer', @sName, 'contact', '_bx_contact_menu_item_title_system_contact', '_bx_contact_menu_item_title_contact', 'page.php?i=contact', '', '', '', '', 2147483647, 1, 1, @iMIOrder + 1);
+
+
+-- 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', @sName, '_bx_contact', 'bx_contact@modules/boonex/contact/|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, @sName, '_bx_contact', 1);
+SET @iCategId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_error`, `extra`, `order`) VALUES
+('bx_contact_email', '', @iCategId, '_bx_contact_option_email', 'digit', '', '', '', 1),
+('bx_contact_send_from_senders_email', '', @iCategId, '_bx_contact_option_send_from_senders_email', 'checkbox', '', '', '', 20);
+
+
+-- ACL
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+(@sName, 'contact', NULL, '_bx_contact_acl_action_contact', '', 1, 0);
+SET @iIdActionContact = 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
+
+-- contact
+(@iUnauthenticated, @iIdActionContact),
+(@iAccount, @iIdActionContact),
+(@iStandard, @iIdActionContact),
+(@iUnconfirmed, @iIdActionContact),
+(@iPending, @iIdActionContact),
+(@iSuspended, @iIdActionContact),
+(@iModerator, @iIdActionContact),
+(@iAdministrator, @iIdActionContact),
+(@iPremium, @iIdActionContact);
+
+
+-- EMAIL TEMPLATES
+INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `Body`) VALUES 
+(@sName, '_bx_contact_et_contact_form_message', 'bx_contact_contact_form_message', '_bx_contact_et_contact_form_message_subject', '_bx_contact_et_contact_form_message_body');

+ 72 - 0
modules/boonex/convos/updates/9.0.3_9.0.4/source/classes/BxCnvCmts.php

@@ -0,0 +1,72 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Convos Convos
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxCnvCmts extends BxTemplCmts
+{
+    /**
+     * Comments are enabled for collaborators only
+     */
+    public function isEnabled ()
+    {
+        if (!parent::isEnabled ())
+            return false;
+
+        $oModule = BxDolModule::getInstance('bx_convos');
+        if (!$oModule->_oDb->getContentInfoById((int)$this->getId()))
+            return false;
+
+        $aCollaborators = $oModule->_oDb->getCollaborators((int)$this->getId());
+        if (!isset($aCollaborators[bx_get_logged_profile_id()]))
+            return false;
+
+        return true;
+    }
+
+    public function isRemoveAllowed ($aCmt, $isPerformAction = false)
+    {
+        if (isAdmin())
+            return true;
+
+        return false;
+    }
+
+    public function msgErrRemoveAllowed ()
+    {
+        return _t('_sys_txt_access_denied');
+    }
+
+    public function isEditAllowed ($aCmt, $isPerformAction = false)
+    {
+        return $this->isRemoveAllowed ($aCmt, $isPerformAction);
+    }
+
+    public function msgErrEditAllowed ()
+    {
+        return $this->msgErrRemoveAllowed ();
+    }
+
+    protected function _getFormObject($sAction = BX_CMT_ACTION_POST)
+    {
+        $oForm = parent::_getFormObject($sAction);
+        $oForm->aInputs['cmt_submit']['value'] = _t('_sys_send');
+        return $oForm;
+    }
+
+    function getCommentsBlock($aBp = array(), $aDp = array())
+    {
+        $mixedBlock = parent::getCommentsBlock($aBp, $aDp);
+        if (is_array($mixedBlock) && isset($mixedBlock['title']))
+            $mixedBlock['title'] = _t('_bx_cnv_page_block_title_entry_comments', $this->getCommentsCount());
+        return $mixedBlock;
+    }
+}
+
+/** @} */

+ 375 - 0
modules/boonex/convos/updates/9.0.3_9.0.4/source/classes/BxCnvModule.php

@@ -0,0 +1,375 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Convos Convos
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+define('BX_CNV_FOLDER_INBOX', 1);
+define('BX_CNV_FOLDER_DRAFTS', 2);
+define('BX_CNV_FOLDER_SPAM', 3);
+define('BX_CNV_FOLDER_TRASH', 4);
+
+/**
+ * Conversations module
+ */
+class BxCnvModule extends BxBaseModTextModule
+{
+    function __construct(&$aModule)
+    {
+        parent::__construct($aModule);
+    }
+
+    public function sortCollaborators ($aCollaborators, $iProfileIdLastComment, $iProfileIdAuthor, $iProfileIdCurrent = 0)
+    {
+        if (!$iProfileIdCurrent)
+            $iProfileIdCurrent = bx_get_logged_profile_id();
+
+        $aMoveUp = array($iProfileIdCurrent, $iProfileIdLastComment, $iProfileIdAuthor);
+
+        asort($aCollaborators, SORT_NUMERIC);
+
+        foreach ($aMoveUp as $iProfileId) {
+            if (!isset($aCollaborators[$iProfileId]))
+                continue;
+
+            $a = array($iProfileId => $aCollaborators[$iProfileId]);
+            unset($aCollaborators[$iProfileId]);
+            $aCollaborators = $a + $aCollaborators;
+        }
+
+        return $aCollaborators;
+    }
+
+    public function setModuleSubmenu ($iCurrentFolderId = 0)
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        $aMapFolderId2MenuName = array (
+            BX_CNV_FOLDER_INBOX => 'convos-folder-inbox',
+            BX_CNV_FOLDER_DRAFTS => 'convos-drafts',
+            BX_CNV_FOLDER_SPAM => 'convos-spam',
+            BX_CNV_FOLDER_TRASH => 'convos-trash',
+        );
+
+        $oMenuSubmenu = BxDolMenu::getObjectInstance('sys_site_submenu');
+        if (!$oMenuSubmenu)
+            return;
+
+        $oMenuSubmenu->setObjectSubmenu($CNF['OBJECT_MENU_SUBMENU'], array (
+            'title' => _t('_bx_cnv'),
+            'link' => BX_DOL_URL_ROOT . $CNF['URL_HOME'],
+            'icon' => '',
+        ));
+
+        $oMenuModule = BxDolMenu::getObjectInstance($CNF['OBJECT_MENU_SUBMENU']);
+        if ($oMenuModule && isset($aMapFolderId2MenuName[$iCurrentFolderId]))
+            $oMenuModule->setSelected($this->_aModule['name'], $aMapFolderId2MenuName[$iCurrentFolderId]);
+    }
+
+    /**
+     * Mark conversation as unread for the current user
+     * @return error string on error, or empty string on success
+     */
+    public function markUnread ($iContentId)
+    {
+        $aContentInfo = $this->_oDb->getContentInfoById($iContentId);
+        if (!$aContentInfo)
+            return _t('_sys_request_page_not_found_cpt');
+
+        if (CHECK_ACTION_RESULT_ALLOWED !== ($sMsg = $this->checkAllowedView($aContentInfo)))
+            return $sMsg;
+
+        if (!$this->_oDb->updateReadComments(bx_get_logged_profile_id(), (int)$iContentId, -1))
+            return _t('_error occured');
+
+        return '';
+    }
+
+    /**
+     * Delete conversation for current user by content id, before deletetion it checks user permission to delete convos
+     * @return error string on error, or empty string on success
+     */
+    public function deleteConvo ($iContentId)
+    {
+        $aContentInfo = $this->_oDb->getContentInfoById($iContentId);
+        if (!$aContentInfo)
+            return _t('_sys_request_page_not_found_cpt');
+
+        if (CHECK_ACTION_RESULT_ALLOWED !== ($sMsg = $this->checkAllowedDelete($aContentInfo)))
+            return $sMsg;
+
+        if (!$this->_oDb->moveConvo((int)$iContentId, bx_get_logged_profile_id(), BX_CNV_FOLDER_TRASH))
+            return _t('_error occured');
+
+        return '';
+    }
+
+    /**
+     * Delete whole conversation for all users by content id
+     * @return error string on error, or empty string on success
+     */
+    public function deleteConvoForever ($iContentId)
+    {
+        if (!$this->_oDb->deleteConvo((int)$iContentId))
+            return _t('_error occured');
+
+        return '';
+    }
+
+    public function actionMarkUnread($iContentId)
+    {
+        header('Content-Type:text/plain; charset=utf-8');
+
+        if ($s = $this->markUnread ($iContentId)) {
+            echo $s;
+            exit;
+        }
+
+        echo BX_DOL_URL_ROOT . $this->_oConfig->CNF['URL_HOME'];
+        exit;
+    }
+
+    public function actionDelete($iContentId)
+    {
+        header('Content-Type:text/plain; charset=utf-8');
+
+        if ($s = $this->deleteConvo ($iContentId)) {
+            echo $s;
+            exit;
+        }
+
+        echo BX_DOL_URL_ROOT . $this->_oConfig->CNF['URL_HOME'];
+        exit;
+    }
+
+    /**
+     * Display convos in folder
+     */
+    public function actionFolder ($iFolderId)
+    {
+        $oTemplate = BxDolTemplate::getInstance();
+
+        $aFolder = $this->_oDb->getFolder((int)$iFolderId);
+        $oPage = BxDolPage::getObjectInstance('bx_convos_home');
+
+        if (!$aFolder || !$oPage) {
+            $this->_oTemplate->displayPageNotFound();
+            exit;
+        }
+
+        // add replaceable markers
+        $oPage->addMarkers(array(
+            'folder_id' => (int)$iFolderId,
+            'folder' => _t($aFolder['name']),
+        ));
+
+        $s = $oPage->getCode();
+
+        $this->_oTemplate = BxDolTemplate::getInstance();
+        $this->_oTemplate->setPageNameIndex (BX_PAGE_DEFAULT);
+        $this->_oTemplate->setPageContent ('page_main_code', $s);
+        $this->_oTemplate->getPageCode();
+    }
+
+    /**
+     * Get possible recipients for start conversation form
+     */
+    public function actionAjaxGetRecipients ()
+    {
+        $sTerm = bx_get('term');
+
+        $a = BxDolService::call('system', 'profiles_search', array($sTerm), 'TemplServiceProfiles');
+
+        header('Content-Type:text/javascript; charset=utf-8');
+        echo(json_encode($a));
+    }
+
+    public function serviceConversationsInFolder ($iFolderId = BX_CNV_FOLDER_INBOX)
+    {
+        $oGrid = BxDolGrid::getObjectInstance($this->_oConfig->CNF['OBJECT_GRID']);
+        if (!$oGrid)
+            return false;
+
+        $aFolder = $this->_oDb->getFolder((int)$iFolderId);
+        if (!$aFolder)
+            return false;
+
+        $this->setModuleSubmenu ((int)$iFolderId);
+
+        // TODO: incorporate markers into custom class, so replace will work in search and so on
+        $oGrid->addMarkers(array(
+            'folder_id' => (int)$iFolderId,
+            'profile_id' => bx_get_logged_profile_id(),
+        ));
+
+        return $oGrid->getCode();
+    }
+
+    public function serviceMessagesPreviews ($iProfileId = 0)
+    {
+        if (!$iProfileId)
+            $iProfileId = bx_get_logged_profile_id();
+
+        $a = $this->_oDb->getMessagesPreviews($iProfileId, 0, (int)getParam('bx_convos_preview_messages_num'));
+
+        return $this->_oTemplate->getMessagesPreviews($a);
+    }
+
+    /**
+     * Get number of unread messages for spme profile
+     * @param $iProfileId - profile to get unread messages for, if omitted then currently logged is profile is used
+     * @return integer
+     */
+    public function serviceGetUnreadMessagesNum ($iProfileId = 0)
+    {
+        if (!$iProfileId)
+            $iProfileId = bx_get_logged_profile_id();
+
+        return $this->_oDb->getUnreadMessagesNum((int)$iProfileId);
+    }
+
+    public function serviceGetLiveUpdates($aMenuItemParent, $aMenuItemChild, $iCount = 0)
+    {
+        $iProfileId = (int)bx_get_logged_profile_id();
+        $iCountNew = $this->_oDb->getUnreadMessagesNum($iProfileId);
+        if($iCountNew <= $iCount)
+			return false;
+
+        return array(
+    		'count' => $iCountNew, // required
+    		'method' => 'bx_menu_show_live_update(oData)', // required
+    		'data' => array(
+    			'code' => BxDolTemplate::getInstance()->parseHtmlByName('menu_item_addon.html', array(
+    				'content' => '{count}'
+                )),
+                'mi_parent' => $aMenuItemParent,
+                'mi_child' => $aMenuItemChild
+    		),  // optional, may have some additional data to be passed in JS method provided using 'method' param above.
+    	);
+    }
+
+    /**
+     * Update last comment time and author
+     */
+    public function serviceTriggerCommentPost ($iContentId, $iProfileId, $iCommentId, $iTimestamp = 0, $sCommentText = '')
+    {
+        if (!(int)$iContentId)
+            return false;
+        $aContentInfo = $this->_oDb->getContentInfoById((int)$iContentId);
+        if (!$aContentInfo)
+            return false;
+
+        if (!$iTimestamp)
+            $iTimestamp = time();
+
+        if ($iProfileId == bx_get_logged_profile_id())
+            $this->_oDb->updateReadComments($iProfileId, $aContentInfo[$this->_oConfig->CNF['FIELD_ID']], $aContentInfo[$this->_oConfig->CNF['FIELD_COMMENTS']]);
+
+        if (!$this->_oDb->updateLastCommentTimeProfile((int)$iContentId, (int)$iProfileId, (int)$iCommentId, $iTimestamp))
+            return false;
+
+        // send notification to all collaborators
+        if ($oProfile = BxDolProfile::getInstance($iProfileId)) {
+            $aCollaborators = $this->_oDb->getCollaborators($aContentInfo[$this->_oConfig->CNF['FIELD_ID']]);
+            foreach ($aCollaborators as $iCollaborator => $iReadComments) {
+                if ($iCollaborator == $iProfileId)
+                    continue;
+                sendMailTemplate('bx_cnv_new_reply', 0, $iCollaborator, array(
+                    'SenderDisplayName' => $oProfile->getDisplayName(),
+                    'SenderUrl' => $oProfile->getUrl(),
+                    'Message' => $sCommentText,
+                ), BX_EMAIL_NOTIFY);
+            }
+        }
+
+        return true;
+    }
+
+    /**
+     * Entry collaborators block
+     */
+    public function serviceEntityCollaborators ($iContentId = 0)
+    {
+        if (!$iContentId)
+            $iContentId = bx_process_input(bx_get('id'), BX_DATA_INT);
+        if (!$iContentId)
+            return false;
+        $aContentInfo = $this->_oDb->getContentInfoById($iContentId);
+        if (!$aContentInfo)
+            return false;
+
+        return $this->_oTemplate->entryCollaborators ($aContentInfo, 5, 'right');
+    }
+
+    /**
+     * No social sharing for private conversations
+     */
+    public function serviceEntitySocialSharing ($iContentId = 0)
+    {
+        return '';
+    }
+
+    /**
+     * No moderators for personal convos
+     */
+    protected function _isModerator ($isPerformAction = false)
+    {
+        return false;
+    }
+
+    /**
+     * No thumbs for convos
+     */
+    public function checkAllowedSetThumb ()
+    {
+        return _t('_sys_txt_access_denied');
+    }
+
+    public function checkAllowedEdit ($aDataEntry, $isPerformAction = false)
+    {       
+        if ($aDataEntry[$this->_oConfig->CNF['FIELD_ALLOW_EDIT']] && $this->isCollaborator($aDataEntry, bx_get_logged_profile_id()))
+            return CHECK_ACTION_RESULT_ALLOWED;
+
+        return parent::checkAllowedEdit ($aDataEntry, $isPerformAction);
+    }
+    
+    /**
+     * Conversations can be deleted by author and/or collaborators only.
+     * Admins can't delete conversations, since it's designed for participant only, it's moved to trash actually, also it's private content.
+     */
+    public function checkAllowedDelete (&$aDataEntry, $isPerformAction = false)
+    {
+        if ($aDataEntry[$this->_oConfig->CNF['FIELD_AUTHOR']] == $this->_iProfileId || $this->isCollaborator($aDataEntry, bx_get_logged_profile_id()))
+            return CHECK_ACTION_RESULT_ALLOWED;
+
+        if ($this->_isModerator($isPerformAction))
+            return _t('_sys_txt_access_denied');
+
+        return parent::checkAllowedDelete ($aDataEntry, $isPerformAction);
+    }
+
+    /**
+     * Only collaborators can view convo
+     */
+    public function checkAllowedView ($aDataEntry, $isPerformAction = false)
+    {
+        if (CHECK_ACTION_RESULT_ALLOWED !== ($sMsg = parent::checkAllowedView ($aDataEntry, $isPerformAction)))
+            return $sMsg;
+
+        return $this->isCollaborator($aDataEntry, bx_get_logged_profile_id()) ? CHECK_ACTION_RESULT_ALLOWED : _t('_sys_txt_access_denied');
+    }
+
+
+    protected function isCollaborator($aDataEntry, $iProfileId)
+    {
+        $aCollaborators = $this->_oDb->getCollaborators($aDataEntry[$this->_oConfig->CNF['FIELD_ID']]);
+        return isset($aCollaborators[$iProfileId]);
+    }
+}
+
+/** @} */

+ 104 - 0
modules/boonex/convos/updates/9.0.3_9.0.4/source/install/config.php

@@ -0,0 +1,104 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Convos Convos
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_convos',
+    'title' => 'Conversations',
+    'note' => 'Conversations module.',
+    'version' => '9.0.4',
+    'vendor' => 'BoonEx',
+	'help_url' => 'http://feed.boonex.com/?section={module_name}',
+
+    'compatible_with' => array(
+        '9.0.0-RC1'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/convos/',
+    'home_uri' => 'convos',
+
+    'db_prefix' => 'bx_convos_',
+    'class_prefix' => 'BxCnv',
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => 'Conversations',
+
+    /**
+     * Menu triggers.
+     */
+    'menu_triggers' => array(
+        'trigger_profile_view_actions',
+        'trigger_group_view_actions',
+    ),
+
+    /**
+     * Storages.
+     */
+    'storages' => array(
+    	'bx_convos_files'
+    ),
+
+	/**
+     * Transcoders.
+     */
+    'transcoders' => array(
+		'bx_convos_preview'
+    ),
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+        'execute_sql' => 1,
+        'update_languages' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'uninstall' => array (
+    	'process_storages' => 1,
+        'execute_sql' => 1,
+        'update_languages' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'enable' => array(
+        'execute_sql' => 1,
+        'clear_db_cache' => 1,
+    ),
+	'enable_success' => array(
+    	'process_menu_triggers' => 1,
+    	'register_transcoders' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'disable' => array (
+        'execute_sql' => 1,
+    	'unregister_transcoders' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'disable_failed' => array (
+    	'register_transcoders' => 1,
+    	'clear_db_cache' => 1,
+    ),
+
+    /**
+     * Dependencies Section
+     */
+    'dependencies' => array(),
+);
+
+/** @} */

+ 135 - 0
modules/boonex/convos/updates/9.0.3_9.0.4/source/install/langs/en.xml

@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+
+	<string name="_bx_cnv"><![CDATA[Conversations]]></string>
+	<string name="_bx_convos"><![CDATA[Conversations]]></string>
+
+	<string name="_bx_cnv_option_preview_messages_num"><![CDATA[Number of preview messages]]></string>
+
+	<string name="_bx_cnv_form_entry"><![CDATA[Conversations]]></string>
+	<string name="_bx_cnv_form_entry_display_add"><![CDATA[New conversation]]></string>
+	<string name="_bx_cnv_form_entry_display_edit"><![CDATA[Edit conversation]]></string>
+	<string name="_bx_cnv_form_entry_display_delete"><![CDATA[Delete conversation]]></string>
+	<string name="_bx_cnv_form_entry_display_view"><![CDATA[View conversation]]></string>
+	<string name="_bx_cnv_form_entry_input_sys_do_submit"><![CDATA[Submit]]></string>
+	<string name="_bx_cnv_form_entry_input_do_submit"><![CDATA[Submit]]></string>
+	<string name="_bx_cnv_form_entry_input_sys_text"><![CDATA[Text]]></string>
+	<string name="_bx_cnv_form_entry_input_text"><![CDATA[Text]]></string>
+	<string name="_bx_cnv_form_entry_input_text_err"><![CDATA[Text field can't be empty]]></string>
+	<string name="_bx_cnv_form_entry_input_sys_delete_confirm"><![CDATA[Delete confirmation]]></string>
+	<string name="_bx_cnv_form_entry_input_delete_confirm"><![CDATA[I am sure I want to delete this conversation]]></string>
+	<string name="_bx_cnv_form_entry_input_delete_confirm_info"><![CDATA[This action can not be undone]]></string>
+	<string name="_bx_cnv_form_entry_input_delete_confirm_error"><![CDATA[Please check this checkbox if you really want to delete the conversation]]></string>
+	<string name="_bx_cnv_form_entry_input_sys_attachments"><![CDATA[Attachments]]></string>
+	<string name="_bx_cnv_form_entry_input_attachments"><![CDATA[Attachments]]></string>
+    <string name="_bx_cnv_form_entry_input_recipients"><![CDATA[Recipients]]></string>
+    <string name="_bx_cnv_form_entry_input_sys_recipients"><![CDATA[Recipients]]></string>
+    <string name="_bx_cnv_form_entry_input_recipients_err"><![CDATA[Recipients is mandatory]]></string>
+    <string name="_bx_cnv_form_entry_input_sys_submit_text"><![CDATA[Draft status]]></string>
+    <string name="_bx_cnv_form_entry_input_sys_submit_block"><![CDATA[Submit block]]></string>
+    <string name="_bx_cnv_form_entry_input_sys_draft_id"><![CDATA[Draft ID]]></string>
+    <string name="_bx_cnv_form_entry_input_sys_allow_edit"><![CDATA[Main post editing by participants]]></string>
+    <string name="_bx_cnv_form_entry_input_allow_edit"><![CDATA[Main post editing by participants]]></string>
+
+	<string name="_bx_cnv_acl_action_create_entry"><![CDATA[New conversation]]></string>
+	<string name="_bx_cnv_acl_action_delete_entry"><![CDATA[Delete conversation]]></string>
+	<string name="_bx_cnv_acl_action_view_entry"><![CDATA[View conversation]]></string>
+
+	<string name="_bx_cnv_page_title_sys_create_entry"><![CDATA[New conversation]]></string>
+	<string name="_bx_cnv_page_title_create_entry"><![CDATA[New conversation]]></string>
+	<string name="_bx_cnv_page_block_title_create_entry"><![CDATA[New conversation]]></string>
+	<string name="_bx_cnv_page_title_sys_view_entry"><![CDATA[View conversation]]></string>
+	<string name="_bx_cnv_page_title_view_entry"><![CDATA[{title}]]></string>
+	<string name="_bx_cnv_page_block_title_entry_attachments"><![CDATA[Attachments]]></string>
+	<string name="_bx_cnv_page_block_title_entry_text"><![CDATA[Text]]></string>
+    <string name="_bx_cnv_page_block_title_entry_author"><![CDATA[Author]]></string>
+    <string name="_bx_cnv_page_block_title_entry_actions"><![CDATA[Actions]]></string>
+    <string name="_bx_cnv_page_block_title_entry_breadcrumb"><![CDATA[Breadcrumb]]></string>
+    <string name="_bx_cnv_page_block_title_entry_comments"><![CDATA[Replies ({0})]]></string>
+    <string name="_bx_cnv_page_block_title_entry_collaborators"><![CDATA[Participants]]></string>
+    <string name="_bx_cnv_page_title_sys_folder"><![CDATA[Conversations in folder]]></string>
+    <string name="_bx_cnv_page_title_folder"><![CDATA[Folder: {folder}]]></string>
+    <string name="_bx_cnv_page_block_title_folder"><![CDATA[Folder: {folder}]]></string>
+    <string name="_bx_cnv_page_block_title_convos"><![CDATA[Conversations]]></string>
+    <string name="_bx_cnv_page_title_sys_edit_entry"><![CDATA[Edit conversation]]></string>
+    <string name="_bx_cnv_page_title_edit_entry"><![CDATA[Edit conversation]]></string>
+    <string name="_bx_cnv_page_block_title_edit_entry"><![CDATA[Edit conversation]]></string>
+
+    <string name="_bx_cnv_menu_set_title_view_entry"><![CDATA[Conversation Actions]]></string>
+    <string name="_bx_cnv_menu_title_view_entry"><![CDATA[Conversation Actions]]></string>
+    <string name="_bx_cnv_menu_title_submenu"><![CDATA[Conversations Submenu]]></string>
+    <string name="_bx_cnv_menu_set_title_submenu"><![CDATA[Conversations Submenu]]></string>
+    <string name="_bx_cnv_menu_title_folders_more"><![CDATA[Conversations folders]]></string>
+    <string name="_bx_cnv_menu_set_title_submenu"><![CDATA[Conversations folders]]></string>
+    <string name="_bx_cnv_menu_set_title_folders_more"><![CDATA[More folders]]></string>
+    <string name="_bx_cnv_menu_item_title_system_message"><![CDATA[Message]]></string>
+    <string name="_bx_cnv_menu_item_title_message"><![CDATA[Message]]></string>
+    <string name="_bx_cnv_menu_item_title_system_message_group"><![CDATA[Group Message]]></string>
+    <string name="_bx_cnv_menu_item_title_message_group"><![CDATA[Group Message]]></string>
+    <string name="_bx_cnv_menu_item_title_system_mark_unread_entry"><![CDATA[Mark as unread]]></string>
+    <string name="_bx_cnv_menu_item_title_mark_unread_entry"><![CDATA[Mark as unread]]></string>
+
+    <string name="_bx_cnv_menu_item_title_system_delete_entry"><![CDATA[Delete conversation]]></string>
+    <string name="_bx_cnv_menu_item_title_delete_entry"><![CDATA[Delete conversation]]></string>
+    <string name="_bx_cnv_menu_item_title_system_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_cnv_menu_item_title_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_cnv_menu_item_title_system_folder_inbox"><![CDATA[Inbox]]></string>
+    <string name="_bx_cnv_menu_item_title_folder_inbox"><![CDATA[Inbox]]></string>
+    <string name="_bx_cnv_menu_item_title_system_folder_drafts"><![CDATA[Drafts]]></string>
+    <string name="_bx_cnv_menu_item_title_folder_drafts"><![CDATA[Drafts]]></string>
+    <string name="_bx_cnv_menu_item_title_system_folder_spam"><![CDATA[Spam]]></string>
+    <string name="_bx_cnv_menu_item_title_folder_spam"><![CDATA[Spam]]></string>
+    <string name="_bx_cnv_menu_item_title_system_folder_trash"><![CDATA[Trash]]></string>
+    <string name="_bx_cnv_menu_item_title_folder_trash"><![CDATA[Trash]]></string>
+    <string name="_bx_cnv_menu_item_title_system_folder_more"><![CDATA[More]]></string>
+    <string name="_bx_cnv_menu_item_title_folder_more"><![CDATA[More]]></string>
+    <string name="_bx_cnv_menu_item_title_system_convos"><![CDATA[Conversations]]></string>
+    <string name="_bx_cnv_menu_item_title_convos"><![CDATA[Conversations]]></string>
+    <string name="_bx_cnv_menu_item_title_system_unread_messages"><![CDATA[Unread messages number]]></string>
+    <string name="_bx_cnv_menu_item_title_unread_messages"><![CDATA[{addon} unread messages]]></string>
+
+    <string name="_bx_cnv_txt_sample_single"><![CDATA[conversation]]></string>
+
+    <string name="_bx_cnv_folder_inbox"><![CDATA[Inbox]]></string>
+    <string name="_bx_cnv_folder_drafts"><![CDATA[Drafts]]></string>
+    <string name="_bx_cnv_folder_spam"><![CDATA[Spam]]></string>
+    <string name="_bx_cnv_folder_trash"><![CDATA[Trash]]></string>
+
+    <string name="_bx_cnv_field_comments"><![CDATA[#]]></string>
+    <string name="_bx_cnv_field_preview"><![CDATA[Preview]]></string>
+    <string name="_bx_cnv_field_collaborators"><![CDATA[Participants]]></string>
+
+    <string name="_bx_cnv_grid_action_delete"><![CDATA[Delete]]></string>
+    <string name="_bx_cnv_grid_action_compose"><![CDATA[New conversation]]></string>
+
+    <string name="_bx_cnv_collaborator_info"><![CDATA[{0} ({1})]]></string>
+    <string name="_bx_cnv_collaborator_author"><![CDATA[author]]></string>
+    <string name="_bx_cnv_collaborator_last_replier"><![CDATA[last replier]]></string>
+    <string name="_bx_cnv_more"><![CDATA[{0} more]]></string>
+
+    <string name="_bx_cnv_author_desc"><![CDATA[{0} (updated {1})]]></string>
+    <string name="_bx_cnv_x_date_by_x_replier"><![CDATA[{0} by {1}]]></string>
+
+    <string name="_bx_cnv_read_by_all"><![CDATA[Read by all]]></string>
+    <string name="_bx_cnv_see_all"><![CDATA[See all conversations...]]></string>
+    <string name="_bx_cnv_you_are_last_replier"><![CDATA[You are last replier]]></string>
+
+    <string name="_bx_cnv_draft_saving_error"><![CDATA[Draft saving error!]]></string>
+    <string name="_bx_cnv_draft_saved_success"><![CDATA[Draft saved.]]></string>
+
+    <string name="_bx_cnv_email_new_message"><![CDATA[New message]]></string>
+    <string name="_bx_cnv_email_new_message_subject"><![CDATA[New message from {SenderDisplayName}]]></string>
+    <string name="_bx_cnv_email_new_message_body"><![CDATA[{email_header}
+<p>New message from <a href="{SenderUrl}">{SenderDisplayName}</a>:</p>
+<hr />
+<p>{Message}</p>
+{email_footer}]]></string>
+
+    <string name="_bx_cnv_email_new_reply"><![CDATA[New reply]]></string>
+    <string name="_bx_cnv_email_new_reply_subject"><![CDATA[New reply from {SenderDisplayName}]]></string>
+    <string name="_bx_cnv_email_new_reply_body"><![CDATA[{email_header}
+<p>New reply from <a href="{SenderUrl}">{SenderDisplayName}</a>:</p>
+<hr />
+<p>{Message}</p>
+{email_footer}]]></string>
+</resources>

+ 48 - 0
modules/boonex/convos/updates/9.0.3_9.0.4/source/install/sql/disable.sql

@@ -0,0 +1,48 @@
+
+-- SETTINGS
+SET @iTypeId = (SELECT `ID` FROM `sys_options_types` WHERE `name` = 'bx_convos' 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_convos';
+DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_convos' OR `object` IN('bx_convos_create_entry', 'bx_convos_edit_entry', 'bx_convos_view_entry', 'bx_convos_home');
+
+-- MENU
+DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_convos';
+DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_convos';
+DELETE FROM `sys_menu_items` WHERE `module` = 'bx_convos' OR `set_name` IN('bx_convos_view', 'bx_convos_submenu', 'bx_convos_menu_folders_more');
+
+-- GRID
+DELETE FROM `sys_objects_grid` WHERE `object` LIKE 'bx_convos%';
+DELETE FROM `sys_grid_fields` WHERE `object` LIKE 'bx_convos%';
+DELETE FROM `sys_grid_actions` WHERE `object` LIKE 'bx_convos%';
+
+-- 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_convos';
+DELETE FROM `sys_acl_actions` WHERE `Module` = 'bx_convos';
+
+
+-- COMMENTS
+DELETE FROM `sys_objects_cmts` WHERE `Name` = 'bx_convos';
+
+
+-- VIEWS
+DELETE FROM `sys_objects_view` WHERE `Name` = 'bx_convos';
+
+
+-- LIVE UPDATES
+DELETE FROM `sys_objects_live_updates` WHERE `name` = 'bx_convos';
+
+
+-- ALERTS
+SET @iHandler := (SELECT `id` FROM `sys_alerts_handlers` WHERE `name` = 'bx_convos' LIMIT 1);
+DELETE FROM `sys_alerts` WHERE `handler_id` = @iHandler;
+DELETE FROM `sys_alerts_handlers` WHERE `id` = @iHandler;
+
+
+-- EMAIL TEMPLATES
+DELETE FROM `sys_email_templates` WHERE `Module` = 'bx_convos';
+

+ 214 - 0
modules/boonex/convos/updates/9.0.3_9.0.4/source/install/sql/enable.sql

@@ -0,0 +1,214 @@
+
+-- 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_convos', '_bx_cnv', 'bx_convos@modules/boonex/convos/|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_convos', '_bx_cnv', 1);
+SET @iCategId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_error`, `extra`, `order`) VALUES
+('bx_convos_preview_messages_num', '3', @iCategId, '_bx_cnv_option_preview_messages_num', 'digit', '', '', '', 1);
+
+-- PAGE: dash
+SET @iPBCellDashboard = 3;
+SET @iPBOrderDashboard = 0;
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('sys_dashboard', @iPBCellDashboard, 'bx_convos', '_bx_cnv_page_block_title_convos', 11, 2147483646, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_convos\";s:6:\"method\";s:17:\"messages_previews\";}', 0, 1, 0, @iPBOrderDashboard);
+
+
+-- PAGE: create entry
+
+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_convos_create_entry', '_bx_cnv_page_title_sys_create_entry', '_bx_cnv_page_title_create_entry', 'bx_convos', 5, 2147483647, 1, 'start-convo', 'page.php?i=start-convo', '', '', '', 0, 1, 0, 'BxCnvPageBrowse', 'modules/boonex/convos/classes/BxCnvPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_convos_create_entry', 1, 'bx_convos', '_bx_cnv_page_block_title_create_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_convos";s:6:"method";s:13:"entity_create";}', 0, 1, 1);
+
+-- PAGE: edit entry
+
+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_convos_edit_entry', '_bx_cnv_page_title_sys_edit_entry', '_bx_cnv_page_title_edit_entry', 'bx_convos', 5, 2147483647, 0, 'edit-convo', '', '', '', '', 0, 0, 0, 'BxCnvPageBrowse', 'modules/boonex/convos/classes/BxCnvPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_convos_edit_entry', 1, 'bx_convos', '_bx_cnv_page_block_title_edit_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_convos";s:6:"method";s:11:"entity_edit";}', 0, 0, 0);
+
+-- PAGE: view entry
+
+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_convos_view_entry', 'view-convo', '_bx_cnv_page_title_sys_view_entry', '_bx_cnv_page_title_view_entry', 'bx_convos', 10, 2147483647, 1, '', '', '', '', 0, 1, 0, 'BxCnvPageEntry', 'modules/boonex/convos/classes/BxCnvPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES
+('bx_convos_view_entry', 1, 'bx_convos', '_bx_cnv_page_block_title_entry_breadcrumb', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_convos";s:6:"method";s:17:"entity_breadcrumb";}', 0, 0, 1, 0),
+('bx_convos_view_entry', 4, 'bx_convos', '_bx_cnv_page_block_title_entry_text', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_convos\";s:6:\"method\";s:17:\"entity_text_block\";}', 0, 0, 1, 0),
+('bx_convos_view_entry', 3, 'bx_convos', '_bx_cnv_page_block_title_entry_collaborators', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_convos\";s:6:\"method\";s:20:\"entity_collaborators\";}', 0, 0, 1, 0),
+('bx_convos_view_entry', 2, 'bx_convos', '_bx_cnv_page_block_title_entry_author', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_convos\";s:6:\"method\";s:13:\"entity_author\";}', 0, 0, 1, 0),
+('bx_convos_view_entry', 4, 'bx_convos', '_bx_cnv_page_block_title_entry_attachments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_convos\";s:6:\"method\";s:18:\"entity_attachments\";}', 0, 0, 1, 1),
+('bx_convos_view_entry', 4, 'bx_convos', '_bx_cnv_page_block_title_entry_comments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_convos\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 1, 2);
+
+
+-- 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_convos_home', '_bx_cnv_page_title_sys_folder', '_bx_cnv_page_title_folder', 'bx_convos', 5, 2147483647, 1, 'convos-folder', 'modules/?r=convos/folder/1', '', '', '', 0, 1, 0, 'BxCnvPageBrowse', 'modules/boonex/convos/classes/BxCnvPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_convos_home', 1, 'bx_convos', '_bx_cnv_page_block_title_folder', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_convos";s:6:"method";s:23:"conversations_in_folder";s:6:"params";a:1:{i:0;s:11:"{folder_id}";}}', 0, 1, 0);
+
+
+-- MENU: actions menu for view entry 
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_convos_view', '_bx_cnv_menu_title_view_entry', 'bx_convos_view', 'bx_convos', 9, 0, 1, 'BxCnvMenuView', 'modules/boonex/convos/classes/BxCnvMenuView.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_convos_view', 'bx_convos', '_bx_cnv_menu_set_title_view_entry', 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_convos_view', 'bx_convos', 'edit-convo', '_bx_cnv_menu_item_title_system_edit_entry', '_bx_cnv_menu_item_title_edit_entry', 'page.php?i=edit-convo&id={content_id}', '', '', 'pencil', '', 2147483647, 1, 0, 1),
+('bx_convos_view', 'bx_convos', 'delete-convo', '_bx_cnv_menu_item_title_system_delete_entry', '_bx_cnv_menu_item_title_delete_entry', 'javascript:void(0);', 'bx_cnv_delete(this, \'{content_id}\')', '', 'remove', '', 2147483647, 1, 0, 2),
+('bx_convos_view', 'bx_convos', 'mark-unread-convo', '_bx_cnv_menu_item_title_system_mark_unread_entry', '_bx_cnv_menu_item_title_mark_unread_entry', 'javascript:void(0);', 'bx_cnv_mark_unread(this, \'{content_id}\')', '', 'check', '', 2147483647, 1, 0, 3);
+
+
+-- 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_convos_submenu', '_bx_cnv_menu_title_submenu', 'bx_convos_submenu', 'bx_convos', 8, 0, 1, '', '');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_convos_submenu', 'bx_convos', '_bx_cnv_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_convos_submenu', 'bx_convos', 'convos-folder-inbox', '_bx_cnv_menu_item_title_system_folder_inbox', '_bx_cnv_menu_item_title_folder_inbox', 'modules/?r=convos/folder/1', '', '', '', '', 2147483647, 1, 1, 1),
+('bx_convos_submenu', 'bx_convos', 'convos-drafts', '_bx_cnv_menu_item_title_system_folder_drafts', '_bx_cnv_menu_item_title_folder_drafts', 'modules/?r=convos/folder/2', '', '', '', '', 2147483647, 1, 1, 2),
+('bx_convos_submenu', 'bx_convos', 'convos-spam', '_bx_cnv_menu_item_title_system_folder_spam', '_bx_cnv_menu_item_title_folder_spam', 'modules/?r=convos/folder/3', '', '', '', '', 2147483647, 1, 1, 3),
+('bx_convos_submenu', 'bx_convos', 'convos-trash', '_bx_cnv_menu_item_title_system_folder_trash', '_bx_cnv_menu_item_title_folder_trash', 'modules/?r=convos/folder/4', '', '', '', '', 2147483647, 1, 1, 4);
+-- ('bx_convos_submenu', 'bx_convos', 'convos-folder-more', '_bx_cnv_menu_item_title_system_folder_more', '_bx_cnv_menu_item_title_folder_more', 'javascript:void(0);', 'bx_menu_popup(''bx_convos_menu_folders_more'', this);', '', '', '', 2147483647, 1, 1, 5)
+
+-- TODO: Remove it completely if 'more' menu item isn't needed.
+-- MENU: more folders
+-- INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+-- ('bx_convos_menu_folders_more', '_bx_cnv_menu_title_folders_more', 'bx_convos_menu_folders_more', 'bx_convos', 4, 0, 1, '', '');
+
+-- INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+-- ('bx_convos_menu_folders_more', 'bx_convos', '_bx_cnv_menu_set_title_folders_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_convos_menu_folders_more', 'bx_convos', 'convos-drafts', '_bx_cnv_menu_item_title_system_folder_drafts', '_bx_cnv_menu_item_title_folder_drafts', 'modules/?r=convos/folder/2', '', '', '', '', 2147483647, 1, 1, 1);
+
+
+-- MENU: notifications
+SET @iMIOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name` = 'sys_account_notifications' AND `order` < 9999);
+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_notifications', 'bx_convos', 'notifications-convos', '_bx_cnv_menu_item_title_system_convos', '_bx_cnv_menu_item_title_convos', 'modules/?r=convos/folder/1', '', '', 'comments col-red1', 'a:2:{s:6:"module";s:9:"bx_convos";s:6:"method";s:23:"get_unread_messages_num";}', '', 2147483646, 1, 0, @iMIOrder + 1);
+
+
+-- MENU: profile stats
+
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
+('sys_profile_stats', 'bx_convos', 'profile-stats-unread-messages', '_bx_cnv_menu_item_title_system_unread_messages', '_bx_cnv_menu_item_title_unread_messages', 'modules/?r=convos/folder/1', '', '', 'comments col-red1', 'a:2:{s:6:"module";s:9:"bx_convos";s:6:"method";s:23:"get_unread_messages_num";}', '', 2147483646, 1, 0, 2);
+
+-- MENU: add menu item to profiles modules actions menu (trigger* menu sets are processed separately upon modules enable/disable)
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('trigger_profile_view_actions', 'bx_convos', 'convos-compose', '_bx_cnv_menu_item_title_system_message', '_bx_cnv_menu_item_title_message', 'page.php?i=start-convo&profiles={profile_id}', '', '', 'envelope', '', 2147483646, 1, 0, 0),
+('trigger_group_view_actions', 'bx_convos', 'convos-compose', '_bx_cnv_menu_item_title_system_message_group', '_bx_cnv_menu_item_title_message_group', 'page.php?i=start-convo&profiles={recipients}', '', '', 'envelope', '', 2147483646, 1, 0, 0);
+
+-- GRID
+
+INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_mode`, `sorting_fields`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
+('bx_convos', 'Sql', 'SELECT `c`.`id`, `c`.`author`, `c`.`text`, `c`.`added`, `c`.`comments`, `f`.`read_comments`, `last_reply_timestamp`, `last_reply_profile_id`, `cmt`.`cmt_text` FROM `bx_convos_conversations` AS `c` INNER JOIN `bx_convos_conv2folder` AS `f` ON (`c`.`id` = `f`.`conv_id` AND `f`.`folder_id` = {folder_id} AND `f`.`collaborator` = {profile_id}) LEFT JOIN `bx_convos_cmts` AS `cmt` ON (`cmt`.`cmt_id` = `c`.`last_reply_comment_id`)', 'bx_convos_conversations', 'id', 'last_reply_timestamp', '', 10, NULL, 'start', '', 'text', 'auto', 'comments,last_reply_timestamp', 2147483646, 'BxCnvGrid', 'modules/boonex/convos/classes/BxCnvGrid.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `params`, `order`) VALUES
+('bx_convos', 'checkbox', '_sys_select', '2%', '', 1),
+('bx_convos', 'collaborators', '_bx_cnv_field_collaborators', '25%', '', 2),
+('bx_convos', 'last_reply_timestamp', '_bx_cnv_field_preview', '68%', '', 3),
+('bx_convos', 'comments', '_bx_cnv_field_comments', '5%', '', 4);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `confirm`, `order`) VALUES
+('bx_convos', 'bulk', 'delete', '_bx_cnv_grid_action_delete', '', 1, 1),
+('bx_convos', 'independent', 'add', '_bx_cnv_grid_action_compose', '', 0, 1);
+
+
+-- ACL
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_convos', 'create entry', NULL, '_bx_cnv_acl_action_create_entry', '', 1, 3);
+SET @iIdActionEntryCreate = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_convos', 'delete entry', NULL, '_bx_cnv_acl_action_delete_entry', '', 1, 3);
+SET @iIdActionEntryDelete = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_convos', 'view entry', NULL, '_bx_cnv_acl_action_view_entry', '', 1, 0);
+SET @iIdActionEntryView = 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
+
+-- entry create
+(@iStandard, @iIdActionEntryCreate),
+(@iModerator, @iIdActionEntryCreate),
+(@iAdministrator, @iIdActionEntryCreate),
+(@iPremium, @iIdActionEntryCreate),
+
+-- entry delete
+(@iStandard, @iIdActionEntryDelete),
+(@iModerator, @iIdActionEntryDelete),
+(@iAdministrator, @iIdActionEntryDelete),
+(@iPremium, @iIdActionEntryDelete),
+
+-- entry view
+(@iUnauthenticated, @iIdActionEntryView),
+(@iAccount, @iIdActionEntryView),
+(@iStandard, @iIdActionEntryView),
+(@iUnconfirmed, @iIdActionEntryView),
+(@iPending, @iIdActionEntryView),
+(@iModerator, @iIdActionEntryView),
+(@iAdministrator, @iIdActionEntryView),
+(@iPremium, @iIdActionEntryView);
+
+
+-- COMMENTS
+INSERT INTO `sys_objects_cmts` (`Name`, `Module`, `Table`, `CharsPostMin`, `CharsPostMax`, `CharsDisplayMax`, `Nl2br`, `PerView`, `PerViewReplies`, `BrowseType`, `IsBrowseSwitch`, `PostFormPosition`, `NumberOfLevels`, `IsDisplaySwitch`, `IsRatable`, `ViewingThreshold`, `IsOn`, `RootStylePrefix`, `BaseUrl`, `ObjectVote`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldTitle`, `TriggerFieldComments`, `ClassName`, `ClassFile`) VALUES
+('bx_convos', 'bx_convos', 'bx_convos_cmts', 1, 5000, 1000, 1, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-convo&id={object_id}', '', 'bx_convos_conversations', 'id', 'author', '', 'comments', 'BxCnvCmts', 'modules/boonex/convos/classes/BxCnvCmts.php');
+
+
+-- VIEWS
+INSERT INTO `sys_objects_view` (`name`, `table_track`, `period`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_convos', 'bx_convos_views_track', '86400', '1', 'bx_convos_conversations', 'id', 'author', 'views', '', '');
+
+
+-- LIVE UPDATES
+INSERT INTO `sys_objects_live_updates`(`name`, `frequency`, `service_call`, `active`) VALUES
+('bx_convos', 1, 'a:3:{s:6:"module";s:9:"bx_convos";s:6:"method";s:16:"get_live_updates";s:6:"params";a:3:{i:0;a:2:{s:11:"menu_object";s:18:"sys_toolbar_member";s:9:"menu_item";s:7:"account";}i:1;a:2:{s:11:"menu_object";s:25:"sys_account_notifications";s:9:"menu_item";s:20:"notifications-convos";}i:2;s:7:"{count}";}}', 1);
+
+
+-- ALERTS
+INSERT INTO `sys_alerts_handlers` (`name`, `class`, `file`, `service_call`) VALUES 
+('bx_convos', 'BxCnvAlertsResponse', 'modules/boonex/convos/classes/BxCnvAlertsResponse.php', '');
+SET @iHandler := LAST_INSERT_ID();
+
+INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
+('bx_convos', 'commentPost', @iHandler),
+('bx_convos', 'commentRemoved', @iHandler),
+('profile', 'delete', @iHandler);
+
+
+-- EMAIL TEMPLATES
+INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `Body`) VALUES
+('bx_convos', '_bx_cnv_email_new_message', 'bx_cnv_new_message', '_bx_cnv_email_new_message_subject', '_bx_cnv_email_new_message_body'),
+('bx_convos', '_bx_cnv_email_new_reply', 'bx_cnv_new_reply', '_bx_cnv_email_new_reply_subject', '_bx_cnv_email_new_reply_body');

+ 112 - 0
modules/boonex/developer/updates/9.0.3_9.0.4/source/classes/BxDevConfig.php

@@ -0,0 +1,112 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxDevConfig extends BxBaseModGeneralConfig
+{
+    protected $aJsClasses;
+    protected $aJsObjects;
+    protected $sAnimationEffect;
+    protected $iAnimationSpeed;
+
+    function __construct($aModule)
+    {
+        parent::__construct($aModule);
+
+        $this->_aObjects = array(
+        	//--- Forms builder grids.
+			'grid_forms' => $this->_sName . '_forms',
+        	'grid_forms_displays' => $this->_sName . '_forms_displays',
+        	'grid_forms_fields' => $this->_sName . '_forms_fields',
+	        'grid_forms_pre_lists' => $this->_sName . '_forms_pre_lists',
+	        'grid_forms_pre_values' => $this->_sName . '_forms_pre_values',
+            'grid_search_forms' => $this->_sName . '_search_forms',
+        	'grid_search_forms_fields' => $this->_sName . '_search_forms_fields',
+
+        	//--- Forms builder forms.
+        	'form_forms_form' => $this->_sName . '_forms_form',
+        	'form_display_forms_form_add' => $this->_sName . '_forms_form_add',
+        	'form_display_forms_form_edit' => $this->_sName . '_forms_form_edit',
+        	'form_forms_display' => $this->_sName . '_forms_display',
+        	'form_display_forms_display_add' => $this->_sName . '_forms_display_add',
+        	'form_display_forms_display_edit' => $this->_sName . '_forms_display_edit',
+        	'form_forms_prelist' => $this->_sName . '_forms_prelist',
+        	'form_display_forms_prelist_add' => $this->_sName . '_forms_prelist_add',
+        	'form_display_forms_prelist_edit' => $this->_sName . '_forms_prelist_edit',
+        	'form_forms_prevalue' => $this->_sName . '_forms_prevalue',
+        	'form_display_forms_prevalue_add' => $this->_sName . '_forms_prevalue_add',
+        	'form_display_forms_prevalue_edit' => $this->_sName . '_forms_prevalue_edit',
+        	'form_forms_search_form' => $this->_sName . '_forms_search_form',
+        	'form_display_forms_search_form_add' => $this->_sName . '_forms_search_form_add',
+        	'form_display_forms_search_form_edit' => $this->_sName . '_forms_search_form_edit',
+        	'form_forms_search_fields' => $this->_sName . '_forms_search_fields',
+        	'form_display_forms_search_fields_edit' => $this->_sName . '_forms_search_fields_edit',
+
+	        //--- Navigation builder grids.
+			'grid_nav_menus' => $this->_sName . '_nav_menus',
+	        'grid_nav_sets' => $this->_sName . '_nav_sets',
+	        'grid_nav_items' => $this->_sName . '_nav_items',
+
+        	//--- Navigation builder forms.
+        	'form_nav_menu' => $this->_sName . '_nav_menu',
+        	'form_display_nav_menu_add' => $this->_sName . '_nav_menu_add',
+        	'form_display_nav_menu_edit' => $this->_sName . '_nav_menu_edit',        
+        	'form_nav_set' => $this->_sName . '_nav_set',
+        	'form_display_nav_set_add' => $this->_sName . '_nav_set_add',
+        	'form_display_nav_set_edit' => $this->_sName . '_nav_set_edit',
+        	'form_nav_item' => $this->_sName . '_nav_item',
+        	'form_display_nav_item_add' => $this->_sName . '_nav_item_add',
+        	'form_display_nav_item_edit' => $this->_sName . '_nav_item_edit',
+
+	        //--- Pages builder forms.
+        	'form_bp_page' => $this->_sName . '_bp_page',
+        	'form_display_bp_page_add' => $this->_sName . '_bp_page_add',
+        	'form_bp_block' => $this->_sName . '_bp_block',
+        	'form_display_bp_block_edit' => $this->_sName . '_bp_block_edit',
+
+			//--- Polyglot grids.
+        	'grid_pgt_manage' => $this->_sName . '_pgt_manage',
+        
+        );
+
+        $this->aJsClasses = array('polyglot' => 'BxDevPolyglot');
+        $this->aJsObjects = array('polyglot' => 'oBxDevPolyglot');
+        $this->sAnimationEffect = 'fade';
+        $this->iAnimationSpeed = 'slow';
+    }
+
+    function getJsClass($sType = 'main')
+    {
+        if(empty($sType))
+            return $this->aJsClasses;
+
+        return $this->aJsClasses[$sType];
+    }
+
+    function getJsObject($sType = 'main')
+    {
+        if(empty($sType))
+            return $this->aJsObjects;
+
+        return $this->aJsObjects[$sType];
+    }
+
+    function getAnimationEffect()
+    {
+        return $this->sAnimationEffect;
+    }
+
+    function getAnimationSpeed()
+    {
+        return $this->iAnimationSpeed;
+    }
+}
+
+/** @} */

+ 43 - 0
modules/boonex/developer/updates/9.0.3_9.0.4/source/classes/BxDevForms.php

@@ -0,0 +1,43 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxDevForms extends BxTemplStudioForms
+{
+    protected $oModule;
+    protected $aParams;
+    protected $aGridObjects;
+
+    function __construct($aParams)
+    {
+        parent::__construct(isset($aParams['page']) ? $aParams['page'] : '');
+
+        $this->aParams = $aParams;
+        $this->sSubpageUrl = $this->aParams['url'] . '&form_page=';
+
+        $this->oModule = BxDolModule::getInstance('bx_developer');
+
+        $this->aGridObjects = array(
+        	'forms' => $this->oModule->_oConfig->getObject('grid_forms'),
+	        'displays' => $this->oModule->_oConfig->getObject('grid_forms_displays'),
+	        'fields' => $this->oModule->_oConfig->getObject('grid_forms_fields'),
+
+	        'pre_lists' => $this->oModule->_oConfig->getObject('grid_forms_pre_lists'),
+	        'pre_values' => $this->oModule->_oConfig->getObject('grid_forms_pre_values'),
+
+        	'search_forms' => $this->oModule->_oConfig->getObject('grid_search_forms'),
+	        'search_fields' => $this->oModule->_oConfig->getObject('grid_search_forms_fields'),
+        );
+
+        $this->oModule->_oTemplate->addStudioCss(array('forms.css'));
+    }
+}
+
+/** @} */

+ 329 - 0
modules/boonex/developer/updates/9.0.3_9.0.4/source/classes/BxDevFormsField.php

@@ -0,0 +1,329 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+require_once('BxDevFunctions.php');
+
+class BxDevFormsField extends BxTemplStudioFormsField
+{
+    function __construct($aParams = array(), $aField = array())
+    {
+        parent::__construct($aParams, $aField);
+
+        $this->aTypes = array_merge($this->aTypes, array(
+        	'captcha' => array('add' => 1),
+        	'location' => array('add' => 1), 
+        	'custom' => array('add' => 1)
+        ));
+    }
+}
+
+class BxDevFormsFieldBlockHeader extends BxTemplStudioFormsFieldBlockHeader
+{
+    public function init()
+	{
+		parent::init();
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldValue extends BxTemplStudioFormsFieldValue
+{
+    public function init()
+	{
+		parent::init();
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldText extends BxTemplStudioFormsFieldText
+{
+    public function init()
+	{
+		parent::init();
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldPassword extends BxTemplStudioFormsFieldPassword
+{
+    public function init()
+	{
+		parent::init();
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldTextarea extends BxTemplStudioFormsFieldTextarea
+{
+    public function init()
+	{
+		parent::init();
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+
+        $this->aForm['inputs'] = $this->addInArray($this->aForm['inputs'], 'required', array(
+            'unique' => $this->aFieldUnique
+        ));
+    }
+}
+
+class BxDevFormsFieldNumber extends BxTemplStudioFormsFieldNumber
+{
+    public function init()
+	{
+		parent::init();
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldDatepicker extends BxTemplStudioFormsFieldDatepicker
+{
+    public function init()
+	{
+		parent::init();
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldDatetime extends BxTemplStudioFormsFieldDatetime
+{
+    public function init()
+	{
+		parent::init();
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldCheckbox extends BxTemplStudioFormsFieldCheckbox
+{
+    public function init()
+	{
+		parent::init();
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+
+        $this->aForm['inputs']['value']['type'] = 'text';
+    }
+}
+
+class BxDevFormsFieldSwitcher extends BxTemplStudioFormsFieldSwitcher
+{
+    public function init()
+	{
+		parent::init();
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+
+        $this->aForm['inputs']['value']['type'] = 'text';
+    }
+}
+
+class BxDevFormsFieldFile extends BxTemplStudioFormsFieldFile
+{
+    public function init()
+	{
+		parent::init();
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldFiles extends BxTemplStudioFormsFieldFiles
+{
+    public function init()
+	{
+		parent::init();
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldSlider extends BxTemplStudioFormsFieldSlider
+{
+    public function init()
+	{
+		parent::init();
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+
+        $this->aForm['inputs'] = $this->addInArray($this->aForm['inputs'], 'required', array(
+            'unique' => $this->aFieldUnique
+        ));
+    }
+}
+
+class BxDevFormsFieldDoublerange extends BxTemplStudioFormsFieldDoublerange
+{
+    public function init()
+	{
+		parent::init();
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+
+        $this->aForm['inputs'] = $this->addInArray($this->aForm['inputs'], 'required', array(
+            'unique' => $this->aFieldUnique
+        ));
+    }
+}
+
+class BxDevFormsFieldHidden extends BxTemplStudioFormsFieldHidden
+{
+    public function init()
+	{
+		parent::init();
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldButton extends BxTemplStudioFormsFieldButton
+{
+    public function init()
+	{
+		parent::init();
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldReset extends BxTemplStudioFormsFieldReset
+{
+    public function init()
+	{
+		parent::init();
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldSubmit extends BxTemplStudioFormsFieldSubmit
+{
+    public function init()
+	{
+		parent::init();
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldImage extends BxTemplStudioFormsFieldImage
+{
+    public function init()
+	{
+		parent::init();
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldSelect extends BxTemplStudioFormsFieldSelect
+{
+    public function init()
+	{
+		parent::init();
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+
+        $this->aForm['inputs'] = $this->addInArray($this->aForm['inputs'], 'required', array(
+            'unique' => $this->aFieldUnique
+        ));
+    }
+}
+
+class BxDevFormsFieldSelectMultiple extends BxTemplStudioFormsFieldSelectMultiple
+{
+    public function init()
+	{
+		parent::init();
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+
+        $this->aForm['inputs'] = $this->addInArray($this->aForm['inputs'], 'required', array(
+            'unique' => $this->aFieldUnique
+        ));
+    }
+}
+
+class BxDevFormsFieldCheckboxSet extends BxTemplStudioFormsFieldCheckboxSet
+{
+    public function init()
+	{
+		parent::init();
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+
+        $this->aForm['inputs'] = $this->addInArray($this->aForm['inputs'], 'required', array(
+            'unique' => $this->aFieldUnique
+        ));
+    }
+}
+
+class BxDevFormsFieldRadioSet extends BxTemplStudioFormsFieldRadioSet
+{
+    public function init()
+	{
+		parent::init();
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+
+        $this->aForm['inputs'] = $this->addInArray($this->aForm['inputs'], 'required', array(
+            'unique' => $this->aFieldUnique
+        ));
+    }
+}
+
+class BxDevFormsFieldCustom extends BxTemplStudioFormsFieldCustom
+{
+    public function init()
+	{
+		parent::init();
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldInputSet extends BxTemplStudioFormsFieldInputSet
+{
+    public function init()
+	{
+		parent::init();
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldCaptcha extends BxTemplStudioFormsFieldCaptcha
+{
+    public function init()
+	{
+		parent::init();
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldLocation extends BxTemplStudioFormsFieldLocation
+{
+    public function init()
+	{
+		parent::init();
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+/** @} */

+ 189 - 0
modules/boonex/developer/updates/9.0.3_9.0.4/source/classes/BxDevFormsForms.php

@@ -0,0 +1,189 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxDevFormsForms extends BxTemplStudioFormsForms
+{
+    protected $oModule;
+
+    function __construct($aOptions, $oTemplate = false)
+    {
+        parent::__construct($aOptions, $oTemplate);
+
+        $this->oModule = BxDolModule::getInstance('bx_developer');
+        $this->sUrlViewDisplays = BX_DOL_URL_STUDIO . 'module.php?name=' . $this->oModule->_oConfig->getName() . '&page=forms&form_page=displays&form_module=%s&form_object=%s';
+
+        $this->_aOptions['actions_single']['export']['attr']['title'] = _t('_bx_dev_frm_btn_forms_gl_export');
+    }
+
+    public function performActionAdd()
+    {
+        $sAction = 'add';
+        $sFormObject = $this->oModule->_oConfig->getObject('form_forms_form');
+        $sFormDisplay = $this->oModule->_oConfig->getObject('form_display_forms_form_add');
+
+        $oForm = BxDolForm::getObjectInstance($sFormObject, $sFormDisplay, $this->oModule->_oTemplate);
+        $oForm->aFormAttrs['action'] = BX_DOL_URL_ROOT . 'grid.php?o=' . $this->_sObject . '&a=' . $sAction;
+        $oForm->aInputs['module']['values'] = array_merge(array('' => _t('_bx_dev_frm_txt_select_module')), BxDolStudioUtils::getModules());
+
+        $oForm->initChecker();
+        if($oForm->isSubmittedAndValid()) {
+            $sObject = uriGenerate($oForm->getCleanValue('object'), 'sys_objects_form', 'object', 'object');
+            BxDolForm::setSubmittedValue('object', $sObject, $oForm->aFormAttrs['method']);
+
+            if(($iId = (int)$oForm->insert()) != 0)
+                $aRes = array('grid' => $this->getCode(false), 'blink' => $iId);
+            else
+                $aRes = array('msg' => _t('_bx_dev_frm_err_forms_create'));
+
+            echoJson($aRes);
+        } else {
+            $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-frm-form-create-popup', _t('_bx_dev_frm_txt_forms_create_popup'), $this->oModule->_oTemplate->parseHtmlByName('form_add_form.html', array(
+                'form_id' => $oForm->aFormAttrs['id'],
+                'form' => $oForm->getCode(true),
+                'object' => $this->_sObject,
+                'action' => $sAction
+            )));
+
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
+        }
+    }
+
+    public function performActionEdit()
+    {
+        $sAction = 'edit';
+        $sFormObject = $this->oModule->_oConfig->getObject('form_forms_form');
+        $sFormDisplay = $this->oModule->_oConfig->getObject('form_display_forms_form_edit');
+
+        $aIds = bx_get('ids');
+        if(!$aIds || !is_array($aIds)) {
+            $iId = (int)bx_get('id');
+            if(!$iId) {
+                echoJson(array());
+                exit;
+            }
+
+            $aIds = array($iId);
+        }
+
+        $iId = $aIds[0];
+
+        $aForm = array();
+        $this->oDb->getForms(array('type' => 'by_id', 'value' => $iId), $aForm, false);
+        if(empty($aForm) || !is_array($aForm)){
+            echoJson(array());
+            exit;
+        }
+
+        $oForm = BxDolForm::getObjectInstance($sFormObject, $sFormDisplay, $this->oModule->_oTemplate);
+        $oForm->aFormAttrs['action'] = BX_DOL_URL_ROOT . 'grid.php?o=' . $this->_sObject . '&a=' . $sAction;
+        $oForm->aInputs['module']['values'] = array_merge(array('' => _t('_bx_dev_frm_txt_select_module')), BxDolStudioUtils::getModules());
+        $oForm->aInputs['controls'][0]['value'] = _t('_bx_dev_frm_btn_forms_save');
+
+        $aForm['form_attrs'] = BxDevFunctions::unserializeString($aForm['form_attrs']);
+        $aForm['params'] = BxDevFunctions::unserializeString($aForm['params']);
+        $oForm->initChecker($aForm);
+
+        if($oForm->isSubmittedAndValid()) {
+            $sObject = $oForm->getCleanValue('object');
+            if(strcmp($sObject, $aForm['object']) != 0) {
+                $sObject = uriGenerate($sObject, 'sys_objects_form', 'object', 'object');
+                BxDolForm::setSubmittedValue('object', $sObject, $oForm->aFormAttrs['method']);
+            }
+
+            $sValue = BxDolForm::getSubmittedValue('form_attrs', $oForm->aFormAttrs['method']);
+            $sValue = BxDevFunctions::serializeString($sValue);
+            BxDolForm::setSubmittedValue('form_attrs', $sValue, $oForm->aFormAttrs['method']);
+
+            $sValue = BxDolForm::getSubmittedValue('params', $oForm->aFormAttrs['method']);
+            $sValue = BxDevFunctions::serializeString($sValue);
+            BxDolForm::setSubmittedValue('params', $sValue, $oForm->aFormAttrs['method']);
+
+            if($oForm->update($iId) !== false)
+                $aRes = array('grid' => $this->getCode(false), 'blink' => $iId);
+            else
+                $aRes = array('msg' => _t('_bx_dev_frm_err_forms_edit'));
+
+            echoJson($aRes);
+        } else {
+            $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-frm-form-edit-popup', _t('_bx_dev_frm_txt_forms_edit_popup', _t($aForm['title'])), $this->oModule->_oTemplate->parseHtmlByName('form_add_form.html', array(
+                'form_id' => $oForm->aFormAttrs['id'],
+                'form' => $oForm->getCode(true),
+                'object' => $this->_sObject,
+                'action' => $sAction
+            )));
+
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
+        }
+    }
+
+    public function performActionExport()
+    {
+        $sContentInsert = $sContentDelete = "";
+
+        $aForm = $this->_getItem('getForms');
+        if($aForm === false) {
+            echoJson(array());
+            exit;
+        }
+
+        $sContentInsert .= ($this->oModule->_oDb->getQueryInsert('sys_objects_form', array($aForm), "Dumping data for '" . $aForm['object'] . "' form"));
+        $sContentDelete .= ($this->oModule->_oDb->getQueryDelete('sys_objects_form', 'object', array($aForm), "Deleting data for '" . $aForm['object'] . "' form"));
+
+        $aDisplays = array();
+        $this->oDb->getDisplays(array('type' => 'by_object', 'value' => $aForm['object']), $aDisplays, false);
+        $sContentInsert .= $this->oModule->_oDb->getQueryInsert('sys_form_displays', $aDisplays, false, array('id', 'name'));
+        $sContentDelete .= $this->oModule->_oDb->getQueryDelete('sys_form_displays', 'object', array($aForm), false);
+
+        $aFields = array();
+        $this->oDb->getInputs(array('type' => 'dump_inputs', 'value' => $aForm['object']), $aFields, false);
+        $sContentInsert .= $this->oModule->_oDb->getQueryInsert('sys_form_inputs', $aFields);
+        $sContentDelete .= $this->oModule->_oDb->getQueryDelete('sys_form_inputs', 'object', array($aForm), false);
+
+        $aConnections = array();
+        $this->oDb->getInputs(array('type' => 'dump_connections', 'value' => $aForm['object']), $aConnections, false);
+        $sContentInsert .= $this->oModule->_oDb->getQueryInsert('sys_form_display_inputs', $aConnections);
+        $sContentDelete .= $this->oModule->_oDb->getQueryDelete('sys_form_display_inputs', 'display_name', $aDisplays);
+
+        $aFormStructure = array(
+            'form_attrs' => array(),
+            'inputs' => array (
+                'insert' => array(
+                    'type' => 'textarea',
+                    'name' => 'insert',
+                    'caption' => _t('_bx_dev_frm_txt_forms_export_insert'),
+                    'value' => $sContentInsert,
+                ),
+                'delete' => array(
+                    'type' => 'textarea',
+                    'name' => 'delete',
+                    'caption' => _t('_bx_dev_frm_txt_forms_export_delete'),
+                    'value' => $sContentDelete,
+                ),
+                'done' => array (
+                    'type' => 'button',
+                    'name' => 'done',
+                    'value' => _t('_bx_dev_frm_btn_forms_done'),
+                    'attrs' => array(
+                        'onclick' => "$('.bx-popup-applied:visible').dolPopupHide()",
+                    ),
+                )
+            )
+        );
+        $oForm = new BxTemplStudioFormView($aFormStructure);
+
+        $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-frm-form-export-popup', _t('_bx_dev_frm_txt_forms_export_popup', _t($aForm['title'])), $this->oModule->_oTemplate->parseHtmlByName('form_export.html', array(
+            'content' => $oForm->getCode()
+        )));
+
+        echoJson(array('popup' => $sContent));
+    }
+}
+/** @} */

+ 162 - 0
modules/boonex/developer/updates/9.0.3_9.0.4/source/classes/BxDevFormsPreValues.php

@@ -0,0 +1,162 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxDevFormsPreValues extends BxTemplStudioFormsPreValues
+{
+    function __construct($aOptions, $oTemplate = false)
+    {
+        parent::__construct($aOptions, $oTemplate);
+
+        $this->oModule = BxDolModule::getInstance('bx_developer');
+        $this->sUrlPage = BX_DOL_URL_STUDIO . 'module.php?name=' . $this->oModule->_oConfig->getName() . '&page=forms&form_page=pre_values';
+
+        $sModule = bx_get('form_module');
+        if(!empty($sModule)) {
+            $this->sModule = bx_process_input($sModule);
+            $this->_aQueryAppend['module'] = $this->sModule;
+        }
+
+        $sList = bx_get('form_list');
+        if(!empty($sList)) {
+            $this->sList = bx_process_input($sList);
+            $this->_aQueryAppend['list'] = $this->sList;
+        }
+    }
+
+    public function performActionAdd()
+    {
+        $sAction = 'add';
+        $sFormObject = $this->oModule->_oConfig->getObject('form_forms_prevalue');
+        $sFormDisplay = $this->oModule->_oConfig->getObject('form_display_forms_prevalue_add');
+
+        $oForm = BxDolForm::getObjectInstance($sFormObject, $sFormDisplay, $this->oModule->_oTemplate);
+        $oForm->aFormAttrs['action'] = BX_DOL_URL_ROOT . 'grid.php?o=' . $this->_sObject . '&a=' . $sAction . '&list=' . $this->sList;
+
+        $this->onLoad($oForm->aInputs);
+
+        $oForm->initChecker();
+        if($oForm->isSubmittedAndValid()) {
+            if(!$this->onAdd($oForm))
+                return;
+
+            if(($iId = (int)$oForm->insert()) != 0)
+                $aRes = array('grid' => $this->getCode(false), 'blink' => $iId);
+            else
+                $aRes = array('msg' => _t('_bx_dev_frm_err_prevalues_create'));
+
+            echoJson($aRes);
+        } else {
+            $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-frm-prevalue-create-popup', _t('_bx_dev_frm_txt_prevalues_create_popup'), $this->oModule->_oTemplate->parseHtmlByName('form_add_value.html', array(
+                'form_id' => $oForm->aFormAttrs['id'],
+                'form' => $oForm->getCode(true),
+                'object' => $this->_sObject,
+                'action' => $sAction
+            )));
+
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
+        }
+    }
+
+    public function performActionEdit()
+    {
+        $sAction = 'edit';
+        $sFormObject = $this->oModule->_oConfig->getObject('form_forms_prevalue');
+        $sFormDisplay = $this->oModule->_oConfig->getObject('form_display_forms_prevalue_edit');
+
+        $aValue = $this->_getItem('getValues');
+        if($aValue === false) {
+            echoJson(array());
+            exit;
+        }
+
+        $oForm = BxDolForm::getObjectInstance($sFormObject, $sFormDisplay, $this->oModule->_oTemplate);
+        $oForm->aFormAttrs['action'] = BX_DOL_URL_ROOT . 'grid.php?o=' . $this->_sObject . '&a=' . $sAction . '&list=' . $this->sList;
+
+        $this->onLoad($oForm->aInputs);
+
+        $oForm->initChecker($aValue);
+        if($oForm->isSubmittedAndValid()) {
+            if($oForm->update($aValue['id']) !== false) {
+                $this->onSave($oForm);
+                $aRes = array('grid' => $this->getCode(false), 'blink' => $aValue['id']);
+            } else
+                $aRes = array('msg' => _t('_bx_dev_frm_err_prevalues_edit'));
+
+            echoJson($aRes);
+        } else {
+            $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-frm-prevalue-edit-popup', _t('_bx_dev_frm_txt_prevalues_edit_popup', _t($aValue['lkey'])), $this->oModule->_oTemplate->parseHtmlByName('form_add_value.html', array(
+                'form_id' => $oForm->aFormAttrs['id'],
+                'form' => $oForm->getCode(true),
+                'object' => $this->_sObject,
+                'action' => $sAction
+            )));
+
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
+        }
+    }
+
+    protected function canAdd()
+    {
+        return $this->sList != '';
+    }
+
+    private function onLoad(&$aInputs)
+    {
+        $aLists = array();
+        $this->oDb->getLists(array('type' => 'all'), $aLists, false);
+        foreach($aLists as $aList)
+            $aInputs['Key']['values'][$aList['key']] = _t($aList['title']);
+
+        asort($aInputs['Key']['values']);
+        $aInputs['Key']['values'] = array_merge(array('' => _t('_bx_dev_frm_txt_prevalues_key_select')), $aInputs['Key']['values']);
+        $aInputs['Key']['value'] = $this->sList;
+
+        $aInputs['Value']['value'] = $this->_getAvailableSetValue($this->sList);
+    }
+
+    private function onAdd(&$oForm)
+    {
+        $aList = array();
+        $this->oDb->getLists(array('type' => 'by_key', 'value' => $oForm->getCleanValue('Key')), $aList, false);
+
+        if((int)$aList['use_for_sets'] == 1) {
+            $mixedValue = $oForm->getCleanValue('Value');
+            if(!$this->canUseForSet($mixedValue)) {
+                if($this->oDb->isListUsedInSet($this->sList)) {
+                    echoJson(array('msg' => _t('_bx_dev_frm_err_prevalues_create_forbidden', BX_DOL_STUDIO_FIELD_PRE_VALUE_INT_MAX)));
+                    return false;
+                }
+
+                $this->oDb->updateList($aList['id'], array('use_for_sets' => '0'));
+            }
+        }
+
+        return true;
+    }
+
+    private function onSave(&$oForm)
+    {
+        $aList = array();
+        $this->oDb->getLists(array('type' => 'by_key', 'value' => $oForm->getCleanValue('Key')), $aList, false);
+
+        $iUseInSets = 1;
+        $aValues = BxDolForm::getDataItems($aList['key']);
+        foreach($aValues as $mixedValue => $sTitle)
+            if(!$this->canUseForSet($mixedValue)) {
+                $iUseInSets = 0;
+                break;
+            }
+
+        if($iUseInSets != (int)$aList['use_for_sets'])
+            $this->oDb->updateList($aList['id'], array('use_for_sets' => $iUseInSets));
+    }
+}
+/** @} */

+ 119 - 0
modules/boonex/developer/updates/9.0.3_9.0.4/source/classes/BxDevFormsSearchFields.php

@@ -0,0 +1,119 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxDevFormsSearchFields extends BxTemplStudioFormsSearchFields
+{
+    protected $oModule;
+
+    function __construct($aOptions, $oTemplate = false)
+    {
+        parent::__construct($aOptions, $oTemplate);
+
+        $this->oModule = BxDolModule::getInstance('bx_developer');
+        $this->sUrlPage = BX_DOL_URL_STUDIO . 'module.php?name=' . $this->oModule->_oConfig->getName() . '&page=forms&form_page=search_fields';
+
+        $this->_aOptions['actions_single']['edit']['attr']['title'] = _t('_bx_dev_frm_btn_search_forms_fields_edit');
+
+        $sModule = bx_get('form_module');
+        if(!empty($sModule)) {
+            $this->sModule = bx_process_input($sModule);
+            $this->_aQueryAppend['module'] = $this->sModule;
+        }
+
+        $sForm = bx_get('form_form');
+        if(!empty($sForm)) {
+            $this->sForm = bx_process_input($sForm);
+            $this->_aQueryAppend['form'] = $this->sForm;
+        }
+    }
+
+    public function performActionEdit()
+    {
+        $sAction = 'edit';
+        $sFormObject = $this->oModule->_oConfig->getObject('form_forms_search_fields');
+        $sFormDisplay = $this->oModule->_oConfig->getObject('form_display_forms_search_fields_edit');
+
+        $aIds = bx_get('ids');
+        if(!$aIds || !is_array($aIds)) {
+            $iId = (int)bx_get('id');
+            if(!$iId) {
+                echoJson(array());
+                exit;
+            }
+
+            $aIds = array($iId);
+        }
+
+        $iId = $aIds[0];
+
+        $aField = array();
+        $iField = $this->oDb->getSearchFields(array('type' => 'by_id', 'id' => $iId), $aField);
+        if($iField != 1 || empty($aField)){
+            echoJson(array());
+            exit;
+        }
+
+        $oForm = BxDolForm::getObjectInstance($sFormObject, $sFormDisplay, $this->oModule->_oTemplate);
+        $oForm->aFormAttrs['action'] = bx_append_url_params(BX_DOL_URL_ROOT . 'grid.php?', array(
+        	'o' => $this->_sObject,
+            'a' => $sAction,
+            'module' => $this->sModule,
+            'form' => $this->sForm
+        ));
+
+        $aForms = array();
+        $this->oDb->getSearchForms(array('type' => 'by_module', 'module' => $this->sModule), $aForms, false);
+
+        $oForm->aInputs['object']['value'] = $this->sForm;
+        $oForm->aInputs['object']['values'] = array();
+        foreach($aForms as $aForm)
+            $oForm->aInputs['object']['values'][$aForm['object']] = _t($aForm['title']);
+        asort($oForm->aInputs['object']['values']);
+        $oForm->aInputs['object']['values'] = array_merge(array('' => _t('_bx_dev_frm_txt_select_object')), $oForm->aInputs['object']['values']);
+
+        foreach(BxDolSearchExtended::$SEARCHABLE_TYPES as $sType)
+            $oForm->aInputs['type']['values'][] = array('key' => $sType, 'value' => _t('_adm_form_txt_field_type_' . $sType));
+
+        foreach(BxDolSearchExtended::$TYPE_TO_TYPE_SEARCH[$aField['type']] as $sType)
+            $oForm->aInputs['search_type']['values'][] = array('key' => $sType, 'value' => _t('_adm_form_txt_field_type_' . $sType));
+
+        foreach(BxDolSearchExtended::$TYPE_TO_OPERATOR[$aField['type']] as $sOperator)
+            $oForm->aInputs['search_operator']['values'][] = array('key' => $sOperator, 'value' => $sOperator);
+
+        $oForm->initChecker($aField);
+        if($oForm->isSubmittedAndValid()) {
+            if($oForm->update($iId) !== false)
+                $aRes = array('grid' => $this->getCode(false), 'blink' => $iId);
+            else
+                $aRes = array('msg' => _t('_bx_dev_frm_err_search_fields_edit'));
+
+            return echoJson($aRes);
+        }
+
+        $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-frm-search-fields-edit-popup', _t('_bx_dev_frm_txt_search_fields_edit_popup', _t($aField['caption'])), $this->_oTemplate->parseHtmlByName('form_add_search_field.html', array(
+            'form_id' => $oForm->aFormAttrs['id'],
+            'form' => $oForm->getCode(true),
+            'object' => $this->_sObject,
+            'action' => $sAction
+        )));
+
+        return echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
+    }
+
+    protected function _getActionEdit ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
+    {
+        if($sType == 'single' && !$this->_isEditable($aRow))
+            return '';
+
+        return  parent::_getActionDefault($sType, $sKey, $a, false, $isDisabled, $aRow);
+    }
+}
+/** @} */

+ 125 - 0
modules/boonex/developer/updates/9.0.3_9.0.4/source/classes/BxDevFormsSearchForms.php

@@ -0,0 +1,125 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxDevFormsSearchForms extends BxTemplStudioFormsSearchForms
+{
+    protected $oModule;
+
+    function __construct($aOptions, $oTemplate = false)
+    {
+        parent::__construct($aOptions, $oTemplate);
+
+        $this->oModule = BxDolModule::getInstance('bx_developer');
+        $this->sUrlViewFields = BX_DOL_URL_STUDIO . 'module.php?name=' . $this->oModule->_oConfig->getName() . '&page=forms&form_page=search_fields&form_module=%s&form_form=%s';
+
+        $this->_aOptions['actions_single']['edit']['attr']['title'] = _t('_bx_dev_frm_btn_search_forms_gl_edit');
+    }
+
+    public function performActionAdd()
+    {
+        $sAction = 'add';
+        $sFormObject = $this->oModule->_oConfig->getObject('form_forms_search_form');
+        $sFormDisplay = $this->oModule->_oConfig->getObject('form_display_forms_search_form_add');
+
+        $oForm = BxDolForm::getObjectInstance($sFormObject, $sFormDisplay, $this->oModule->_oTemplate);
+        $oForm->aFormAttrs['action'] = BX_DOL_URL_ROOT . 'grid.php?o=' . $this->_sObject . '&a=' . $sAction;
+
+        $oForm->aInputs['module']['values'] = array_merge(array('' => _t('_bx_dev_frm_txt_select_module')), BxDolStudioUtils::getModules());
+        $oForm->aInputs['object_content_info']['values'] = array('' => _t('_bx_dev_frm_txt_select_object_content_info'));
+        $aCiObjects = BxDolContentInfo::getSystems();
+        foreach($aCiObjects as $aCiObject)
+            $oForm->aInputs['object_content_info']['values'][$aCiObject['name']] = _t($aCiObject['title']);
+
+        $oForm->initChecker();
+        if($oForm->isSubmittedAndValid()) {
+            $sObject = uriGenerate($oForm->getCleanValue('object'), 'sys_objects_search_extended', 'object', 'object');
+            BxDolForm::setSubmittedValue('object', $sObject, $oForm->aFormAttrs['method']);
+
+            if(($iId = (int)$oForm->insert()) != 0)
+                $aRes = array('grid' => $this->getCode(false), 'blink' => $iId);
+            else
+                $aRes = array('msg' => _t('_bx_dev_frm_err_search_forms_create'));
+
+            return echoJson($aRes);
+        }
+
+        $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-frm-search-form-create-popup', _t('_bx_dev_frm_txt_search_forms_create_popup'), $this->oModule->_oTemplate->parseHtmlByName('form_add_search_form.html', array(
+            'form_id' => $oForm->aFormAttrs['id'],
+            'form' => $oForm->getCode(true),
+            'object' => $this->_sObject,
+            'action' => $sAction
+        )));
+
+        return echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
+    }
+
+    public function performActionEdit()
+    {
+        $sAction = 'edit';
+        $sFormObject = $this->oModule->_oConfig->getObject('form_forms_search_form');
+        $sFormDisplay = $this->oModule->_oConfig->getObject('form_display_forms_search_form_edit');
+
+        $aIds = bx_get('ids');
+        if(!$aIds || !is_array($aIds)) {
+            $iId = (int)bx_get('id');
+            if(!$iId) {
+                echoJson(array());
+                exit;
+            }
+
+            $aIds = array($iId);
+        }
+
+        $iId = $aIds[0];
+
+        $aForm = array();
+        $this->oDb->getSearchForms(array('type' => 'by_id', 'id' => $iId), $aForm, false);
+        if(empty($aForm) || !is_array($aForm)){
+            echoJson(array());
+            exit;
+        }
+
+        $oForm = BxDolForm::getObjectInstance($sFormObject, $sFormDisplay, $this->oModule->_oTemplate);
+        $oForm->aFormAttrs['action'] = BX_DOL_URL_ROOT . 'grid.php?o=' . $this->_sObject . '&a=' . $sAction;
+        $oForm->aInputs['module']['values'] = array_merge(array('' => _t('_bx_dev_frm_txt_select_module')), BxDolStudioUtils::getModules());
+        $oForm->aInputs['object_content_info']['values'] = array('' => _t('_bx_dev_frm_txt_select_object_content_info'));
+        $aCiObjects = BxDolContentInfo::getSystems();
+        foreach($aCiObjects as $aCiObject)
+            $oForm->aInputs['object_content_info']['values'][$aCiObject['name']] = _t($aCiObject['title']);
+        $oForm->aInputs['controls'][0]['value'] = _t('_bx_dev_frm_btn_search_forms_save');
+
+        $oForm->initChecker($aForm);
+        if($oForm->isSubmittedAndValid()) {
+            $sObject = $oForm->getCleanValue('object');
+            if(strcmp($sObject, $aForm['object']) != 0) {
+                $sObject = uriGenerate($sObject, 'sys_objects_search_extended', 'object', 'object');
+                BxDolForm::setSubmittedValue('object', $sObject, $oForm->aFormAttrs['method']);
+            }
+
+            if($oForm->update($iId) !== false)
+                $aRes = array('grid' => $this->getCode(false), 'blink' => $iId);
+            else
+                $aRes = array('msg' => _t('_bx_dev_frm_err_forms_edit'));
+
+            return echoJson($aRes);
+        }
+
+        $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-frm-search-form-edit-popup', _t('_bx_dev_frm_txt_search_forms_edit_popup', _t($aForm['title'])), $this->oModule->_oTemplate->parseHtmlByName('form_add_search_form.html', array(
+            'form_id' => $oForm->aFormAttrs['id'],
+            'form' => $oForm->getCode(true),
+            'object' => $this->_sObject,
+            'action' => $sAction
+        )));
+
+        return echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
+    }
+}
+/** @} */

+ 127 - 0
modules/boonex/developer/updates/9.0.3_9.0.4/source/classes/BxDevNavigationItems.php

@@ -0,0 +1,127 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxDevNavigationItems extends BxTemplStudioNavigationItems
+{
+    protected $oModule;
+
+    function __construct($aOptions, $oTemplate = false)
+    {
+        parent::__construct($aOptions, $oTemplate);
+
+        $this->oModule = BxDolModule::getInstance('bx_developer');
+        $this->sUrlPage = BX_DOL_URL_STUDIO . 'module.php?name=' . $this->oModule->_oConfig->getName() . '&page=navigation&nav_page=items';
+        $this->sUrlViewItems = $this->sUrlPage . '&nav_module=%s&nav_set=%s';
+
+        $sModule = bx_get('nav_module');
+        if(!empty($sModule)) {
+            $this->sModule = bx_process_input($sModule);
+            $this->_aQueryAppend['module'] = $this->sModule;
+        }
+
+        $sSet = bx_get('nav_set');
+        if(!empty($sSet)) {
+            $this->sSet = bx_process_input($sSet);
+            $this->_aQueryAppend['set'] = $this->sSet;
+        }
+    }
+
+    public function performActionAdd()
+    {
+        $sAction = 'add';
+        $sFormObject = $this->oModule->_oConfig->getObject('form_nav_item');
+        $sFormDisplay = $this->oModule->_oConfig->getObject('form_display_nav_item_add');
+
+        $oForm = BxDolForm::getObjectInstance($sFormObject, $sFormDisplay, $this->oModule->_oTemplate);
+        $oForm->aFormAttrs['action'] = BX_DOL_URL_ROOT . 'grid.php?o=' . $this->_sObject . '&a=' . $sAction . '&set=' . $this->sSet;
+        $this->fillInSelects($oForm->aInputs);
+
+        $oForm->initChecker();
+        if($oForm->isSubmittedAndValid()) {
+            if(($iId = (int)$oForm->insert()) != 0)
+                $aRes = array('grid' => $this->getCode(false), 'blink' => $iId);
+            else
+                $aRes = array('msg' => _t('_bx_dev_nav_err_items_create'));
+
+            echoJson($aRes);
+        } else {
+            $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-nav-item-create-popup', _t('_bx_dev_nav_txt_items_create_popup'), $this->_oTemplate->parseHtmlByName('nav_add_item.html', array(
+                'form_id' => $oForm->aFormAttrs['id'],
+                'form' => $oForm->getCode(true),
+                'object' => $this->_sObject,
+                'action' => $sAction
+            )));
+
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
+        }
+    }
+
+    public function performActionEdit($bUpdateGrid = false)
+    {
+        $sAction = 'edit';
+        $sFormObject = $this->oModule->_oConfig->getObject('form_nav_item');
+        $sFormDisplay = $this->oModule->_oConfig->getObject('form_display_nav_item_edit');
+
+        $aItem = $this->_getItem('getItems');
+        if($aItem === false) {
+            echoJson(array());
+            exit;
+        }
+
+        $oForm = BxDolForm::getObjectInstance($sFormObject, $sFormDisplay, $this->oModule->_oTemplate);
+        $oForm->aFormAttrs['action'] = BX_DOL_URL_ROOT . 'grid.php?o=' . $this->_sObject . '&a=' . $sAction . '&set=' . $this->sSet;
+        $oForm->aInputs['controls'][0]['value'] = _t('_bx_dev_nav_btn_items_save');
+        $this->fillInSelects($oForm->aInputs);
+
+        $oForm->initChecker($aItem);
+        if($oForm->isSubmittedAndValid()) {
+            if($oForm->update($aItem['id']) !== false)
+                $aRes = array('grid' => $this->getCode(false), 'blink' => $aItem['id']);
+            else
+                $aRes = array('msg' => _t('_bx_dev_nav_err_items_edit'));
+
+            echoJson($aRes);
+        } else {
+            $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-nav-item-edit-popup', _t('_bx_dev_nav_txt_items_edit_popup', _t($aItem['title_system'])), $this->oModule->_oTemplate->parseHtmlByName('nav_add_item.html', array(
+                'form_id' => $oForm->aFormAttrs['id'],
+                'form' => $oForm->getCode(true),
+                'object' => $this->_sObject,
+                'action' => $sAction
+            )));
+
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
+        }
+    }
+
+    protected function _getActionDelete ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
+    {
+        return  parent::_getActionDefault($sType, $sKey, $a, false, $isDisabled, $aRow);
+    }
+
+    protected function _isEditable(&$aRow)
+    {
+    	return true;
+    }
+
+	protected function _isDeletable(&$aRow)
+    {
+    	return true;
+    }
+
+    private function fillInSelects(&$aInputs)
+    {
+        $aInputs['module']['values'] = array_merge(array('' => _t('_bx_dev_nav_txt_select_module')), BxDolStudioUtils::getModules());
+        $aInputs['module']['value'] = $this->sModule;
+
+        $aInputs['set_name']['value'] = $this->sSet;
+    }
+}
+/** @} */

+ 69 - 0
modules/boonex/developer/updates/9.0.3_9.0.4/source/install/config.php

@@ -0,0 +1,69 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_developer',
+    'title' => 'Developer',
+    'note' => 'Developer tools...',
+    'version' => '9.0.4',
+    'vendor' => 'BoonEx',
+	'help_url' => 'http://feed.boonex.com/?section={module_name}',
+
+    'compatible_with' => array(
+        '9.0.0-RC1'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/developer/',
+    'home_uri' => 'developer',
+
+    'db_prefix' => 'bx_dev_',
+    'class_prefix' => 'BxDev',
+
+	/**
+     * Category for language keys.
+     */
+    'language_category' => 'BoonEx Developer',
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+        'execute_sql' => 1,
+        'update_languages' => 1,
+        'clear_db_cache' => 1
+    ),
+    'uninstall' => array (
+        'execute_sql' => 1,
+        'update_languages' => 1,
+        'clear_db_cache' => 1
+    ),
+    'enable' => array(
+        'execute_sql' => 1,
+    ),
+    'disable' => array(
+        'execute_sql' => 1,
+    ),
+
+    /**
+     * Dependencies Section
+     */
+    'dependencies' => array(),
+
+);
+
+/** @} */

+ 2 - 0
modules/boonex/developer/updates/9.0.3_9.0.4/source/install/info/inst_concl.html

@@ -0,0 +1,2 @@
+Congratulation!!!
+P.S. It's easy to install and easy to use. :)

+ 1 - 0
modules/boonex/developer/updates/9.0.3_9.0.4/source/install/info/inst_intro.html

@@ -0,0 +1 @@
+Follow the instructions carefully!!!

+ 1 - 0
modules/boonex/developer/updates/9.0.3_9.0.4/source/install/info/uninst_concl.html

@@ -0,0 +1 @@
+You don't like our module  :(

+ 1 - 0
modules/boonex/developer/updates/9.0.3_9.0.4/source/install/info/uninst_intro.html

@@ -0,0 +1 @@
+NO, NO, NO... Don't do it.

+ 463 - 0
modules/boonex/developer/updates/9.0.3_9.0.4/source/install/langs/en.xml

@@ -0,0 +1,463 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+    <string name="_bx_developer"><![CDATA[Developer]]></string>
+
+    <string name="_bx_dev_adm_wgt_cpt"><![CDATA[Developer]]></string>
+    <string name="_bx_dev_adm_page_cpt"><![CDATA[Developer]]></string>
+    
+    <!-- Forms Builder -->
+    <string name="_bx_dev_frm_txt_forms_gl_title"><![CDATA[System Name]]></string>
+    <string name="_bx_dev_frm_txt_forms_gl_module"><![CDATA[Module]]></string>
+    <string name="_bx_dev_frm_txt_forms_gl_displays"><![CDATA[Displays]]></string>
+    <string name="_bx_dev_frm_btn_forms_gl_export"><![CDATA[Export Form]]></string>
+    <string name="_bx_dev_frm_txt_displays_gl_title"><![CDATA[System Name]]></string>
+    <string name="_bx_dev_frm_txt_displays_gl_module"><![CDATA[Module]]></string>
+    <string name="_bx_dev_frm_txt_displays_gl_form"><![CDATA[Form]]></string>
+    <string name="_bx_dev_frm_txt_displays_gl_fields"><![CDATA[Fields]]></string>
+    <string name="_bx_dev_frm_txt_fields_gl_type"><![CDATA[Type]]></string>
+    <string name="_bx_dev_frm_txt_fields_gl_caption_system"><![CDATA[System Name]]></string>
+    <string name="_bx_dev_frm_txt_fields_gl_module"><![CDATA[Module]]></string>
+    <string name="_bx_dev_frm_txt_fields_gl_visible"><![CDATA[Visible For]]></string>
+    <string name="_bx_dev_frm_txt_pre_lists_gl_title"><![CDATA[System Name]]></string>
+    <string name="_bx_dev_frm_txt_pre_lists_gl_module"><![CDATA[Module]]></string>
+    <string name="_bx_dev_frm_txt_pre_lists_gl_values"><![CDATA[Values]]></string>
+    <string name="_bx_dev_frm_txt_pre_lists_gl_use_for_sets"><![CDATA[Use For Sets]]></string>
+    <string name="_bx_dev_frm_txt_pre_values_gl_lkey"><![CDATA[Title]]></string>
+    <string name="_bx_dev_frm_txt_search_forms_gl_title"><![CDATA[System Name]]></string>
+    <string name="_bx_dev_frm_txt_search_forms_gl_module"><![CDATA[Module]]></string>
+    <string name="_bx_dev_frm_txt_search_forms_gl_fields"><![CDATA[Fields]]></string>
+    <string name="_bx_dev_frm_txt_search_forms_fields_gl_type"><![CDATA[Type]]></string>
+    <string name="_bx_dev_frm_txt_search_forms_fields_gl_caption"><![CDATA[Caption]]></string>
+    <string name="_bx_dev_frm_txt_search_forms_fields_gl_search_type"><![CDATA[Search Type]]></string>
+    <string name="_bx_dev_frm_txt_search_forms_fields_gl_search_operator"><![CDATA[Search Operator]]></string>
+    <string name="_bx_dev_frm_btn_forms_gl_create"><![CDATA[Add New Form]]></string>
+    <string name="_bx_dev_frm_btn_displays_gl_create"><![CDATA[Add New Display]]></string>
+    <string name="_bx_dev_frm_btn_fields_create"><![CDATA[Add New Field]]></string>
+    <string name="_bx_dev_frm_btn_pre_lists_create"><![CDATA[Add New List]]></string>
+    <string name="_bx_dev_frm_btn_pre_values_create"><![CDATA[Add New Item]]></string>
+    <string name="_bx_dev_frm_btn_search_forms_create"><![CDATA[Add New Search]]></string>
+    <string name="_bx_dev_frm_btn_search_forms_edit"><![CDATA[Edit search form]]></string>
+    <string name="_bx_dev_frm_btn_search_forms_fields_edit"><![CDATA[Edit search field]]></string>
+    <string name="_bx_dev_frm_btn_search_forms_fields_reset"><![CDATA[Reset]]></string>
+    <string name="_bx_dev_frm_txt_select_module"><![CDATA[Select Module...]]></string>
+    <string name="_bx_dev_frm_txt_select_object"><![CDATA[Select Object...]]></string>
+    <string name="_bx_dev_frm_txt_select_object_content_info"><![CDATA[Select Content Info Object...]]></string>
+    <string name="_bx_dev_frm_txt_forms_create_popup"><![CDATA[Add New Form]]></string>
+    <string name="_bx_dev_frm_txt_forms_edit_popup"><![CDATA[Edit "{0}" Form]]></string>
+    <string name="_bx_dev_frm_txt_forms_export_popup"><![CDATA[Export "{0}" Form]]></string>
+    <string name="_bx_dev_frm_err_forms_create"><![CDATA[Cannot add form]]></string>
+    <string name="_bx_dev_frm_err_forms_edit"><![CDATA[Cannot update form]]></string>
+    <string name="_bx_dev_frm_txt_forms_form"><![CDATA[Forms Builder Form]]></string>
+    <string name="_bx_dev_frm_txt_forms_display_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_frm_txt_forms_display_edit"><![CDATA[Edit]]></string>
+    <string name="_bx_dev_frm_txt_sys_forms_id"><![CDATA[ID]]></string>
+    <string name="_bx_dev_frm_txt_sys_forms_object"><![CDATA[Name]]></string>
+    <string name="_bx_dev_frm_txt_forms_object"><![CDATA[Name]]></string>
+    <string name="_bx_dev_frm_err_forms_object"><![CDATA[You need to enter a unique value here]]></string>    
+    <string name="_bx_dev_frm_txt_sys_forms_module"><![CDATA[Module]]></string>
+    <string name="_bx_dev_frm_txt_forms_module"><![CDATA[Module]]></string>
+    <string name="_bx_dev_frm_err_forms_module"><![CDATA[You need to select a module]]></string>
+    <string name="_bx_dev_frm_txt_sys_forms_title"><![CDATA[Title]]></string>
+    <string name="_bx_dev_frm_txt_forms_title"><![CDATA[Title]]></string>
+    <string name="_bx_dev_frm_err_forms_title"><![CDATA[You need to enter a value here]]></string>
+    <string name="_bx_dev_frm_txt_sys_forms_action"><![CDATA[Action]]></string>
+    <string name="_bx_dev_frm_txt_forms_action"><![CDATA[Action]]></string>
+    <string name="_bx_dev_frm_txt_sys_forms_form_attrs"><![CDATA[Form Attrs]]></string>
+    <string name="_bx_dev_frm_txt_forms_form_attrs"><![CDATA[Form Attrs]]></string>
+    <string name="_bx_dev_frm_txt_sys_forms_submit_name"><![CDATA[Submit Name]]></string>
+    <string name="_bx_dev_frm_txt_forms_submit_name"><![CDATA[Submit Name]]></string>
+    <string name="_bx_dev_frm_txt_sys_forms_table"><![CDATA[Table]]></string>
+    <string name="_bx_dev_frm_txt_forms_table"><![CDATA[Table]]></string>
+    <string name="_bx_dev_frm_txt_sys_forms_key"><![CDATA[Key Field]]></string>
+    <string name="_bx_dev_frm_txt_forms_key"><![CDATA[Key Field]]></string>
+    <string name="_bx_dev_frm_txt_sys_forms_uri"><![CDATA[URI Field]]></string>
+    <string name="_bx_dev_frm_txt_forms_uri"><![CDATA[URI Field]]></string>
+    <string name="_bx_dev_frm_txt_sys_forms_uri_title"><![CDATA[URI Source Field]]></string>
+    <string name="_bx_dev_frm_txt_forms_uri_title"><![CDATA[URI Source Field]]></string>
+    <string name="_bx_dev_frm_txt_sys_forms_params"><![CDATA[Params]]></string>
+    <string name="_bx_dev_frm_txt_forms_params"><![CDATA[Params]]></string>
+    <string name="_bx_dev_frm_txt_sys_forms_deletable"><![CDATA[Deletable]]></string>
+    <string name="_bx_dev_frm_txt_forms_deletable"><![CDATA[Deletable]]></string>
+    <string name="_bx_dev_frm_txt_sys_forms_override_class_name"><![CDATA[Class Name]]></string>
+    <string name="_bx_dev_frm_txt_forms_override_class_name"><![CDATA[Class Name]]></string>
+    <string name="_bx_dev_frm_txt_sys_forms_override_class_file"><![CDATA[Class File]]></string>
+    <string name="_bx_dev_frm_txt_forms_override_class_file"><![CDATA[Class File]]></string>
+    <string name="_bx_dev_frm_txt_forms_export_insert"><![CDATA[Adding to database]]></string>
+    <string name="_bx_dev_frm_txt_forms_export_delete"><![CDATA[Removing from database]]></string>
+    <string name="_bx_dev_frm_btn_sys_forms_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_frm_btn_forms_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_frm_btn_forms_save"><![CDATA[Save]]></string>
+    <string name="_bx_dev_frm_btn_sys_forms_cancel"><![CDATA[Cancel]]></string>
+    <string name="_bx_dev_frm_btn_forms_cancel"><![CDATA[Cancel]]></string>
+    <string name="_bx_dev_frm_btn_forms_done"><![CDATA[Done]]></string>
+    <string name="_bx_dev_frm_txt_displays_create_popup"><![CDATA[Add New Display]]></string>
+    <string name="_bx_dev_frm_txt_displays_edit_popup"><![CDATA[Edit "{0}" Display]]></string>
+    <string name="_bx_dev_frm_err_displays_create"><![CDATA[Cannot add display]]></string>
+    <string name="_bx_dev_frm_err_displays_edit"><![CDATA[Cannot update display]]></string>
+    <string name="_bx_dev_frm_txt_displays_diplay"><![CDATA[Forms Builder Display]]></string>
+    <string name="_bx_dev_frm_txt_displays_display_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_frm_txt_displays_display_edit"><![CDATA[Edit]]></string>
+    <string name="_bx_dev_frm_txt_sys_displays_id"><![CDATA[ID]]></string>
+    <string name="_bx_dev_frm_txt_sys_displays_display_name"><![CDATA[Name]]></string>
+    <string name="_bx_dev_frm_txt_displays_display_name"><![CDATA[Name]]></string>
+    <string name="_bx_dev_frm_err_displays_display_name"><![CDATA[You need to enter a unique (in the form) value here]]></string>
+    <string name="_bx_dev_frm_txt_sys_displays_module"><![CDATA[Module]]></string>
+    <string name="_bx_dev_frm_txt_displays_module"><![CDATA[Module]]></string>
+    <string name="_bx_dev_frm_err_displays_module"><![CDATA[You need to select a module]]></string>
+    <string name="_bx_dev_frm_txt_sys_displays_object"><![CDATA[Form Name]]></string>
+    <string name="_bx_dev_frm_txt_displays_object"><![CDATA[Form Name]]></string>
+    <string name="_bx_dev_frm_err_displays_object"><![CDATA[You need to enter a value here]]></string>
+    <string name="_bx_dev_frm_txt_sys_displays_title"><![CDATA[Title]]></string>
+    <string name="_bx_dev_frm_txt_displays_title"><![CDATA[Title]]></string>
+    <string name="_bx_dev_frm_err_displays_title"><![CDATA[You need to enter a value here]]></string>
+    <string name="_bx_dev_frm_txt_sys_displays_view_mode"><![CDATA[View Mode]]></string>
+    <string name="_bx_dev_frm_txt_displays_view_mode"><![CDATA[View Mode]]></string>
+    <string name="_bx_dev_frm_btn_sys_displays_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_frm_btn_displays_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_frm_btn_displays_save"><![CDATA[Save]]></string>
+    <string name="_bx_dev_frm_btn_sys_displays_cancel"><![CDATA[Cancel]]></string>
+    <string name="_bx_dev_frm_btn_displays_cancel"><![CDATA[Cancel]]></string>
+    <string name="_bx_dev_frm_txt_field_title_editable"><![CDATA[Editable]]></string>
+    <string name="_bx_dev_frm_txt_field_info_editable"><![CDATA[Make the field Editable in Studio Forms Builder]]></string>
+    <string name="_bx_dev_frm_txt_field_title_deletable"><![CDATA[Deletable]]></string>
+    <string name="_bx_dev_frm_txt_field_info_deletable"><![CDATA[Make the field Deletable in Studio Forms Builder]]></string>
+    <string name="_bx_dev_frm_txt_prelists_create_popup"><![CDATA[Add Data List]]></string>
+    <string name="_bx_dev_frm_err_prelists_create"><![CDATA[Cannot add data list]]></string>
+    <string name="_bx_dev_frm_txt_prelists_edit_popup"><![CDATA[Edit "{0}" Data List]]></string>
+    <string name="_bx_dev_frm_err_prelists_edit"><![CDATA[Cannot update data list]]></string>
+    <string name="_bx_dev_frm_txt_prelists_export_popup"><![CDATA[Export "{0}" Data List]]></string>
+    <string name="_bx_dev_frm_txt_prelists_prelist"><![CDATA[Forms Builder Data List]]></string>
+    <string name="_bx_dev_frm_txt_prelists_display_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_frm_txt_prelists_display_edit"><![CDATA[Edit]]></string>
+    <string name="_bx_dev_frm_txt_sys_prelists_id"><![CDATA[id]]></string>
+    <string name="_bx_dev_frm_txt_sys_prelists_key"><![CDATA[Key]]></string>
+    <string name="_bx_dev_frm_txt_prelists_key"><![CDATA[Key]]></string>
+    <string name="_bx_dev_frm_err_prelists_key"><![CDATA[You need to enter a unique value here]]></string>
+    <string name="_bx_dev_frm_txt_sys_prelists_module"><![CDATA[Module]]></string>
+    <string name="_bx_dev_frm_txt_prelists_module"><![CDATA[Module]]></string>
+    <string name="_bx_dev_frm_err_prelists_module"><![CDATA[You need to select a module]]></string>
+    <string name="_bx_dev_frm_txt_sys_prelists_title"><![CDATA[Title]]></string>
+    <string name="_bx_dev_frm_txt_prelists_title"><![CDATA[Title]]></string>
+    <string name="_bx_dev_frm_err_prelists_title"><![CDATA[You need to enter a value here]]></string>
+    <string name="_bx_dev_frm_txt_sys_prelists_use_for_sets"><![CDATA[Use For Sets]]></string>
+    <string name="_bx_dev_frm_txt_prelists_use_for_sets"><![CDATA[Use For Sets]]></string>
+    <string name="_bx_dev_frm_btn_sys_prelists_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_frm_btn_prelists_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_frm_btn_prelists_save"><![CDATA[Save]]></string>
+    <string name="_bx_dev_frm_btn_sys_prelists_cancel"><![CDATA[Cancel]]></string>
+    <string name="_bx_dev_frm_btn_prelists_cancel"><![CDATA[Cancel]]></string>
+    <string name="_bx_dev_frm_btn_prelists_done"><![CDATA[Done]]></string>
+    <string name="_bx_dev_frm_txt_prelists_export_insert"><![CDATA[Adding to database]]></string>
+    <string name="_bx_dev_frm_txt_prelists_export_delete"><![CDATA[Removing from database]]></string>
+    <string name="_bx_dev_frm_txt_prevalues_create_popup"><![CDATA[Add Data Value]]></string>
+    <string name="_bx_dev_frm_err_prevalues_create"><![CDATA[Cannot add data value]]></string>
+    <string name="_bx_dev_frm_txt_prevalues_edit_popup"><![CDATA[Edit "{0}" Data Value]]></string>
+    <string name="_bx_dev_frm_err_prevalues_edit"><![CDATA[Cannot update data value]]></string>
+    <string name="_bx_dev_frm_txt_prevalues_prevalue"><![CDATA[Forms Builder Data Value]]></string>
+    <string name="_bx_dev_frm_txt_prevalues_display_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_frm_txt_prevalues_display_edit"><![CDATA[Edd]]></string>
+    <string name="_bx_dev_frm_txt_sys_prevalues_id"><![CDATA[ID]]></string>
+    <string name="_bx_dev_frm_txt_sys_prevalues_key"><![CDATA[List]]></string>
+    <string name="_bx_dev_frm_txt_prevalues_key"><![CDATA[List]]></string>
+    <string name="_bx_dev_frm_txt_prevalues_key_select"><![CDATA[Select List...]]></string>
+    <string name="_bx_dev_frm_err_prevalues_key"><![CDATA[You need to select a list]]></string>
+    <string name="_bx_dev_frm_txt_sys_prevalues_value"><![CDATA[Value]]></string>
+    <string name="_bx_dev_frm_txt_prevalues_value"><![CDATA[Value]]></string>
+    <string name="_bx_dev_frm_err_prevalues_value"><![CDATA[You need to enter a value here]]></string>
+    <string name="_bx_dev_frm_txt_sys_prevalues_lkey"><![CDATA[Title]]></string>
+    <string name="_bx_dev_frm_txt_prevalues_lkey"><![CDATA[Title]]></string>
+    <string name="_bx_dev_frm_err_prevalues_lkey"><![CDATA[You need to enter a value here]]></string>
+    <string name="_bx_dev_frm_txt_sys_prevalues_lkey2"><![CDATA[Title Additional]]></string>
+    <string name="_bx_dev_frm_txt_prevalues_lkey2"><![CDATA[Title Additional]]></string>
+    <string name="_bx_dev_frm_btn_sys_prevalues_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_frm_btn_prevalues_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_frm_btn_sys_prevalues_cancel"><![CDATA[Cancel]]></string>
+    <string name="_bx_dev_frm_btn_prevalues_cancel"><![CDATA[Cancel]]></string>
+    <string name="_bx_dev_frm_err_prevalues_create_forbidden"><![CDATA[This list is already used. It's impossible to add non-numeric, or less than 1, or more than {0} values in it.]]></string>
+    <string name="_bx_dev_frm_txt_search_forms_create_popup"><![CDATA[Add New Search Form]]></string>
+    <string name="_bx_dev_frm_txt_search_forms_edit_popup"><![CDATA[Edit "{0}" Search Form]]></string>
+    <string name="_bx_dev_frm_err_search_forms_create"><![CDATA[Cannot add search form]]></string>
+    <string name="_bx_dev_frm_err_search_forms_edit"><![CDATA[Cannot update search form]]></string>
+    <string name="_bx_dev_frm_txt_search_forms_form"><![CDATA[Forms Builder Search Form]]></string>
+    <string name="_bx_dev_frm_txt_search_forms_display_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_frm_txt_search_forms_display_edit"><![CDATA[Edit]]></string>
+    <string name="_bx_dev_frm_txt_sys_search_forms_id"><![CDATA[ID]]></string>
+    <string name="_bx_dev_frm_txt_sys_search_forms_object"><![CDATA[Name]]></string>
+    <string name="_bx_dev_frm_txt_search_forms_object"><![CDATA[Name]]></string>
+    <string name="_bx_dev_frm_err_forms_object"><![CDATA[You need to enter a unique value here]]></string>    
+    <string name="_bx_dev_frm_txt_sys_search_forms_object_content_info"><![CDATA[Content Info object]]></string>
+    <string name="_bx_dev_frm_txt_search_forms_object_content_info"><![CDATA[Content Info object]]></string>
+    <string name="_bx_dev_frm_err_forms_object_content_info"><![CDATA[You need to select the name of Content Info object here]]></string>    
+    <string name="_bx_dev_frm_txt_sys_search_forms_module"><![CDATA[Module]]></string>
+    <string name="_bx_dev_frm_txt_search_forms_module"><![CDATA[Module]]></string>
+    <string name="_bx_dev_frm_err_forms_module"><![CDATA[You need to select a module]]></string>
+    <string name="_bx_dev_frm_txt_sys_search_forms_title"><![CDATA[Title]]></string>
+    <string name="_bx_dev_frm_txt_search_forms_title"><![CDATA[Title]]></string>
+    <string name="_bx_dev_frm_err_forms_title"><![CDATA[You need to enter a value here]]></string>
+    <string name="_bx_dev_frm_txt_sys_search_forms_class_name"><![CDATA[Class Name]]></string>
+    <string name="_bx_dev_frm_txt_search_forms_class_name"><![CDATA[Class Name]]></string>
+    <string name="_bx_dev_frm_txt_sys_search_forms_class_file"><![CDATA[Class File]]></string>
+    <string name="_bx_dev_frm_txt_search_forms_class_file"><![CDATA[Class File]]></string>
+    <string name="_bx_dev_frm_btn_sys_search_forms_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_frm_btn_search_forms_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_frm_btn_search_forms_save"><![CDATA[Save]]></string>
+    <string name="_bx_dev_frm_btn_sys_search_forms_cancel"><![CDATA[Cancel]]></string>
+    <string name="_bx_dev_frm_btn_search_forms_cancel"><![CDATA[Cancel]]></string>
+    <string name="_bx_dev_frm_txt_search_fields_edit_popup"><![CDATA[Edit "{0}" Search Field]]></string>
+    <string name="_bx_dev_frm_err_search_fields_edit"><![CDATA[Cannot update search field]]></string>
+    <string name="_bx_dev_frm_txt_search_fields_form"><![CDATA[Forms Builder Search Field]]></string>
+    <string name="_bx_dev_frm_txt_search_fields_display_edit"><![CDATA[Edit]]></string>
+    <string name="_bx_dev_frm_txt_sys_search_fields_id"><![CDATA[ID]]></string>
+    <string name="_bx_dev_frm_txt_sys_search_fields_object"><![CDATA[Search Form]]></string>
+    <string name="_bx_dev_frm_txt_search_fields_object"><![CDATA[Search Form]]></string>
+    <string name="_bx_dev_frm_txt_sys_search_fields_name"><![CDATA[Name]]></string>
+    <string name="_bx_dev_frm_txt_search_fields_name"><![CDATA[Name]]></string>
+    <string name="_bx_dev_frm_err_search_fields_name"><![CDATA[You need to enter a value here]]></string>
+    <string name="_bx_dev_frm_txt_sys_search_fields_type"><![CDATA[Type]]></string>
+    <string name="_bx_dev_frm_txt_search_fields_type"><![CDATA[Type]]></string>
+    <string name="_bx_dev_frm_err_search_fields_type"><![CDATA[You need to select a type]]></string>
+    <string name="_bx_dev_frm_txt_sys_search_fields_caption"><![CDATA[Caption]]></string>
+    <string name="_bx_dev_frm_txt_search_fields_caption"><![CDATA[Caption]]></string>
+    <string name="_bx_dev_frm_err_search_fields_caption"><![CDATA[You need to enter a value here]]></string>
+    <string name="_bx_dev_frm_txt_sys_search_fields_values"><![CDATA[Values]]></string>
+    <string name="_bx_dev_frm_txt_search_fields_values"><![CDATA[Values]]></string>
+    <string name="_bx_dev_frm_txt_sys_search_fields_search_type"><![CDATA[Search Type]]></string>
+    <string name="_bx_dev_frm_txt_search_fields_search_type"><![CDATA[Search Type]]></string>
+    <string name="_bx_dev_frm_err_search_fields_search_type"><![CDATA[You need to select a search type]]></string>
+    <string name="_bx_dev_frm_txt_sys_search_fields_search_value"><![CDATA[Default Value]]></string>
+    <string name="_bx_dev_frm_txt_search_fields_search_value"><![CDATA[Default Value]]></string>
+    <string name="_bx_dev_frm_txt_sys_search_fields_search_operator"><![CDATA[Operator]]></string>
+    <string name="_bx_dev_frm_txt_search_fields_search_operator"><![CDATA[Operator]]></string>
+    <string name="_bx_dev_frm_err_search_fields_search_operator"><![CDATA[You need to select an operator]]></string>
+    <string name="_bx_dev_frm_btn_search_fields_save"><![CDATA[Save]]></string>
+    <string name="_bx_dev_frm_btn_sys_search_fields_save"><![CDATA[Save]]></string>
+    <string name="_bx_dev_frm_btn_search_fields_cancel"><![CDATA[Cancel]]></string>
+    <string name="_bx_dev_frm_btn_sys_search_fields_cancel"><![CDATA[Cancel]]></string>
+    
+    <!-- Navigation Builder -->
+    <string name="_bx_dev_nav_txt_menus_gl_title"><![CDATA[System Name]]></string>
+    <string name="_bx_dev_nav_txt_menus_gl_set_title"><![CDATA[Set]]></string>
+    <string name="_bx_dev_nav_txt_menus_gl_items"><![CDATA[Items]]></string>
+    <string name="_bx_dev_nav_txt_menus_gl_template_title"><![CDATA[Style]]></string>
+    <string name="_bx_dev_nav_txt_menus_gl_module"><![CDATA[Module]]></string>
+    <string name="_bx_dev_nav_txt_sets_gl_title"><![CDATA[System Name]]></string>
+    <string name="_bx_dev_nav_txt_sets_gl_module"><![CDATA[Module]]></string>
+    <string name="_bx_dev_nav_txt_sets_gl_items"><![CDATA[Items]]></string>
+    <string name="_bx_dev_nav_txt_items_gl_icon"><![CDATA[Icon]]></string>
+    <string name="_bx_dev_nav_txt_items_gl_title_system"><![CDATA[System Name]]></string>
+    <string name="_bx_dev_nav_txt_items_gl_link"><![CDATA[URL]]></string>
+    <string name="_bx_dev_nav_txt_items_gl_module"><![CDATA[Module]]></string>
+    <string name="_bx_dev_nav_txt_items_gl_visible"><![CDATA[Visibile For]]></string>
+    <string name="_bx_dev_nav_btn_menus_gl_create"><![CDATA[Add New Menu]]></string>
+    <string name="_bx_dev_nav_btn_menus_gl_export"><![CDATA[Export Menu]]></string>
+    <string name="_bx_dev_nav_btn_sets_gl_create"><![CDATA[Add New Set]]></string>
+    <string name="_bx_dev_nav_btn_items_gl_create"><![CDATA[Add New Item]]></string>
+    <string name="_bx_dev_nav_btn_items_gl_import"><![CDATA[Import Items]]></string>
+    <string name="_bx_dev_nav_btn_items_gl_visible"><![CDATA[Visibile For]]></string>
+    <string name="_bx_dev_nav_txt_select_module"><![CDATA[Select Module...]]></string>
+    <string name="_bx_dev_nav_txt_menus_create_popup"><![CDATA[Add New Menu]]></string>
+    <string name="_bx_dev_nav_err_menus_create"><![CDATA[Cannot add menu]]></string>
+    <string name="_bx_dev_nav_txt_menus_edit_popup"><![CDATA[Edit "{0}" Menu]]></string>
+    <string name="_bx_dev_nav_err_menus_edit"><![CDATA[Cannot update menu]]></string>
+    <string name="_bx_dev_nav_txt_menus_export_popup"><![CDATA[Export "{0}" Menu]]></string>
+    <string name="_bx_dev_nav_txt_menus_menu"><![CDATA[Navigation Builder Menu]]></string>
+    <string name="_bx_dev_nav_txt_menus_display_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_nav_txt_menus_display_edit"><![CDATA[Edit]]></string>
+    <string name="_bx_dev_nav_txt_sys_menus_id"><![CDATA[ID]]></string>
+    <string name="_bx_dev_nav_txt_sys_menus_object"><![CDATA[Name]]></string>
+    <string name="_bx_dev_nav_txt_menus_object"><![CDATA[Name]]></string>
+    <string name="_bx_dev_nav_err_menus_object"><![CDATA[You need to enter a unique value here]]></string>
+    <string name="_bx_dev_nav_txt_sys_menus_module"><![CDATA[Module]]></string>
+    <string name="_bx_dev_nav_txt_menus_module"><![CDATA[Module]]></string>
+    <string name="_bx_dev_nav_err_menus_module"><![CDATA[You need to select a module]]></string>
+    <string name="_bx_dev_nav_txt_sys_menus_title"><![CDATA[Title]]></string>
+    <string name="_bx_dev_nav_txt_menus_title"><![CDATA[Title]]></string>
+    <string name="_bx_dev_nav_err_menus_title"><![CDATA[You need to enter a value here]]></string>
+    <string name="_bx_dev_nav_txt_sys_menus_set_name"><![CDATA[Set]]></string>
+    <string name="_bx_dev_nav_txt_menus_set_name"><![CDATA[Set]]></string>
+    <string name="_bx_dev_nav_txt_menus_set_name_select"><![CDATA[Select Set...]]></string>
+    <string name="_bx_dev_nav_err_menus_set_name"><![CDATA[You need to select a set]]></string>
+    <string name="_bx_dev_nav_txt_sys_menus_template_id"><![CDATA[Style]]></string>
+    <string name="_bx_dev_nav_txt_menus_template_id"><![CDATA[Style]]></string>
+    <string name="_bx_dev_nav_txt_menus_template_id_select"><![CDATA[Select Style...]]></string>
+    <string name="_bx_dev_nav_err_menus_template_id"><![CDATA[You need to select a style]]></string>
+    <string name="_bx_dev_nav_txt_sys_menus_deletable"><![CDATA[Deletable]]></string>
+    <string name="_bx_dev_nav_txt_menus_deletable"><![CDATA[Deletable]]></string>
+    <string name="_bx_dev_nav_txt_sys_menus_override_class_name"><![CDATA[Class Name]]></string>
+    <string name="_bx_dev_nav_txt_menus_override_class_name"><![CDATA[Class Name]]></string>
+    <string name="_bx_dev_nav_txt_sys_menus_override_class_file"><![CDATA[Class File]]></string>
+    <string name="_bx_dev_nav_txt_menus_override_class_file"><![CDATA[Class File]]></string>
+    <string name="_bx_dev_nav_txt_menus_export_insert"><![CDATA[Adding to database]]></string>
+    <string name="_bx_dev_nav_txt_menus_export_delete"><![CDATA[Removing from database]]></string>
+    <string name="_bx_dev_nav_btn_sys_menus_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_nav_btn_menus_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_nav_btn_menus_save"><![CDATA[Save]]></string>
+    <string name="_bx_dev_nav_btn_sys_menus_cancel"><![CDATA[Cancel]]></string>
+    <string name="_bx_dev_nav_btn_menus_cancel"><![CDATA[Cancel]]></string>
+    <string name="_bx_dev_nav_btn_menus_done"><![CDATA[Done]]></string>
+    <string name="_bx_dev_nav_txt_sets_create_popup"><![CDATA[Add New Set]]></string>
+    <string name="_bx_dev_nav_err_sets_create"><![CDATA[Cannot add set]]></string>
+    <string name="_bx_dev_nav_txt_sets_edit_popup"><![CDATA[Edit "{0}" Set]]></string>
+    <string name="_bx_dev_nav_err_sets_edit"><![CDATA[Cannot update set]]></string>
+    <string name="_bx_dev_nav_txt_sets_set"><![CDATA[Navigation Builder Sets]]></string>
+    <string name="_bx_dev_nav_txt_sets_display_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_nav_txt_sets_display_edit"><![CDATA[Edit]]></string>
+    <string name="_bx_dev_nav_txt_sys_sets_module"><![CDATA[Module]]></string>
+    <string name="_bx_dev_nav_txt_sets_module"><![CDATA[Module]]></string>
+    <string name="_bx_dev_nav_err_sets_module"><![CDATA[You need to select a module]]></string>
+    <string name="_bx_dev_nav_txt_sys_sets_set_name"><![CDATA[Set]]></string>
+    <string name="_bx_dev_nav_txt_sets_set_name"><![CDATA[Set]]></string>
+    <string name="_bx_dev_nav_err_sets_set_name"><![CDATA[You need to enter a set name]]></string>
+    <string name="_bx_dev_nav_txt_sys_sets_title"><![CDATA[Title]]></string>
+    <string name="_bx_dev_nav_txt_sets_title"><![CDATA[Title]]></string>
+    <string name="_bx_dev_nav_err_sets_title"><![CDATA[You need to enter a value here]]></string>
+    <string name="_bx_dev_nav_txt_sys_sets_deletable"><![CDATA[Deletable]]></string>
+    <string name="_bx_dev_nav_txt_sets_deletable"><![CDATA[Deletable]]></string>
+    <string name="_bx_dev_nav_btn_sys_sets_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_nav_btn_sets_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_nav_btn_sys_sets_cancel"><![CDATA[Cancel]]></string>
+    <string name="_bx_dev_nav_btn_sets_cancel"><![CDATA[Cancel]]></string>
+    <string name="_bx_dev_nav_txt_items_create_popup"><![CDATA[Add New Item]]></string>
+    <string name="_bx_dev_nav_err_items_create"><![CDATA[Cannot add item]]></string>
+    <string name="_bx_dev_nav_txt_items_edit_popup"><![CDATA[Edit "{0}" Item]]></string>
+    <string name="_bx_dev_nav_err_items_edit"><![CDATA[Cannot update item]]></string>
+    <string name="_bx_dev_nav_txt_items_item"><![CDATA[Navigation Builder Items]]></string>
+    <string name="_bx_dev_nav_txt_items_display_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_nav_txt_items_display_edit"><![CDATA[Edit]]></string>
+    <string name="_bx_dev_nav_txt_sys_items_id"><![CDATA[ID]]></string>
+    <string name="_bx_dev_nav_txt_sys_items_module"><![CDATA[Module]]></string>
+    <string name="_bx_dev_nav_txt_items_module"><![CDATA[Module]]></string>
+    <string name="_bx_dev_nav_err_items_module"><![CDATA[You need to select a module]]></string>
+    <string name="_bx_dev_nav_txt_sys_items_set_name"><![CDATA[Set]]></string>
+    <string name="_bx_dev_nav_txt_items_set_name"><![CDATA[Set]]></string>
+    <string name="_bx_dev_nav_err_items_set_name"><![CDATA[You need to select a set]]></string>
+    <string name="_bx_dev_nav_txt_sys_items_name"><![CDATA[Name]]></string>
+    <string name="_bx_dev_nav_txt_items_name"><![CDATA[Name]]></string>
+    <string name="_bx_dev_nav_err_items_name"><![CDATA[You need to enter a unique value here]]></string>
+    <string name="_bx_dev_nav_txt_sys_items_title_system"><![CDATA[System Title]]></string>
+    <string name="_bx_dev_nav_txt_items_title_system"><![CDATA[System Title]]></string>
+    <string name="_bx_dev_nav_err_items_title_system"><![CDATA[You need to enter a value here]]></string>
+    <string name="_bx_dev_nav_txt_sys_items_title"><![CDATA[Title]]></string>
+    <string name="_bx_dev_nav_txt_items_title"><![CDATA[Title]]></string>
+    <string name="_bx_dev_nav_txt_sys_items_link"><![CDATA[Link]]></string>
+    <string name="_bx_dev_nav_txt_items_link"><![CDATA[Link]]></string>
+    <string name="_bx_dev_nav_txt_sys_items_onclick"><![CDATA[OnClick]]></string>
+    <string name="_bx_dev_nav_txt_items_onclick"><![CDATA[OnClick]]></string>
+    <string name="_bx_dev_nav_txt_sys_items_target"><![CDATA[Target]]></string>
+    <string name="_bx_dev_nav_txt_items_target"><![CDATA[Target]]></string>
+    <string name="_bx_dev_nav_txt_sys_items_icon"><![CDATA[Icon]]></string>
+    <string name="_bx_dev_nav_txt_items_icon"><![CDATA[Icon]]></string>
+    <string name="_bx_dev_nav_txt_sys_items_submenu_object"><![CDATA[Submenu Object]]></string>
+    <string name="_bx_dev_nav_txt_items_submenu_object"><![CDATA[Submenu Object]]></string>
+    <string name="_bx_dev_nav_txt_sys_items_copyable"><![CDATA[Copyable]]></string>
+    <string name="_bx_dev_nav_txt_items_copyable"><![CDATA[Copyable]]></string>
+    <string name="_bx_dev_nav_btn_sys_items_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_nav_btn_items_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_nav_btn_items_save"><![CDATA[Save]]></string>
+    <string name="_bx_dev_nav_btn_sys_items_cancel"><![CDATA[Cancel]]></string>
+    <string name="_bx_dev_nav_btn_items_cancel"><![CDATA[Cancel]]></string>
+
+    <!-- Page Builder -->
+    <string name="_bx_dev_bp_txt_select_module"><![CDATA[Select Module...]]></string>
+    <string name="_bx_dev_bp_txt_page_create_popup"><![CDATA[Add New Page]]></string>
+    <string name="_bx_dev_bp_err_page_create"><![CDATA[Cannot add page]]></string>
+    <string name="_bx_dev_bp_txt_page_form"><![CDATA[Page in Page Builder]]></string>
+    <string name="_bx_dev_bp_txt_page_display_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_bp_txt_sys_page_module"><![CDATA[Module]]></string>
+    <string name="_bx_dev_bp_txt_page_module"><![CDATA[Module]]></string>
+    <string name="_bx_dev_bp_err_page_module"><![CDATA[You need to select a module]]></string>
+    <string name="_bx_dev_bp_txt_sys_page_object"><![CDATA[Name]]></string>
+    <string name="_bx_dev_bp_txt_page_object"><![CDATA[Name]]></string>
+    <string name="_bx_dev_bp_err_page_object"><![CDATA[You need to enter a unique value here]]></string>
+    <string name="_bx_dev_bp_txt_sys_page_title_system"><![CDATA[System Title]]></string>
+    <string name="_bx_dev_bp_txt_page_title_system"><![CDATA[System Title]]></string>
+    <string name="_bx_dev_bp_err_page_title_system"><![CDATA[You need to enter a value here]]></string>
+    <string name="_bx_dev_bp_txt_sys_page_title"><![CDATA[Title]]></string>
+    <string name="_bx_dev_bp_txt_page_title"><![CDATA[Title]]></string>
+    <string name="_bx_dev_bp_err_page_title"><![CDATA[You need to enter a value here]]></string>
+    <string name="_bx_dev_bp_txt_sys_page_uri"><![CDATA[URI]]></string>
+    <string name="_bx_dev_bp_txt_page_uri"><![CDATA[URI]]></string>
+    <string name="_bx_dev_bp_txt_sys_page_url"><![CDATA[URL]]></string>
+    <string name="_bx_dev_bp_txt_page_url"><![CDATA[URL]]></string>
+    <string name="_bx_dev_bp_txt_sys_page_layout_id"><![CDATA[Layout]]></string>
+    <string name="_bx_dev_bp_txt_page_layout_id"><![CDATA[Layout]]></string>
+    <string name="_bx_dev_bp_txt_page_layout_id_select"><![CDATA[Select Layout...]]></string>
+    <string name="_bx_dev_bp_err_page_layout_id"><![CDATA[You need to select a layout]]></string>
+    <string name="_bx_dev_bp_txt_page_cache_editable"><![CDATA[Editable]]></string>
+    <string name="_bx_dev_bp_txt_sys_page_deletable"><![CDATA[Deletable]]></string>
+    <string name="_bx_dev_bp_txt_page_deletable"><![CDATA[Deletable]]></string>
+    <string name="_bx_dev_bp_txt_sys_page_override_class_name"><![CDATA[Class Name]]></string>
+    <string name="_bx_dev_bp_txt_page_override_class_name"><![CDATA[Class Name]]></string>
+    <string name="_bx_dev_bp_txt_sys_page_override_class_file"><![CDATA[Class File]]></string>
+    <string name="_bx_dev_bp_txt_page_override_class_file"><![CDATA[Class File]]></string>
+    <string name="_bx_dev_bp_btn_sys_page_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_bp_btn_page_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_bp_btn_sys_page_cancel"><![CDATA[Cancel]]></string>
+    <string name="_bx_dev_bp_btn_page_cancel"><![CDATA[Cancel]]></string>
+    <string name="_bx_dev_bp_btn_page_done"><![CDATA[Done]]></string>
+    <string name="_bx_dev_bp_btn_page_export"><![CDATA[Export Page]]></string>
+    <string name="_bx_dev_bp_txt_page_export_popup"><![CDATA[Export "{0}" Page]]></string>
+    <string name="_bx_dev_bp_txt_page_export_insert"><![CDATA[Adding to database]]></string>
+    <string name="_bx_dev_bp_txt_page_export_delete"><![CDATA[Removing from database]]></string>
+    <string name="_bx_dev_bp_txt_block_edit_popup"><![CDATA[Edit "{0}" Block]]></string>
+    <string name="_bx_dev_bp_err_block_edit"><![CDATA[Cannot update page]]></string>
+    <string name="_bx_dev_bp_err_block_not_found"><![CDATA[Block was not found]]></string>
+    <string name="_bx_dev_bp_err_block_delete"><![CDATA[Cannot delete block]]></string>
+    <string name="_bx_dev_bp_txt_block_form"><![CDATA[Block in Page Builder]]></string>
+    <string name="_bx_dev_bp_txt_block_display_edit"><![CDATA[Edit]]></string>
+    <string name="_bx_dev_bp_txt_sys_block_id"><![CDATA[ID]]></string>
+    <string name="_bx_dev_bp_txt_sys_block_object"><![CDATA[Name]]></string>
+    <string name="_bx_dev_bp_txt_block_object"><![CDATA[Name]]></string>
+    <string name="_bx_dev_bp_err_block_object"><![CDATA[You need to enter a unique value here]]></string>
+    <string name="_bx_dev_bp_txt_sys_block_module"><![CDATA[Module]]></string>
+    <string name="_bx_dev_bp_txt_block_module"><![CDATA[Module]]></string>
+    <string name="_bx_dev_bp_err_block_module"><![CDATA[You need to select a module]]></string>
+	<string name="_bx_dev_bp_txt_sys_block_title_system"><![CDATA[Title System]]></string>
+    <string name="_bx_dev_bp_txt_block_title_system"><![CDATA[Title System]]></string>
+    <string name="_bx_dev_bp_err_block_title_system"><![CDATA[You need to enter a value here]]></string>
+    <string name="_bx_dev_bp_txt_sys_block_title"><![CDATA[Title]]></string>
+    <string name="_bx_dev_bp_txt_block_title"><![CDATA[Title]]></string>
+    <string name="_bx_dev_bp_err_block_title"><![CDATA[You need to enter a value here]]></string>
+    <string name="_bx_dev_bp_txt_sys_block_designbox_id"><![CDATA[Layout]]></string>
+    <string name="_bx_dev_bp_txt_block_designbox_id"><![CDATA[Layout]]></string>
+    <string name="_bx_dev_bp_err_block_designbox_id"><![CDATA[You need to select a layout]]></string>
+    <string name="_bx_dev_bp_txt_sys_block_visible_for"><![CDATA[Visible For]]></string>
+    <string name="_bx_dev_bp_txt_block_visible_for"><![CDATA[Visible For]]></string>
+    <string name="_bx_dev_bp_txt_block_visible_for_all"><![CDATA[Anyone]]></string>
+    <string name="_bx_dev_bp_txt_block_visible_for_selected"><![CDATA[Selected levels]]></string>
+    <string name="_bx_dev_bp_txt_sys_block_visible_for_levels"><![CDATA[Select Levels]]></string>
+    <string name="_bx_dev_bp_txt_block_visible_for_levels"><![CDATA[Select Levels]]></string>
+    <string name="_bx_dev_bp_txt_block_content_service"><![CDATA[Code]]></string>
+    <string name="_bx_dev_bp_txt_block_content_lang"><![CDATA[Content]]></string>
+    <string name="_bx_dev_bp_dsc_block_content_lang"><![CDATA[Enter language key]]></string>
+    <string name="_bx_dev_bp_txt_sys_block_deletable"><![CDATA[Deletable]]></string>
+    <string name="_bx_dev_bp_txt_block_deletable"><![CDATA[Deletable]]></string>
+    <string name="_bx_dev_bp_txt_sys_block_copyable"><![CDATA[Copyable]]></string>
+    <string name="_bx_dev_bp_txt_block_copyable"><![CDATA[Copyable]]></string>
+    <string name="_bx_dev_bp_txt_sys_block_active"><![CDATA[Active]]></string>
+    <string name="_bx_dev_bp_txt_block_active"><![CDATA[Active]]></string>
+    <string name="_bx_dev_bp_btn_sys_block_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_bp_btn_block_add"><![CDATA[Add]]></string>
+    <string name="_bx_dev_bp_btn_block_save"><![CDATA[Save]]></string>
+    <string name="_bx_dev_bp_btn_sys_block_cancel"><![CDATA[Cancel]]></string>
+    <string name="_bx_dev_bp_btn_block_cancel"><![CDATA[Cancel]]></string>
+    <string name="_bx_dev_bp_btn_sys_block_delete"><![CDATA[Delete]]></string>
+    <string name="_bx_dev_bp_btn_block_delete"><![CDATA[Delete]]></string>
+
+	<!-- Polyglot -->
+    <string name="_bx_dev_pgt_txt_manage_gl_title"><![CDATA[Module]]></string>
+    <string name="_bx_dev_pgt_btn_manage_gl_recompile"><![CDATA[Recompile All]]></string>
+    <string name="_bx_dev_pgt_btn_manage_gl_restore"><![CDATA[Restore All]]></string>
+    <string name="_bx_dev_pgt_txt_manage_recompile_title_sing"><![CDATA[Recompile %s language for %s module.]]></string>
+    <string name="_bx_dev_pgt_txt_manage_restore_title_sing"><![CDATA[Restore %s language for %s module.]]></string>
+    <string name="_bx_dev_pgt_txt_manage_recompile_title_plur"><![CDATA[Recompile %s language for all modules.]]></string>
+    <string name="_bx_dev_pgt_txt_manage_restore_title_plur"><![CDATA[Restore %s language for all modules.]]></string>
+    <string name="_bx_dev_pgt_txt_manage_modules_all"><![CDATA[All]]></string>
+
+	<!-- Hash -->
+	<string name="_bx_dev_hash_msg_reset_hash_system"><![CDATA[System hash was successfully reset.]]></string>
+	<string name="_bx_dev_hash_err_reset_hash_system"><![CDATA[Cannot reset system hash.]]></string>
+	<string name="_bx_dev_hash_msg_reset_hash_modules"><![CDATA[Hash was successfully reset for the following modules:]]></string>
+	<string name="_bx_dev_hash_txt_reset_hash_module"><![CDATA[Module]]></string>
+	<string name="_bx_dev_hash_txt_reset_hash_files"><![CDATA[Files Hashed]]></string>
+</resources>

+ 648 - 0
modules/boonex/developer/updates/9.0.3_9.0.4/source/install/sql/install.sql

@@ -0,0 +1,648 @@
+SET @sName = 'bx_developer';
+
+
+--
+-- Studio page and widget.
+--
+INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
+(3, @sName, '_bx_dev_adm_page_cpt', '_bx_dev_adm_page_cpt', 'bx_developer@modules/boonex/developer/|std-icon.svg');
+SET @iPageId = LAST_INSERT_ID();
+
+SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name`='home');
+SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id`=@iParentPageId);
+INSERT INTO `sys_std_widgets`(`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
+(@iPageId, @sName, CONCAT('{url_studio}module.php?name=', @sName), '', 'bx_developer@modules/boonex/developer/|std-icon.svg', '_bx_dev_adm_wgt_cpt', '', '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(NOT ISNULL(@iParentPageOrder), @iParentPageOrder + 1, 1));
+
+
+--
+-- Forms Builder -> Grid descriptors
+--
+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_developer_forms', 'Sql', 'SELECT * FROM `sys_objects_form` WHERE 1 ', 'sys_objects_form', 'id', 'module,title', 'active', '', 100, NULL, 'start', '', 'module', 'title', 'like', 'module', 'title', 2147483647, 'BxDevFormsForms', 'modules/boonex/developer/classes/BxDevFormsForms.php'),
+('bx_developer_forms_displays', 'Sql', 'SELECT `td`.`id` AS `id`, `td`.`object` AS `object`, `td`.`display_name` AS `display_name`, `td`.`title` AS `display_title`, `td`.`module` AS `module`, `tf`.`title` AS `form_title` FROM `sys_form_displays` AS `td` LEFT JOIN `sys_objects_form` AS `tf` ON `td`.`object`=`tf`.`object` WHERE 1 ', 'sys_form_displays', 'id', 'module,object,display_title', '', '', 100, NULL, 'start', '', 'td`.`module', 'td`.`title', 'like', 'module', 'display_title,form_title', 2147483647, 'BxDevFormsDisplays', 'modules/boonex/developer/classes/BxDevFormsDisplays.php'),
+('bx_developer_forms_fields', 'Sql', 'SELECT `tdi`.`id` AS `id`, `ti`.`caption_system` AS `caption_system`, `ti`.`type` AS `type`, `ti`.`module` AS `module`, `tdi`.`visible_for_levels` AS `visible_for_levels`, `tdi`.`active` AS `active`, `ti`.`editable` AS `editable`, `ti`.`deletable` AS `deletable`, `tdi`.`order` AS `order` FROM `sys_form_display_inputs` AS `tdi` LEFT JOIN `sys_form_inputs` AS `ti` ON `tdi`.`input_name`=`ti`.`name` AND `ti`.`object`=? WHERE 1 AND `tdi`.`display_name`=?', 'sys_form_display_inputs', 'id', 'order', 'active', '', 100, NULL, 'start', '', 'ti`.`type', 'ti`.`caption_system', 'like', '', '', 2147483647, 'BxDevFormsFields', 'modules/boonex/developer/classes/BxDevFormsFields.php'),
+
+('bx_developer_forms_pre_lists', 'Sql', 'SELECT * FROM `sys_form_pre_lists` WHERE 1 ', 'sys_form_pre_lists', 'id', '', '', '', 100, NULL, 'start', '', 'module,key', 'title', 'auto', 'module', 'title', 2147483647, 'BxDevFormsPreLists', 'modules/boonex/developer/classes/BxDevFormsPreLists.php'),
+('bx_developer_forms_pre_values', 'Sql', 'SELECT * FROM `sys_form_pre_values` WHERE 1 ', 'sys_form_pre_values', 'id', 'Order', '', '', 1000, NULL, 'start', '', 'Key,Value', 'LKey,LKey2', 'auto', '', '', 2147483647, 'BxDevFormsPreValues', 'modules/boonex/developer/classes/BxDevFormsPreValues.php'),
+
+('bx_developer_search_forms', 'Sql', 'SELECT * FROM `sys_objects_search_extended` WHERE 1 ', 'sys_objects_search_extended', 'id', 'module,title', 'active', '', 100, NULL, 'start', '', 'module', 'title', 'like', 'module', 'title', 2147483647, 'BxDevFormsSearchForms', 'modules/boonex/developer/classes/BxDevFormsSearchForms.php'),
+('bx_developer_search_forms_fields', 'Sql', 'SELECT * FROM `sys_search_extended_fields` WHERE 1 AND `object`=?', 'sys_search_extended_fields', 'id', 'order', 'active', '', 100, NULL, 'start', '', 'type', 'caption', 'like', '', '', 2147483647, 'BxDevFormsSearchFields', 'modules/boonex/developer/classes/BxDevFormsSearchFields.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('bx_developer_forms', 'switcher', '', '10%', 0, '', '', 1),
+('bx_developer_forms', 'title', '_bx_dev_frm_txt_forms_gl_title', '40%', 1, '38', '', 2),
+('bx_developer_forms', 'module', '_bx_dev_frm_txt_forms_gl_module', '15%', 0, '13', '', 3),
+('bx_developer_forms', 'displays', '_bx_dev_frm_txt_forms_gl_displays', '15%', 0, '13', '', 4),
+('bx_developer_forms', 'actions', '', '20%', 0, '', '', 5),
+
+('bx_developer_forms_displays', 'display_title', '_bx_dev_frm_txt_displays_gl_title', '30%', 1, '48', '', 1),
+('bx_developer_forms_displays', 'module', '_bx_dev_frm_txt_displays_gl_module', '13%', 0, '11', '', 2),
+('bx_developer_forms_displays', 'form_title', '_bx_dev_frm_txt_displays_gl_form', '24%', 1, '22', '', 3),
+('bx_developer_forms_displays', 'fields', '_bx_dev_frm_txt_displays_gl_fields', '13%', 0, '11', '', 4),
+('bx_developer_forms_displays', 'actions', '', '20%', 0, '', '', 5),
+
+('bx_developer_forms_fields', 'order', '', '1%', 0, '', '', 1),
+('bx_developer_forms_fields', 'switcher', '', '9%', 0, '', '', 2),
+('bx_developer_forms_fields', 'type', '_bx_dev_frm_txt_fields_gl_type', '5%', 0, '', '', 3),
+('bx_developer_forms_fields', 'caption_system', '_bx_dev_frm_txt_fields_gl_caption_system', '40%', 1, '38', '', 4),
+('bx_developer_forms_fields', 'module', '_bx_dev_frm_txt_fields_gl_module', '15%', 0, '13', '', 5),
+('bx_developer_forms_fields', 'visible_for_levels', '_bx_dev_frm_txt_fields_gl_visible', '10%', 0, '10', '', 6),
+('bx_developer_forms_fields', 'actions', '', '20%', 0, '', '', 7),
+
+('bx_developer_forms_pre_lists', 'title', '_bx_dev_frm_txt_pre_lists_gl_title', '45%', 1, '50', '', 1),
+('bx_developer_forms_pre_lists', 'values', '_bx_dev_frm_txt_pre_lists_gl_values', '12%', 0, '10', '', 2),
+('bx_developer_forms_pre_lists', 'module', '_bx_dev_frm_txt_pre_lists_gl_module', '13%', 0, '11', '', 3),
+('bx_developer_forms_pre_lists', 'use_for_sets', '_bx_dev_frm_txt_pre_lists_gl_use_for_sets', '10%', 0, '8', '', 4),
+('bx_developer_forms_pre_lists', 'actions', '', '20%', 0, '', '', 5),
+
+('bx_developer_forms_pre_values', 'order', '', '1%', 0, '', '', 1),
+('bx_developer_forms_pre_values', 'LKey', '_bx_dev_frm_txt_pre_values_gl_lkey', '79%', 1, '75', '', 2),
+('bx_developer_forms_pre_values', 'actions', '', '20%', 0, '', '', 3),
+
+('bx_developer_search_forms', 'switcher', '', '10%', 0, '', '', 1),
+('bx_developer_search_forms', 'title', '_bx_dev_frm_txt_search_forms_gl_title', '40%', 1, '38', '', 2),
+('bx_developer_search_forms', 'module', '_bx_dev_frm_txt_search_forms_gl_module', '15%', 0, '13', '', 3),
+('bx_developer_search_forms', 'fields', '_bx_dev_frm_txt_search_forms_gl_fields', '15%', 0, '13', '', 4),
+('bx_developer_search_forms', 'actions', '', '20%', 0, '', '', 5),
+
+('bx_developer_search_forms_fields', 'order', '', '1%', 0, '', '', 1),
+('bx_developer_search_forms_fields', 'switcher', '', '9%', 0, '', '', 2),
+('bx_developer_search_forms_fields', 'type', '_bx_dev_frm_txt_search_forms_fields_gl_type', '10%', 0, '', '', 3),
+('bx_developer_search_forms_fields', 'caption', '_bx_dev_frm_txt_search_forms_fields_gl_caption', '40%', 1, '38', '', 4),
+('bx_developer_search_forms_fields', 'search_type', '_bx_dev_frm_txt_search_forms_fields_gl_search_type', '10%', 0, '', '', 5),
+('bx_developer_search_forms_fields', 'search_operator', '_bx_dev_frm_txt_search_forms_fields_gl_search_operator', '10%', 0, '', '', 6),
+('bx_developer_search_forms_fields', 'actions', '', '20%', 0, '', '', 7);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `confirm`, `order`) VALUES
+('bx_developer_forms', 'independent', 'add', '_bx_dev_frm_btn_forms_gl_create', '', 0, 1),
+('bx_developer_forms', 'single', 'export', '', 'download', 0, 1),
+('bx_developer_forms', 'single', 'edit', '', 'pencil', 0, 2),
+
+('bx_developer_forms_displays', 'independent', 'add', '_bx_dev_frm_btn_displays_gl_create', '', 0, 1),
+('bx_developer_forms_displays', 'single', 'edit', '', 'pencil', 0, 1),
+
+('bx_developer_forms_fields', 'single', 'edit', '', 'pencil', 0, 1),
+('bx_developer_forms_fields', 'single', 'delete', '', 'remove', 1, 2),
+('bx_developer_forms_fields', 'single', 'show_to', '_bx_dev_frm_btn_fields_visible', '', 0, 3),
+('bx_developer_forms_fields', 'independent', 'add', '_bx_dev_frm_btn_fields_create', '', 0, 1),
+
+('bx_developer_forms_pre_lists', 'independent', 'add', '_bx_dev_frm_btn_pre_lists_create', '', 0, 1),
+('bx_developer_forms_pre_lists', 'single', 'export', '', 'download', 0, 1),
+('bx_developer_forms_pre_lists', 'single', 'edit', '', 'pencil', 0, 2),
+('bx_developer_forms_pre_lists', 'single', 'delete', '', 'remove', 1, 3),
+
+('bx_developer_forms_pre_values', 'independent', 'add', '_bx_dev_frm_btn_pre_values_create', '', 0, 1),
+('bx_developer_forms_pre_values', 'single', 'edit', '', 'pencil', 0, 1),
+('bx_developer_forms_pre_values', 'single', 'delete', '', 'remove', 1, 2),
+
+('bx_developer_search_forms', 'independent', 'add', '_bx_dev_frm_btn_search_forms_create', '', 0, 1),
+('bx_developer_search_forms', 'single', 'edit', '', 'pencil', 0, 1),
+
+('bx_developer_search_forms_fields', 'single', 'edit', '', 'pencil', 0, 1),
+('bx_developer_search_forms_fields', 'independent', 'reset', '_bx_dev_frm_btn_search_forms_fields_reset', '', 0, 1);
+
+
+--
+-- Forms Builder -> Forms.
+--
+INSERT INTO `sys_objects_form` (`object`, `module`, `title`, `action`, `form_attrs`, `submit_name`, `table`, `key`, `uri`, `uri_title`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
+('bx_developer_forms_form', @sName, '_bx_dev_frm_txt_forms_form', '', '', 'do_submit', 'sys_objects_form', 'id', '', '', '', 0, 1, 'BxDevFormView', 'modules/boonex/developer/classes/BxDevFormView.php');
+
+INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
+('bx_developer_forms_form_add', @sName, 'bx_developer_forms_form', '_bx_dev_frm_txt_forms_display_add', 0),
+('bx_developer_forms_form_edit', @sName, 'bx_developer_forms_form', '_bx_dev_frm_txt_forms_display_edit', 0);
+
+INSERT INTO `sys_form_inputs` (`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES
+('bx_developer_forms_form', @sName, 'id', '0', '', 0, 'hidden', '_bx_dev_frm_txt_sys_forms_id', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
+('bx_developer_forms_form', @sName, 'object', '', '', 0, 'text', '_bx_dev_frm_txt_sys_forms_object', '_bx_dev_frm_txt_forms_object', '', 1, 0, 0, '', '', '', 'Length', 'a:2:{s:3:"min";i:6;s:3:"max";i:100;}', '_bx_dev_frm_err_forms_object', 'Xss', '', 0, 0),
+('bx_developer_forms_form', @sName, 'module', '', '', 0, 'select', '_bx_dev_frm_txt_sys_forms_module', '_bx_dev_frm_txt_forms_module', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_dev_frm_err_forms_module', 'Xss', '', 0, 0),
+('bx_developer_forms_form', @sName, 'title', '', '', 0, 'text', '_bx_dev_frm_txt_sys_forms_title', '_bx_dev_frm_txt_forms_title', '', 1, 0, 0, '', '', '', 'Length', 'a:2:{s:3:"min";i:6;s:3:"max";i:100;}', '_bx_dev_frm_err_forms_title', 'Xss', '', 0, 0),
+('bx_developer_forms_form', @sName, 'action', '', '', 0, 'text', '_bx_dev_frm_txt_sys_forms_action', '_bx_dev_frm_txt_forms_action', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_developer_forms_form', @sName, 'form_attrs', '', '', 0, 'textarea', '_bx_dev_frm_txt_sys_forms_form_attrs', '_bx_dev_frm_txt_forms_form_attrs', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_developer_forms_form', @sName, 'submit_name', '', '', 0, 'text', '_bx_dev_frm_txt_sys_forms_submit_name', '_bx_dev_frm_txt_forms_submit_name', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_developer_forms_form', @sName, 'table', '', '', 0, 'text', '_bx_dev_frm_txt_sys_forms_table', '_bx_dev_frm_txt_forms_table', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_developer_forms_form', @sName, 'key', '', '', 0, 'text', '_bx_dev_frm_txt_sys_forms_key', '_bx_dev_frm_txt_forms_key', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_developer_forms_form', @sName, 'uri', '', '', 0, 'text', '_bx_dev_frm_txt_sys_forms_uri', '_bx_dev_frm_txt_forms_uri', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_developer_forms_form', @sName, 'uri_title', '', '', 0, 'text', '_bx_dev_frm_txt_sys_forms_uri_title', '_bx_dev_frm_txt_forms_uri_title', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_developer_forms_form', @sName, 'params', '', '', 0, 'textarea', '_bx_dev_frm_txt_sys_forms_params', '_bx_dev_frm_txt_forms_params', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_developer_forms_form', @sName, 'deletable', '1', '', 0, 'switcher', '_bx_dev_frm_txt_sys_forms_deletable', '_bx_dev_frm_txt_forms_deletable', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
+('bx_developer_forms_form', @sName, 'override_class_name', '', '', 0, 'text', '_bx_dev_frm_txt_sys_forms_override_class_name', '_bx_dev_frm_txt_forms_override_class_name', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_developer_forms_form', @sName, 'override_class_file', '', '', 0, 'text', '_bx_dev_frm_txt_sys_forms_override_class_file', '_bx_dev_frm_txt_forms_override_class_file', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_developer_forms_form', @sName, 'controls', '', 'do_submit,cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_developer_forms_form', @sName, 'do_submit', '_bx_dev_frm_btn_forms_add', '', 0, 'submit', '_bx_dev_frm_btn_sys_forms_add', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_developer_forms_form', @sName, 'cancel', '_bx_dev_frm_btn_forms_cancel', '', 0, 'button', '_bx_dev_frm_btn_sys_forms_cancel', '', '', 0, 0, 0, 'a:2:{s:7:"onclick";s:45:"$(''.bx-popup-applied:visible'').dolPopupHide()";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 0, 0);
+
+INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
+('bx_developer_forms_form_add', 'object', 2147483647, 1, 1),
+('bx_developer_forms_form_add', 'module', 2147483647, 1, 2),
+('bx_developer_forms_form_add', 'title', 2147483647, 1, 3),
+('bx_developer_forms_form_add', 'action', 2147483647, 1, 4),
+('bx_developer_forms_form_add', 'form_attrs', 2147483647, 1, 5),
+('bx_developer_forms_form_add', 'submit_name', 2147483647, 1, 6),
+('bx_developer_forms_form_add', 'table', 2147483647, 1, 7),
+('bx_developer_forms_form_add', 'key', 2147483647, 1, 8),
+('bx_developer_forms_form_add', 'uri', 2147483647, 1, 9),
+('bx_developer_forms_form_add', 'uri_title', 2147483647, 1, 10),
+('bx_developer_forms_form_add', 'params', 2147483647, 1, 11),
+('bx_developer_forms_form_add', 'deletable', 2147483647, 1, 12),
+('bx_developer_forms_form_add', 'override_class_name', 2147483647, 1, 13),
+('bx_developer_forms_form_add', 'override_class_file', 2147483647, 1, 14),
+('bx_developer_forms_form_add', 'controls', 2147483647, 1, 15),
+('bx_developer_forms_form_add', 'do_submit', 2147483647, 1, 16),
+('bx_developer_forms_form_add', 'cancel', 2147483647, 1, 17),
+('bx_developer_forms_form_edit', 'id', 2147483647, 1, 1),
+('bx_developer_forms_form_edit', 'object', 2147483647, 1, 2),
+('bx_developer_forms_form_edit', 'module', 2147483647, 1, 3),
+('bx_developer_forms_form_edit', 'title', 2147483647, 1, 4),
+('bx_developer_forms_form_edit', 'action', 2147483647, 1, 5),
+('bx_developer_forms_form_edit', 'form_attrs', 2147483647, 1, 6),
+('bx_developer_forms_form_edit', 'submit_name', 2147483647, 1, 7),
+('bx_developer_forms_form_edit', 'table', 2147483647, 1, 8),
+('bx_developer_forms_form_edit', 'key', 2147483647, 1, 9),
+('bx_developer_forms_form_edit', 'uri', 2147483647, 1, 10),
+('bx_developer_forms_form_edit', 'uri_title', 2147483647, 1, 11),
+('bx_developer_forms_form_edit', 'params', 2147483647, 1, 12),
+('bx_developer_forms_form_edit', 'deletable', 2147483647, 1, 13),
+('bx_developer_forms_form_edit', 'override_class_name', 2147483647, 1, 14),
+('bx_developer_forms_form_edit', 'override_class_file', 2147483647, 1, 15),
+('bx_developer_forms_form_edit', 'controls', 2147483647, 1, 16),
+('bx_developer_forms_form_edit', 'do_submit', 2147483647, 1, 17),
+('bx_developer_forms_form_edit', 'cancel', 2147483647, 1, 18);
+
+--
+-- Forms Builder -> Displays.
+--
+INSERT INTO `sys_objects_form` (`object`, `module`, `title`, `action`, `form_attrs`, `submit_name`, `table`, `key`, `uri`, `uri_title`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
+('bx_developer_forms_display', @sName, '_bx_dev_frm_txt_displays_diplay', '', '', 'do_submit', 'sys_form_displays', 'id', '', '', '', 0, 1, 'BxDevFormView', 'modules/boonex/developer/classes/BxDevFormView.php');
+
+INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
+('bx_developer_forms_display_add', @sName, 'bx_developer_forms_display', '_bx_dev_frm_txt_displays_display_add', 0),
+('bx_developer_forms_display_edit', @sName, 'bx_developer_forms_display', '_bx_dev_frm_txt_displays_display_edit', 0);
+
+INSERT INTO `sys_form_inputs` (`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES
+('bx_developer_forms_display', @sName, 'id', '0', '', 0, 'hidden', '_bx_dev_frm_txt_sys_displays_id', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
+('bx_developer_forms_display', @sName, 'display_name', '', '', 0, 'text', '_bx_dev_frm_txt_sys_displays_display_name', '_bx_dev_frm_txt_displays_display_name', '', 1, 0, 0, '', '', '', 'Length', 'a:2:{s:3:"min";i:6;s:3:"max";i:100;}', '_bx_dev_frm_err_displays_display_name', 'Xss', '', 0, 0),
+('bx_developer_forms_display', @sName, 'module', '', '', 0, 'select', '_bx_dev_frm_txt_sys_displays_module', '_bx_dev_frm_txt_displays_module', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_dev_frm_err_displays_module', 'Xss', '', 0, 0),
+('bx_developer_forms_display', @sName, 'object', '', '', 0, 'select', '_bx_dev_frm_txt_sys_displays_object', '_bx_dev_frm_txt_displays_object', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_dev_frm_err_displays_object', 'Xss', '', 0, 0),
+('bx_developer_forms_display', @sName, 'title', '', '', 0, 'text', '_bx_dev_frm_txt_sys_displays_title', '_bx_dev_frm_txt_displays_title', '', 1, 0, 0, '', '', '', 'Length', 'a:2:{s:3:"min";i:6;s:3:"max";i:100;}', '_bx_dev_frm_err_displays_title', 'Xss', '', 0, 0),
+('bx_developer_forms_display', @sName, 'view_mode', '1', '', 0, 'switcher', '_bx_dev_frm_txt_sys_displays_view_mode', '_bx_dev_frm_txt_displays_view_mode', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
+('bx_developer_forms_display', @sName, 'controls', '', 'do_submit,cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_developer_forms_display', @sName, 'do_submit', '_bx_dev_frm_btn_displays_add', '', 0, 'submit', '_bx_dev_frm_btn_sys_displays_add', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_developer_forms_display', @sName, 'cancel', '_bx_dev_frm_btn_displays_cancel', '', 0, 'button', '_bx_dev_frm_btn_sys_displays_cancel', '', '', 0, 0, 0, 'a:2:{s:7:"onclick";s:45:"$(''.bx-popup-applied:visible'').dolPopupHide()";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 0, 0);
+
+INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
+('bx_developer_forms_display_add', 'display_name', 2147483647, 1, 1),
+('bx_developer_forms_display_add', 'module', 2147483647, 1, 2),
+('bx_developer_forms_display_add', 'object', 2147483647, 1, 3),
+('bx_developer_forms_display_add', 'title', 2147483647, 1, 4),
+('bx_developer_forms_display_add', 'view_mode', 2147483647, 1, 5),
+('bx_developer_forms_display_add', 'controls', 2147483647, 1, 6),
+('bx_developer_forms_display_add', 'do_submit', 2147483647, 1, 7),
+('bx_developer_forms_display_add', 'cancel', 2147483647, 1, 8),
+('bx_developer_forms_display_edit', 'id', 2147483647, 1, 1),
+('bx_developer_forms_display_edit', 'display_name', 2147483647, 1, 1),
+('bx_developer_forms_display_edit', 'module', 2147483647, 1, 2),
+('bx_developer_forms_display_edit', 'object', 2147483647, 1, 3),
+('bx_developer_forms_display_edit', 'title', 2147483647, 1, 4),
+('bx_developer_forms_display_edit', 'view_mode', 2147483647, 1, 5),
+('bx_developer_forms_display_edit', 'controls', 2147483647, 1, 6),
+('bx_developer_forms_display_edit', 'do_submit', 2147483647, 1, 7),
+('bx_developer_forms_display_edit', 'cancel', 2147483647, 1, 8);
+
+--
+-- Forms Builder -> Pre Lists.
+--
+INSERT INTO `sys_objects_form` (`object`, `module`, `title`, `action`, `form_attrs`, `submit_name`, `table`, `key`, `uri`, `uri_title`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
+('bx_developer_forms_prelist', @sName, '_bx_dev_frm_txt_prelists_prelist', '', '', 'do_submit', 'sys_form_pre_lists', 'id', '', '', '', 0, 1, 'BxDevFormView', 'modules/boonex/developer/classes/BxDevFormView.php');
+
+INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
+('bx_developer_forms_prelist_add', @sName, 'bx_developer_forms_prelist', '_bx_dev_frm_txt_prelists_display_add', 0),
+('bx_developer_forms_prelist_edit', @sName, 'bx_developer_forms_prelist', '_bx_dev_frm_txt_prelists_display_edit', 0);
+
+INSERT INTO `sys_form_inputs` (`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES
+('bx_developer_forms_prelist', @sName, 'id', '0', '', 0, 'hidden', '_bx_dev_frm_txt_sys_prelists_id', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
+('bx_developer_forms_prelist', @sName, 'key', '', '', 0, 'text', '_bx_dev_frm_txt_sys_prelists_key', '_bx_dev_frm_txt_prelists_key', '', 1, 0, 0, '', '', '', 'Length', 'a:2:{s:3:"min";i:6;s:3:"max";i:100;}', '_bx_dev_frm_err_prelists_key', 'Xss', '', 0, 0),
+('bx_developer_forms_prelist', @sName, 'module', '', '', 0, 'select', '_bx_dev_frm_txt_sys_prelists_module', '_bx_dev_frm_txt_prelists_module', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_dev_frm_err_prelists_module', 'Xss', '', 0, 0),
+('bx_developer_forms_prelist', @sName, 'title', '', '', 0, 'text', '_bx_dev_frm_txt_sys_prelists_title', '_bx_dev_frm_txt_prelists_title', '', 1, 0, 0, '', '', '', 'Length', 'a:2:{s:3:"min";i:6;s:3:"max";i:100;}', '_bx_dev_frm_err_prelists_title', 'Xss', '', 0, 0),
+('bx_developer_forms_prelist', @sName, 'use_for_sets', '1', '', 1, 'switcher', '_bx_dev_frm_txt_sys_prelists_use_for_sets', '_bx_dev_frm_txt_prelists_use_for_sets', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
+('bx_developer_forms_prelist', @sName, 'controls', '', 'do_submit,cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_developer_forms_prelist', @sName, 'do_submit', '_bx_dev_frm_btn_prelists_add', '', 0, 'submit', '_bx_dev_frm_btn_sys_prelists_add', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_developer_forms_prelist', @sName, 'cancel', '_bx_dev_frm_btn_prelists_cancel', '', 0, 'button', '_bx_dev_frm_btn_sys_prelists_cancel', '', '', 0, 0, 0, 'a:2:{s:7:"onclick";s:45:"$(''.bx-popup-applied:visible'').dolPopupHide()";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 0, 0);
+
+INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
+('bx_developer_forms_prelist_add', 'key', 2147483647, 1, 1),
+('bx_developer_forms_prelist_add', 'module', 2147483647, 1, 2),
+('bx_developer_forms_prelist_add', 'title', 2147483647, 1, 3),
+('bx_developer_forms_prelist_add', 'use_for_sets', 2147483647, 1, 4),
+('bx_developer_forms_prelist_add', 'controls', 2147483647, 1, 5),
+('bx_developer_forms_prelist_add', 'do_submit', 2147483647, 1, 6),
+('bx_developer_forms_prelist_add', 'cancel', 2147483647, 1, 7),
+('bx_developer_forms_prelist_edit', 'id', 2147483647, 1, 1),
+('bx_developer_forms_prelist_edit', 'module', 2147483647, 1, 2),
+('bx_developer_forms_prelist_edit', 'title', 2147483647, 1, 3),
+('bx_developer_forms_prelist_edit', 'use_for_sets', 2147483647, 1, 4),
+('bx_developer_forms_prelist_edit', 'controls', 2147483647, 1, 5),
+('bx_developer_forms_prelist_edit', 'do_submit', 2147483647, 1, 6),
+('bx_developer_forms_prelist_edit', 'cancel', 2147483647, 1, 7);
+
+--
+-- Forms Builder -> Pre Values.
+--
+INSERT INTO `sys_objects_form` (`object`, `module`, `title`, `action`, `form_attrs`, `submit_name`, `table`, `key`, `uri`, `uri_title`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
+('bx_developer_forms_prevalue', @sName, '_bx_dev_frm_txt_prevalues_prevalue', '', '', 'do_submit', 'sys_form_pre_values', 'id', '', '', '', 0, 1, 'BxDevFormView', 'modules/boonex/developer/classes/BxDevFormView.php');
+
+INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
+('bx_developer_forms_prevalue_add', @sName, 'bx_developer_forms_prevalue', '_bx_dev_frm_txt_prevalues_display_add', 0),
+('bx_developer_forms_prevalue_edit', @sName, 'bx_developer_forms_prevalue', '_bx_dev_frm_txt_prevalues_display_edit', 0);
+
+INSERT INTO `sys_form_inputs` (`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES
+('bx_developer_forms_prevalue', @sName, 'id', '0', '', 0, 'hidden', '_bx_dev_frm_txt_sys_prevalues_id', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
+('bx_developer_forms_prevalue', @sName, 'Key', '', '', 0, 'select', '_bx_dev_frm_txt_sys_prevalues_key', '_bx_dev_frm_txt_prevalues_key', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_dev_frm_err_prevalues_key', 'Xss', '', 0, 0),
+('bx_developer_forms_prevalue', @sName, 'Value', '', '', 0, 'text', '_bx_dev_frm_txt_sys_prevalues_value', '_bx_dev_frm_txt_prevalues_value', '', 1, 0, 0, '', '', '', 'Length', 'a:2:{s:3:"min";i:1;s:3:"max";i:255;}', '_bx_dev_frm_err_prevalues_value', 'Xss', '', 0, 0),
+('bx_developer_forms_prevalue', @sName, 'LKey', '', '', 0, 'text', '_bx_dev_frm_txt_sys_prevalues_lkey', '_bx_dev_frm_txt_prevalues_lkey', '', 1, 0, 0, '', '', '', 'Length', 'a:2:{s:3:"min";i:1;s:3:"max";i:100;}', '_bx_dev_frm_err_prevalues_lkey', 'Xss', '', 0, 0),
+('bx_developer_forms_prevalue', @sName, 'LKey2', '', '', 0, 'text', '_bx_dev_frm_txt_sys_prevalues_lkey2', '_bx_dev_frm_txt_prevalues_lkey2', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_developer_forms_prevalue', @sName, 'controls', '', 'do_submit,cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_developer_forms_prevalue', @sName, 'do_submit', '_bx_dev_frm_btn_prevalues_add', '', 0, 'submit', '_bx_dev_frm_btn_sys_prevalues_add', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_developer_forms_prevalue', @sName, 'cancel', '_bx_dev_frm_btn_prevalues_cancel', '', 0, 'button', '_bx_dev_frm_btn_sys_prevalues_cancel', '', '', 0, 0, 0, 'a:2:{s:7:"onclick";s:45:"$(''.bx-popup-applied:visible'').dolPopupHide()";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 0, 0);
+
+INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
+('bx_developer_forms_prevalue_add', 'Key', 2147483647, 1, 1),
+('bx_developer_forms_prevalue_add', 'Value', 2147483647, 1, 2),
+('bx_developer_forms_prevalue_add', 'LKey', 2147483647, 1, 3),
+('bx_developer_forms_prevalue_add', 'LKey2', 2147483647, 1, 4),
+('bx_developer_forms_prevalue_add', 'controls', 2147483647, 1, 5),
+('bx_developer_forms_prevalue_add', 'do_submit', 2147483647, 1, 6),
+('bx_developer_forms_prevalue_add', 'cancel', 2147483647, 1, 7),
+('bx_developer_forms_prevalue_edit', 'id', 2147483647, 1, 1),
+('bx_developer_forms_prevalue_edit', 'Key', 2147483647, 1, 2),
+('bx_developer_forms_prevalue_edit', 'Value', 2147483647, 1, 3),
+('bx_developer_forms_prevalue_edit', 'LKey', 2147483647, 1, 4),
+('bx_developer_forms_prevalue_edit', 'LKey2', 2147483647, 1, 5),
+('bx_developer_forms_prevalue_edit', 'controls', 2147483647, 1, 6),
+('bx_developer_forms_prevalue_edit', 'do_submit', 2147483647, 1, 7),
+('bx_developer_forms_prevalue_edit', 'cancel', 2147483647, 1, 8);
+
+--
+-- Forms Builder -> Search Forms.
+--
+INSERT INTO `sys_objects_form` (`object`, `module`, `title`, `action`, `form_attrs`, `submit_name`, `table`, `key`, `uri`, `uri_title`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
+('bx_developer_forms_search_form', @sName, '_bx_dev_frm_txt_search_forms', '', '', 'do_submit', 'sys_objects_search_extended', 'id', '', '', '', 0, 1, 'BxDevFormView', 'modules/boonex/developer/classes/BxDevFormView.php');
+
+INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
+('bx_developer_forms_search_form_add', @sName, 'bx_developer_forms_search_form', '_bx_dev_frm_txt_search_forms_display_add', 0),
+('bx_developer_forms_search_form_edit', @sName, 'bx_developer_forms_search_form', '_bx_dev_frm_txt_search_forms_display_edit', 0);
+
+INSERT INTO `sys_form_inputs` (`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES
+('bx_developer_forms_search_form', @sName, 'id', '0', '', 0, 'hidden', '_bx_dev_frm_txt_sys_search_forms_id', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
+('bx_developer_forms_search_form', @sName, 'object', '', '', 0, 'text', '_bx_dev_frm_txt_sys_search_forms_object', '_bx_dev_frm_txt_search_forms_object', '', 1, 0, 0, '', '', '', 'Length', 'a:2:{s:3:"min";i:6;s:3:"max";i:100;}', '_bx_dev_frm_err_forms_object', 'Xss', '', 0, 0),
+('bx_developer_forms_search_form', @sName, 'object_content_info', '', '', 0, 'select', '_bx_dev_frm_txt_sys_search_forms_object_content_info', '_bx_dev_frm_txt_search_forms_object_content_info', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_dev_frm_err_forms_object_content_info', 'Xss', '', 0, 0),
+('bx_developer_forms_search_form', @sName, 'module', '', '', 0, 'select', '_bx_dev_frm_txt_sys_search_forms_module', '_bx_dev_frm_txt_search_forms_module', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_dev_frm_err_forms_module', 'Xss', '', 0, 0),
+('bx_developer_forms_search_form', @sName, 'title', '', '', 0, 'text', '_bx_dev_frm_txt_sys_search_forms_title', '_bx_dev_frm_txt_search_forms_title', '', 1, 0, 0, '', '', '', 'Length', 'a:2:{s:3:"min";i:6;s:3:"max";i:100;}', '_bx_dev_frm_err_forms_title', 'Xss', '', 0, 0),
+('bx_developer_forms_search_form', @sName, 'class_name', '', '', 0, 'text', '_bx_dev_frm_txt_sys_search_forms_class_name', '_bx_dev_frm_txt_search_forms_class_name', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_developer_forms_search_form', @sName, 'class_file', '', '', 0, 'text', '_bx_dev_frm_txt_sys_search_forms_class_file', '_bx_dev_frm_txt_search_forms_class_file', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_developer_forms_search_form', @sName, 'controls', '', 'do_submit,cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_developer_forms_search_form', @sName, 'do_submit', '_bx_dev_frm_btn_search_forms_add', '', 0, 'submit', '_bx_dev_frm_btn_sys_search_forms_add', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_developer_forms_search_form', @sName, 'cancel', '_bx_dev_frm_btn_search_forms_cancel', '', 0, 'button', '_bx_dev_frm_btn_sys_search_forms_cancel', '', '', 0, 0, 0, 'a:2:{s:7:"onclick";s:45:"$(''.bx-popup-applied:visible'').dolPopupHide()";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 0, 0);
+
+INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
+('bx_developer_forms_search_form_add', 'object', 2147483647, 1, 1),
+('bx_developer_forms_search_form_add', 'object_content_info', 2147483647, 1, 2),
+('bx_developer_forms_search_form_add', 'module', 2147483647, 1, 3),
+('bx_developer_forms_search_form_add', 'title', 2147483647, 1, 4),
+('bx_developer_forms_search_form_add', 'class_name', 2147483647, 1, 5),
+('bx_developer_forms_search_form_add', 'class_file', 2147483647, 1, 6),
+('bx_developer_forms_search_form_add', 'controls', 2147483647, 1, 7),
+('bx_developer_forms_search_form_add', 'do_submit', 2147483647, 1, 8),
+('bx_developer_forms_search_form_add', 'cancel', 2147483647, 1, 9),
+
+('bx_developer_forms_search_form_edit', 'id', 2147483647, 1, 1),
+('bx_developer_forms_search_form_edit', 'object', 2147483647, 1, 2),
+('bx_developer_forms_search_form_edit', 'object_content_info', 2147483647, 1, 3),
+('bx_developer_forms_search_form_edit', 'module', 2147483647, 1, 4),
+('bx_developer_forms_search_form_edit', 'title', 2147483647, 1, 5),
+('bx_developer_forms_search_form_edit', 'class_name', 2147483647, 1, 6),
+('bx_developer_forms_search_form_edit', 'class_file', 2147483647, 1, 7),
+('bx_developer_forms_search_form_edit', 'controls', 2147483647, 1, 8),
+('bx_developer_forms_search_form_edit', 'do_submit', 2147483647, 1, 9),
+('bx_developer_forms_search_form_edit', 'cancel', 2147483647, 1, 10);
+
+--
+-- Forms Builder -> Search Fields.
+--
+INSERT INTO `sys_objects_form` (`object`, `module`, `title`, `action`, `form_attrs`, `submit_name`, `table`, `key`, `uri`, `uri_title`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
+('bx_developer_forms_search_fields', @sName, '_bx_dev_frm_txt_search_fields_form', '', '', 'do_submit', 'sys_search_extended_fields', 'id', '', '', '', 0, 1, 'BxDevFormView', 'modules/boonex/developer/classes/BxDevFormView.php');
+
+INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
+('bx_developer_forms_search_fields_edit', @sName, 'bx_developer_forms_search_fields', '_bx_dev_frm_txt_search_fields_display_edit', 0);
+
+INSERT INTO `sys_form_inputs` (`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES
+('bx_developer_forms_search_fields', @sName, 'id', '0', '', 0, 'hidden', '_bx_dev_frm_txt_sys_search_fields_id', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
+('bx_developer_forms_search_fields', @sName, 'object', '', '', 0, 'select', '_bx_dev_frm_txt_sys_search_fields_object', '_bx_dev_frm_txt_search_fields_object', '', 1, 0, 0, '', '', '', 'Length', 'a:2:{s:3:"min";i:6;s:3:"max";i:100;}', '_bx_dev_frm_err_forms_object', 'Xss', '', 0, 0),
+('bx_developer_forms_search_fields', @sName, 'name', '', '', 0, 'text', '_bx_dev_frm_txt_sys_search_fields_name', '_bx_dev_frm_txt_search_fields_name', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_dev_frm_err_search_fields_name', 'Xss', '', 0, 0),
+('bx_developer_forms_search_fields', @sName, 'type', '', '', 0, 'select', '_bx_dev_frm_txt_sys_search_fields_type', '_bx_dev_frm_txt_search_fields_type', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_dev_frm_err_search_fields_type', 'Xss', '', 0, 0),
+('bx_developer_forms_search_fields', @sName, 'caption', '', '', 0, 'text', '_bx_dev_frm_txt_sys_search_fields_caption', '_bx_dev_frm_txt_search_fields_caption', '', 1, 0, 0, '', '', '', 'Length', 'a:2:{s:3:"min";i:6;s:3:"max";i:100;}', '_bx_dev_frm_err_search_fields_caption', 'Xss', '', 0, 0),
+('bx_developer_forms_search_fields', @sName, 'values', '', '', 0, 'text', '_bx_dev_frm_txt_sys_search_fields_values', '_bx_dev_frm_txt_search_fields_values', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_developer_forms_search_fields', @sName, 'search_type', '', '', 0, 'select', '_bx_dev_frm_txt_sys_search_fields_search_type', '_bx_dev_frm_txt_search_fields_search_type', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_dev_frm_err_search_fields_search_type', 'Xss', '', 0, 0),
+('bx_developer_forms_search_fields', @sName, 'search_value', '', '', 0, 'text', '_bx_dev_frm_txt_sys_search_fields_search_value', '_bx_dev_frm_txt_search_fields_search_value', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_developer_forms_search_fields', @sName, 'search_operator', '', '', 0, 'select', '_bx_dev_frm_txt_sys_search_fields_search_operator', '_bx_dev_frm_txt_search_fields_search_operator', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_dev_frm_err_search_fields_search_operator', 'Xss', '', 0, 0),
+('bx_developer_forms_search_fields', @sName, 'controls', '', 'do_submit,cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_developer_forms_search_fields', @sName, 'do_submit', '_bx_dev_frm_btn_search_fields_save', '', 0, 'submit', '_bx_dev_frm_btn_sys_search_fields_save', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_developer_forms_search_fields', @sName, 'cancel', '_bx_dev_frm_btn_search_fields_cancel', '', 0, 'button', '_bx_dev_frm_btn_sys_search_fields_cancel', '', '', 0, 0, 0, 'a:2:{s:7:"onclick";s:45:"$(''.bx-popup-applied:visible'').dolPopupHide()";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 0, 0);
+
+INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
+('bx_developer_forms_search_fields_edit', 'id', 2147483647, 1, 1),
+('bx_developer_forms_search_fields_edit', 'object', 2147483647, 1, 2),
+('bx_developer_forms_search_fields_edit', 'name', 2147483647, 1, 3),
+('bx_developer_forms_search_fields_edit', 'type', 2147483647, 1, 4),
+('bx_developer_forms_search_fields_edit', 'caption', 2147483647, 1, 5),
+('bx_developer_forms_search_fields_edit', 'values', 2147483647, 1, 6),
+('bx_developer_forms_search_fields_edit', 'search_type', 2147483647, 1, 7),
+('bx_developer_forms_search_fields_edit', 'search_value', 2147483647, 1, 8),
+('bx_developer_forms_search_fields_edit', 'search_operator', 2147483647, 1, 9),
+('bx_developer_forms_search_fields_edit', 'controls', 2147483647, 1, 10),
+('bx_developer_forms_search_fields_edit', 'do_submit', 2147483647, 1, 11),
+('bx_developer_forms_search_fields_edit', 'cancel', 2147483647, 1, 12);
+
+--
+-- Navigation Builder -> Grid descriptors
+--
+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_developer_nav_menus', 'Sql', 'SELECT `tm`.*, `tms`.`title` AS `set_title`, `tmt`.`title` AS `template_title` FROM `sys_objects_menu` AS `tm` LEFT JOIN `sys_menu_sets` AS `tms` ON `tm`.`set_name`=`tms`.`set_name` LEFT JOIN `sys_menu_templates` AS `tmt` ON `tm`.`template_id`=`tmt`.`id` WHERE 1 ', 'sys_objects_menu', 'id', '', 'active', '', 100, NULL, 'start', '', '', 'tm`.`title,tms`.`title,tmt`.`title', 'auto', '', '', 2147483647, 'BxDevNavigationMenus', 'modules/boonex/developer/classes/BxDevNavigationMenus.php'),
+('bx_developer_nav_sets', 'Sql', 'SELECT * FROM `sys_menu_sets` WHERE 1 ', 'sys_menu_sets', 'set_name', '', '', '', 100, NULL, 'start', '', '', 'title', 'auto', '', '', 2147483647, 'BxDevNavigationSets', 'modules/boonex/developer/classes/BxDevNavigationSets.php'),
+('bx_developer_nav_items', 'Sql', 'SELECT * FROM `sys_menu_items` WHERE 1 ', 'sys_menu_items', 'id', 'order', 'active', '', 100, NULL, 'start_it', '', 'link', 'title_system', 'like', '', '', 2147483647, 'BxDevNavigationItems', 'modules/boonex/developer/classes/BxDevNavigationItems.php');
+
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('bx_developer_nav_menus', 'switcher', '', '10%', 0, '', '', 1),
+('bx_developer_nav_menus', 'title', '_bx_dev_nav_txt_menus_gl_title', '17%', 0, '15', '', 2),
+('bx_developer_nav_menus', 'set_title', '_bx_dev_nav_txt_menus_gl_set_title', '17%', 1, '15', '', 3),
+('bx_developer_nav_menus', 'items', '_bx_dev_nav_txt_menus_gl_items', '10%', 0, '8', '', 4),
+('bx_developer_nav_menus', 'template_title', '_bx_dev_nav_txt_menus_gl_template_title', '17%', 1, '15', '', 5),
+('bx_developer_nav_menus', 'module', '_bx_dev_nav_txt_menus_gl_module', '12%', 0, '10', '', 6),
+('bx_developer_nav_menus', 'actions', '', '17%', 0, '', '', 7),
+('bx_developer_nav_sets', 'title', '_bx_dev_nav_txt_sets_gl_title', '50%', 1, '48', '', 1),
+('bx_developer_nav_sets', 'module', '_bx_dev_nav_txt_sets_gl_module', '15%', 0, '13', '', 2),
+('bx_developer_nav_sets', 'items', '_bx_dev_nav_txt_sets_gl_items', '15%', 0, '13', '', 3),
+('bx_developer_nav_sets', 'actions', '', '20%', 0, '', '', 4),
+('bx_developer_nav_items', 'order', '', '1%', 0, '', '', 1),
+('bx_developer_nav_items', 'switcher', '', '9%', 0, '', '', 2),
+('bx_developer_nav_items', 'icon', '_bx_dev_nav_txt_items_gl_icon', '5%', 0, '', '', 3),
+('bx_developer_nav_items', 'title_system', '_bx_dev_nav_txt_items_gl_title_system', '23%', 1, '23', '', 4),
+('bx_developer_nav_items', 'link', '_bx_dev_nav_txt_items_gl_link', '23%', 0, '23', '', 5),
+('bx_developer_nav_items', 'module', '_bx_dev_nav_txt_items_gl_module', '12%', 0, '12', '', 6),
+('bx_developer_nav_items', 'visible_for_levels', '_bx_dev_nav_txt_items_gl_visible', '10%', 0, '10', '', 7),
+('bx_developer_nav_items', 'actions', '', '17%', 0, '', '', 8);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `confirm`, `order`) VALUES
+('bx_developer_nav_menus', 'independent', 'add', '_bx_dev_nav_btn_menus_gl_create', '', 0, 1),
+('bx_developer_nav_menus', 'single', 'export', '', 'download', 0, 1),
+('bx_developer_nav_menus', 'single', 'edit', '', 'pencil', 0, 2),
+('bx_developer_nav_menus', 'single', 'delete', '', 'remove', 1, 3),
+('bx_developer_nav_sets', 'independent', 'add', '_bx_dev_nav_btn_sets_gl_create', '', 0, 1),
+('bx_developer_nav_sets', 'single', 'edit', '', 'pencil', 0, 1),
+('bx_developer_nav_sets', 'single', 'delete', '', 'remove', 1, 2),
+('bx_developer_nav_items', 'independent', 'import', '_bx_dev_nav_btn_items_gl_import', '', 0, 1),
+('bx_developer_nav_items', 'independent', 'add', '_bx_dev_nav_btn_items_gl_create', '', 0, 2),
+('bx_developer_nav_items', 'single', 'edit', '', 'pencil', 0, 1),
+('bx_developer_nav_items', 'single', 'delete', '', 'remove', 1, 2),
+('bx_developer_nav_items', 'single', 'show_to', '_bx_dev_nav_btn_items_gl_visible', '', 0, 3);
+
+--
+-- Navigation Builder -> Menus.
+--
+INSERT INTO `sys_objects_form` (`object`, `module`, `title`, `action`, `form_attrs`, `submit_name`, `table`, `key`, `uri`, `uri_title`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
+('bx_developer_nav_menu', @sName, '_bx_dev_nav_txt_menus_menu', '', '', 'do_submit', 'sys_objects_menu', 'id', '', '', '', 0, 1, 'BxDevFormView', 'modules/boonex/developer/classes/BxDevFormView.php');
+
+INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
+('bx_developer_nav_menu_add', @sName, 'bx_developer_nav_menu', '_bx_dev_nav_txt_menus_display_add', 0),
+('bx_developer_nav_menu_edit', @sName, 'bx_developer_nav_menu', '_bx_dev_nav_txt_menus_display_edit', 0);
+
+INSERT INTO `sys_form_inputs` (`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES
+('bx_developer_nav_menu', @sName, 'id', '0', '', 0, 'hidden', '_bx_dev_nav_txt_sys_menus_id', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
+('bx_developer_nav_menu', @sName, 'object', '', '', 0, 'text', '_bx_dev_nav_txt_sys_menus_object', '_bx_dev_nav_txt_menus_object', '', 1, 0, 0, '', '', '', 'Length', 'a:2:{s:3:"min";i:6;s:3:"max";i:100;}', '_bx_dev_nav_err_menus_object', 'Xss', '', 0, 0),
+('bx_developer_nav_menu', @sName, 'module', '', '', 0, 'select', '_bx_dev_nav_txt_sys_menus_module', '_bx_dev_nav_txt_menus_module', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_dev_nav_err_menus_module', 'Xss', '', 0, 0),
+('bx_developer_nav_menu', @sName, 'title', '', '', 0, 'text', '_bx_dev_nav_txt_sys_menus_title', '_bx_dev_nav_txt_menus_title', '', 1, 0, 0, '', '', '', 'Length', 'a:2:{s:3:"min";i:6;s:3:"max";i:100;}', '_bx_dev_nav_err_menus_title', 'Xss', '', 0, 0),
+('bx_developer_nav_menu', @sName, 'set_name', '', '', 0, 'select', '_bx_dev_nav_txt_sys_menus_set_name', '_bx_dev_nav_txt_menus_set_name', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_dev_nav_err_menus_set_name', 'Xss', '', 0, 0),
+('bx_developer_nav_menu', @sName, 'template_id', '', '', 0, 'select', '_bx_dev_nav_txt_sys_menus_template_id', '_bx_dev_nav_txt_menus_template_id', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_dev_nav_err_menus_template_id', 'Int', '', 0, 0),
+('bx_developer_nav_menu', @sName, 'deletable', '1', '', 0, 'switcher', '_bx_dev_nav_txt_sys_menus_deletable', '_bx_dev_nav_txt_menus_deletable', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
+('bx_developer_nav_menu', @sName, 'override_class_name', '', '', 0, 'text', '_bx_dev_nav_txt_sys_menus_override_class_name', '_bx_dev_nav_txt_menus_override_class_name', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_developer_nav_menu', @sName, 'override_class_file', '', '', 0, 'text', '_bx_dev_nav_txt_sys_menus_override_class_file', '_bx_dev_nav_txt_menus_override_class_file', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_developer_nav_menu', @sName, 'controls', '', 'do_submit,cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_developer_nav_menu', @sName, 'do_submit', '_bx_dev_nav_btn_menus_add', '', 0, 'submit', '_bx_dev_nav_btn_sys_menus_add', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_developer_nav_menu', @sName, 'cancel', '_bx_dev_nav_btn_menus_cancel', '', 0, 'button', '_bx_dev_nav_btn_sys_menus_cancel', '', '', 0, 0, 0, 'a:2:{s:7:"onclick";s:45:"$(''.bx-popup-applied:visible'').dolPopupHide()";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 0, 0);
+
+INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
+('bx_developer_nav_menu_add', 'object', 2147483647, 1, 1),
+('bx_developer_nav_menu_add', 'module', 2147483647, 1, 2),
+('bx_developer_nav_menu_add', 'title', 2147483647, 1, 3),
+('bx_developer_nav_menu_add', 'set_name', 2147483647, 1, 4),
+('bx_developer_nav_menu_add', 'template_id', 2147483647, 1, 5),
+('bx_developer_nav_menu_add', 'deletable', 2147483647, 1, 6),
+('bx_developer_nav_menu_add', 'override_class_name', 2147483647, 1, 7),
+('bx_developer_nav_menu_add', 'override_class_file', 2147483647, 1, 8),
+('bx_developer_nav_menu_add', 'controls', 2147483647, 1, 9),
+('bx_developer_nav_menu_add', 'do_submit', 2147483647, 1, 10),
+('bx_developer_nav_menu_add', 'cancel', 2147483647, 1, 11),
+('bx_developer_nav_menu_edit', 'id', 2147483647, 1, 1),
+('bx_developer_nav_menu_edit', 'object', 2147483647, 1, 2),
+('bx_developer_nav_menu_edit', 'module', 2147483647, 1, 3),
+('bx_developer_nav_menu_edit', 'title', 2147483647, 1, 4),
+('bx_developer_nav_menu_edit', 'set_name', 2147483647, 1, 5),
+('bx_developer_nav_menu_edit', 'template_id', 2147483647, 1, 6),
+('bx_developer_nav_menu_edit', 'deletable', 2147483647, 1, 7),
+('bx_developer_nav_menu_edit', 'override_class_name', 2147483647, 1, 8),
+('bx_developer_nav_menu_edit', 'override_class_file', 2147483647, 1, 9),
+('bx_developer_nav_menu_edit', 'controls', 2147483647, 1, 10),
+('bx_developer_nav_menu_edit', 'do_submit', 2147483647, 1, 11),
+('bx_developer_nav_menu_edit', 'cancel', 2147483647, 1, 12);
+
+--
+-- Navigation Builder -> Sets.
+--
+INSERT INTO `sys_objects_form` (`object`, `module`, `title`, `action`, `form_attrs`, `submit_name`, `table`, `key`, `uri`, `uri_title`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
+('bx_developer_nav_set', @sName, '_bx_dev_nav_txt_sets_set', '', '', 'do_submit', 'sys_menu_sets', 'set_name', '', '', '', 0, 1, 'BxDevFormView', 'modules/boonex/developer/classes/BxDevFormView.php');
+
+INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
+('bx_developer_nav_set_add', @sName, 'bx_developer_nav_set', '_bx_dev_nav_txt_sets_display_add', 0),
+('bx_developer_nav_set_edit', @sName, 'bx_developer_nav_set', '_bx_dev_nav_txt_sets_display_edit', 0);
+
+INSERT INTO `sys_form_inputs` (`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES
+('bx_developer_nav_set', @sName, 'module', '', '', 0, 'select', '_bx_dev_nav_txt_sys_sets_module', '_bx_dev_nav_txt_sets_module', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_dev_nav_err_sets_module', 'Xss', '', 0, 0),
+('bx_developer_nav_set', @sName, 'set_name', '', '', 0, 'text', '_bx_dev_nav_txt_sys_sets_set_name', '_bx_dev_nav_txt_sets_set_name', '', 1, 0, 0, '', '', '', 'Length', 'a:2:{s:3:"min";i:6;s:3:"max";i:100;}', '_bx_dev_nav_err_sets_set_name', 'Xss', '', 0, 0),
+('bx_developer_nav_set', @sName, 'title', '', '', 0, 'text', '_bx_dev_nav_txt_sys_sets_title', '_bx_dev_nav_txt_sets_title', '', 1, 0, 0, '', '', '', 'Length', 'a:2:{s:3:"min";i:6;s:3:"max";i:100;}', '_bx_dev_nav_err_sets_title', 'Xss', '', 0, 0),
+('bx_developer_nav_set', @sName, 'deletable', '1', '', 0, 'switcher', '_bx_dev_nav_txt_sys_sets_deletable', '_bx_dev_nav_txt_sets_deletable', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
+('bx_developer_nav_set', @sName, 'controls', '', 'do_submit,cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_developer_nav_set', @sName, 'do_submit', '_bx_dev_nav_btn_sets_add', '', 0, 'submit', '_bx_dev_nav_btn_sys_sets_add', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_developer_nav_set', @sName, 'cancel', '_bx_dev_nav_btn_sets_cancel', '', 0, 'button', '_bx_dev_nav_btn_sys_sets_cancel', '', '', 0, 0, 0, 'a:2:{s:7:"onclick";s:45:"$(''.bx-popup-applied:visible'').dolPopupHide()";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 0, 0);
+
+INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
+('bx_developer_nav_set_add', 'module', 2147483647, 1, 1),
+('bx_developer_nav_set_add', 'set_name', 2147483647, 1, 2),
+('bx_developer_nav_set_add', 'title', 2147483647, 1, 3),
+('bx_developer_nav_set_add', 'deletable', 2147483647, 1, 4),
+('bx_developer_nav_set_add', 'controls', 2147483647, 1, 5),
+('bx_developer_nav_set_add', 'do_submit', 2147483647, 1, 6),
+('bx_developer_nav_set_add', 'cancel', 2147483647, 1, 7),
+('bx_developer_nav_set_edit', 'module', 2147483647, 1, 1),
+('bx_developer_nav_set_edit', 'set_name', 2147483647, 0, 2),
+('bx_developer_nav_set_edit', 'title', 2147483647, 1, 3),
+('bx_developer_nav_set_edit', 'deletable', 2147483647, 1, 4),
+('bx_developer_nav_set_edit', 'controls', 2147483647, 1, 5),
+('bx_developer_nav_set_edit', 'do_submit', 2147483647, 1, 6),
+('bx_developer_nav_set_edit', 'cancel', 2147483647, 1, 7);
+
+--
+-- Navigation Builder -> Items.
+--
+INSERT INTO `sys_objects_form` (`object`, `module`, `title`, `action`, `form_attrs`, `submit_name`, `table`, `key`, `uri`, `uri_title`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
+('bx_developer_nav_item', @sName, '_bx_dev_nav_txt_items_item', '', '', 'do_submit', 'sys_menu_items', 'id', '', '', '', 0, 1, 'BxDevFormView', 'modules/boonex/developer/classes/BxDevFormView.php');
+
+INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
+('bx_developer_nav_item_add', @sName, 'bx_developer_nav_item', '_bx_dev_nav_txt_items_display_add', 0),
+('bx_developer_nav_item_edit', @sName, 'bx_developer_nav_item', '_bx_dev_nav_txt_items_display_edit', 0);
+
+INSERT INTO `sys_form_inputs` (`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES
+('bx_developer_nav_item', @sName, 'id', '0', '', 0, 'hidden', '_bx_dev_nav_txt_sys_items_id', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
+('bx_developer_nav_item', @sName, 'module', '', '', 0, 'select', '_bx_dev_nav_txt_sys_items_module', '_bx_dev_nav_txt_items_module', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_dev_nav_err_items_module', 'Xss', '', 0, 0),
+('bx_developer_nav_item', @sName, 'set_name', '', '', 0, 'text', '_bx_dev_nav_txt_sys_items_set_name', '_bx_dev_nav_txt_items_set_name', '', 0, 0, 0, 'a:1:{s:8:"readonly";s:8:"readonly";}', '', '', 'Avail', '', '_bx_dev_nav_err_items_set_name', 'Xss', '', 0, 0),
+('bx_developer_nav_item', @sName, 'name', '', '', 0, 'text', '_bx_dev_nav_txt_sys_items_name', '_bx_dev_nav_txt_items_name', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_dev_nav_err_items_name', 'Xss', '', 0, 0),
+('bx_developer_nav_item', @sName, 'title_system', '', '', 0, 'text', '_bx_dev_nav_txt_sys_items_title_system', '_bx_dev_nav_txt_items_title_system', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_dev_nav_err_items_title_system', 'Xss', '', 0, 0),
+('bx_developer_nav_item', @sName, 'title', '', '', 0, 'text', '_bx_dev_nav_txt_sys_items_title', '_bx_dev_nav_txt_items_title', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_developer_nav_item', @sName, 'link', '', '', 0, 'text', '_bx_dev_nav_txt_sys_items_link', '_bx_dev_nav_txt_items_link', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_developer_nav_item', @sName, 'onclick', '', '', 0, 'text', '_bx_dev_nav_txt_sys_items_onclick', '_bx_dev_nav_txt_items_onclick', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_developer_nav_item', @sName, 'target', '', '', 0, 'text', '_bx_dev_nav_txt_sys_items_target', '_bx_dev_nav_txt_items_target', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_developer_nav_item', @sName, 'icon', '', '', 0, 'text', '_bx_dev_nav_txt_sys_items_icon', '_bx_dev_nav_txt_items_icon', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_developer_nav_item', @sName, 'submenu_object', '', '', 0, 'text', '_bx_dev_nav_txt_sys_items_submenu_object', '_bx_dev_nav_txt_items_submenu_object', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_developer_nav_item', @sName, 'copyable', '1', '', 0, 'switcher', '_bx_dev_nav_txt_sys_items_copyable', '_bx_dev_nav_txt_items_copyable', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
+('bx_developer_nav_item', @sName, 'controls', '', 'do_submit,cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_developer_nav_item', @sName, 'do_submit', '_bx_dev_nav_btn_items_add', '', 0, 'submit', '_bx_dev_nav_btn_sys_items_add', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_developer_nav_item', @sName, 'cancel', '_bx_dev_nav_btn_items_cancel', '', 0, 'button', '_bx_dev_nav_btn_sys_items_cancel', '', '', 0, 0, 0, 'a:2:{s:7:"onclick";s:45:"$(''.bx-popup-applied:visible'').dolPopupHide()";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 0, 0);
+
+INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
+('bx_developer_nav_item_add', 'module', 2147483647, 1, 1),
+('bx_developer_nav_item_add', 'set_name', 2147483647, 1, 2),
+('bx_developer_nav_item_add', 'name', 2147483647, 1, 3),
+('bx_developer_nav_item_add', 'title_system', 2147483647, 1, 4),
+('bx_developer_nav_item_add', 'title', 2147483647, 1, 5),
+('bx_developer_nav_item_add', 'link', 2147483647, 1, 6),
+('bx_developer_nav_item_add', 'onclick', 2147483647, 1, 7),
+('bx_developer_nav_item_add', 'target', 2147483647, 1, 8),
+('bx_developer_nav_item_add', 'icon', 2147483647, 1, 9),
+('bx_developer_nav_item_add', 'submenu_object', 2147483647, 1, 10),
+('bx_developer_nav_item_add', 'copyable', 2147483647, 1, 11),
+('bx_developer_nav_item_add', 'controls', 2147483647, 1, 12),
+('bx_developer_nav_item_add', 'do_submit', 2147483647, 1, 13),
+('bx_developer_nav_item_add', 'cancel', 2147483647, 1, 14),
+('bx_developer_nav_item_edit', 'id', 2147483647, 1, 1),
+('bx_developer_nav_item_edit', 'module', 2147483647, 1, 2),
+('bx_developer_nav_item_edit', 'set_name', 2147483647, 1, 3),
+('bx_developer_nav_item_edit', 'name', 2147483647, 1, 4),
+('bx_developer_nav_item_edit', 'title_system', 2147483647, 1, 5),
+('bx_developer_nav_item_edit', 'title', 2147483647, 1, 6),
+('bx_developer_nav_item_edit', 'link', 2147483647, 1, 7),
+('bx_developer_nav_item_edit', 'onclick', 2147483647, 1, 8),
+('bx_developer_nav_item_edit', 'target', 2147483647, 1, 9),
+('bx_developer_nav_item_edit', 'icon', 2147483647, 1, 10),
+('bx_developer_nav_item_edit', 'submenu_object', 2147483647, 1, 11),
+('bx_developer_nav_item_edit', 'copyable', 2147483647, 1, 12),
+('bx_developer_nav_item_edit', 'controls', 2147483647, 1, 13),
+('bx_developer_nav_item_edit', 'do_submit', 2147483647, 1, 14),
+('bx_developer_nav_item_edit', 'cancel', 2147483647, 1, 15);
+
+--
+-- Page Builder -> Page.
+--
+INSERT INTO `sys_objects_form` (`object`, `module`, `title`, `action`, `form_attrs`, `submit_name`, `table`, `key`, `uri`, `uri_title`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
+('bx_developer_bp_page', @sName, '_bx_dev_bp_txt_page_form', '', '', 'do_submit', 'sys_objects_page', 'id', '', '', '', 0, 1, 'BxDevFormView', 'modules/boonex/developer/classes/BxDevFormView.php');
+
+INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
+('bx_developer_bp_page_add', @sName, 'bx_developer_bp_page', '_bx_dev_bp_txt_page_display_add', 0);
+
+INSERT INTO `sys_form_inputs` (`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES
+('bx_developer_bp_page', @sName, 'object', '', '', 0, 'text', '_bx_dev_bp_txt_sys_page_object', '_bx_dev_bp_txt_page_object', '', 1, 0, 0, '', '', '', 'Length', 'a:2:{s:3:"min";i:6;s:3:"max";i:100;}', '_bx_dev_bp_err_page_object', 'Xss', '', 0, 0),
+('bx_developer_bp_page', @sName, 'module', '', '', 0, 'select', '_bx_dev_bp_txt_sys_page_module', '_bx_dev_bp_txt_page_module', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_dev_bp_err_page_module', 'Xss', '', 0, 0),
+('bx_developer_bp_page', @sName, 'title_system', '', '', 0, 'text', '_bx_dev_bp_txt_sys_page_title_system', '_bx_dev_bp_txt_page_title_system', '', 1, 0, 0, '', '', '', 'Length', 'a:2:{s:3:"min";i:6;s:3:"max";i:100;}', '_bx_dev_bp_err_page_title_system', 'Xss', '', 0, 0),
+('bx_developer_bp_page', @sName, 'title', '', '', 0, 'text', '_bx_dev_bp_txt_sys_page_title', '_bx_dev_bp_txt_page_title', '', 1, 0, 0, '', '', '', 'Length', 'a:2:{s:3:"min";i:6;s:3:"max";i:100;}', '_bx_dev_bp_err_page_title', 'Xss', '', 0, 0),
+('bx_developer_bp_page', @sName, 'uri', '', '', 0, 'text', '_bx_dev_bp_txt_sys_page_uri', '_bx_dev_bp_txt_page_uri', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_developer_bp_page', @sName, 'url', '', '', 0, 'text', '_bx_dev_bp_txt_sys_page_url', '_bx_dev_bp_txt_page_url', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_developer_bp_page', @sName, 'layout_id', '', '', 0, 'select', '_bx_dev_bp_txt_sys_page_layout_id', '_bx_dev_bp_txt_page_layout_id', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_dev_bp_err_page_layout_id', 'Int', '', 0, 0),
+('bx_developer_bp_page', @sName, 'deletable', '1', '', 0, 'switcher', '_bx_dev_bp_txt_sys_page_deletable', '_bx_dev_bp_txt_page_deletable', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
+('bx_developer_bp_page', @sName, 'override_class_name', '', '', 0, 'text', '_bx_dev_bp_txt_sys_page_override_class_name', '_bx_dev_bp_txt_page_override_class_name', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_developer_bp_page', @sName, 'override_class_file', '', '', 0, 'text', '_bx_dev_bp_txt_sys_page_override_class_file', '_bx_dev_bp_txt_page_override_class_file', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_developer_bp_page', @sName, 'controls', '', 'do_submit,cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_developer_bp_page', @sName, 'do_submit', '_bx_dev_bp_btn_page_add', '', 0, 'submit', '_bx_dev_bp_btn_sys_page_add', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_developer_bp_page', @sName, 'cancel', '_bx_dev_bp_btn_page_cancel', '', 0, 'button', '_bx_dev_bp_btn_sys_page_cancel', '', '', 0, 0, 0, 'a:2:{s:7:"onclick";s:45:"$(''.bx-popup-applied:visible'').dolPopupHide()";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 0, 0);
+
+INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
+('bx_developer_bp_page_add', 'object', 2147483647, 1, 1),
+('bx_developer_bp_page_add', 'module', 2147483647, 1, 2),
+('bx_developer_bp_page_add', 'title_system', 2147483647, 1, 3),
+('bx_developer_bp_page_add', 'title', 2147483647, 1, 4),
+('bx_developer_bp_page_add', 'uri', 2147483647, 1, 5),
+('bx_developer_bp_page_add', 'url', 2147483647, 1, 6),
+('bx_developer_bp_page_add', 'layout_id', 2147483647, 1, 7),
+('bx_developer_bp_page_add', 'deletable', 2147483647, 1, 8),
+('bx_developer_bp_page_add', 'override_class_name', 2147483647, 1, 9),
+('bx_developer_bp_page_add', 'override_class_file', 2147483647, 1, 10),
+('bx_developer_bp_page_add', 'controls', 2147483647, 1, 11),
+('bx_developer_bp_page_add', 'do_submit', 2147483647, 1, 12),
+('bx_developer_bp_page_add', 'cancel', 2147483647, 1, 13);
+
+--
+-- Page Builder -> Block.
+--
+INSERT INTO `sys_objects_form` (`object`, `module`, `title`, `action`, `form_attrs`, `submit_name`, `table`, `key`, `uri`, `uri_title`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
+('bx_developer_bp_block', @sName, '_bx_dev_bp_txt_block_form', '', '', 'do_submit', 'sys_pages_blocks', 'id', '', '', '', 0, 1, 'BxDevFormView', 'modules/boonex/developer/classes/BxDevFormView.php');
+
+INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
+('bx_developer_bp_block_edit', @sName, 'bx_developer_bp_block', '_bx_dev_bp_txt_block_display_edit', 0);
+
+INSERT INTO `sys_form_inputs` (`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES
+('bx_developer_bp_block', @sName, 'id', '0', '', 0, 'hidden', '_bx_dev_bp_txt_sys_block_id', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
+('bx_developer_bp_block', @sName, 'object', '', '', 0, 'text', '_bx_dev_bp_txt_sys_block_object', '_bx_dev_bp_txt_block_object', '', 1, 0, 0, '', '', '', 'Length', 'a:2:{s:3:"min";i:6;s:3:"max";i:100;}', '_bx_dev_bp_err_block_object', 'Xss', '', 0, 0),
+('bx_developer_bp_block', @sName, 'module', '', '', 0, 'select', '_bx_dev_bp_txt_sys_block_module', '_bx_dev_bp_txt_block_module', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_dev_bp_err_block_module', 'Xss', '', 0, 0),
+('bx_developer_bp_block', @sName, 'title_system', '', '', 0, 'text', '_bx_dev_bp_txt_sys_block_title_system', '_bx_dev_bp_txt_block_title_system', '', 1, 0, 0, '', '', '', 'Length', 'a:2:{s:3:"min";i:6;s:3:"max";i:100;}', '_bx_dev_bp_err_block_title_system', 'Xss', '', 0, 0),
+('bx_developer_bp_block', @sName, 'title', '', '', 0, 'text', '_bx_dev_bp_txt_sys_block_title', '_bx_dev_bp_txt_block_title', '', 1, 0, 0, '', '', '', 'Length', 'a:2:{s:3:"min";i:6;s:3:"max";i:100;}', '_bx_dev_bp_err_block_title', 'Xss', '', 0, 0),
+('bx_developer_bp_block', @sName, 'designbox_id', '', '', 0, 'select', '_bx_dev_bp_txt_sys_block_designbox_id', '_bx_dev_bp_txt_block_designbox_id', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_dev_bp_err_block_designbox_id', 'Xss', '', 0, 0),
+('bx_developer_bp_block', @sName, 'visible_for', '', '', 0, 'select', '_bx_dev_bp_txt_sys_block_visible_for', '_bx_dev_bp_txt_block_visible_for', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_developer_bp_block', @sName, 'visible_for_levels', '', '', 0, 'checkbox_set', '_bx_dev_bp_txt_sys_block_visible_for_levels', '_bx_dev_bp_txt_block_visible_for_levels', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
+('bx_developer_bp_block', @sName, 'deletable', '1', '', 0, 'switcher', '_bx_dev_bp_txt_sys_block_deletable', '_bx_dev_bp_txt_block_deletable', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
+('bx_developer_bp_block', @sName, 'copyable', '1', '', 0, 'switcher', '_bx_dev_bp_txt_sys_block_copyable', '_bx_dev_bp_txt_block_copyable', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
+('bx_developer_bp_block', @sName, 'active', '1', '', 0, 'switcher', '_bx_dev_bp_txt_sys_block_active', '_bx_dev_bp_txt_block_active', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
+('bx_developer_bp_block', @sName, 'controls', '', 'do_submit,cancel,delete', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_developer_bp_block', @sName, 'do_submit', '_bx_dev_bp_btn_block_add', '', 0, 'submit', '_bx_dev_bp_btn_sys_block_add', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_developer_bp_block', @sName, 'cancel', '_bx_dev_bp_btn_block_cancel', '', 0, 'button', '_bx_dev_bp_btn_sys_block_cancel', '', '', 0, 0, 0, 'a:2:{s:7:"onclick";s:45:"$(''.bx-popup-applied:visible'').dolPopupHide()";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 0, 0),
+('bx_developer_bp_block', @sName, 'delete', '_bx_dev_bp_btn_block_delete', '', 0, 'button', '_bx_dev_bp_btn_sys_block_delete', '', '', 0, 0, 0, 'a:1:{s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 0, 0);
+
+INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
+('bx_developer_bp_block_edit', 'id', 2147483647, 1, 1),
+('bx_developer_bp_block_edit', 'object', 2147483647, 1, 2),
+('bx_developer_bp_block_edit', 'module', 2147483647, 1, 3),
+('bx_developer_bp_block_edit', 'title_system', 2147483647, 1, 4),
+('bx_developer_bp_block_edit', 'title', 2147483647, 1, 5),
+('bx_developer_bp_block_edit', 'designbox_id', 2147483647, 1, 6),
+('bx_developer_bp_block_edit', 'visible_for', 2147483647, 1, 7),
+('bx_developer_bp_block_edit', 'visible_for_levels', 2147483647, 1, 8),
+('bx_developer_bp_block_edit', 'deletable', 2147483647, 1, 9),
+('bx_developer_bp_block_edit', 'copyable', 2147483647, 1, 10),
+('bx_developer_bp_block_edit', 'active', 2147483647, 1, 11),
+('bx_developer_bp_block_edit', 'controls', 2147483647, 1, 12),
+('bx_developer_bp_block_edit', 'do_submit', 2147483647, 1, 13),
+('bx_developer_bp_block_edit', 'cancel', 2147483647, 1, 14),
+('bx_developer_bp_block_edit', 'delete', 2147483647, 1, 15);
+
+--
+-- Polyglot -> Grid descriptors
+--
+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_developer_pgt_manage', 'Sql', 'SELECT * FROM `sys_modules` WHERE 1 ', 'sys_modules', 'id', 'name', '', '', 100, NULL, '', '', '', '', '', '', '', 2147483647, 'BxDevPolyglotManage', 'modules/boonex/developer/classes/BxDevPolyglotManage.php');
+
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('bx_developer_pgt_manage', 'title', '_bx_dev_pgt_txt_manage_gl_title', '100%', 0, '', '', 1);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `confirm`, `order`) VALUES
+('bx_developer_pgt_manage', 'independent', 'recompile', '_bx_dev_pgt_btn_manage_gl_recompile', '', 0, 1),
+('bx_developer_pgt_manage', 'independent', 'restore', '_bx_dev_pgt_btn_manage_gl_restore', '', 0, 2);

+ 41 - 0
modules/boonex/developer/updates/9.0.3_9.0.4/source/install/sql/uninstall.sql

@@ -0,0 +1,41 @@
+SET @sName = 'bx_developer';
+
+--
+-- Studio page and widget.
+--
+DELETE FROM `tp`, `tw`, `tpw`
+USING `sys_std_pages` AS `tp` LEFT JOIN `sys_std_widgets` AS `tw` ON `tp`.`id`=`tw`.`page_id` LEFT JOIN `sys_std_pages_widgets` AS `tpw` ON `tw`.`id`=`tpw`.`widget_id`
+WHERE `tp`.`name`=@sName;
+
+
+--
+-- Forms Builder
+--
+DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_developer_forms', 'bx_developer_forms_displays', 'bx_developer_forms_fields', 'bx_developer_forms_pre_lists', 'bx_developer_forms_pre_values', 'bx_developer_search_forms', 'bx_developer_search_forms_fields');
+DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_developer_forms', 'bx_developer_forms_displays', 'bx_developer_forms_fields', 'bx_developer_forms_pre_lists', 'bx_developer_forms_pre_values', 'bx_developer_search_forms', 'bx_developer_search_forms_fields');
+DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_developer_forms', 'bx_developer_forms_displays', 'bx_developer_forms_fields', 'bx_developer_forms_pre_lists', 'bx_developer_forms_pre_values', 'bx_developer_search_forms', 'bx_developer_search_forms_fields');
+
+
+--
+-- Navigation Builder
+--
+DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_developer_nav_menus', 'bx_developer_nav_sets', 'bx_developer_nav_items');
+DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_developer_nav_menus', 'bx_developer_nav_sets', 'bx_developer_nav_items');
+DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_developer_nav_menus', 'bx_developer_nav_sets', 'bx_developer_nav_items');
+
+
+--
+-- Polyglot
+--
+DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_developer_pgt_manage');
+DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_developer_pgt_manage');
+DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_developer_pgt_manage');
+
+
+--
+-- Forms All
+--
+DELETE FROM `sys_form_display_inputs` WHERE `display_name` IN  (SELECT `display_name` FROM `sys_form_displays` WHERE `module`=@sName);
+DELETE FROM `sys_form_inputs` WHERE `module`=@sName;
+DELETE FROM `sys_form_displays` WHERE `module`=@sName;
+DELETE FROM `sys_objects_form` WHERE `module`=@sName;

+ 19 - 0
modules/boonex/developer/updates/9.0.3_9.0.4/source/template/form_add_search_field.html

@@ -0,0 +1,19 @@
+<div class="bx-dev-add-search-field bx-def-color-bg-block">
+    <div class="bx-dev-add-search-field-cnt">
+        __form__
+        <script type="text/javascript">
+            $(document).ready(function () {
+                $("#__form_id__").ajaxForm({ 
+                    dataType: "json",
+                    beforeSubmit: function (formData, jqForm, options) {
+                        bx_loading($("#__form_id__"), true);
+                    },
+                    success: function (data) {
+                        $(".bx-popup-applied:visible").dolPopupHide();
+                        glGrids.__object__.processJson(data, '__action__');
+                    }
+                });
+            });
+        </script>
+    </div>
+</div>

+ 19 - 0
modules/boonex/developer/updates/9.0.3_9.0.4/source/template/form_add_search_form.html

@@ -0,0 +1,19 @@
+<div class="bx-dev-add-search-form bx-def-color-bg-block">
+    <div class="bx-dev-add-search-form-cnt">
+        __form__
+        <script type="text/javascript">
+            $(document).ready(function () {
+                $("#__form_id__").ajaxForm({ 
+                    dataType: "json",
+                    beforeSubmit: function (formData, jqForm, options) {
+                        bx_loading($("#__form_id__"), true);
+                    },
+                    success: function (data) {
+                        $(".bx-popup-applied:visible").dolPopupHide();
+                        glGrids.__object__.processJson(data, '__action__');
+                    }
+                });
+            });
+        </script>
+    </div>
+</div>

+ 203 - 0
modules/boonex/events/updates/9.0.2_9.0.3/source/classes/BxEventsConfig.php

@@ -0,0 +1,203 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Events Events
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxEventsConfig extends BxBaseModProfileConfig
+{
+    function __construct($aModule)
+    {
+        parent::__construct($aModule);
+
+        $aMenuItems2Methods = array (
+            'view-event-profile' => 'checkAllowedView',
+            'edit-event-profile' => 'checkAllowedEdit',
+            'edit-event-cover' => 'checkAllowedChangeCover',
+            'invite-to-event' => 'checkAllowedInvite',
+            'delete-event-profile' => 'checkAllowedDelete',
+            'profile-fan-add' => 'checkAllowedFanAdd',
+            'profile-fan-remove' => 'checkAllowedFanRemove',
+            'profile-subscribe-add' => 'checkAllowedSubscribeAdd',
+            'profile-subscribe-remove' => 'checkAllowedSubscribeRemove',
+            'profile-actions-more' => 'checkAllowedViewMoreMenu',
+            'convos-compose' => 'checkAllowedCompose',
+        );
+
+        $this->CNF = array (
+
+            // module icon
+            'ICON' => 'calendar col-red2',
+
+            // database tables
+            'TABLE_ENTRIES' => $aModule['db_prefix'] . 'data',
+            'TABLE_ENTRIES_FULLTEXT' => 'search_fields',
+            'TABLE_ADMINS' => $aModule['db_prefix'] . 'admins',
+
+            // database fields
+            'FIELD_ID' => 'id',
+            'FIELD_AUTHOR' => 'author',
+            'FIELD_ADDED' => 'added',
+            'FIELD_CHANGED' => 'changed',
+            'FIELD_NAME' => 'event_name',
+            'FIELD_TITLE' => 'event_name',
+            'FIELD_TEXT' => 'event_desc',
+            'FIELD_PICTURE' => 'picture',
+            'FIELD_COVER' => 'cover',
+            'FIELD_TIMEZONE' => 'timezone',
+            'FIELD_JOIN_CONFIRMATION' => 'join_confirmation',
+        	'FIELD_REMINDER' => 'reminder',
+            'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
+            'FIELDS_QUICK_SEARCH' => array('event_name'),
+            'FIELD_LOCATION_PREFIX' => 'location',
+            'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
+
+            // page URIs
+            'URI_VIEW_ENTRY' => 'view-event-profile',
+            'URI_EDIT_ENTRY' => 'edit-event-profile',
+            'URI_EDIT_COVER' => 'edit-event-cover',
+            'URI_JOINED_ENTRIES' => 'joined-events',
+        	'URI_MANAGE_COMMON' => 'events-manage',
+
+            'URL_HOME' => 'page.php?i=events-home',
+        	'URL_MANAGE_COMMON' => 'page.php?i=events-manage',
+        	'URL_MANAGE_ADMINISTRATION' => 'page.php?i=events-administration',
+
+            'PARAM_NUM_RSS' => 'bx_events_num_rss',
+            'PARAM_NUM_CONNECTIONS_QUICK' => 'bx_events_num_connections_quick',
+            
+            'PARAM_SEARCHABLE_FIELDS' => 'bx_events_searchable_fields',
+
+            // objects
+            'OBJECT_STORAGE' => 'bx_events_pics',
+            'OBJECT_STORAGE_COVER' => 'bx_events_pics',
+            'OBJECT_IMAGES_TRANSCODER_THUMB' => 'bx_events_thumb',
+            'OBJECT_IMAGES_TRANSCODER_ICON' => 'bx_events_icon',
+            'OBJECT_IMAGES_TRANSCODER_AVATAR' => 'bx_events_avatar',
+            'OBJECT_IMAGES_TRANSCODER_PICTURE' => 'bx_events_picture',
+            'OBJECT_IMAGES_TRANSCODER_COVER' => 'bx_events_cover',
+            'OBJECT_IMAGES_TRANSCODER_COVER_THUMB' => 'bx_events_cover_thumb',
+        	'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_events_gallery',
+            'OBJECT_VIEWS' => 'bx_events',
+            'OBJECT_VOTES' => 'bx_events',
+        	'OBJECT_FAVORITES' => 'bx_events',
+        	'OBJECT_FEATURED' => 'bx_events',
+        	'OBJECT_COMMENTS' => 'bx_events',
+            'OBJECT_REPORTS' => 'bx_events',
+            'OBJECT_METATAGS' => 'bx_events',
+            'OBJECT_FORM_ENTRY' => 'bx_event',
+            'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_event_view',
+        	'OBJECT_FORM_ENTRY_DISPLAY_VIEW_FULL' => 'bx_event_view_full', // for "info" tab on view group page
+            'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_event_add',
+            'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_event_edit',
+            'OBJECT_FORM_ENTRY_DISPLAY_EDIT_COVER' => 'bx_event_edit_cover',
+            'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_event_delete',
+            'OBJECT_FORM_ENTRY_DISPLAY_INVITE' => 'bx_event_invite',
+            'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_events_view_actions', // actions menu on view entry page
+            'OBJECT_MENU_ACTIONS_VIEW_ENTRY_MORE' => 'bx_events_view_actions_more', // actions menu on view entry page for "more" popup
+            'OBJECT_MENU_SUBMENU' => 'bx_events_submenu', // main module submenu
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_events_view_submenu',  // view entry submenu
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY_COVER' => 'bx_events_view_submenu_cover',  // view entry submenu displayed in cover
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'events-home', // first item in view entry submenu from main module submenu
+            'OBJECT_MENU_MANAGE_TOOLS' => 'bx_events_menu_manage_tools', //manage menu in content administration tools
+            'OBJECT_PAGE_VIEW_ENTRY' => 'bx_events_view_profile',
+            'OBJECT_PAGE_VIEW_ENTRY_CLOSED' => 'bx_events_view_profile_closed',
+            'OBJECT_PRIVACY_VIEW' => 'bx_events_allow_view_to',
+            'OBJECT_PRIVACY_VIEW_NOTIFICATION_EVENT' => 'bx_events_allow_view_notification_to',
+            'OBJECT_GRID_ADMINISTRATION' => 'bx_events_administration',
+        	'OBJECT_GRID_COMMON' => 'bx_events_common',
+            'OBJECT_GRID_CONNECTIONS' => 'bx_events_fans',
+            'OBJECT_CONNECTIONS' => 'bx_events_fans',
+            'OBJECT_UPLOADERS_COVER' => array('bx_events_cover_crop'),
+            'OBJECT_UPLOADERS_PICTURE' => array('bx_events_picture_crop'),
+
+            'EMAIL_INVITATION' => 'bx_events_invitation',
+            'EMAIL_JOIN_REQUEST' => 'bx_events_join_request',
+            'EMAIL_JOIN_CONFIRM' => 'bx_events_join_confirm',
+            'EMAIL_FAN_BECOME_ADMIN' => 'bx_events_fan_become_admin',
+            'EMAIL_ADMIN_BECOME_FAN' => 'bx_events_admin_become_fan',
+            'EMAIL_FAN_REMOVE' => 'bx_events_fan_remove',
+            'EMAIL_JOIN_REJECT' => 'bx_events_join_reject',
+            'EMAIL_REMINDER' => 'bx_events_reminder',
+
+            'TRIGGER_MENU_PROFILE_VIEW_SUBMENU' => 'trigger_group_view_submenu',
+            'TRIGGER_MENU_PROFILE_VIEW_ACTIONS' => 'trigger_group_view_actions',
+        	'TRIGGER_PAGE_VIEW_ENTRY' => 'trigger_page_group_view_entry',
+
+            // menu items which visibility depends on custom visibility checking
+            'MENU_ITEM_TO_METHOD' => array (
+                'bx_events_view_actions' => $aMenuItems2Methods,
+                'bx_events_view_actions_more' => $aMenuItems2Methods,
+            ),
+
+            // informer messages
+            'INFORMERS' => array (
+                'status' => array (
+                    'name' => 'bx-events-status-not-active',
+                    'map' => array (
+                        BX_PROFILE_STATUS_PENDING => '_bx_events_txt_account_pending',
+                        BX_PROFILE_STATUS_SUSPENDED => '_bx_events_txt_account_suspended',
+                    ),
+                ),
+            ),
+
+            // some language keys
+            'T' => array (
+                'txt_sample_single' => '_bx_events_txt_sample_single',
+            	'txt_sample_single_with_article' => '_bx_events_txt_sample_single_with_article',
+            	'txt_sample_comment_single' => '_bx_events_txt_sample_comment_single',
+                'txt_sample_vote_single' => '_bx_events_txt_sample_vote_single',
+                'txt_private_group' => '_bx_events_txt_private_group',
+                'txt_N_fans' => '_bx_events_txt_N_fans',
+                'txt_ntfs_join_request' => '_bx_events_txt_ntfs_join_request',
+                'txt_ntfs_fan_added' => '_bx_events_txt_ntfs_fan_added',
+            	'form_field_author' => '_bx_events_form_profile_input_author',
+                'menu_item_title_befriend_sent' => '_bx_events_menu_item_title_befriend_sent',
+                'menu_item_title_unfriend_cancel_request' => '_bx_events_menu_item_title_unfriend_cancel_request',
+                'menu_item_title_befriend_confirm' => '_bx_events_menu_item_title_befriend_confirm',
+                'menu_item_title_unfriend_reject_request' => '_bx_events_menu_item_title_unfriend_reject_request',
+                'menu_item_title_befriend' => '_bx_events_menu_item_title_befriend',
+                'menu_item_title_unfriend' => '_bx_events_menu_item_title_unfriend',
+            	'grid_action_err_delete' => '_bx_events_grid_action_err_delete',
+            	'grid_txt_account_manager' => '_bx_events_grid_txt_account_manager',
+				'filter_item_active' => '_bx_events_grid_filter_item_title_adm_active',
+            	'filter_item_pending' => '_bx_events_grid_filter_item_title_adm_pending',
+            	'filter_item_suspended' => '_bx_events_grid_filter_item_title_adm_suspended',
+            	'filter_item_select_one_filter1' => '_bx_events_grid_filter_item_title_adm_select_one_filter1',
+            	'menu_item_manage_my' => '_bx_events_menu_item_title_manage_my',
+                'menu_item_manage_all' => '_bx_events_menu_item_title_manage_all',
+                'menu_item_title_become_fan_sent' => '_bx_events_menu_item_title_become_fan_sent',
+                'menu_item_title_leave_group_cancel_request' => '_bx_events_menu_item_title_leave_group_cancel_request',
+                'menu_item_title_become_fan' => '_bx_events_menu_item_title_become_fan',
+                'menu_item_title_leave_group' => '_bx_events_menu_item_title_leave_group',
+                
+                'menu_item_title_become_fan_sent' => '_bx_events_menu_item_title_become_fan_sent',
+                'menu_item_title_become_fan' => '_bx_events_menu_item_title_become_fan',
+            	'txt_all_entries_by_author' => '_bx_events_page_title_browse_by_author'
+            ),
+
+        );
+
+        $this->_aJsClasses = array(
+        	'manage_tools' => 'BxEventsManageTools'
+        );
+
+        $this->_aJsObjects = array(
+        	'manage_tools' => 'oBxEventsManageTools'
+        );
+
+        $this->_aGridObjects = array(
+        	'common' => $this->CNF['OBJECT_GRID_COMMON'],
+        	'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
+        	
+        );
+    }
+
+}
+
+/** @} */

+ 157 - 0
modules/boonex/events/updates/9.0.2_9.0.3/source/classes/BxEventsDb.php

@@ -0,0 +1,157 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Events Events
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Groups module database queries
+ */
+class BxEventsDb extends BxBaseModGroupsDb
+{
+    public function __construct(&$oConfig)
+    {
+        parent::__construct($oConfig);
+    }
+
+    public function getContentInfoByIntervalId ($iIntervalId)
+    {
+        $iContentId = $this->getOne("SELECT `event_id` FROM `bx_events_intervals` WHERE `interval_id` = :interval", array(
+            'interval' => $iIntervalId,
+        ));
+        if (!$iContentId)
+            return 0;
+        return $this->getContentInfoById ($iContentId);
+    }
+
+    public function getContentInfoById ($iContentId)
+    {
+        $sQuery = $this->prepare ("SELECT `c`.*, `p`.`account_id`, `p`.`id` AS `profile_id`, `p`.`status` AS `profile_status`, MAX(`i`.`repeat_stop`) AS `repeat_stop` FROM `" . $this->_oConfig->CNF['TABLE_ENTRIES'] . "` AS `c` 
+            INNER JOIN `sys_profiles` AS `p` ON (`p`.`content_id` = `c`.`id` AND `p`.`type` = ?) 
+            LEFT JOIN `bx_events_intervals` as `i` ON (`c`.`id` = `i`.`event_id`)
+            WHERE `c`.`id` = ?
+            GROUP BY `c`.`id`", $this->_oConfig->getName(), $iContentId);
+        return $this->getRow($sQuery);
+    }
+
+    public function deleteIntervalById ($iIntervalId)
+    {
+        return $this->query("DELETE FROM `bx_events_intervals` WHERE `interval_id` = :interval", array(
+            'interval' => $iIntervalId,
+        ));
+    }
+    
+    public function getIntervals ($iContentId) 
+    {
+        return $this->getAllWithKey("SELECT * FROM `bx_events_intervals` WHERE `event_id` = :event_id", 'interval_id', array(
+            'event_id' => $iContentId,
+        ));
+    }
+
+    public function getEntriesByDate($sDateFrom, $sDateTo, $iEventId = 0, $aSQLPart = array())
+    {
+        // validate input data
+        if (false === ($oDateFrom = date_create($sDateFrom, new DateTimeZone('UTC'))))
+            return array();
+        if (false === ($oDateTo = date_create($sDateTo, new DateTimeZone('UTC'))))
+            return array();
+        if ($oDateFrom > $oDateTo)
+            return array();
+
+        // increase start and end date to cover timezones
+        $oDateFrom = $oDateFrom->sub(new DateInterval("P1D"));
+        $oDateTo = $oDateTo->add(new DateInterval("P1D"));
+
+        // look throught all days in the interval
+        $oDateIter = clone($oDateFrom);
+        $aEntries = array();
+        while ($oDateIter->format('Y-m-d') != $oDateTo->format('Y-m-d')) {
+
+            $oDateMin = date_create($oDateIter->format('Y-m-d') . '00:00:00', new DateTimeZone('UTC'));
+            $oDateMax = date_create($oDateIter->format('Y-m-d') . '23:59:59', new DateTimeZone('UTC'));
+                
+            // get all events for the specific day            
+            $oDateMonthBegin = date_create($oDateIter->format('Y-m-01'), new DateTimeZone('UTC'));
+            $iWeekOfMonth = $oDateIter->format('W') - $oDateMonthBegin->format('W') + 1;
+            $aBindings = array(
+                'timestamp_min' => $oDateMin->getTimestamp(),
+                'timestamp_max' => $oDateMax->getTimestamp(),
+                'timestamp_from' => $oDateFrom->getTimestamp(),
+                'timestamp_to' => $oDateTo->getTimestamp(),
+                'year_start' => $oDateFrom->format('Y'),
+                'year' => $oDateIter->format('Y'),
+                'month' => $oDateIter->format('n'),
+                'week_of_month' => $iWeekOfMonth > 0 ? $iWeekOfMonth : $oDateIter->format('W') + 1,
+                'day_of_month' => $oDateIter->format('j'),
+                'day_of_week' => $oDateIter->format('N'),
+            );
+
+            $sWhere = isset($aSQLPart['where']) ? $aSQLPart['where'] : '';
+            if ((int)$iEventId) {
+                $aBindings['event'] = (int)$iEventId;
+                $sWhere .= " AND `bx_events_data`.`id` = :event ";
+            }
+            $a = $this->getAll("SELECT DISTINCT `bx_events_data`.`id`, `bx_events_data`.`event_name` AS `title`, `bx_events_data`.`date_start`, `bx_events_data`.`date_end`, `bx_events_data`.`timezone`, `bx_events_data`.`reminder`
+                FROM `bx_events_data`
+                LEFT JOIN `bx_events_intervals` AS `i` ON (
+                    `bx_events_data`.`id` = `i`.`event_id`
+                    AND
+                    `bx_events_data`.`date_start` < :timestamp_max
+                    AND
+                    (0 = `i`.`repeat_stop` OR `i`.`repeat_stop` >= :timestamp_min)
+                    AND (
+                        (0 = `i`.`repeat_year` OR 0 = (:year - :year_start) % `i`.`repeat_year`)
+                        AND 
+                        (0 = `i`.`repeat_month` OR :month = `i`.`repeat_month`)
+                        AND 
+                        (0 = `i`.`repeat_week_of_month` OR :week_of_month = `i`.`repeat_week_of_month`)
+                        AND 
+                        (0 = `i`.`repeat_day_of_month` OR :day_of_month = `i`.`repeat_day_of_month`)
+                        AND 
+                        (0 = `i`.`repeat_day_of_week` OR :day_of_week = `i`.`repeat_day_of_week`)
+                    )
+                )
+                WHERE ((`bx_events_data`.`date_start` >= :timestamp_min AND `bx_events_data`.`date_start` <= :timestamp_max AND `i`.`interval_id` IS NULL) OR (`i`.`interval_id` IS NOT NULL)) $sWhere
+            ", $aBindings);
+
+            // prepare variables for each event
+            $sCurrentDay = $oDateIter->format('Y-m-d');
+            foreach ($a as $k => $r) {
+                $oDateStart = new DateTime();
+                $oDateStart->setTimestamp($r['date_start']);
+                $oDateStart->setTimezone(new DateTimeZone('UTC'));
+                $oDateEnd = new DateTime();
+                $oDateEnd->setTimestamp($r['date_end']);
+                $oDateEnd->setTimezone(new DateTimeZone('UTC'));
+                $oDuration = $oDateStart->diff($oDateEnd);
+
+                $sHoursStart = $oDateStart->format('H:i:s');
+
+                $oStart = date_create($sCurrentDay . ' ' . $sHoursStart, new DateTimeZone($r['timezone'] ? $r['timezone'] : 'UTC'));
+                $oEnd = $oStart ? clone($oStart) : null;
+                $oEnd = $oEnd ? $oEnd->add($oDuration) : null;
+
+                $a[$k]['start'] = $oStart ? $oStart->format('c') : 0;
+                $a[$k]['end'] = $oEnd ? $oEnd->format('c') : 0;
+                $a[$k]['start_utc'] = $oStart ? $oStart->getTimestamp() : 0;
+                $a[$k]['end_utc'] = $oEnd ? $oEnd->getTimestamp() : 0;
+                $a[$k]['url'] = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->_oConfig->CNF['URI_VIEW_ENTRY'] . '&id=' . $r['id']);
+            }
+
+            // merge with all other events
+            $aEntries = array_merge($aEntries, $a);
+
+            // go to the next day
+            $oDateIter = $oDateIter->add(new DateInterval("P1D"));
+        }
+
+        return $aEntries;
+    }
+}
+
+/** @} */

+ 247 - 0
modules/boonex/events/updates/9.0.2_9.0.3/source/classes/BxEventsFormEntry.php

@@ -0,0 +1,247 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Events Events
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Create/Edit Group Form.
+ */
+class BxEventsFormEntry extends BxBaseModGroupsFormEntry
+{
+    protected $_iContentId = 0;
+
+    public function __construct($aInfo, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_events';
+        parent::__construct($aInfo, $oTemplate);
+
+        if (isset($this->aInputs['reoccurring'])) {
+            $this->aInputs['reoccurring']['ghost_template'] = array (
+                
+                'params' => array(
+                    'nested_form_template' => 'form_ghost_template_wrapper.html',
+                    'db' => array(
+                        'table' => 'bx_events_intervals',
+                        'key' => 'interval_id',
+                        'submit_name' => 'interval_id',
+                    ),
+                ),
+                'inputs' => array (
+                    'interval_id' => array (
+                        'type' => 'hidden',
+                        'name' => 'interval_id[]',
+                        'value' => '{interval_id}',
+                        'caption' => _t('Interval ID'),
+                        'db' => array (
+                            'pass' => 'Int',
+                        ),
+                    ),                
+                    'repeat_year' => array (
+                        'type' => 'select',                    
+                        'name' => 'repeat_year[]',
+                        'value' => '{repeat_year}',
+                        'values' => BxDolForm::getDataItems('bx_events_repeat_year'),
+                        'caption' => _t('_bx_events_form_input_repeat_year'),
+                        'db' => array (
+                            'pass' => 'Int',
+                        ),
+                    ),
+                    'repeat_month' => array (
+                        'type' => 'select',
+                        'name' => 'repeat_month[]',
+                        'value' => '{repeat_month}',
+                        'values' => BxDolForm::getDataItems('bx_events_repeat_month'),
+                        'caption' => _t('_bx_events_form_input_repeat_month'),
+                        'db' => array (
+                            'pass' => 'Int',
+                        ),
+                    ),
+                    'repeat_week_of_month' => array (
+                        'type' => 'select',
+                        'name' => 'repeat_week_of_month[]',
+                        'value' => '{repeat_week_of_month}',
+                        'values' => BxDolForm::getDataItems('bx_events_repeat_week_of_month'),
+                        'caption' => _t('_bx_events_form_input_repeat_week_of_month'),
+                        'db' => array (
+                            'pass' => 'Int',
+                        ),
+                    ),                
+                    'repeat_day_of_month' => array (
+                        'type' => 'select',
+                        'name' => 'repeat_day_of_month[]',
+                        'value' => '{repeat_day_of_month}',
+                        'values' => BxDolForm::getDataItems('bx_events_repeat_day_of_month'),
+                        'caption' => _t('_bx_events_form_input_repeat_day_of_month'),
+                        'db' => array (
+                            'pass' => 'Int',
+                        ),
+                    ),
+                    'repeat_day_of_week' => array (
+                        'type' => 'select',
+                        'name' => 'repeat_day_of_week[]',
+                        'value' => '{repeat_day_of_week}',
+                        'values' => BxDolForm::getDataItems('bx_events_repeat_day_of_week'),
+                        'caption' => _t('_bx_events_form_input_repeat_day_of_week'),
+                        'db' => array (
+                            'pass' => 'Int',
+                        ),
+                    ),
+                    'repeat_stop' => array (
+                        'type' => 'datepicker',
+                        'name' => 'repeat_stop[]',
+                        'value' => '{repeat_stop}',
+                        'caption' => _t('_bx_events_form_input_stop_repeating'),
+                        'db' => array (
+                            'pass' => 'DateTs',
+                        ),
+                    ),
+                ),
+            );
+        }
+
+        if (isset($this->aInputs['timezone']) && !$this->aParams['view_mode']) {
+            $this->aInputs['timezone']['values'] = array_combine(timezone_identifiers_list(), timezone_identifiers_list());
+        }        
+    }
+
+    function initChecker ($aValues = array (), $aSpecificValues = array())
+    {
+        if (isset($aValues[$this->_oModule->_oConfig->CNF['FIELD_ID']]))
+            $this->_iContentId = $aValues[$this->_oModule->_oConfig->CNF['FIELD_ID']];
+
+        parent::initChecker($aValues, $aSpecificValues);
+    }
+
+    protected function genCustomRowDateEnd (&$aInput)
+    {
+        if ($this->aParams['view_mode'])
+            return $this->_isSameDayEvent() ? '' : $this->genViewRowWrapped($aInput);
+
+        return $this->genRowStandard($aInput);
+    }
+
+    protected function _isSameDayEvent()
+    {
+        if (false === ($aStartEnd = $this->_getStartEnd()))
+            return false;
+        else
+            return $aStartEnd['start']->format('Y-m-d') == $aStartEnd['end']->format('Y-m-d');
+    }
+
+    protected function _getStartEnd()
+    {
+        if (!isset($this->aInputs['timezone']['value']) || !isset($this->aInputs['date_start']['value']) || !isset($this->aInputs['date_end']['value']))
+            return false;
+
+        $iTimeStart = bx_process_input ($this->aInputs['date_start']['value'], isset($this->aInputs['date_start']['date_filter']) ? $this->aInputs['date_start']['date_filter'] : BX_DATA_DATETIME_TS, false, false);
+        $iTimeEnd = bx_process_input ($this->aInputs['date_end']['value'], isset($this->aInputs['date_end']['date_filter']) ? $this->aInputs['date_end']['date_filter'] : BX_DATA_DATETIME_TS, false, false);
+        $oDateStart = date_create(date('Y-m-d H:i:s', $iTimeStart), new DateTimeZone($this->aInputs['timezone']['value'] ? $this->aInputs['timezone']['value'] : 'UTC'));
+        $oDateEnd = date_create(date('Y-m-d H:i:s', $iTimeEnd), new DateTimeZone($this->aInputs['timezone']['value'] ? $this->aInputs['timezone']['value'] : 'UTC'));
+
+        return array('start' => $oDateStart, 'end' => $oDateEnd);
+    }
+    
+    protected function genCustomRowTime (&$aInput)
+    {
+        if (!$this->aParams['view_mode'])
+            return '';
+
+        if (false === ($aStartEnd = $this->_getStartEnd())) {
+            $aInput['value'] = "Timezone, date start & date end fields are required to display this field";
+        }
+        else {            
+            if ($aStartEnd['start']->format('Y-m-d') == $aStartEnd['end']->format('Y-m-d'))
+                $aInput['value'] = _t('_bx_events_txt_from_time_to_time', $aStartEnd['start']->format(getParam('bx_events_time_format')), $aStartEnd['end']->format(getParam('bx_events_time_format')));
+            else
+                $aInput['value'] = '';
+        }
+        return $this->genViewRowWrapped($aInput);
+    }
+ 
+    function genViewRowValue(&$aInput)
+    {
+        if (in_array($aInput['name'], array('date_start', 'date_end'))) {
+
+            if (false === ($aStartEnd = $this->_getStartEnd()))
+                return "Timezone, date start & date end fields are required to display this field";
+        
+            $sFormat = $aStartEnd['start']->format('Y-m-d') == $aStartEnd['end']->format('Y-m-d') ? BX_FORMAT_DATE : BX_FORMAT_DATE_TIME;
+            $oDate = 'date_start' == $aInput['name'] ? $aStartEnd['start'] : $aStartEnd['end'];
+            return bx_time_js ($oDate->getTimestamp(), $sFormat, true);
+        }
+        return parent::genViewRowValue($aInput);
+    }
+
+    protected function genCustomRowReoccurring (&$aInput)
+    {
+        return $this->genRowCustom($aInput, 'genInputReoccurring');
+    }
+
+    protected function genInputReoccurring (&$aInput, $sInfo = '', $sError = '')
+    {
+        $sUniqId = genRndPwd (8, false);
+
+        return $this->oTemplate->parseHtmlByName('form_field_reoccurring.html', array(
+            'info' => $sInfo,
+            'error' => $sError,
+            'uniq_id' => $sUniqId,
+            'js_instance_name' => 'oBxEventsIntervals_' . $sUniqId,
+            'options' => json_encode(array(
+                'uniq_id' => $sUniqId,
+                'js_instance_name' => 'oBxEventsIntervals_' . $sUniqId,
+                'template_ghost' => $this->genGhostTemplate($aInput),
+                'content_id' => $this->_iContentId, 
+            )),
+        ));
+    }
+
+    public function insert ($aValsToAdd = array(), $isIgnore = false)
+    {
+        $iContentId = parent::insert ($aValsToAdd, $isIgnore);
+
+        if (isset($this->aInputs['reoccurring']) && is_array($this->aInputs['reoccurring']['ghost_template']) && !isset($this->aInputs['reoccurring']['ghost_template']['inputs'])) {
+            foreach ($this->aInputs['reoccurring']['ghost_template'] as $oFormNested) {
+                $oFormNested->insert(array('event_id' => $iContentId));
+            }
+        }
+        
+        return $iContentId;
+    }
+
+    function update ($val, $aValsToAdd = array(), &$aTrackTextFieldsChanges = null)
+    {
+        $iAffectedRows = parent::update($val, $aValsToAdd, $aTrackTextFieldsChanges);
+
+        if (isset($this->aInputs['reoccurring']) && is_array($this->aInputs['reoccurring']['ghost_template']) && !isset($this->aInputs['reoccurring']['ghost_template']['inputs'])) {
+            foreach ($this->aInputs['reoccurring']['ghost_template'] as $oFormNested) {
+                $aSpecificValues = $oFormNested->getSpecificValues();
+                $iIntervalId = $oFormNested->getSubmittedValue('interval_id', BX_DOL_FORM_METHOD_SPECIFIC, $aSpecificValues);
+                if ($iIntervalId) {
+                    $oFormNested->update($iIntervalId);
+                } else {
+                    $oFormNested->insert(array('event_id' => $this->_iContentId));
+                }
+            }
+        }
+        
+        return $iAffectedRows;
+    }
+    
+    function addCssJs ()
+    {
+        if (!self::$_isCssJsAdded) {
+            $this->oTemplate->addJs('intervals.js');
+            $this->oTemplate->addCss('informer.css');
+        }
+
+        parent::addCssJs ();
+    }
+}
+
+/** @} */

+ 262 - 0
modules/boonex/events/updates/9.0.2_9.0.3/source/classes/BxEventsModule.php

@@ -0,0 +1,262 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Events Events
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Groups profiles module.
+ */
+class BxEventsModule extends BxBaseModGroupsModule
+{
+    function __construct(&$aModule)
+    {
+        parent::__construct($aModule);
+        
+        $CNF = &$this->_oConfig->CNF;
+        $this->_aSearchableNamesExcept = array_merge($this->_aSearchableNamesExcept, array(
+            $CNF['FIELD_TIMEZONE'],
+            $CNF['FIELD_JOIN_CONFIRMATION'],
+            $CNF['FIELD_REMINDER']
+        ));
+    }
+
+    public function actionCalendarData()
+    {
+        // check permissions
+        $iContentId = (int)bx_get('event');
+        if ($iContentId) {
+            $aContentInfo = $this->_oDb->getContentInfoById($iContentId);
+            if (CHECK_ACTION_RESULT_ALLOWED !== $this->checkAllowedView($aContentInfo)) {
+                $this->_oTemplate->displayAccessDenied();
+                exit;
+            }
+            $aSQLPart = array();
+        }
+        else {
+            $oPrivacy = BxDolPrivacy::getObjectInstance($this->_oConfig->CNF['OBJECT_PRIVACY_VIEW']);
+            $aSQLPart = $oPrivacy ? $oPrivacy->getContentPublicAsSQLPart(0, $oPrivacy->getPartiallyVisiblePrivacyGroups()) : array();
+        }
+
+        // get entries
+        $aEntries = $this->_oDb->getEntriesByDate(bx_get('start'), bx_get('end'), bx_get('event'), $aSQLPart);
+        
+        header('Content-Type: application/json; charset=utf-8');
+        echo json_encode($aEntries);
+    }
+
+    /**
+     * @page service Service Calls
+     * @section Events Events
+     * @subsection calendar
+     * @see BxEventsModule::serviceCalendar
+     * 
+     * Shows event or events calendar
+     * 
+     * @param $aData additional data to point which events to show, leave empty to show all events, specify event's ID in 'event' array key to show calendar for one event only. If only one event is specified then it will show calendar only if it's repeating event.
+     * @param $sTemplate template to use to show calendar, or leave empty for default template, possible options: calendar.html, calendar_compact.html
+     * @return HTML string with calendar to display on the site, all necessary CSS and JS files are automatically added to the HEAD section of the site HTML. On error empty string is returned.
+     */ 
+    public function serviceCalendar($aData = array(), $sTemplate = 'calendar.html')
+    {
+        if (isset($aData['event'])) {
+            $aContentInfo = $this->_oDb->getContentInfoById ((int)$aData['event']);
+            if ('' == $aContentInfo['repeat_stop']) // don't display calendar for non repeating events
+                return '';
+        } 
+
+        $o = new BxTemplCalendar(array(
+            'eventSources' => array (
+                'url' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'calendar_data',
+                'data' => $aData,
+            ),
+        ), $this->_oTemplate);
+        return $o->display($sTemplate);
+    }
+
+    /**
+     * @page service Service Calls
+     * @section Events Events
+     * @subsection process_reminders
+     * @see BxEventsModule::serviceProcessReminders
+     * 
+     * Send remiders to event's participants.
+     *
+     * It must be processed once every hour for the proper processing.
+     * @return nothing
+     */ 
+    public function serviceProcessReminders()
+    {
+        $iNow = time();
+
+        // get all events for today and tomorrow, since the max reminder is 24 hours
+        $aEntries = $this->_oDb->getEntriesByDate('@' . time(), '@' . (time() + 86400));
+
+        foreach ($aEntries as $a) {
+            if (!$a['reminder'])
+                continue;
+            $iTimestamp = $a['start_utc'] - (3600 * $a['reminder']);
+            if ($iNow > ($iTimestamp - 3600) && $iNow < $iTimestamp)
+                $this->sendReminders($a);
+        }
+    }
+
+    /**
+     * @page service Service Calls
+     * @section Events Events
+     * @subsection get_timeline_post
+     * @see BxEventsModule::serviceGetTimelinePost
+     *
+     * Get Timeline post. It's needed for Timeline module.
+     * 
+     * @param $aEvent timeline event array from Timeline module
+     * @return array in special format which is needed specifically for Timeline module to display the data.
+     */
+    public function serviceGetTimelinePost($aEvent)
+    {
+        $a = parent::serviceGetTimelinePost($aEvent);
+
+        if (!($aContentInfo = $this->_oDb->getContentInfoById($aEvent['object_id'])))
+            return $a;
+
+        $CNF = $this->_oConfig->CNF;
+        
+        $oDateStart = date_create('@' . $aContentInfo['date_start'], new DateTimeZone($aContentInfo['timezone'] ? $aContentInfo['timezone'] : 'UTC'));
+        $oDateEnd = date_create('@' . ($aContentInfo['date_start'] > $aContentInfo['repeat_stop'] ? $aContentInfo['date_start'] : $aContentInfo['repeat_stop']), new DateTimeZone($aContentInfo['timezone'] ? $aContentInfo['timezone'] : 'UTC'));
+
+        $oMetatags = BxDolMetatags::getObjectInstance($CNF['OBJECT_METATAGS']);
+        $sLocationString = $oMetatags ? $oMetatags->locationsString($aContentInfo[$CNF['FIELD_ID']], false) : false;
+
+        $a['content']['raw'] = $this->_oTemplate->parseHtmlByName('timeline_post.html', array(
+            'title' => $a['content']['title'],
+            'title_attr' => bx_html_attribute($a['content']['title']),
+            'url' => $a['content']['url'],
+            'date' => $oDateStart->format(getParam('bx_events_short_date_format')) . ($oDateStart->format('ymd') == $oDateEnd->format('ymd') ? '' : ' - ' . $oDateEnd->format(getParam('bx_events_short_date_format'))),
+            'date_c' => $oDateStart->format('c'),
+            'bx_if:location' => array(
+                'condition' => !!$sLocationString,
+                'content' => array('location' => $sLocationString),
+            ),
+        ));
+
+        $a['content']['title'] = '';
+        $a['content']['text'] = '';
+
+        return $a;
+    }
+    
+    public function actionIntervals()
+    {
+        $sAction = bx_get('a');
+        $sMethodName = 'subaction' . ucfirst($sAction);
+        if (!method_exists($this, $sMethodName)) {
+            $this->_oTemplate->pageNotFound();
+            return;
+        }
+        $this->$sMethodName();
+    }
+
+    public function subactionRestore($iContentId = 0)
+    {
+        if (!$iContentId)
+            $iContentId = (int)bx_get('c');
+
+        $aContentInfo = $this->_oDb->getContentInfoById($iContentId);
+
+        if (
+            ($aContentInfo && CHECK_ACTION_RESULT_ALLOWED !== $this->checkAllowedEdit ($aContentInfo))
+            ||
+            (!$aContentInfo && CHECK_ACTION_RESULT_ALLOWED !== $this->checkAllowedAdd ())
+        ) {
+            $this->_oTemplate->displayAccessDenied();
+            exit;
+        }
+
+        $a = $this->_oDb->getIntervals($iContentId);
+        foreach ($a as $iIntervalId => $r) {
+            $a[$iIntervalId]['file_id'] = $r['interval_id'];
+            $a[$iIntervalId]['repeat_stop'] = bx_process_output ($r['repeat_stop'], BX_DATA_DATE_TS);
+        }
+
+        if ('json' == bx_get('f')) {
+            header('Content-type: text/html; charset=utf-8');
+            echo json_encode($a);
+        }
+    }
+
+    public function subactionDelete()
+    {
+        header('Content-type: text/html; charset=utf-8');
+
+        $iIntervalId = (int)bx_get('id');
+
+        if (!($aContentInfo = $this->_oDb->getContentInfoByIntervalId($iIntervalId))) {
+            echo _t('_sys_request_page_not_found_cpt');
+        }
+        elseif (CHECK_ACTION_RESULT_ALLOWED !== ($sMsg = $this->checkAllowedEdit ($aContentInfo))) {
+            echo $sMsg;
+        } 
+        elseif (!$this->_oDb->deleteIntervalById($iIntervalId)) {
+            echo _t('_sys_txt_error_occured');
+        } 
+        else {
+            echo 'ok';
+        }
+    }
+
+    /**
+     * Send reminder to event's paritcipants
+     * @param $aContentInfo content info
+     * @return number of sent reminders
+     */ 
+    protected function sendReminders($aContentInfo)
+    {
+        $CNF = $this->_oConfig->CNF;
+
+        $oConnection = BxDolConnection::getObjectInstance($CNF['OBJECT_CONNECTIONS']);
+        if (!$oConnection)
+            return false;
+
+        $oGroupProfile = BxDolProfile::getInstanceByContentAndType($aContentInfo[$CNF['FIELD_ID']], $this->getName());
+        if (!$oGroupProfile)
+            return false;
+
+        $aParticipants = $oConnection->getConnectedInitiators($oGroupProfile->id(), true);
+        if (!$aParticipants)
+            return true;
+
+        $oDateBegin = new DateTime();
+        $oDateBegin->setTimestamp($aContentInfo['start_utc']);
+        $oDateBegin->setTimezone(new DateTimeZone($aContentInfo['timezone'] ? $aContentInfo['timezone'] : 'UTC'));
+        $sEntryBegin = $oDateBegin->format('r');
+        $sEntryBeginShort = $oDateBegin->format(getParam('bx_events_short_date_format'));
+        $oDateBegin->setTimezone(new DateTimeZone('UTC'));
+        $sEntryBeginUTC = $oDateBegin->format('c');
+
+        $oMetatags = BxDolMetatags::getObjectInstance($CNF['OBJECT_METATAGS']);
+        $sLocationString = $oMetatags->locationsString($aContentInfo[$CNF['FIELD_ID']], false);
+
+        $iCounter = 0;
+        foreach ($aParticipants as $iProfileId) {
+
+            $b = sendMailTemplate($CNF['EMAIL_REMINDER'], 0, $iProfileId, array(
+                'EntryUrl' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]),
+                'EntryTitle' => $aContentInfo['title'],
+                'EntryBegin' => $sEntryBegin,
+                'EntryBeginShort' => $sEntryBeginShort,
+                'EntryBeginUTC' => $sEntryBeginUTC,
+                'EntryLocation' => $sLocationString,
+            ), BX_EMAIL_NOTIFY);
+
+            $iCounter += $b ? 1 : 0;
+        }
+        return $iCounter;
+    }
+}
+
+/** @} */

+ 205 - 0
modules/boonex/events/updates/9.0.2_9.0.3/source/classes/BxEventsSearchResult.php

@@ -0,0 +1,205 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Events Events
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxEventsSearchResult extends BxBaseModGroupsSearchResult
+{
+    function __construct($sMode = '', $aParams = false)
+    {
+        parent::__construct($sMode, $aParams); 
+
+        $this->aCurrent =  array(
+            'name' => 'bx_events',
+            'module_name' => 'bx_events',
+            'object_metatags' => 'bx_events',
+            'title' => _t('_bx_events_page_title_browse'),
+            'table' => 'sys_profiles',
+            'tableSearch' => 'bx_events_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_events', 'field' => 'type', 'operator' => '='),
+                'owner' => array('value' => '', 'field' => 'author', 'operator' => '=', 'table' => 'bx_events_data'),
+        		'featured' => array('value' => '', 'field' => 'featured', 'operator' => '<>', 'table' => 'bx_events_data'),
+            ),
+            'join' => array (
+                'profile' => array(
+                    'type' => 'INNER',
+                    'table' => 'bx_events_data',
+                    'mainField' => 'content_id',
+                    'onField' => 'id',
+                    'joinFields' => array('id', 'event_name', 'picture', 'cover', 'added', 'author', 'allow_view_to'),
+                ),
+                'account' => array(
+                    'type' => 'INNER',
+                    'table' => 'sys_accounts',
+                    'mainField' => 'account_id',
+                    'onField' => 'id',
+                    'joinFields' => array(),
+                ),
+            ),
+            'paginate' => array('perPage' => getParam('bx_events_per_page_browse'), 'start' => 0),
+            'sorting' => 'none',
+            'rss' => array(
+                'title' => '',
+                'link' => '',
+                'image' => '',
+                'profile' => 0,
+                'fields' => array (
+                    'Guid' => 'link',
+                    'Link' => 'link',
+                    'Title' => 'event_name',
+                    'DateTimeUTS' => 'added',
+                    'Desc' => 'event_name',
+                    'Picture' => 'picture',
+                ),
+            ),
+            'ident' => 'id'
+        );
+
+        $this->sFilterName = 'bx_events_data_filter';
+        $this->oModule = $this->getMain();
+        $this->aCurrent['searchFields'] = explode(',', getParam($this->oModule->_oConfig->CNF['PARAM_SEARCHABLE_FIELDS']));
+
+        $oJoinedProfile = null;
+        $bProcessConditionsForPrivateContent = true;
+
+        $CNF = &$this->oModule->_oConfig->CNF;
+
+        switch ($sMode) {
+
+            case 'joined_entries':
+                $oJoinedProfile = BxDolProfile::getInstance((int)$aParams['joined_profile']);
+                if (!$oJoinedProfile) {
+                    $this->isError = true;
+                    break;
+                }
+
+                $bProcessConditionsForPrivateContent = false;
+
+                $this->aCurrent['join']['fans'] = array(
+                    'type' => 'INNER',
+                    'table' => 'bx_events_fans',
+                    'mainField' => 'id',
+                    'onField' => 'content',
+                    'joinFields' => array('initiator'),
+                );
+
+                $this->aCurrent['restriction']['fans'] = array('value' => $oJoinedProfile->id(), 'field' => 'initiator', 'operator' => '=', 'table' => 'bx_events_fans');
+
+                $this->sBrowseUrl = 'page.php?i=' . $CNF['URI_JOINED_ENTRIES'] . '&profile_id={profile_id}';
+                $this->aCurrent['title'] = _t('_bx_events_page_title_joined_entries');
+                $this->aCurrent['rss']['link'] = 'modules/?r=events/rss/' . $sMode . '/' . $oJoinedProfile->id();
+                break;
+
+            case 'connections':
+                if ($this->_setConnectionsConditions($aParams)) {
+                    $bProcessConditionsForPrivateContent = false;
+                    $oProfile = BxDolProfile::getInstance($aParams['profile']);
+                    $oProfile2 = isset($aParams['profile2']) ? BxDolProfile::getInstance($aParams['profile2']) : null;
+
+                    if (isset($aParams['type']) && $aParams['type'] == 'common' && $oProfile && $oProfile2)
+                        $this->aCurrent['title'] = _t('_bx_events_page_title_browse_connections_mutual', $oProfile->getDisplayName(), $oProfile2->getDisplayName());
+                    elseif ((!isset($aParams['type']) || $aParams['type'] != 'common') && $oProfile)
+                        $this->aCurrent['title'] = _t('_bx_events_page_title_browse_connections', $oProfile->getDisplayName());
+
+                    $this->aCurrent['rss']['link'] = 'modules/?r=events/rss/' . $sMode . '/' . $aParams['object'] . '/' . $aParams['type'] . '/' . (int)$aParams['profile'] . '/' . (int)$aParams['profile2'] . '/' . (int)$aParams['mutual'];
+                }
+                break;
+
+            case 'favorite':
+                if(!$this->_setFavoriteConditions($sMode, $aParams, $oJoinedProfile)) {
+                    $this->isError = true;
+                    break;
+                }
+                break;
+
+            case 'recent':
+                $this->aCurrent['rss']['link'] = 'modules/?r=events/rss/' . $sMode;
+                $this->aCurrent['title'] = _t('_bx_events_page_title_browse_recent');
+                $this->aCurrent['sorting'] = 'last';
+                $this->sBrowseUrl = 'page.php?i=events-home';
+                break;
+
+            case 'featured':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME']);
+                $this->aCurrent['title'] = _t('_bx_events_page_title_browse_featured');
+                $this->aCurrent['restriction']['featured']['value'] = '0';
+                $this->aCurrent['rss']['link'] = 'modules/?r=events/rss/' . $sMode;
+                $this->aCurrent['sorting'] = 'featured';
+                break;
+
+            case 'top':
+                $this->aCurrent['rss']['link'] = 'modules/?r=events/rss/' . $sMode;
+                $this->aCurrent['title'] = _t('_bx_events_page_title_browse_top');
+                $this->aCurrent['sorting'] = 'top';
+                $this->sBrowseUrl = 'page.php?i=events-top';
+                break;
+
+            case '': // search results
+                $this->sBrowseUrl = BX_DOL_SEARCH_KEYWORD_PAGE;
+                $this->aCurrent['title'] = _t('_bx_events');
+                $this->aCurrent['paginate']['perPage'] = 5;
+                unset($this->aCurrent['rss']);
+                break;
+
+            default:
+                $this->isError = true;
+        }
+
+        if ($bProcessConditionsForPrivateContent)
+            $this->addConditionsForPrivateContent($CNF, $oJoinedProfile);
+
+        $this->sCenterContentUnitSelector = false;
+    }
+
+    protected function addConditionsForPrivateContent($CNF, $oJoinedProfile) 
+    {
+        // add conditions for private content
+        $oPrivacy = BxDolPrivacy::getObjectInstance($CNF['OBJECT_PRIVACY_VIEW']);
+        $a = $oPrivacy ? $oPrivacy->getContentPublicAsCondition($oJoinedProfile ? $oJoinedProfile->id() : 0, $oPrivacy->getPartiallyVisiblePrivacyGroups()) : array();
+        if (isset($a['restriction']))
+            $this->aCurrent['restriction'] = array_merge($this->aCurrent['restriction'], $a['restriction']);
+        if (isset($a['join']))
+            $this->aCurrent['join'] = array_merge($this->aCurrent['join'], $a['join']);
+
+        $this->setProcessPrivateContent(false);
+    }
+
+    function getAlterOrder()
+    {
+        switch ($this->aCurrent['sorting']) {
+        case 'featured':
+            return array('order' => ' ORDER BY `bx_events_data`.`featured` DESC ');
+        case 'none':
+            return array('order' => ' ORDER BY `sys_accounts`.`logged` DESC ');
+        case 'top':
+            return array('order' => ' ORDER BY `bx_events_data`.`views` DESC ');
+        case 'last':
+        default:                        
+            return array('order' => ' ORDER BY `bx_events_data`.`added` DESC ');
+        }
+    }
+
+    function _getPseud ()
+    {
+        return array(
+            'id' => 'id',
+            'event_name' => 'event_name',
+            'added' => 'added',
+            'author' => 'author',
+            'picture' => 'picture',
+        );
+    }
+}
+
+/** @} */

+ 42 - 0
modules/boonex/events/updates/9.0.2_9.0.3/source/classes/BxEventsTemplate.php

@@ -0,0 +1,42 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Events Events
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/*
+ * Groups module representation.
+ */
+class BxEventsTemplate extends BxBaseModGroupsTemplate
+{
+    function __construct(&$oConfig, &$oDb)
+    {
+        $this->MODULE = 'bx_events';
+        parent::__construct($oConfig, $oDb);
+    }
+
+    function unitVars ($aData, $isCheckPrivateContent = true, $sTemplateName = 'unit.html')
+    {
+        $aVars = parent::unitVars ($aData, $isCheckPrivateContent, $sTemplateName);
+
+        $CNF = &$this->_oConfig->CNF;
+
+        $oPrivacy = BxDolPrivacy::getObjectInstance($CNF['OBJECT_PRIVACY_VIEW']);
+
+        $isPublic = CHECK_ACTION_RESULT_ALLOWED === $this->getModule()->checkAllowedView($aData) || $oPrivacy->isPartiallyVisible($aData[$CNF['FIELD_ALLOW_VIEW_TO']]);        
+        if ($isPublic) {
+            $aContentInfo = $this->getModule()->_oDb->getContentInfoById($aData[$CNF['FIELD_ID']]);
+            $oDateStart = date_create('@' . $aContentInfo['date_start'], new DateTimeZone($aContentInfo['timezone'] ? $aContentInfo['timezone'] : 'UTC'));
+            $aVars['bx_if:info']['content']['members'] = $oDateStart->format(getParam('bx_events_short_date_format'));
+        }
+
+        return $aVars;
+    }
+}
+
+/** @} */

+ 140 - 0
modules/boonex/events/updates/9.0.2_9.0.3/source/install/config.php

@@ -0,0 +1,140 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Events Events
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_events',
+    'title' => 'Events',
+    'note' => 'Events functionality.',
+    'version' => '9.0.3',
+    'vendor' => 'BoonEx',
+	'help_url' => 'http://feed.boonex.com/?section={module_name}',
+
+    'compatible_with' => array(
+        '9.0.0-RC1'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/events/',
+    'home_uri' => 'events',
+
+    'db_prefix' => 'bx_events_',
+    'class_prefix' => 'BxEvents',
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => 'Events',
+
+    /**
+     * Connections.
+     */
+    'connections' => array(
+    	'sys_profiles_friends' => array ('type' => 'profiles'),
+		'sys_profiles_subscriptions' => array ('type' => 'profiles'),
+    ),
+
+    /**
+     * Menu triggers.
+     */
+    'menu_triggers' => array(
+    	'trigger_profile_view_submenu',
+    	'trigger_group_view_submenu',
+        'trigger_group_view_actions',
+    ),
+
+    /**
+     * Page triggers.
+     */
+    'page_triggers' => array (
+    	'trigger_page_group_view_entry', 
+    ),
+
+    /**
+     * Storages.
+     */
+    'storages' => array(
+    	'bx_events_pics'
+    ),
+
+	/**
+     * Transcoders.
+     */
+    'transcoders' => array(
+    	'bx_events_icon', 
+    	'bx_events_thumb', 
+    	'bx_events_avatar', 
+    	'bx_events_picture', 
+    	'bx_events_cover', 
+    	'bx_events_cover_thumb',
+    	'bx_events_gallery'
+    ),
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+        'execute_sql' => 1,
+        'update_languages' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'uninstall' => array (
+    	'process_storages' => 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,
+    	'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',
+    ),
+);
+
+/** @} */

+ 404 - 0
modules/boonex/events/updates/9.0.2_9.0.3/source/install/langs/en.xml

@@ -0,0 +1,404 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+
+	<string name="_bx_events"><![CDATA[Events]]></string>
+	<string name="_bx_events_cmts"><![CDATA[Events' Comments]]></string>
+
+	<string name="_bx_events_option_num_connections_quick"><![CDATA[Number of items in friends block]]></string>
+    <string name="_bx_events_option_per_page_browse"><![CDATA[Number of items per page]]></string>
+	<string name="_bx_events_option_num_rss"><![CDATA[Number of items in RSS feed]]></string>
+    <string name="_bx_events_option_time_format"><![CDATA[Time format]]></string>
+    <string name="_bx_events_option_short_date_format"><![CDATA[Short date format]]></string>
+    <string name="_bx_events_option_searchable_fields"><![CDATA[Searchable fields]]></string>
+
+	<string name="_bx_events_form_profile"><![CDATA[Events]]></string>
+	<string name="_bx_events_form_profile_display_add"><![CDATA[Add Event]]></string>
+	<string name="_bx_events_form_profile_display_edit"><![CDATA[Edit Event]]></string>
+	<string name="_bx_events_form_profile_display_edit_cover"><![CDATA[Edit Cover]]></string>
+	<string name="_bx_events_form_profile_display_delete"><![CDATA[Delete Event]]></string>
+	<string name="_bx_events_form_profile_display_view"><![CDATA[View Event]]></string>
+    <string name="_bx_events_form_profile_display_view_full"><![CDATA[Full View Event]]></string>
+    <string name="_bx_events_form_profile_display_invite"><![CDATA[Invite to Event]]></string>
+    <string name="_bx_events_form_profile_input_author"><![CDATA[Author]]></string>
+	<string name="_bx_events_form_profile_input_sys_do_submit"><![CDATA[Submit]]></string>
+    <string name="_bx_events_form_profile_input_sys_join_confirm"><![CDATA[Join confirmation]]></string>
+    <string name="_bx_events_form_profile_input_join_confirm"><![CDATA[Join confirmation]]></string>
+    <string name="_bx_events_form_profile_input_sys_allow_view_to"><![CDATA[Privacy]]></string>
+    <string name="_bx_events_form_profile_input_allow_view_to"><![CDATA[Privacy]]></string>
+    <string name="_bx_events_form_profile_input_allow_view_to_desc"><![CDATA[Closed - anyone can find the event and see who's in it, only members can see posts. Secret - only members can find the event and see posts.]]></string>
+    <string name="_bx_events_form_profile_input_sys_initial_members"><![CDATA[Invite Members]]></string>
+    <string name="_bx_events_form_profile_input_initial_members"><![CDATA[Invite Members]]></string>
+    <string name="_bx_events_form_profile_input_sys_event_name"><![CDATA[Event Name]]></string>
+    <string name="_bx_events_form_profile_input_event_name"><![CDATA[Event Name]]></string>
+    <string name="_bx_events_form_profile_input_event_name_err"><![CDATA[This information is essential. Please, fill in this field.]]></string>
+    <string name="_bx_events_form_profile_input_sys_event_desc"><![CDATA[Description]]></string>
+    <string name="_bx_events_form_profile_input_event_desc"><![CDATA[Description]]></string>
+    <string name="_bx_events_form_profile_input_sys_event_cat"><![CDATA[Category]]></string>
+	<string name="_bx_events_form_profile_input_event_cat"><![CDATA[Category]]></string>
+    <string name="_bx_events_form_profile_input_event_cat_err"><![CDATA[Category field is mandatory]]></string>
+	<string name="_bx_events_form_profile_input_sys_picture"><![CDATA[Event Picture]]></string>
+	<string name="_bx_events_form_profile_input_picture"><![CDATA[Upload New Event Picture]]></string>
+	<string name="_bx_events_form_profile_input_picture_err"><![CDATA[Event picture is mandatory.]]></string>
+	<string name="_bx_events_form_profile_input_sys_cover"><![CDATA[Cover Picture]]></string>
+	<string name="_bx_events_form_profile_input_cover"><![CDATA[Upload New Cover Picture]]></string>
+	<string name="_bx_events_form_profile_input_sys_delete_confirm"><![CDATA[Delete confirmation]]></string>
+	<string name="_bx_events_form_profile_input_delete_confirm"><![CDATA[I am sure I want to delete this event]]></string>
+	<string name="_bx_events_form_profile_input_delete_confirm_info"><![CDATA[This action can not be undone.]]></string>
+	<string name="_bx_events_form_profile_input_delete_confirm_error"><![CDATA[Please check this checkbox if you really want to delete event.]]></string>
+    <string name="_bx_events_form_profile_input_sys_reoccurring"><![CDATA[Reoccurring]]></string>
+    <string name="_bx_events_form_profile_input_reoccurring"><![CDATA[Reoccurring]]></string>
+    <string name="_bx_events_form_profile_input_reoccurring_add_interval"><![CDATA[Add repeating interval]]></string>
+    <string name="_bx_events_form_profile_input_sys_date_start"><![CDATA[Date start]]></string>
+    <string name="_bx_events_form_profile_input_date_start"><![CDATA[Date start]]></string>
+    <string name="_bx_events_form_profile_input_date_start_err"><![CDATA[Start date is mandatory]]></string>
+    <string name="_bx_events_form_profile_input_sys_date_end"><![CDATA[Date end]]></string>
+    <string name="_bx_events_form_profile_input_date_end"><![CDATA[Date end]]></string>    
+    <string name="_bx_events_form_profile_input_date_end_err"><![CDATA[End date is mandatory]]></string>
+    <string name="_bx_events_form_profile_input_sys_timezone"><![CDATA[Timezone]]></string>
+    <string name="_bx_events_form_profile_input_timezone"><![CDATA[Timezone]]></string>
+    <string name="_bx_events_form_profile_input_sys_time"><![CDATA[Time]]></string>
+    <string name="_bx_events_form_profile_input_time"><![CDATA[Time]]></string>
+    <string name="_bx_events_form_profile_input_sys_reminder"><![CDATA[Reminder]]></string>
+    <string name="_bx_events_form_profile_input_reminder"><![CDATA[Reminder]]></string>
+
+    <string name="_bx_events_form_input_repeat_year"><![CDATA[Repeat year]]></string>
+    <string name="_bx_events_form_input_repeat_month"><![CDATA[Repeat month]]></string>
+    <string name="_bx_events_form_input_repeat_week_of_month"><![CDATA[Repeat week of month]]></string>
+    <string name="_bx_events_form_input_repeat_day_of_month"><![CDATA[Repeat day of month]]></string>
+    <string name="_bx_events_form_input_repeat_day_of_week"><![CDATA[Repeat day of week]]></string>
+    <string name="_bx_events_form_input_stop_repeating"><![CDATA[Stop repeating]]></string>
+
+	<string name="_bx_events_acl_action_create_profile"><![CDATA[Create Event]]></string>
+	<string name="_bx_events_acl_action_delete_profile"><![CDATA[Delete Event]]></string>
+	<string name="_bx_events_acl_action_view_profile"><![CDATA[View Event]]></string>
+	<string name="_bx_events_acl_action_edit_any_profile"><![CDATA[Edit Any Event]]></string>
+
+	<string name="_bx_events_page_title_sys_joined_entries"><![CDATA[Joined Events]]></string>
+	<string name="_bx_events_page_title_joined_entries"><![CDATA[Joined Events]]></string>
+	<string name="_bx_events_page_title_sys_create_profile"><![CDATA[Create Event]]></string>
+	<string name="_bx_events_page_title_create_profile"><![CDATA[Create Event]]></string>
+	<string name="_bx_events_page_title_sys_edit_profile"><![CDATA[Edit Event]]></string>
+	<string name="_bx_events_page_title_edit_profile"><![CDATA[Edit Event]]></string>
+	<string name="_bx_events_page_title_sys_edit_profile_cover"><![CDATA[Edit Event Cover]]></string>
+	<string name="_bx_events_page_title_edit_profile_cover"><![CDATA[Edit Cover]]></string>
+	<string name="_bx_events_page_title_sys_delete_profile"><![CDATA[Delete Event]]></string>
+	<string name="_bx_events_page_title_delete_profile"><![CDATA[Delete Event]]></string>
+	<string name="_bx_events_page_title_sys_view_profile_closed"><![CDATA[View Closed Event]]></string>
+	<string name="_bx_events_page_title_sys_view_profile"><![CDATA[View Event]]></string>
+	<string name="_bx_events_page_title_view_profile"><![CDATA[{display_name}]]></string>
+	<string name="_bx_events_page_title_browse"><![CDATA[Events]]></string>
+	<string name="_bx_events_page_title_browse_by_author"><![CDATA[Events of {display_name}]]></string>
+	<string name="_bx_events_page_title_browse_featured"><![CDATA[Featured]]></string>
+	<string name="_bx_events_page_title_browse_top"><![CDATA[Top Events]]></string>
+	<string name="_bx_events_page_title_browse_recent"><![CDATA[New Events]]></string>
+	<string name="_bx_events_page_title_browse_connections"><![CDATA[{0} connections]]></string>
+	<string name="_bx_events_page_title_browse_connections_mutual"><![CDATA[{0} and {1} mutual connections]]></string>
+	<string name="_bx_events_page_title_sys_profile_friends"><![CDATA[Friends]]></string>
+	<string name="_bx_events_page_title_profile_friends"><![CDATA[Friends]]></string>
+	<string name="_bx_events_page_title_sys_group_fans"><![CDATA[Members]]></string>
+	<string name="_bx_events_page_title_group_fans"><![CDATA[Members]]></string>
+	<string name="_bx_events_page_title_sys_profile_comments"><![CDATA[Comments]]></string>
+    <string name="_bx_events_page_title_profile_comments"><![CDATA[Comments]]></string>
+	<string name="_bx_events_page_title_sys_profile_info"><![CDATA[Event Info]]></string>
+	<string name="_bx_events_page_title_profile_info"><![CDATA[Info about {display_name}]]></string>
+	<string name="_bx_events_page_title_sys_recent"><![CDATA[New Events]]></string>
+	<string name="_bx_events_page_title_recent"><![CDATA[New Events]]></string>
+	<string name="_bx_events_page_title_sys_manage"><![CDATA[Manage Own Events]]></string>
+	<string name="_bx_events_page_title_sys_manage_administration"><![CDATA[Manage All Events]]></string>
+	<string name="_bx_events_page_title_manage"><![CDATA[Manage Events]]></string>
+	<string name="_bx_events_page_title_sys_top"><![CDATA[Top Events]]></string>
+    <string name="_bx_events_page_title_top"><![CDATA[Top Events]]></string>
+	<string name="_bx_events_page_title_sys_calendar"><![CDATA[Events Calendar]]></string>
+    <string name="_bx_events_page_title_calendar"><![CDATA[Events Calendar]]></string>
+    <string name="_bx_events_page_title_sys_invite_to_group"><![CDATA[Invite Members to the Event]]></string>
+	<string name="_bx_events_page_title_invite_to_group"><![CDATA[Invite Members to the Event]]></string>
+	<string name="_bx_events_page_title_sys_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_events_page_title_entries_search"><![CDATA[Search]]></string>
+
+	<string name="_bx_events_page_block_title_favorites_of_author"><![CDATA[Favorite Events]]></string>
+    <string name="_bx_events_page_block_title_sys_favorites_of_author"><![CDATA[Favorite Events]]></string>
+	<string name="_bx_events_page_block_title_sys_joined_entries"><![CDATA[Joined Events]]></string>
+	<string name="_bx_events_page_block_title_joined_entries"><![CDATA[Joined Events]]></string>
+	<string name="_bx_events_page_block_title_create_profile"><![CDATA[Create Event]]></string>
+	<string name="_bx_events_page_block_title_edit_profile"><![CDATA[Edit Event]]></string>
+	<string name="_bx_events_page_block_title_edit_profile_cover"><![CDATA[Edit Cover]]></string>
+	<string name="_bx_events_page_block_title_delete_profile"><![CDATA[Delete Event]]></string>
+	<string name="_bx_events_page_block_title_profile_info_link"><![CDATA[About <a href="{profile_link}">{display_name}</a>]]></string>
+	<string name="_bx_events_page_block_title_profile_info"><![CDATA[Info]]></string>
+	<string name="_bx_events_page_block_title_system_profile_info"><![CDATA[Info]]></string>
+	<string name="_bx_events_page_block_title_profile_description"><![CDATA[Description]]></string>
+	<string name="_bx_events_page_block_title_profile_friends_link"><![CDATA[Friends of <a href="{profile_link}">{display_name}</a>]]></string>
+	<string name="_bx_events_page_block_title_profile_friends"><![CDATA[Friends]]></string>
+	<string name="_bx_events_page_block_title_system_profile_friends"><![CDATA[Friends]]></string>
+	<string name="_bx_events_page_block_title_admins"><![CDATA[Administrators]]></string>
+	<string name="_bx_events_page_block_title_fans_link"><![CDATA[Members of <a href="{profile_link}">{display_name}</a>]]></string>
+    <string name="_bx_events_page_block_title_fans"><![CDATA[Members]]></string>
+	<string name="_bx_events_page_block_title_system_fans"><![CDATA[Members]]></string>
+	<string name="_bx_events_page_block_title_profile_comments"><![CDATA[Comments]]></string>
+    <string name="_bx_events_page_block_title_profile_comments_link"><![CDATA[Comments to <a href="{entry_link}">{title}</a>]]></string>
+	<string name="_bx_events_page_block_title_profile_actions"><![CDATA[Actions]]></string>
+	<string name="_bx_events_page_block_title_featured_profiles"><![CDATA[Featured Events]]></string>
+	<string name="_bx_events_page_block_title_latest_profiles"><![CDATA[New Events]]></string>
+	<string name="_bx_events_page_block_title_system_manage"><![CDATA[Manage Own Events]]></string>
+	<string name="_bx_events_page_block_title_system_manage_administration"><![CDATA[Manage All Events]]></string>
+	<string name="_bx_events_page_block_title_manage"><![CDATA[Manage Events]]></string>
+    <string name="_bx_events_page_block_title_top_profiles"><![CDATA[Top Events]]></string>
+    <string name="_bx_events_page_block_title_entry_social_sharing"><![CDATA[Share]]></string>
+    <string name="_bx_events_page_block_title_categories"><![CDATA[Event categories]]></string>
+    <string name="_bx_events_page_block_title_calendar"><![CDATA[Events calendar]]></string>
+    <string name="_bx_events_page_block_title_profile_calendar"><![CDATA[Calendar]]></string>
+    <string name="_bx_events_page_block_title_entry_location"><![CDATA[Location]]></string>
+    <string name="_bx_events_page_block_title_invite_to_group"><![CDATA[Invite Members to the Event]]></string>
+    <string name="_bx_events_page_block_title_search_form"><![CDATA[Search Form]]></string>
+    <string name="_bx_events_page_block_title_search_results"><![CDATA[Search Results]]></string>
+    <string name="_bx_events_page_block_title_search_form_cmts"><![CDATA[Comments Search Form]]></string>
+    <string name="_bx_events_page_block_title_search_results_cmts"><![CDATA[Comments Search Results]]></string>
+    
+    <string name="_bx_events_menu_title_submenu"><![CDATA[Events Submenu]]></string>
+    <string name="_bx_events_menu_set_title_submenu"><![CDATA[Events Submenu]]></string>
+    <string name="_bx_events_menu_set_title_view_profile_actions"><![CDATA[Event Actions]]></string>
+    <string name="_bx_events_menu_title_view_profile_actions"><![CDATA[Event Actions]]></string>
+    <string name="_bx_events_menu_set_title_view_profile_actions_more"><![CDATA[Event More Actions]]></string>
+    <string name="_bx_events_menu_title_view_profile_actions_more"><![CDATA[Event More Actions]]></string>
+    <string name="_bx_events_menu_set_title_view_profile_submenu"><![CDATA[View Event Submenu]]></string>
+    <string name="_bx_events_menu_title_view_profile_submenu"><![CDATA[View Event Submenu]]></string>
+    <string name="_bx_events_menu_title_view_profile_submenu_cover"><![CDATA[Event Cover Submenu]]></string>
+	<string name="_bx_events_menu_set_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string>
+    <string name="_bx_events_menu_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string>
+    <string name="_bx_events_menu_item_title_system_delete"><![CDATA[Delete]]></string>
+    <string name="_bx_events_menu_item_title_delete"><![CDATA[Delete]]></string>
+    <string name="_bx_events_menu_item_title_system_delete_with_content"><![CDATA[Delete With Content]]></string>
+    <string name="_bx_events_menu_item_title_delete_with_content"><![CDATA[Delete With Content]]></string>
+    <string name="_bx_events_menu_item_title_system_edit_cover"><![CDATA[Edit Cover]]></string>
+    <string name="_bx_events_menu_item_title_edit_cover"><![CDATA[Edit Cover]]></string>
+    <string name="_bx_events_menu_item_title_system_edit_profile"><![CDATA[Edit Event]]></string>
+    <string name="_bx_events_menu_item_title_edit_profile"><![CDATA[Edit Event]]></string>
+    <string name="_bx_events_menu_item_title_system_delete_profile"><![CDATA[Delete Event]]></string>
+    <string name="_bx_events_menu_item_title_delete_profile"><![CDATA[Delete Event]]></string>
+    <string name="_bx_events_menu_item_title_system_delete_account"><![CDATA[Delete Account]]></string>
+    <string name="_bx_events_menu_item_title_delete_account"><![CDATA[Delete Account]]></string>
+    <string name="_bx_events_menu_item_title_system_profile_type"><![CDATA[Event]]></string>
+    <string name="_bx_events_menu_item_title_profile_type"><![CDATA[Event]]></string>
+    <string name="_bx_events_menu_item_title_system_create_profile"><![CDATA[New Event]]></string>
+    <string name="_bx_events_menu_item_title_create_profile"><![CDATA[New Event]]></string>
+    <string name="_bx_events_menu_item_title_system_view_profile_friends"><![CDATA[Friends]]></string>
+    <string name="_bx_events_menu_item_title_view_profile_friends"><![CDATA[Friends]]></string>
+    <string name="_bx_events_menu_item_title_system_view_joined_groups"><![CDATA[Events]]></string>
+    <string name="_bx_events_menu_item_title_view_joined_groups"><![CDATA[Events]]></string>
+    <string name="_bx_events_menu_item_title_system_view_fans"><![CDATA[Members]]></string>
+    <string name="_bx_events_menu_item_title_view_fans"><![CDATA[Members]]></string>
+    <string name="_bx_events_menu_item_title_system_view_profile_comments"><![CDATA[Comments]]></string>
+    <string name="_bx_events_menu_item_title_view_profile_comments"><![CDATA[Comments]]></string>
+    <string name="_bx_events_menu_item_title_system_view_profile_info"><![CDATA[Info]]></string>
+    <string name="_bx_events_menu_item_title_view_profile_info"><![CDATA[Info]]></string>
+    <string name="_bx_events_menu_item_title_system_view_profile_view"><![CDATA[Event]]></string>
+    <string name="_bx_events_menu_item_title_view_profile_view"><![CDATA[Event]]></string>
+    <string name="_bx_events_menu_item_title_system_invite"><![CDATA[Invite]]></string>
+    <string name="_bx_events_menu_item_title_invite"><![CDATA[Invite]]></string>
+
+    <string name="_bx_events_menu_item_title_system_befriend"><![CDATA[Add friend]]></string>
+    <string name="_bx_events_menu_item_title_befriend"><![CDATA[Add friend]]></string>
+    <string name="_bx_events_menu_item_title_befriend_sent"><![CDATA[Add friend (requested)]]></string>
+    <string name="_bx_events_menu_item_title_befriend_confirm"><![CDATA[Accept friend request]]></string>
+    <string name="_bx_events_menu_item_title_system_unfriend"><![CDATA[Unfriend]]></string>
+    <string name="_bx_events_menu_item_title_unfriend"><![CDATA[Unfriend]]></string>
+    <string name="_bx_events_menu_item_title_unfriend_cancel_request"><![CDATA[Cancel friend request]]></string>
+    <string name="_bx_events_menu_item_title_unfriend_reject_request"><![CDATA[Reject friend request]]></string>
+
+    <string name="_bx_events_menu_item_title_system_become_fan"><![CDATA[Join Event]]></string>
+    <string name="_bx_events_menu_item_title_become_fan"><![CDATA[Join Event]]></string>
+    <string name="_bx_events_menu_item_title_become_fan_sent"><![CDATA[Join Event (requested)]]></string>
+    <string name="_bx_events_menu_item_title_become_fan_confirm"><![CDATA[Accept Request]]></string>
+    <string name="_bx_events_menu_item_title_system_leave_group"><![CDATA[Leave Event]]></string>
+    <string name="_bx_events_menu_item_title_leave_group"><![CDATA[Leave Event]]></string>
+    <string name="_bx_events_menu_item_title_leave_group_cancel_request"><![CDATA[Cancel Request]]></string>
+    <string name="_bx_events_menu_item_title_leave_group_reject_request"><![CDATA[Reject Request]]></string>
+
+    <string name="_bx_events_menu_item_title_system_subscribe"><![CDATA[Follow]]></string>
+    <string name="_bx_events_menu_item_title_subscribe"><![CDATA[Follow]]></string>
+    <string name="_bx_events_menu_item_title_system_unsubscribe"><![CDATA[Unfollow]]></string>
+    <string name="_bx_events_menu_item_title_unsubscribe"><![CDATA[Unfollow]]></string>
+    <string name="_bx_events_menu_item_title_system_more_actions"><![CDATA[More Actions]]></string>
+    <string name="_bx_events_menu_item_title_more_actions"><![CDATA[]]></string>
+    <string name="_bx_events_menu_item_title_system_friends"><![CDATA[Friends]]></string>
+    <string name="_bx_events_menu_item_title_friends"><![CDATA[Friends]]></string>
+    <string name="_bx_events_menu_item_title_system_friend_requests"><![CDATA[Friend requests number]]></string>
+    <string name="_bx_events_menu_item_title_friend_requests"><![CDATA[{addon} friend requests]]></string>
+    <string name="_bx_events_menu_item_title_system_manage_my_groups"><![CDATA[My events]]></string>
+    <string name="_bx_events_menu_item_title_manage_my_groups"><![CDATA[{addon} events]]></string>
+    <string name="_bx_events_menu_item_title_system_entries_recent"><![CDATA[New]]></string>
+    <string name="_bx_events_menu_item_title_entries_recent"><![CDATA[New]]></string>
+    <string name="_bx_events_menu_item_title_system_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_events_menu_item_title_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_events_menu_item_title_system_entries_manage"><![CDATA[Manage]]></string>
+    <string name="_bx_events_menu_item_title_entries_manage"><![CDATA[Manage]]></string>
+    <string name="_bx_events_menu_item_title_system_entries_home"><![CDATA[Events]]></string>
+    <string name="_bx_events_menu_item_title_entries_home"><![CDATA[Events]]></string>
+    <string name="_bx_events_menu_item_title_system_admt_groups"><![CDATA[Events]]></string>
+	<string name="_bx_events_menu_item_title_admt_groups"><![CDATA[Events - {addon} unapproved]]></string>
+	<string name="_bx_events_menu_item_title_manage_my"><![CDATA[My Events]]></string>
+	<string name="_bx_events_menu_item_title_manage_all"><![CDATA[All Events]]></string>
+	<string name="_bx_events_menu_item_title_system_entries_top"><![CDATA[Top]]></string>
+	<string name="_bx_events_menu_item_title_entries_top"><![CDATA[Top]]></string>
+	<string name="_bx_events_menu_item_title_system_calendar"><![CDATA[Calendar]]></string>
+    <string name="_bx_events_menu_item_title_calendar"><![CDATA[Calendar]]></string>
+    
+	<string name="_bx_events_grid_filter_item_title_adm_select_one_filter1"><![CDATA[All Statuses]]></string>
+	<string name="_bx_events_grid_filter_item_title_adm_active"><![CDATA[Active]]></string>
+	<string name="_bx_events_grid_filter_item_title_adm_pending"><![CDATA[Pending]]></string>
+	<string name="_bx_events_grid_filter_item_title_adm_suspended"><![CDATA[Suspended]]></string>
+	<string name="_bx_events_grid_column_title_adm_active"><![CDATA[Active]]></string>
+    <string name="_bx_events_grid_column_title_adm_name"><![CDATA[Name]]></string>
+    <string name="_bx_events_grid_column_title_adm_added"><![CDATA[Created]]></string>
+    <string name="_bx_events_grid_column_title_adm_account"><![CDATA[Account]]></string>
+    <string name="_bx_events_grid_action_title_adm_delete"><![CDATA[Delete]]></string>
+    <string name="_bx_events_grid_action_title_adm_delete_with_content"><![CDATA[Delete With Content]]></string>
+    <string name="_bx_events_grid_action_title_adm_more_actions"><![CDATA[More Actions]]></string>
+	<string name="_bx_events_grid_action_err_delete"><![CDATA[Cannot delete the selected event(s).]]></string>
+	<string name="_bx_events_grid_txt_account_manager"><![CDATA[Redirect to manage account.]]></string>
+
+    <string name="_bx_events_chart_growth"><![CDATA[Events: Growth]]></string>
+    <string name="_bx_events_chart_growth_speed"><![CDATA[Events: Growth Speed]]></string>
+
+    <string name="_bx_events_search_extended"><![CDATA[Events Search]]></string>
+    <string name="_bx_events_search_extended_cmts"><![CDATA[Events Comments Search]]></string>
+
+    <string name="_bx_events_txt_account_pending"><![CDATA[This event is pending approval, please wait until it is activated.]]></string>
+    <string name="_bx_events_txt_account_suspended"><![CDATA[This event is suspended.]]></string>
+    <string name="_bx_events_txt_N_fans"><![CDATA[{0} members]]></string>
+    <string name="_bx_events_txt_sample_single"><![CDATA[event]]></string>
+    <string name="_bx_events_txt_sample_single_with_article"><![CDATA[an event]]></string>
+    <string name="_bx_events_txt_sample_comment_single"><![CDATA[event's comment]]></string>
+    <string name="_bx_events_txt_sample_vote_single"><![CDATA[event's vote]]></string>
+    <string name="_bx_events_txt_to_admins"><![CDATA[To Admins]]></string>
+    <string name="_bx_events_txt_from_admins"><![CDATA[From Admins]]></string>
+    <string name="_bx_events_txt_private_group"><![CDATA[Private event]]></string>
+    <string name="_bx_events_txt_from_time_to_time"><![CDATA[{0} - {1}]]></string>
+
+	<string name="_bx_events_alert_action_fan_added"><![CDATA[member joined]]></string>
+    <string name="_bx_events_txt_ntfs_fan_added"><![CDATA[<a class="bx-ntfs-content-profile" href="{owner_link}">{owner_name}</a> event has got new member - <a href="{subentry_url}">{subentry_sample}</a>]]></string>
+    <string name="_bx_events_alert_action_join_request"><![CDATA[join request]]></string>
+    <string name="_bx_events_txt_ntfs_join_request"><![CDATA[<a class="bx-ntfs-content-profile" href="{owner_link}">{owner_name}</a> event has new request from <a href="{subentry_url}">{subentry_sample}</a>]]></string>
+    <string name="_bx_events_txt_ntfs_timeline_post_common"><![CDATA[New post in <a class="bx-ntfs-content-profile" href="{owner_link}">{owner_name}</a> event timeline  from <a href="{subentry_url}">{subentry_sample}</a>]]></string>
+
+    <string name="_bx_events_privacy_group_closed"><![CDATA[Closed]]></string>
+    <string name="_bx_events_privacy_group_secret"><![CDATA[Secret]]></string>
+
+    <string name="_bx_events_pre_lists_reminder"><![CDATA[Event reminder]]></string>
+    <string name="_bx_events_reminder_none"><![CDATA[Reminder is off]]></string>
+    <string name="_bx_events_reminder_1h"><![CDATA[1 hour]]></string>
+    <string name="_bx_events_reminder_2h"><![CDATA[2 hours]]></string>
+    <string name="_bx_events_reminder_3h"><![CDATA[3 hours]]></string>
+    <string name="_bx_events_reminder_6h"><![CDATA[6 hours]]></string>
+    <string name="_bx_events_reminder_12h"><![CDATA[12 hours]]></string>
+    <string name="_bx_events_reminder_24h"><![CDATA[24 hours]]></string>
+
+    <string name="_bx_events_pre_lists_cats"><![CDATA[Event categories]]></string>
+    <string name="_bx_events_cat_Conference"><![CDATA[Conference]]></string>
+    <string name="_bx_events_cat_Festival"><![CDATA[Festival]]></string>
+    <string name="_bx_events_cat_Fundraiser"><![CDATA[Fundraiser]]></string>
+    <string name="_bx_events_cat_Lecture"><![CDATA[Lecture]]></string>
+    <string name="_bx_events_cat_Market"><![CDATA[Market]]></string>
+    <string name="_bx_events_cat_Meal"><![CDATA[Meal]]></string>
+    <string name="_bx_events_cat_Social_Mixer"><![CDATA[Social Mixer]]></string>
+    <string name="_bx_events_cat_Tour"><![CDATA[Tour]]></string>
+    <string name="_bx_events_cat_Volunteering"><![CDATA[Volunteering]]></string>
+    <string name="_bx_events_cat_Workshop"><![CDATA[Workshop]]></string>
+    <string name="_bx_events_cat_Other"><![CDATA[Other]]></string>
+
+    <string name="_bx_events_pre_lists_repeat_year"><![CDATA[Repeat year]]></string>
+    <string name="_bx_events_cat_repeat_year_every_year"><![CDATA[Every year]]></string>
+    <string name="_bx_events_cat_repeat_year_every_2_years"><![CDATA[Every 2 years]]></string>
+    <string name="_bx_events_cat_repeat_year_every_3_years"><![CDATA[Every 3 years]]></string>
+    <string name="_bx_events_cat_repeat_year_every_4_years"><![CDATA[Every 4 years]]></string>
+
+    <string name="_bx_events_pre_lists_repeat_month"><![CDATA[Repeat month]]></string>
+    <string name="_bx_events_cat_repeat_month_every_month"><![CDATA[Every month]]></string>
+    <string name="_bx_events_cat_repeat_month_jan"><![CDATA[Every January]]></string>
+    <string name="_bx_events_cat_repeat_month_feb"><![CDATA[Every February]]></string>
+    <string name="_bx_events_cat_repeat_month_mar"><![CDATA[Every March]]></string>
+    <string name="_bx_events_cat_repeat_month_apr"><![CDATA[Every April]]></string>
+    <string name="_bx_events_cat_repeat_month_may"><![CDATA[Every May]]></string>
+    <string name="_bx_events_cat_repeat_month_jun"><![CDATA[Every June]]></string>
+    <string name="_bx_events_cat_repeat_month_jul"><![CDATA[Every July]]></string>
+    <string name="_bx_events_cat_repeat_month_aug"><![CDATA[Every August]]></string>
+    <string name="_bx_events_cat_repeat_month_sep"><![CDATA[Every September]]></string>
+    <string name="_bx_events_cat_repeat_month_oct"><![CDATA[Every October]]></string>
+    <string name="_bx_events_cat_repeat_month_nov"><![CDATA[Every November]]></string>
+    <string name="_bx_events_cat_repeat_month_dec"><![CDATA[Every December]]></string>
+
+    <string name="_bx_events_pre_lists_repeat_week_of_month"><![CDATA[Repeat week of the month]]></string>
+    <string name="_bx_events_cat_repeat_week_of_month_every_week"><![CDATA[Every week]]></string>
+    <string name="_bx_events_cat_repeat_week_of_month_first_week_of_month"><![CDATA[Every 1st week of the month]]></string>
+    <string name="_bx_events_cat_repeat_week_of_month_second_week_of_month"><![CDATA[Every 2nd week of the month]]></string>
+    <string name="_bx_events_cat_repeat_week_of_month_third_week_of_month"><![CDATA[Every 3rd week of the month]]></string>
+    <string name="_bx_events_cat_repeat_week_of_month_fourth_week_of_month"><![CDATA[Every 4th week of the month]]></string>
+    <string name="_bx_events_cat_repeat_week_of_month_fifth_week_of_month"><![CDATA[Every 5th week of the month]]></string>
+    <string name="_bx_events_cat_repeat_week_of_month_sixth_week_of_month"><![CDATA[Every 6th week of the month]]></string>
+
+    <string name="_bx_events_pre_lists_repeat_day_of_month"><![CDATA[Repeat day of the month]]></string>
+    <string name="_bx_events_cat_repeat_day_of_month_every_day"><![CDATA[Every day]]></string>
+
+    <string name="_bx_events_pre_lists_repeat_day_of_week"><![CDATA[Repeat day of the week]]></string>
+    <string name="_bx_events_cat_repeat_day_of_week_every_day"><![CDATA[Every day of the week]]></string>
+    <string name="_bx_events_cat_repeat_day_of_week_mon"><![CDATA[Every Monday]]></string>
+    <string name="_bx_events_cat_repeat_day_of_week_tue"><![CDATA[Every Tuesday]]></string>
+    <string name="_bx_events_cat_repeat_day_of_week_wed"><![CDATA[Every Wednesday]]></string>
+    <string name="_bx_events_cat_repeat_day_of_week_thu"><![CDATA[Every Thursday]]></string>
+    <string name="_bx_events_cat_repeat_day_of_week_fri"><![CDATA[Every Friday]]></string>
+    <string name="_bx_events_cat_repeat_day_of_week_sat"><![CDATA[Every Saturday]]></string>
+    <string name="_bx_events_cat_repeat_day_of_week_sun"><![CDATA[Every Sunday]]></string>
+
+    <string name="_bx_events_email_join_request"><![CDATA[Event join request]]></string>
+    <string name="_bx_events_email_join_request_subject"><![CDATA[Request to join your event]]></string>
+    <string name="_bx_events_email_join_request_body"><![CDATA[{email_header}
+<p>New request to join <a href="{EntryUrl}">{EntryTitle}</a> event from <a href="{NewMemberUrl}">{NewMemberDisplayName}</a></p>
+{email_footer}]]></string>
+
+    <string name="_bx_events_email_join_reject"><![CDATA[Event join request was rejected]]></string>
+    <string name="_bx_events_email_join_reject_subject"><![CDATA[Request to join an event was rejected]]></string>
+    <string name="_bx_events_email_join_reject_body"><![CDATA[{email_header}
+<p>Your request to join <a href="{EntryUrl}">{EntryTitle}</a> event was rejected by event admin.</p>
+{email_footer}]]></string>
+
+    <string name="_bx_events_email_join_confirm"><![CDATA[Event join request was confirmed]]></string>
+    <string name="_bx_events_email_join_confirm_subject"><![CDATA[Your request to join an event was confirmed]]></string>
+    <string name="_bx_events_email_join_confirm_body"><![CDATA[{email_header}
+<p>Your request to join <a href="{EntryUrl}">{EntryTitle}</a> event was confirmed by the event admin.</p>
+{email_footer}]]></string>
+
+    <string name="_bx_events_email_fan_remove"><![CDATA[Profile was removed from event participants]]></string>
+    <string name="_bx_events_email_fan_remove_subject"><![CDATA[Your profile was removed from the event]]></string>
+    <string name="_bx_events_email_fan_remove_body"><![CDATA[{email_header}
+<p>Your profile was removed from <a href="{EntryUrl}">{EntryTitle}</a> event by the event admin.</p>
+{email_footer}]]></string>
+
+    <string name="_bx_events_email_fan_become_admin"><![CDATA[Event admin status was granted]]></string>
+    <string name="_bx_events_email_fan_become_admin_subject"><![CDATA[You are an event admin now]]></string>
+    <string name="_bx_events_email_fan_become_admin_body"><![CDATA[{email_header}
+<p>You are an admin of <a href="{EntryUrl}">{EntryTitle}</a> event now.</p>
+{email_footer}]]></string>
+
+    <string name="_bx_events_email_admin_become_fan"><![CDATA[Event admin status was revoked]]></string>
+    <string name="_bx_events_email_admin_become_fan_subject"><![CDATA[Your event admin status was revoked]]></string>
+    <string name="_bx_events_email_admin_become_fan_body"><![CDATA[{email_header}
+<p>Your admin status was revoked from <a href="{EntryUrl}">{EntryTitle}</a> event.</p>
+{email_footer}]]></string>
+
+    <string name="_bx_events_email_invitation"><![CDATA[Invitation to event]]></string>
+    <string name="_bx_events_email_invitation_subject"><![CDATA[Invitation to "{EntryTitle}" event]]></string>
+    <string name="_bx_events_email_invitation_body"><![CDATA[{email_header}
+<p><a href="{InviterUrl}">{InviterDisplayName}</a> invited you to <a href="{EntryUrl}">{EntryTitle} event</a>.</p>
+{email_footer}]]></string>
+
+    <string name="_bx_events_email_reminder"><![CDATA[Reminder for the event]]></string>
+    <string name="_bx_events_email_reminder_subject"><![CDATA["{EntryTitle}" event - {EntryBeginShort}]]></string>
+    <string name="_bx_events_email_reminder_body"><![CDATA[{email_header}
+<p class="vevent">
+    <a href="{EntryUrl}" class="summary">{EntryTitle}</a> event reminder:</a><br />
+    Date: <abbr class="dtstart" title="{EntryBeginUTC}">{EntryBegin}</abbr><br />
+    Location: <span class="location">{EntryLocation}</span>
+</p>
+{email_footer}]]></string>
+
+</resources>

+ 95 - 0
modules/boonex/events/updates/9.0.2_9.0.3/source/install/sql/disable.sql

@@ -0,0 +1,95 @@
+
+-- SETTINGS
+
+SET @iTypeId = (SELECT `ID` FROM `sys_options_types` WHERE `name` = 'bx_events' 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_events';
+DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_events' OR `object` IN('bx_events_create_profile', 'bx_events_delete_profile', 'bx_events_edit_profile', 'bx_events_edit_profile_cover', 'bx_events_invite', 'bx_events_view_profile', 'bx_events_view_profile_closed', 'bx_events_profile_info', 'bx_events_profile_comments', 'bx_events_home', 'bx_events_fans', 'bx_events_joined', 'bx_events_top', 'bx_events_search', 'bx_events_manage', 'bx_events_administration');
+
+-- MENU
+
+DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_events';
+DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_events';
+DELETE FROM `sys_menu_items` WHERE `module` = 'bx_events' OR `set_name` IN('bx_events_view_submenu', 'bx_events_submenu', 'bx_events_view_actions', 'bx_events_view_actions_more');
+
+-- 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_events';
+DELETE FROM `sys_acl_actions` WHERE `Module` = 'bx_events';
+
+-- COMMENTS
+DELETE FROM `sys_objects_cmts` WHERE `Name` = 'bx_events';
+
+-- VIEWS
+DELETE FROM `sys_objects_view` WHERE `name` = 'bx_events';
+
+-- VOTES
+DELETE FROM `sys_objects_vote` WHERE `Name` = 'bx_events';
+
+-- REPORTS
+DELETE FROM `sys_objects_report` WHERE `name` = 'bx_events';
+
+-- FAFORITES
+DELETE FROM `sys_objects_favorite` WHERE `name` = 'bx_events';
+
+-- FEATURED
+DELETE FROM `sys_objects_feature` WHERE `name` = 'bx_events';
+
+-- METATAGS
+DELETE FROM `sys_objects_metatags` WHERE `object` = 'bx_events';
+
+-- CATEGORY
+DELETE FROM `sys_objects_category` WHERE `object` = 'bx_events_cats';
+
+-- SEARCH
+DELETE FROM `sys_objects_search` WHERE `ObjectName` = 'bx_events';
+
+-- SEARCH EXTENDED
+DELETE FROM `sys_objects_search_extended` WHERE `module` = 'bx_events';
+
+-- CONNECTIONS
+DELETE FROM `sys_objects_connection` WHERE `object` = 'bx_events_fans';
+
+-- CONTENT INFO
+DELETE FROM `sys_objects_content_info` WHERE `name` IN ('bx_events', 'bx_events_cmts');
+
+DELETE FROM `sys_content_info_grids` WHERE `object` IN ('bx_events');
+
+-- STATS
+DELETE FROM `sys_statistics` WHERE `name` LIKE 'bx_events%';
+
+-- CHARTS
+DELETE FROM `sys_objects_chart` WHERE `object` LIKE 'bx_events%';
+
+-- GRIDS
+DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_events_administration', 'bx_events_moderation', 'bx_events_common', 'bx_events_fans');
+DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_events_administration', 'bx_events_moderation', 'bx_events_common', 'bx_events_fans');
+DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_events_administration', 'bx_events_moderation', 'bx_events_common', 'bx_events_fans');
+
+-- ALERTS
+
+SET @iHandler := (SELECT `id` FROM `sys_alerts_handlers` WHERE `name` = 'bx_events' 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_events_allow_view_to', 'bx_events_allow_view_notification_to');
+
+-- EMAIL TEMPLATES
+
+DELETE FROM `sys_email_templates` WHERE `Module` = 'bx_events';
+
+-- UPLOADERS
+
+DELETE FROM `sys_objects_uploader` WHERE `object` IN('bx_events_cover_crop', 'bx_events_picture_crop');
+
+-- CRON
+
+DELETE FROM `sys_cron_jobs` WHERE `name` = 'bx_events_process_reminders';
+

+ 509 - 0
modules/boonex/events/updates/9.0.2_9.0.3/source/install/sql/enable.sql

@@ -0,0 +1,509 @@
+
+-- 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_events', '_bx_events', 'bx_events@modules/boonex/events/|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_events', '_bx_events', 1);
+SET @iCategId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
+('bx_events_num_connections_quick', '4', @iCategId, '_bx_events_option_num_connections_quick', 'digit', '', '', '', 10),
+('bx_events_per_page_browse', '24', @iCategId, '_bx_events_option_per_page_browse', 'digit', '', '', '', 11),
+('bx_events_num_rss', '10', @iCategId, '_bx_events_option_num_rss', 'digit', '', '', '', 12),
+('bx_events_time_format', 'H:i', @iCategId, '_bx_events_option_time_format', 'digit', '', '', '', 20),
+('bx_events_short_date_format', 'j M y', @iCategId, '_bx_events_option_short_date_format', 'digit', '', '', '', 22),
+('bx_events_searchable_fields', 'event_name,event_desc', @iCategId, '_bx_events_option_searchable_fields', 'list', 'a:2:{s:6:"module";s:9:"bx_events";s:6:"method";s:21:"get_searchable_fields";}', '', '', 30);
+
+-- PAGES
+
+-- PAGE: create profile
+
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_events_create_profile', 'create-event-profile', '_bx_events_page_title_sys_create_profile', '_bx_events_page_title_create_profile', 'bx_events', 5, 2147483647, 1, 'page.php?i=create-event-profile', '', '', '', 0, 1, 0, '', '');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_events_create_profile', 1, 'bx_events', '_bx_events_page_block_title_create_profile', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_events\";s:6:\"method\";s:13:\"entity_create\";}', 0, 1, 1);
+
+-- PAGE: view profile
+
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_events_view_profile', 'view-event-profile', '_bx_events_page_title_sys_view_profile', '_bx_events_page_title_view_profile', 'bx_events', 10, 2147483647, 1, 'page.php?i=view-event-profile', '', '', '', 0, 1, 0, 'BxEventsPageEntry', 'modules/boonex/events/classes/BxEventsPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `hidden_on`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES
+('bx_events_view_profile', 4, 'bx_events', '', '_bx_events_page_block_title_profile_comments', 11, '', 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_events\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 0, 0),
+('bx_events_view_profile', 4, 'bx_events', '', '_bx_events_page_block_title_profile_description', 13, '', 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_events\";s:6:\"method\";s:17:\"entity_text_block\";}', 0, 0, 1, 0),
+('bx_events_view_profile', 2, 'bx_events', '', '_bx_events_page_block_title_profile_info', 11, '', 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_events\";s:6:\"method\";s:11:\"entity_info\";}', 0, 0, 1, 0),
+('bx_events_view_profile', 1, 'bx_events', '', '_bx_events_page_block_title_entry_social_sharing', 13, '', 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_events\";s:6:\"method\";s:21:\"entity_social_sharing\";}', 0, 0, 1, 0),
+('bx_events_view_profile', 3, 'bx_events', '', '_bx_events_page_block_title_profile_calendar', 11, '', 2147483647, 'service', 'a:3:{s:6:\"module\";s:9:\"bx_events\";s:6:\"method\";s:8:\"calendar\";s:6:\"params\";a:2:{i:0;a:1:{s:5:\"event\";s:12:\"{content_id}\";}i:1;s:21:\"calendar_compact.html\";}}', 0, 0, 1, 0),
+('bx_events_view_profile', 4, 'bx_events', '', '_bx_events_page_block_title_fans', 11, '', 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_events\";s:6:\"method\";s:4:\"fans\";}', 0, 0, 1, 1),
+('bx_events_view_profile', 4, 'bx_events', '', '_bx_events_page_block_title_admins', 11, '', 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_events\";s:6:\"method\";s:6:\"admins\";}', 0, 0, 1, 2),
+('bx_events_view_profile', 2, 'bx_events', '', '_bx_events_page_block_title_entry_location', 11, '', 2147483647, 'service', 'a:4:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:13:\"locations_map\";s:6:\"params\";a:2:{i:0;s:9:\"bx_events\";i:1;s:12:\"{content_id}\";}s:5:\"class\";s:20:\"TemplServiceMetatags\";}', 0, 0, 1, 1);
+
+-- 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_events_view_profile_closed', 'view-event-profile-closed', '_bx_events_page_title_sys_view_profile_closed', '_bx_events_page_title_view_profile', 'bx_events', 10, 2147483647, 1, 'page.php?i=view-event-profile', '', '', '', 0, 1, 0, 'BxEventsPageEntry', 'modules/boonex/events/classes/BxEventsPageEntry.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_events_view_profile_closed', 2, 'bx_events', '', '_bx_events_page_block_title_profile_info', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_events\";s:6:\"method\";s:11:\"entity_info\";}', 0, 0, 1, 0),
+('bx_events_view_profile_closed', 3, 'bx_events', '', '_bx_events_page_block_title_fans', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_events\";s:6:\"method\";s:4:\"fans\";}', 0, 0, 1, 0);
+
+-- PAGE: edit profile
+
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_events_edit_profile', 'edit-event-profile', '_bx_events_page_title_sys_edit_profile', '_bx_events_page_title_edit_profile', 'bx_events', 5, 2147483647, 1, 'page.php?i=edit-event-profile', '', '', '', 0, 1, 0, 'BxEventsPageEntry', 'modules/boonex/events/classes/BxEventsPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_events_edit_profile', 1, 'bx_events', '_bx_events_page_block_title_edit_profile', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_events\";s:6:\"method\";s:11:\"entity_edit\";}', 0, 0, 0);
+
+-- PAGE: edit profile cover
+
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_events_edit_profile_cover', 'edit-event-cover', '_bx_events_page_title_sys_edit_profile_cover', '_bx_events_page_title_edit_profile_cover', 'bx_events', 5, 2147483647, 1, 'page.php?i=edit-event-cover', '', '', '', 0, 1, 0, 'BxEventsPageEntry', 'modules/boonex/events/classes/BxEventsPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_events_edit_profile_cover', 1, 'bx_events', '_bx_events_page_block_title_edit_profile_cover', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_events\";s:6:\"method\";s:17:\"entity_edit_cover\";}', 0, 0, 0);
+
+-- PAGE: invite members
+
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_events_invite', 'invite-to-event', '_bx_events_page_title_sys_invite_to_group', '_bx_events_page_title_invite_to_group', 'bx_events', 5, 2147483647, 1, 'page.php?i=invite-to-event', '', '', '', 0, 1, 0, 'BxEventsPageEntry', 'modules/boonex/events/classes/BxEventsPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_events_invite', 1, 'bx_events', '_bx_events_page_block_title_invite_to_group', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_events\";s:6:\"method\";s:13:\"entity_invite\";}', 0, 0, 0);
+
+-- PAGE: delete profile
+
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_events_delete_profile', 'delete-event-profile', '_bx_events_page_title_sys_delete_profile', '_bx_events_page_title_delete_profile', 'bx_events', 5, 2147483647, 1, 'page.php?i=delete-event-profile', '', '', '', 0, 1, 0, 'BxEventsPageEntry', 'modules/boonex/events/classes/BxEventsPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_events_delete_profile', 1, 'bx_events', '_bx_events_page_block_title_delete_profile', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_events\";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_events_profile_info', 'event-profile-info', '_bx_events_page_title_sys_profile_info', '_bx_events_page_title_profile_info', 'bx_events', 5, 2147483647, 1, 'page.php?i=event-profile-info', '', '', '', 0, 1, 0, 'BxEventsPageEntry', 'modules/boonex/events/classes/BxEventsPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `hidden_on`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_events_profile_info', 1, 'bx_events', '', '_bx_events_page_block_title_profile_description', 13, '', 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_events\";s:6:\"method\";s:17:\"entity_text_block\";}', 0, 0, 1, 0),
+('bx_events_profile_info', 2, 'bx_events', '_bx_events_page_block_title_system_profile_info', '_bx_events_page_block_title_profile_info_link', 11, '', 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_events\";s:6:\"method\";s:16:\"entity_info_full\";}', 0, 0, 1, 0),
+('bx_events_profile_info', 3, 'bx_events', '', '_bx_events_page_block_title_profile_calendar', 11, '', 2147483647, 'service', 'a:3:{s:6:\"module\";s:9:\"bx_events\";s:6:\"method\";s:8:\"calendar\";s:6:\"params\";a:2:{i:0;a:1:{s:5:\"event\";s:12:\"{content_id}\";}i:1;s:21:\"calendar_compact.html\";}}', 0, 0, 1, 0),
+('bx_events_profile_info', 2, 'bx_events', '', '_bx_events_page_block_title_entry_location', 11, '', 2147483647, 'service', 'a:4:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:13:\"locations_map\";s:6:\"params\";a:2:{i:0;s:9:\"bx_events\";i:1;s:12:\"{content_id}\";}s:5:\"class\";s:20:\"TemplServiceMetatags\";}', 0, 0, 1, 1);
+
+-- PAGE: event fans
+
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_events_fans', 'event-fans', '_bx_events_page_title_sys_group_fans', '_bx_events_page_title_group_fans', 'bx_events', 5, 2147483647, 1, 'page.php?i=event-fans', '', '', '', 0, 1, 0, 'BxEventsPageEntry', 'modules/boonex/events/classes/BxEventsPageEntry.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_events_fans', 1, 'bx_events', '_bx_events_page_block_title_system_fans', '_bx_events_page_block_title_fans_link', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_events";s:6:"method";s:10:"fans_table";}', 0, 0, 1, 1);
+
+-- PAGE: view entry comments
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_events_profile_comments', '_bx_events_page_title_sys_profile_comments', '_bx_events_page_title_profile_comments', 'bx_events', 5, 2147483647, 1, 'event-profile-comments', '', '', '', '', 0, 1, 0, 'BxEventsPageEntry', 'modules/boonex/events/classes/BxEventsPageEntry.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_events_profile_comments', 1, 'bx_events', '_bx_events_page_block_title_profile_comments', '_bx_events_page_block_title_profile_comments_link', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_events\";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_events_home', '_bx_events_page_title_sys_recent', '_bx_events_page_title_recent', 'bx_events', 5, 2147483647, 1, 'events-home', 'page.php?i=events-home', '', '', '', 0, 1, 0, 'BxEventsPageBrowse', 'modules/boonex/events/classes/BxEventsPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_events_home', 1, 'bx_events', '_bx_events_page_block_title_featured_profiles', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_events";s:6:"method";s:15:"browse_featured";s:6:"params";a:1:{i:0;s:7:"gallery";}}', 0, 1, 0),
+('bx_events_home', 1, 'bx_events', '_bx_events_page_block_title_latest_profiles', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:9:\"bx_events\";s:6:\"method\";s:22:\"browse_recent_profiles\";s:6:"params";a:1:{i:0;b:1;}}', 0, 1, 1);
+
+-- PAGE: top profiles
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_events_top', '_bx_events_page_title_sys_top', '_bx_events_page_title_top', 'bx_events', 5, 2147483647, 1, 'events-top', 'page.php?i=events-top', '', '', '', 0, 1, 0, 'BxEventsPageBrowse', 'modules/boonex/events/classes/BxEventsPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_events_top', 1, 'bx_events', '_bx_events_page_block_title_top_profiles', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:9:\"bx_events\";s:6:\"method\";s:19:\"browse_top_profiles\";s:6:"params";a:1:{i:0;b:1;}}', 0, 1, 0);
+
+-- PAGE: calendar
+
+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_events_calendar', '_bx_events_page_title_sys_calendar', '_bx_events_page_title_calendar', 'bx_events', 5, 2147483647, 1, 'events-calendar', 'page.php?i=events-calendar', '', '', '', 0, 1, 0, 'BxEventsPageCalendar', 'modules/boonex/events/classes/BxEventsPageCalendar.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_events_calendar', 1, 'bx_events', '_bx_events_page_block_title_calendar', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_events";s:6:"method";s:8:"calendar";}', 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_events_search', '_bx_events_page_title_sys_entries_search', '_bx_events_page_title_entries_search', 'bx_events', 5, 2147483647, 1, 'events-search', 'page.php?i=events-search', '', '', '', 0, 1, 0, 'BxEventsPageBrowse', 'modules/boonex/events/classes/BxEventsPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_events_search', 1, 'bx_events', '_bx_events_page_block_title_search_form', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:8:"get_form";s:6:"params";a:1:{i:0;a:1:{s:6:"object";s:9:"bx_events";}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 1, 1),
+('bx_events_search', 1, 'bx_events', '_bx_events_page_block_title_search_results', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_results";s:6:"params";a:1:{i:0;a:2:{s:6:"object";s:9:"bx_events";s:10:"show_empty";b:1;}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 1, 2),
+('bx_events_search', 1, 'bx_events', '_bx_events_page_block_title_search_form_cmts', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:8:"get_form";s:6:"params";a:1:{i:0;a:1:{s:6:"object";s:14:"bx_events_cmts";}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 0, 3),
+('bx_events_search', 1, 'bx_events', '_bx_events_page_block_title_search_results_cmts', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_results";s:6:"params";a:1:{i:0;a:2:{s:6:"object";s:14:"bx_events_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_events_manage', '_bx_events_page_title_sys_manage', '_bx_events_page_title_manage', 'bx_events', 5, 2147483647, 1, 'events-manage', 'page.php?i=events-manage', '', '', '', 0, 1, 0, 'BxEventsPageBrowse', 'modules/boonex/events/classes/BxEventsPageBrowse.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_events_manage', 1, 'bx_events', '_bx_events_page_block_title_system_manage', '_bx_events_page_block_title_manage', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_events\";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_events_administration', '_bx_events_page_title_sys_manage_administration', '_bx_events_page_title_manage', 'bx_events', 5, 192, 1, 'events-administration', 'page.php?i=events-administration', '', '', '', 0, 1, 0, 'BxEventsPageBrowse', 'modules/boonex/events/classes/BxEventsPageBrowse.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_events_administration', 1, 'bx_events', '_bx_events_page_block_title_system_manage_administration', '_bx_events_page_block_title_manage', 11, 192, 'service', 'a:3:{s:6:\"module\";s:9:\"bx_events\";s:6:\"method\";s:12:\"manage_tools\";s:6:\"params\";a:1:{i:0;s:14:\"administration\";}}', 0, 1, 0);
+
+-- PAGE: user's events
+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_events_joined', 'joined-events', '_bx_events_page_title_sys_joined_entries', '_bx_events_page_title_joined_entries', 'bx_events', 5, 2147483647, 1, '', '', '', '', 0, 1, 0, 'BxEventsPageJoinedEntries', 'modules/boonex/events/classes/BxEventsPageJoinedEntries.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_events_joined', 1, 'bx_events', '_bx_events_page_block_title_sys_favorites_of_author', '_bx_events_page_block_title_favorites_of_author', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_events";s:6:"method";s:15:"browse_favorite";s:6:"params";a:1:{i:0;s:12:"{profile_id}";}}', 0, 1, 1, 1),
+('bx_events_joined', 1, 'bx_events', '_bx_events_page_block_title_sys_joined_entries', '_bx_events_page_block_title_joined_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_events";s:6:"method";s:21:"browse_joined_entries";s:6:"params";a:2:{i:0;i:0;i:1;b:1;}}', 0, 0, 1, 2);
+
+-- 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`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES
+('sys_home', 1, 'bx_events', '_bx_events_page_block_title_latest_profiles', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_events";s:6:"method";s:22:"browse_recent_profiles";}', 1, 0, 0, IFNULL(@iBlockOrder, 0) + 1);
+
+-- 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_events', '', '_bx_events_page_block_title_categories', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:15:"categories_list";s:6:"params";a:2:{i:0;s:14:"bx_events_cats";i:1;a:2:{s:10:\"show_empty\";b:1;s:21:\"show_empty_categories\";b:1;}}s:5:"class";s:20:"TemplServiceCategory";}', 1, 1, 1, IFNULL(@iBlockOrder, 0) + 1);
+
+
+-- MENU
+
+-- MENU: add to site menu
+
+SET @iSiteMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_site' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('sys_site', 'bx_events', 'events-home', '_bx_events_menu_item_title_system_entries_home', '_bx_events_menu_item_title_entries_home', 'page.php?i=events-home', '', '', 'calendar col-red2', 'bx_events_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_events', 'events-home', '_bx_events_menu_item_title_system_entries_home', '_bx_events_menu_item_title_entries_home', 'page.php?i=events-home', '', '', 'calendar col-red2', 'bx_events_submenu', 2147483647, 1, 1, IFNULL(@iHomepageMenuOrder, 0) + 1);
+
+-- MENU: add to "add content" menu
+
+SET @iAddMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_add_content_links' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('sys_add_content_links', 'bx_events', 'create-event-profile', '_bx_events_menu_item_title_system_create_profile', '_bx_events_menu_item_title_create_profile', 'page.php?i=create-event-profile', '', '', 'calendar col-red2', '', 2147483647, 1, 1, IFNULL(@iAddMenuOrder, 0) + 1);
+
+-- MENU: view actions
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_events_view_actions', '_bx_events_menu_title_view_profile_actions', 'bx_events_view_actions', 'bx_events', 9, 0, 1, 'BxEventsMenuView', 'modules/boonex/events/classes/BxEventsMenuView.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_events_view_actions', 'bx_events', '_bx_events_menu_set_title_view_profile_actions', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `submenu_popup`, `visible_for_levels`, `active`, `copyable`, `editable`, `order`) VALUES 
+('bx_events_view_actions', 'bx_events', 'profile-fan-add', '_bx_events_menu_item_title_system_become_fan', '{title_add_fan}', 'javascript:void(0)', 'bx_conn_action(this, \'bx_events_fans\', \'add\', \'{profile_id}\')', '', 'user-plus', '', 0, 2147483647, 1, 0, 0, 5),
+('bx_events_view_actions', 'bx_events', 'profile-subscribe-add', '_bx_events_menu_item_title_system_subscribe', '_bx_events_menu_item_title_subscribe', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_subscriptions\', \'add\', \'{profile_id}\')', '', 'check', '', 0, 2147483647, 1, 0, 1, 20),
+('bx_events_view_actions', 'bx_events', 'profile-actions-more', '_bx_events_menu_item_title_system_more_actions', '_bx_events_menu_item_title_more_actions', 'javascript:void(0)', 'bx_menu_popup(''bx_events_view_actions_more'', this, {}, {profile_id:{profile_id}});', '', 'cog', 'bx_events_view_actions_more', 1, 2147483647, 1, 0, 1, 9999);
+
+-- MENU: view actions more
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_events_view_actions_more', '_bx_events_menu_title_view_profile_actions_more', 'bx_events_view_actions_more', 'bx_events', 6, 0, 1, 'BxEventsMenuView', 'modules/boonex/events/classes/BxEventsMenuView.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_events_view_actions_more', 'bx_events', '_bx_events_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_events_view_actions_more', 'bx_events', 'profile-fan-remove', '_bx_events_menu_item_title_system_leave_group', '{title_remove_fan}', 'javascript:void(0)', 'bx_conn_action(this, \'bx_events_fans\', \'remove\', \'{profile_id}\')', '', 'user-times', '', 2147483647, 1, 0, 10),
+('bx_events_view_actions_more', 'bx_events', 'profile-subscribe-remove', '_bx_events_menu_item_title_system_unsubscribe', '_bx_events_menu_item_title_unsubscribe', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_subscriptions\', \'remove\', \'{profile_id}\')', '', 'check', '', 2147483647, 1, 0, 20),
+('bx_events_view_actions_more', 'bx_events', 'edit-event-cover', '_bx_events_menu_item_title_system_edit_cover', '_bx_events_menu_item_title_edit_cover', 'page.php?i=edit-event-cover&id={content_id}', '', '', 'pencil', '', 2147483647, 1, 0, 30),
+('bx_events_view_actions_more', 'bx_events', 'edit-event-profile', '_bx_events_menu_item_title_system_edit_profile', '_bx_events_menu_item_title_edit_profile', 'page.php?i=edit-event-profile&id={content_id}', '', '', 'pencil', '', 2147483647, 1, 0, 40),
+('bx_events_view_actions_more', 'bx_events', 'invite-to-event', '_bx_events_menu_item_title_system_invite', '_bx_events_menu_item_title_invite', 'page.php?i=invite-to-event&id={content_id}', '', '', 'user-plus', '', 2147483647, 1, 0, 42),
+('bx_events_view_actions_more', 'bx_events', 'delete-event-profile', '_bx_events_menu_item_title_system_delete_profile', '_bx_events_menu_item_title_delete_profile', 'page.php?i=delete-event-profile&id={content_id}', '', '', 'remove', '', 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_events_submenu', '_bx_events_menu_title_submenu', 'bx_events_submenu', 'bx_events', 8, 0, 1, '', '');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_events_submenu', 'bx_events', '_bx_events_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_events_submenu', 'bx_events', 'events-home', '_bx_events_menu_item_title_system_entries_recent', '_bx_events_menu_item_title_entries_recent', 'page.php?i=events-home', '', '', '', '', 2147483647, 1, 1, 1),
+('bx_events_submenu', 'bx_events', 'events-top', '_bx_events_menu_item_title_system_entries_top', '_bx_events_menu_item_title_entries_top', 'page.php?i=events-top', '', '', '', '', 2147483647, 1, 1, 2),
+('bx_events_submenu', 'bx_events', 'events-calendar', '_bx_events_menu_item_title_system_calendar', '_bx_events_menu_item_title_calendar', 'page.php?i=events-calendar', '', '', '', '', 2147483647, 1, 1, 3),
+('bx_events_submenu', 'bx_events', 'events-search', '_bx_events_menu_item_title_system_entries_search', '_bx_events_menu_item_title_entries_search', 'page.php?i=events-search', '', '', '', '', 2147483647, 1, 1, 4),
+('bx_events_submenu', 'bx_events', 'events-manage', '_bx_events_menu_item_title_system_entries_manage', '_bx_events_menu_item_title_entries_manage', 'page.php?i=events-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_events_view_submenu', '_bx_events_menu_title_view_profile_submenu', 'bx_events_view_submenu', 'bx_events', 8, 0, 1, 'BxEventsMenuView', 'modules/boonex/events/classes/BxEventsMenuView.php'),
+('bx_events_view_submenu_cover', '_bx_events_menu_title_view_profile_submenu_cover', 'bx_events_view_submenu', 'bx_events', 7, 0, 1, 'BxEventsMenuView', 'modules/boonex/events/classes/BxEventsMenuView.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_events_view_submenu', 'bx_events', '_bx_events_menu_set_title_view_profile_submenu', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('bx_events_view_submenu', 'bx_events', 'view-event-profile', '_bx_events_menu_item_title_system_view_profile_view', '_bx_events_menu_item_title_view_profile_view', 'page.php?i=view-event-profile&id={content_id}', '', '', 'calendar col-red2', '', 2147483647, 1, 0, 1),
+('bx_events_view_submenu', 'bx_events', 'event-profile-info', '_bx_events_menu_item_title_system_view_profile_info', '_bx_events_menu_item_title_view_profile_info', 'page.php?i=event-profile-info&id={content_id}', '', '', 'info-circle col-gray', '', 2147483647, 1, 0, 2),
+('bx_events_view_submenu', 'bx_events', 'event-profile-comments', '_bx_events_menu_item_title_system_view_profile_comments', '_bx_events_menu_item_title_view_profile_comments', 'page.php?i=event-profile-comments&id={content_id}', '', '', '', '', 2147483647, 0, 0, 3),
+('bx_events_view_submenu', 'bx_events', 'event-fans', '_bx_events_menu_item_title_system_view_fans', '_bx_events_menu_item_title_view_fans', 'page.php?i=event-fans&profile_id={profile_id}', '', '', 'calendar col-blue3', '', 2147483647, 1, 0, 4);
+
+-- MENU: profile stats
+SET @iNotifMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name` = 'sys_profile_stats' AND `active` = 1 LIMIT 1);
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
+('sys_profile_stats', 'bx_events', 'profile-stats-manage-groups', '_bx_events_menu_item_title_system_manage_my_groups', '_bx_events_menu_item_title_manage_my_groups', 'page.php?i=events-manage', '', '_self', 'calendar col-red2', 'a:2:{s:6:"module";s:9:"bx_events";s:6:"method";s:41:"get_menu_addon_manage_tools_profile_stats";}', '', 2147483646, 1, 0, @iNotifMenuOrder + 2);
+
+-- MENU: manage tools submenu
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_events_menu_manage_tools', '_bx_events_menu_title_manage_tools', 'bx_events_menu_manage_tools', 'bx_events', 6, 0, 1, 'BxEventsMenuManageTools', 'modules/boonex/events/classes/BxEventsMenuManageTools.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_events_menu_manage_tools', 'bx_events', '_bx_events_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_events_menu_manage_tools', 'bx_events', 'delete', '_bx_events_menu_item_title_system_delete', '_bx_events_menu_item_title_delete', 'javascript:void(0)', 'javascript:{js_object}.onClickDelete({content_id});', '_self', 'trash-o', '', 2147483647, 1, 0, 1),
+('bx_events_menu_manage_tools', 'bx_events', 'delete-with-content', '_bx_events_menu_item_title_system_delete_with_content', '_bx_events_menu_item_title_delete_with_content', 'javascript:void(0)', 'javascript:{js_object}.onClickDeleteWithContent({content_id});', '_self', 'trash-o', '', 2147483647, 1, 0, 2);
+
+-- MENU: dashboard manage tools
+SET @iManageMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name`='sys_account_dashboard_manage_tools' LIMIT 1);
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('sys_account_dashboard_manage_tools', 'bx_events', 'events-administration', '_bx_events_menu_item_title_system_admt_groups', '_bx_events_menu_item_title_admt_groups', 'page.php?i=events-administration', '', '_self', '', 'a:2:{s:6:"module";s:9:"bx_events";s:6:"method";s:27:"get_menu_addon_manage_tools";}', '', 192, 1, 0, @iManageMenuOrder + 1);
+
+-- MENU: add menu item to profiles modules (trigger* menu sets are processed separately upon modules enable/disable)
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('trigger_profile_view_submenu', 'bx_events', 'joined-events', '_bx_events_menu_item_title_system_view_joined_groups', '_bx_events_menu_item_title_view_joined_groups', 'page.php?i=joined-events&profile_id={profile_id}', '', '', 'calendar col-red2', '', 2147483647, 1, 0, 0);
+
+-- ACL
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_events', 'create entry', NULL, '_bx_events_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_events', 'delete entry', NULL, '_bx_events_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_events', 'view entry', NULL, '_bx_events_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_events', 'edit any entry', NULL, '_bx_events_acl_action_edit_any_profile', '', 1, 3);
+SET @iIdActionProfileEditAny = LAST_INSERT_ID();
+
+SET @iUnauthenticated = 1;
+SET @iAccount = 2;
+SET @iStandard = 3;
+SET @iUnconfirmed = 4;
+SET @iPending = 5;
+SET @iSuspended = 6;
+SET @iModerator = 7;
+SET @iAdministrator = 8;
+SET @iPremium = 9;
+
+INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
+
+-- profile create
+(@iAccount, @iIdActionProfileCreate),
+(@iStandard, @iIdActionProfileCreate),
+(@iUnconfirmed, @iIdActionProfileCreate),
+(@iPending, @iIdActionProfileCreate),
+(@iModerator, @iIdActionProfileCreate),
+(@iAdministrator, @iIdActionProfileCreate),
+(@iPremium, @iIdActionProfileCreate),
+
+-- profile delete
+(@iAccount, @iIdActionProfileDelete),
+(@iStandard, @iIdActionProfileDelete),
+(@iUnconfirmed, @iIdActionProfileDelete),
+(@iPending, @iIdActionProfileDelete),
+(@iModerator, @iIdActionProfileDelete),
+(@iAdministrator, @iIdActionProfileDelete),
+(@iPremium, @iIdActionProfileDelete),
+
+-- profile view
+(@iUnauthenticated, @iIdActionProfileView),
+(@iAccount, @iIdActionProfileView),
+(@iStandard, @iIdActionProfileView),
+(@iUnconfirmed, @iIdActionProfileView),
+(@iPending, @iIdActionProfileView),
+(@iModerator, @iIdActionProfileView),
+(@iAdministrator, @iIdActionProfileView),
+(@iPremium, @iIdActionProfileView),
+
+-- any profile edit
+(@iModerator, @iIdActionProfileEditAny),
+(@iAdministrator, @iIdActionProfileEditAny);
+
+
+-- COMMENTS
+INSERT INTO `sys_objects_cmts` (`Name`, `Module`, `Table`, `CharsPostMin`, `CharsPostMax`, `CharsDisplayMax`, `Nl2br`, `PerView`, `PerViewReplies`, `BrowseType`, `IsBrowseSwitch`, `PostFormPosition`, `NumberOfLevels`, `IsDisplaySwitch`, `IsRatable`, `ViewingThreshold`, `IsOn`, `RootStylePrefix`, `BaseUrl`, `ObjectVote`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldTitle`, `TriggerFieldComments`, `ClassName`, `ClassFile`) VALUES
+('bx_events', 'bx_events', 'bx_events_cmts', 1, 5000, 1000, 1, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-event-profile&id={object_id}', '', 'bx_events_data', 'id', 'author', 'event_name', 'comments', '', '');
+
+-- VIEWS
+INSERT INTO `sys_objects_view` (`name`, `table_track`, `period`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_events', 'bx_events_views_track', '86400', '1', 'bx_events_data', 'id', 'author', 'views', '', '');
+
+-- VOTES
+INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES 
+('bx_events', 'bx_events_votes', 'bx_events_votes_track', '604800', '1', '1', '0', '1', 'bx_events_data', 'id', 'author', 'rate', 'votes', '', '');
+
+-- REPORTS
+INSERT INTO `sys_objects_report` (`name`, `table_main`, `table_track`, `is_on`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_events', 'bx_events_reports', 'bx_events_reports_track', '1', 'page.php?i=view-event-profile&id={object_id}', 'bx_events_data', 'id', 'author', 'reports', '', '');
+
+-- FAFORITES
+INSERT INTO `sys_objects_favorite` (`name`, `table_track`, `is_on`, `is_undo`, `is_public`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_events', 'bx_events_favorites_track', '1', '1', '1', 'page.php?i=view-event-profile&id={object_id}', 'bx_events_data', 'id', 'author', 'favorites', '', '');
+
+-- FEATURED
+INSERT INTO `sys_objects_feature` (`name`, `is_on`, `is_undo`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_flag`, `class_name`, `class_file`) VALUES 
+('bx_events', '1', '1', 'page.php?i=view-event-profile&id={object_id}', 'bx_events_data', 'id', 'author', 'featured', '', '');
+
+-- METATAGS
+INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_events', 'bx_events_meta_keywords', 'bx_events_meta_locations', '', '', '');
+
+-- CATEGORY
+INSERT INTO `sys_objects_category` (`object`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
+('bx_events_cats', 'bx_events', 'bx_event', 'bx_events_cats', 'bx_events_data', 'event_cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`content_id` = `bx_events_data`.`id` AND `sys_profiles`.`type` = ''bx_events'')', 'AND `sys_profiles`.`status` = ''active''', '', '');
+
+-- SEARCH
+SET @iSearchOrder = (SELECT IFNULL(MAX(`Order`), 0) FROM `sys_objects_search`);
+INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `Order`, `ClassName`, `ClassPath`) VALUES
+('bx_events', '_bx_events', @iSearchOrder + 1, 'BxEventsSearchResult', 'modules/boonex/events/classes/BxEventsSearchResult.php');
+
+-- SEARCH EXTENDED
+INSERT INTO `sys_objects_search_extended` (`object`, `object_content_info`, `module`, `title`, `active`, `class_name`, `class_file`) VALUES
+('bx_events', 'bx_events', 'bx_events', '_bx_events_search_extended', 1, '', ''),
+('bx_events_cmts', 'bx_events_cmts', 'bx_events', '_bx_events_search_extended_cmts', 1, 'BxTemplSearchExtendedCmts', '');
+
+-- CONNECTIONS
+INSERT INTO `sys_objects_connection` (`object`, `table`, `type`, `override_class_name`, `override_class_file`) VALUES
+('bx_events_fans', 'bx_events_fans', 'mutual', '', '');
+
+-- 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_events', '_bx_events', 'bx_events', 'added', 'edited', 'deleted', '', ''),
+('bx_events_cmts', '_bx_events_cmts', 'bx_events', 'commentPost', 'commentUpdated', 'commentRemoved', 'BxDolContentInfoCmts', '');
+
+INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`, `condition`, `selection`) VALUES
+('bx_events', 'bx_events_administration', 'td`.`id', '', ''),
+('bx_events', 'bx_events_common', 'td`.`id', '', '');
+
+-- STATS
+SET @iMaxOrderStats = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_statistics`);
+INSERT INTO `sys_statistics` (`module`, `name`, `title`, `link`, `icon`, `query`, `order`) VALUES 
+('bx_events', 'bx_events', '_bx_events', 'page.php?i=events-home', 'calendar col-red2', 'SELECT COUNT(*) FROM `bx_events_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id` = `tp`.`content_id` AND `tp`.`type`=''bx_events'' 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_events_growth', '_bx_events_chart_growth', 'bx_events_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_events'' WHERE 1 AND `tp`.`status`=''active'' {where_inteval} GROUP BY `period` ORDER BY {table}.{field_date} ASC', 1, @iMaxOrderCharts + 1, 'BxDolChartGrowth', ''),
+('bx_events_growth_speed', '_bx_events_chart_growth_speed', 'bx_events_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_events'' WHERE 1 AND `tp`.`status`=''active'' {where_inteval} GROUP BY `period` ORDER BY {table}.{field_date} ASC', 1, @iMaxOrderCharts + 2, 'BxDolChartGrowthSpeed', '');
+
+-- GRID: connections
+INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
+('bx_events_fans', 'Sql', 'SELECT `p`.`id`, `c`.`added`, `c`.`mutual` FROM `sys_profiles` AS `p` INNER JOIN `sys_accounts` AS `a` ON (`a`.`id` = `p`.`account_id`) {join_connections}', 'sys_profiles', 'id', 'c`.`added', '', '', 10, NULL, 'start', '', 'name,email', '', 'auto', '', '', 2147483647, 'BxEventsGridConnections', 'modules/boonex/events/classes/BxEventsGridConnections.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `params`, `order`) VALUES
+('bx_events_fans', 'name', '_sys_name', '50%', '', 10),
+('bx_events_fans', 'actions', '', '50%', '', 20);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `confirm`, `order`) VALUES
+('bx_events_fans', 'single', 'accept', '_sys_accept', '', 0, 10),
+('bx_events_fans', 'single', 'to_admins', '_bx_events_txt_to_admins', '', 0, 20),
+('bx_events_fans', 'single', 'from_admins', '_bx_events_txt_from_admins', '', 0, 30),
+('bx_events_fans', 'single', 'delete', '', 'remove', 1, 40);
+
+-- GRIDS: administration
+
+INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
+('bx_events_administration', 'Sql', 'SELECT `td`.*, `td`.`event_name` AS `name`, `ta`.`email` AS `account`, `td`.`added` AS `added_ts`, `tp`.`status` AS `status` FROM `bx_events_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id`=`tp`.`content_id` AND `tp`.`type`=''bx_events'' LEFT JOIN `sys_accounts` AS `ta` ON `tp`.`account_id`=`ta`.`id` WHERE 1 ', 'bx_events_data', 'id', 'added', 'status', '', 20, NULL, 'start', '', 'event_name', '', 'like', '', '', 192, 'BxEventsGridAdministration', 'modules/boonex/events/classes/BxEventsGridAdministration.php'),
+('bx_events_common', 'Sql', 'SELECT `td`.*, `td`.`event_name` AS `name`, `ta`.`email` AS `account`, `td`.`added` AS `added_ts`, `tp`.`status` AS `status` FROM `bx_events_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id`=`tp`.`content_id` AND `tp`.`type`=''bx_events'' LEFT JOIN `sys_accounts` AS `ta` ON `tp`.`account_id`=`ta`.`id` WHERE 1 ', 'bx_events_data', 'id', 'added', 'status', '', 20, NULL, 'start', '', 'event_name', '', 'like', '', '', 2147483647, 'BxEventsGridCommon', 'modules/boonex/events/classes/BxEventsGridCommon.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('bx_events_administration', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
+('bx_events_administration', 'switcher', '_bx_events_grid_column_title_adm_active', '8%', 0, '', '', 2),
+('bx_events_administration', 'name', '_bx_events_grid_column_title_adm_name', '25%', 0, '', '', 3),
+('bx_events_administration', 'added_ts', '_bx_events_grid_column_title_adm_added', '20%', 1, '25', '', 4),
+('bx_events_administration', 'account', '_bx_events_grid_column_title_adm_account', '25%', 0, '25', '', 5),
+('bx_events_administration', 'actions', '', '20%', 0, '', '', 6),
+('bx_events_common', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
+('bx_events_common', 'name', '_bx_events_grid_column_title_adm_name', '48%', 0, '', '', 2),
+('bx_events_common', 'added_ts', '_bx_events_grid_column_title_adm_added', '30%', 1, '25', '', 3),
+('bx_events_common', 'actions', '', '20%', 0, '', '', 4);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon_only`, `confirm`, `order`) VALUES
+('bx_events_administration', 'bulk', 'delete', '_bx_events_grid_action_title_adm_delete', '', 0, 1, 2),
+('bx_events_administration', 'bulk', 'delete_with_content', '_bx_events_grid_action_title_adm_delete_with_content', '', 0, 1, 3),
+('bx_events_administration', 'single', 'settings', '_bx_events_grid_action_title_adm_more_actions', 'cog', 1, 0, 2),
+('bx_events_common', 'bulk', 'delete', '_bx_events_grid_action_title_adm_delete', '', 0, 1, 1),
+('bx_events_common', 'bulk', 'delete_with_content', '_bx_events_grid_action_title_adm_delete_with_content', '', 0, 1, 2),
+('bx_events_common', 'single', 'settings', '_bx_events_grid_action_title_adm_more_actions', 'cog', 1, 0, 1);
+
+
+-- ALERTS
+
+INSERT INTO `sys_alerts_handlers` (`name`, `class`, `file`, `service_call`) VALUES 
+('bx_events', 'BxEventsAlertsResponse', 'modules/boonex/events/classes/BxEventsAlertsResponse.php', '');
+SET @iHandler := LAST_INSERT_ID();
+
+INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
+('system', 'save_setting', @iHandler),
+('bx_timeline', 'post_common', @iHandler),
+('bx_events_pics', 'file_deleted', @iHandler),
+('bx_events_fans', 'connection_added', @iHandler),
+('bx_events_fans', 'connection_removed', @iHandler),
+('profile', 'delete', @iHandler),
+('bx_events', 'fan_added', @iHandler),
+('bx_events', 'join_invitation', @iHandler),
+('bx_events', 'join_request', @iHandler),
+('bx_events', 'join_request_accepted', @iHandler),
+('bx_events', 'timeline_view', @iHandler),
+('bx_events', 'timeline_post', @iHandler),
+('bx_events', 'timeline_delete', @iHandler),
+('bx_events', 'timeline_comment', @iHandler),
+('bx_events', 'timeline_vote', @iHandler),
+('bx_events', 'timeline_report', @iHandler),
+('bx_events', 'timeline_repost', @iHandler);
+
+-- PRIVACY 
+
+INSERT INTO `sys_objects_privacy` (`object`, `module`, `action`, `title`, `default_group`, `table`, `table_field_id`, `table_field_author`, `override_class_name`, `override_class_file`) VALUES
+('bx_events_allow_view_to', 'bx_events', 'view', '_bx_events_form_profile_input_allow_view_to', '3', 'bx_events_data', 'id', 'author', 'BxEventsPrivacy', 'modules/boonex/events/classes/BxEventsPrivacy.php'),
+('bx_events_allow_view_notification_to', 'bx_events', 'view_event', '_bx_events_form_profile_input_allow_view_notification_to', '3', 'bx_notifications_events', 'id', 'object_owner_id', 'BxEventsPrivacyNotifications', 'modules/boonex/events/classes/BxEventsPrivacyNotifications.php');
+
+-- EMAIL TEMPLATES
+
+INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `Body`) VALUES
+('bx_events', '_bx_events_email_join_request', 'bx_events_join_request', '_bx_events_email_join_request_subject', '_bx_events_email_join_request_body'),
+('bx_events', '_bx_events_email_join_reject', 'bx_events_join_reject', '_bx_events_email_join_reject_subject', '_bx_events_email_join_reject_body'),
+('bx_events', '_bx_events_email_join_confirm', 'bx_events_join_confirm', '_bx_events_email_join_confirm_subject', '_bx_events_email_join_confirm_body'),
+('bx_events', '_bx_events_email_fan_remove', 'bx_events_fan_remove', '_bx_events_email_fan_remove_subject', '_bx_events_email_fan_remove_body'),
+('bx_events', '_bx_events_email_fan_become_admin', 'bx_events_fan_become_admin', '_bx_events_email_fan_become_admin_subject', '_bx_events_email_fan_become_admin_body'),
+('bx_events', '_bx_events_email_admin_become_fan', 'bx_events_admin_become_fan', '_bx_events_email_admin_become_fan_subject', '_bx_events_email_admin_become_fan_body'),
+('bx_events', '_bx_events_email_invitation', 'bx_events_invitation', '_bx_events_email_invitation_subject', '_bx_events_email_invitation_body'),
+('bx_events', '_bx_events_email_reminder', 'bx_events_reminder', '_bx_events_email_reminder_subject', '_bx_events_email_reminder_body');
+
+-- UPLOADERS
+
+INSERT INTO `sys_objects_uploader` (`object`, `active`, `override_class_name`, `override_class_file`) VALUES
+('bx_events_cover_crop', 1, 'BxEventsUploaderCoverCrop', 'modules/boonex/events/classes/BxEventsUploaderCoverCrop.php'),
+('bx_events_picture_crop', 1, 'BxEventsUploaderPictureCrop', 'modules/boonex/events/classes/BxEventsUploaderPictureCrop.php');
+
+-- CRON
+
+INSERT INTO `sys_cron_jobs` (`name`, `time`, `class`, `file`, `service_call`) VALUES
+('bx_events_process_reminders', '55 * * * *', 'BxEventsCronProcessReminders', 'modules/boonex/events/classes/BxEventsCronProcessReminders.php', '');
+

+ 484 - 0
modules/boonex/events/updates/9.0.2_9.0.3/source/install/sql/install.sql

@@ -0,0 +1,484 @@
+
+SET @sStorageEngine = (SELECT `value` FROM `sys_options` WHERE `name` = 'sys_storage_default');
+
+-- TABLE: EVENTS
+CREATE TABLE IF NOT EXISTS `bx_events_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,
+  `event_name` varchar(255) NOT NULL,
+  `event_cat` int(11) NOT NULL,
+  `event_desc` text NOT NULL,
+  `date_start` int(11) DEFAULT NULL,
+  `date_end` int(11) DEFAULT NULL,
+  `timezone` varchar(255) DEFAULT NULL,
+  `views` int(11) NOT NULL default '0',
+  `rate` float NOT NULL default '0',
+  `votes` int(11) NOT NULL default '0',
+  `favorites` int(11) NOT NULL default '0',
+  `comments` int(11) NOT NULL default '0',
+  `reports` int(11) NOT NULL default '0',
+  `featured` int(11) NOT NULL default '0',
+  `join_confirmation` tinyint(4) NOT NULL DEFAULT '1',
+  `reminder` int(11) NOT NULL DEFAULT '1',
+  `allow_view_to` varchar(255) DEFAULT NULL,
+  PRIMARY KEY (`id`),
+  FULLTEXT KEY `search_fields` (`event_name`, `event_desc`)
+);
+
+-- TABLE: REPEATING INTERVALS
+CREATE TABLE IF NOT EXISTS `bx_events_intervals` (
+  `interval_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `event_id` int(10) unsigned NOT NULL,
+  `repeat_year` int(11) NOT NULL,
+  `repeat_month` int(11) NOT NULL,
+  `repeat_week_of_month` int(11) NOT NULL,
+  `repeat_day_of_month` int(11) NOT NULL,
+  `repeat_day_of_week` int(11) NOT NULL,
+  `repeat_stop` int(10) unsigned NOT NULL,
+  PRIMARY KEY (`interval_id`),
+  KEY `event_id` (`event_id`)
+) AUTO_INCREMENT=1000;
+
+-- TABLE: STORAGES & TRANSCODERS
+CREATE TABLE `bx_events_pics` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `profile_id` int(10) unsigned NOT NULL,
+  `remote_id` varchar(128) NOT NULL,
+  `path` varchar(255) NOT NULL,
+  `file_name` varchar(255) NOT NULL,
+  `mime_type` varchar(128) NOT NULL,
+  `ext` varchar(32) NOT NULL,
+  `size` int(11) NOT NULL,
+  `added` int(11) NOT NULL,
+  `modified` int(11) NOT NULL,
+  `private` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `remote_id` (`remote_id`)
+);
+
+CREATE TABLE `bx_events_pics_resized` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `profile_id` int(10) unsigned NOT NULL,
+  `remote_id` varchar(128) NOT NULL,
+  `path` varchar(255) NOT NULL,
+  `file_name` varchar(255) NOT NULL,
+  `mime_type` varchar(128) NOT NULL,
+  `ext` varchar(32) NOT NULL,
+  `size` int(11) NOT NULL,
+  `added` int(11) NOT NULL,
+  `modified` int(11) NOT NULL,
+  `private` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `remote_id` (`remote_id`)
+);
+
+-- TABLE: comments
+CREATE TABLE IF NOT EXISTS `bx_events_cmts` (
+  `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
+  `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_object_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_author_id` int(10) unsigned NOT NULL DEFAULT '0',
+  `cmt_level` int(11) NOT NULL DEFAULT '0',
+  `cmt_text` text NOT NULL,
+  `cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
+  `cmt_rate` int(11) NOT NULL DEFAULT '0',
+  `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
+  `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
+  `cmt_replies` int(11) NOT NULL DEFAULT '0',
+  PRIMARY KEY (`cmt_id`),
+  KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
+  FULLTEXT KEY `search_fields` (`cmt_text`)
+);
+
+-- TABLE: VIEWS
+CREATE TABLE `bx_events_views_track` (
+  `object_id` int(11) NOT NULL default '0',
+  `viewer_id` int(11) NOT NULL default '0',
+  `viewer_nip` int(11) unsigned NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- TABLE: VOTES
+CREATE TABLE IF NOT EXISTS `bx_events_votes` (
+  `object_id` int(11) NOT NULL default '0',
+  `count` int(11) NOT NULL default '0',
+  `sum` int(11) NOT NULL default '0',
+  UNIQUE KEY `object_id` (`object_id`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `bx_events_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`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+-- TABLE: REPORTS
+CREATE TABLE IF NOT EXISTS `bx_events_reports` (
+  `object_id` int(11) NOT NULL default '0',
+  `count` int(11) NOT NULL default '0',
+  UNIQUE KEY `object_id` (`object_id`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `bx_events_reports_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `author_nip` int(11) unsigned NOT NULL default '0',
+  `type` varchar(32) NOT NULL default '',
+  `text` text NOT NULL default '',
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `report` (`object_id`, `author_nip`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+-- TABLE: metas
+CREATE TABLE IF NOT EXISTS `bx_events_meta_keywords` (
+  `object_id` int(10) unsigned NOT NULL,
+  `keyword` varchar(255) NOT NULL,
+  KEY `object_id` (`object_id`),
+  KEY `keyword` (`keyword`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `bx_events_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))
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- TABLE: fans
+CREATE TABLE IF NOT EXISTS `bx_events_fans` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `initiator` int(11) NOT NULL,
+  `content` int(11) NOT NULL,
+  `mutual` tinyint(4) NOT NULL,
+  `added` int(10) unsigned NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `initiator` (`initiator`,`content`),
+  KEY `content` (`content`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- TABLE: admins
+CREATE TABLE IF NOT EXISTS `bx_events_admins` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `group_profile_id` int(10) unsigned NOT NULL,
+  `fan_id` int(10) unsigned NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `admin` (`group_profile_id`,`fan_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- TABLE: favorites
+CREATE TABLE `bx_events_favorites_track` (
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  KEY `id` (`object_id`,`author_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+
+-- 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_events_pics', @sStorageEngine, '', 360, 2592000, 3, 'bx_events_pics', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
+('bx_events_pics_resized', @sStorageEngine, '', 360, 2592000, 3, 'bx_events_pics_resized', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0);
+
+INSERT INTO `sys_objects_transcoder` (`object`, `storage_object`, `source_type`, `source_params`, `private`, `atime_tracking`, `atime_pruning`, `ts`) VALUES 
+('bx_events_icon', 'bx_events_pics_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_events_pics";}', 'no', '1', '2592000', '0'),
+('bx_events_thumb', 'bx_events_pics_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_events_pics";}', 'no', '1', '2592000', '0'),
+('bx_events_avatar', 'bx_events_pics_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_events_pics";}', 'no', '1', '2592000', '0'),
+('bx_events_picture', 'bx_events_pics_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_events_pics";}', 'no', '1', '2592000', '0'),
+('bx_events_cover', 'bx_events_pics_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_events_pics";}', 'no', '1', '2592000', '0'),
+('bx_events_cover_thumb', 'bx_events_pics_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_events_pics";}', 'no', '1', '2592000', '0'),
+('bx_events_gallery', 'bx_events_pics_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_events_pics";}', 'no', '1', '2592000', '0');
+
+INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES 
+('bx_events_icon', 'Resize', 'a:3:{s:1:"w";s:2:"32";s:1:"h";s:2:"32";s:13:"square_resize";s:1:"1";}', '0'),
+('bx_events_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_events_avatar', 'Resize', 'a:3:{s:1:"w";s:2:"96";s:1:"h";s:2:"96";s:13:"square_resize";s:1:"1";}', '0'),
+('bx_events_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_events_cover', 'Resize', 'a:1:{s:1:"w";s:4:"2000";}', '0'),
+('bx_events_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_events_gallery', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0');
+
+-- FORMS
+
+INSERT INTO `sys_objects_form`(`object`, `module`, `title`, `action`, `form_attrs`, `table`, `key`, `uri`, `uri_title`, `submit_name`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_event', 'bx_events', '_bx_events_form_profile', '', 'a:1:{s:7:\"enctype\";s:19:\"multipart/form-data\";}', 'bx_events_data', 'id', '', '', 'do_submit', '', 0, 1, 'BxEventsFormEntry', 'modules/boonex/events/classes/BxEventsFormEntry.php');
+
+INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES 
+('bx_event', 'bx_event_add', 'bx_events', 0, '_bx_events_form_profile_display_add'),
+('bx_event', 'bx_event_delete', 'bx_events', 0, '_bx_events_form_profile_display_delete'),
+('bx_event', 'bx_event_edit', 'bx_events', 0, '_bx_events_form_profile_display_edit'),
+('bx_event', 'bx_event_edit_cover', 'bx_events', 0, '_bx_events_form_profile_display_edit_cover'),
+('bx_event', 'bx_event_view', 'bx_events', 1, '_bx_events_form_profile_display_view'),
+('bx_event', 'bx_event_view_full', 'bx_events', 1, '_bx_events_form_profile_display_view_full'),
+('bx_event', 'bx_event_invite', 'bx_events', 0, '_bx_events_form_profile_display_invite');
+
+INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES 
+('bx_event', 'bx_events', 'allow_view_to', 3, '', 0, 'custom', '_bx_events_form_profile_input_sys_allow_view_to', '_bx_events_form_profile_input_allow_view_to', '_bx_events_form_profile_input_allow_view_to_desc', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_event', 'bx_events', 'cover', 'a:1:{i:0;s:20:\"bx_events_cover_crop\";}', 'a:1:{s:20:\"bx_events_cover_crop\";s:24:\"_sys_uploader_crop_title\";}', 0, 'files', '_bx_events_form_profile_input_sys_cover', '_bx_events_form_profile_input_cover', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_event', 'bx_events', 'date_end', 0, '', 0, 'datetime', '_bx_events_form_profile_input_sys_date_end', '_bx_events_form_profile_input_date_end', '', 1, 0, 0, '', '', '', 'date_time', '', '_bx_events_form_profile_input_date_end_err', 'DateTimeUtc', '', 1, 0),
+('bx_event', 'bx_events', 'date_start', 0, '', 0, 'datetime', '_bx_events_form_profile_input_sys_date_start', '_bx_events_form_profile_input_date_start', '', 1, 0, 0, '', '', '', 'date_time', '', '_bx_events_form_profile_input_date_start_err', 'DateTimeUtc', '', 1, 0),
+('bx_event', 'bx_events', 'delete_confirm', 1, '', 0, 'checkbox', '_bx_events_form_profile_input_sys_delete_confirm', '_bx_events_form_profile_input_delete_confirm', '_bx_events_form_profile_input_delete_confirm_info', 1, 0, 0, '', '', '', 'avail', '', '_bx_events_form_profile_input_delete_confirm_error', '', '', 1, 0),
+('bx_event', 'bx_events', 'do_submit', '_sys_form_account_input_submit', '', 0, 'submit', '_bx_events_form_profile_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_event', 'bx_events', 'event_cat', '', '#!bx_events_cats', 0, 'select', '_bx_events_form_profile_input_sys_event_cat', '_bx_events_form_profile_input_event_cat', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_events_form_profile_input_event_cat_err', 'Xss', '', 1, 1),
+('bx_event', 'bx_events', 'reminder', '', '#!bx_events_reminder', 0, 'select', '_bx_events_form_profile_input_sys_reminder', '_bx_events_form_profile_input_reminder', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 1),
+('bx_event', 'bx_events', 'event_desc', '', '', 0, 'textarea', '_bx_events_form_profile_input_sys_event_desc', '_bx_events_form_profile_input_event_desc', '', 0, 0, 2, '', '', '', '', '', '', 'XssHtml', '', 1, 1),
+('bx_event', 'bx_events', 'event_name', '', '', 0, 'text', '_bx_events_form_profile_input_sys_event_name', '_bx_events_form_profile_input_event_name', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_events_form_profile_input_event_name_err', 'Xss', '', 1, 0),
+('bx_event', 'bx_events', 'initial_members', '', '', 0, 'custom', '_bx_events_form_profile_input_sys_initial_members', '_bx_events_form_profile_input_initial_members', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 1),
+('bx_event', 'bx_events', 'join_confirmation', 1, '', 1, 'switcher', '_bx_events_form_profile_input_sys_join_confirm', '_bx_events_form_profile_input_join_confirm', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
+('bx_event', 'bx_events', 'picture', 'a:1:{i:0;s:22:\"bx_events_picture_crop\";}', 'a:1:{s:22:\"bx_events_picture_crop\";s:24:\"_sys_uploader_crop_title\";}', 0, 'files', '_bx_events_form_profile_input_sys_picture', '_bx_events_form_profile_input_picture', '', 0, 0, 0, '', '', '', '', '', '_bx_events_form_profile_input_picture_err', '', '', 1, 0),
+('bx_event', 'bx_events', 'reoccurring', '', '', 0, 'custom', '_bx_events_form_profile_input_sys_reoccurring', '_bx_events_form_profile_input_reoccurring', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 1),
+('bx_event', 'bx_events', 'time', '', '', 0, 'custom', '_bx_events_form_profile_input_sys_time', '_bx_events_form_profile_input_time', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_event', 'bx_events', 'timezone', 'UTC', '', 0, 'select', '_bx_events_form_profile_input_sys_timezone', '_bx_events_form_profile_input_timezone', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
+('bx_event', 'bx_events', 'location', '', '', 0, 'location', '_sys_form_input_sys_location', '_sys_form_input_location', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0);
+
+INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES 
+('bx_event_add', 'time', 2147483647, 0, 1),
+('bx_event_add', 'delete_confirm', 2147483647, 0, 2),
+('bx_event_add', 'cover', 2147483647, 0, 3),
+('bx_event_add', 'initial_members', 2147483647, 1, 4),
+('bx_event_add', 'picture', 2147483647, 1, 5),
+('bx_event_add', 'event_name', 2147483647, 1, 6),
+('bx_event_add', 'event_cat', 2147483647, 1, 7),
+('bx_event_add', 'event_desc', 2147483647, 1, 8),
+('bx_event_add', 'location', 2147483647, 1, 9),
+('bx_event_add', 'date_start', 2147483647, 1, 10),
+('bx_event_add', 'date_end', 2147483647, 1, 11),
+('bx_event_add', 'timezone', 2147483647, 1, 12),
+('bx_event_add', 'reoccurring', 2147483647, 1, 13),
+('bx_event_add', 'join_confirmation', 2147483647, 1, 14),
+('bx_event_add', 'reminder', 2147483647, 1, 15),
+('bx_event_add', 'allow_view_to', 2147483647, 1, 16),
+('bx_event_add', 'do_submit', 2147483647, 1, 17),
+
+('bx_event_invite', 'initial_members', 2147483647, 1, 1),
+('bx_event_invite', 'do_submit', 2147483647, 1, 2),
+
+('bx_event_delete', 'cover', 2147483647, 0, 0),
+('bx_event_delete', 'picture', 2147483647, 0, 0),
+('bx_event_delete', 'delete_confirm', 2147483647, 1, 0),
+('bx_event_delete', 'do_submit', 2147483647, 1, 1),
+('bx_event_delete', 'event_name', 2147483647, 0, 2),
+('bx_event_delete', 'event_cat', 2147483647, 0, 3),
+
+('bx_event_edit', 'time', 2147483647, 0, 1),
+('bx_event_edit', 'initial_members', 2147483647, 0, 2),
+('bx_event_edit', 'delete_confirm', 2147483647, 0, 3),
+('bx_event_edit', 'cover', 2147483647, 0, 4),
+('bx_event_edit', 'picture', 2147483647, 1, 5),
+('bx_event_edit', 'event_name', 2147483647, 1, 6),
+('bx_event_edit', 'event_cat', 2147483647, 1, 7),
+('bx_event_edit', 'event_desc', 2147483647, 1, 8),
+('bx_event_edit', 'location', 2147483647, 1, 9),
+('bx_event_edit', 'date_start', 2147483647, 1, 10),
+('bx_event_edit', 'date_end', 2147483647, 1, 11),
+('bx_event_edit', 'timezone', 2147483647, 1, 12),
+('bx_event_edit', 'reoccurring', 2147483647, 1, 13),
+('bx_event_edit', 'join_confirmation', 2147483647, 1, 14),
+('bx_event_edit', 'reminder', 2147483647, 1, 15),
+('bx_event_edit', 'allow_view_to', 2147483647, 1, 16),
+('bx_event_edit', 'do_submit', 2147483647, 1, 17),
+
+('bx_event_edit_cover', 'allow_view_to', 2147483647, 0, 1),
+('bx_event_edit_cover', 'time', 2147483647, 0, 2),
+('bx_event_edit_cover', 'reoccurring', 2147483647, 0, 3),
+('bx_event_edit_cover', 'join_confirmation', 2147483647, 0, 4),
+('bx_event_edit_cover', 'initial_members', 2147483647, 0, 5),
+('bx_event_edit_cover', 'timezone', 2147483647, 0, 6),
+('bx_event_edit_cover', 'event_desc', 2147483647, 0, 7),
+('bx_event_edit_cover', 'date_start', 2147483647, 0, 8),
+('bx_event_edit_cover', 'date_end', 2147483647, 0, 9),
+('bx_event_edit_cover', 'delete_confirm', 2147483647, 0, 10),
+('bx_event_edit_cover', 'event_name', 2147483647, 0, 11),
+('bx_event_edit_cover', 'location', 2147483647, 0, 12),
+('bx_event_edit_cover', 'picture', 2147483647, 0, 13),
+('bx_event_edit_cover', 'event_cat', 2147483647, 0, 14),
+('bx_event_edit_cover', 'cover', 2147483647, 1, 15),
+('bx_event_edit_cover', 'do_submit', 2147483647, 1, 16),
+
+('bx_event_view', 'allow_view_to', 2147483647, 0, 1),
+('bx_event_view', 'reoccurring', 2147483647, 0, 2),
+('bx_event_view', 'join_confirmation', 2147483647, 0, 3),
+('bx_event_view', 'initial_members', 2147483647, 0, 4),
+('bx_event_view', 'delete_confirm', 2147483647, 0, 5),
+('bx_event_view', 'picture', 2147483647, 0, 6),
+('bx_event_view', 'cover', 2147483647, 0, 7),
+('bx_event_view', 'do_submit', 2147483647, 0, 8),
+('bx_event_view', 'event_name', 2147483647, 1, 9),
+('bx_event_view', 'event_cat', 2147483647, 1, 10),
+('bx_event_view', 'date_start', 2147483647, 1, 11),
+('bx_event_view', 'date_end', 2147483647, 1, 12),
+('bx_event_view', 'time', 2147483647, 1, 13),
+('bx_event_view', 'timezone', 0, 1, 14),
+('bx_event_view', 'event_desc', 2147483647, 0, 15),
+
+('bx_event_view_full', 'allow_view_to', 2147483647, 0, 1),
+('bx_event_view_full', 'reoccurring', 2147483647, 0, 2),
+('bx_event_view_full', 'picture', 2147483647, 0, 3),
+('bx_event_view_full', 'join_confirmation', 2147483647, 0, 4),
+('bx_event_view_full', 'initial_members', 2147483647, 0, 5),
+('bx_event_view_full', 'do_submit', 2147483647, 0, 6),
+('bx_event_view_full', 'delete_confirm', 2147483647, 0, 7),
+('bx_event_view_full', 'cover', 2147483647, 0, 8),
+('bx_event_view_full', 'event_name', 2147483647, 1, 9),
+('bx_event_view_full', 'event_cat', 2147483647, 1, 10),
+('bx_event_view_full', 'date_start', 2147483647, 1, 11),
+('bx_event_view_full', 'date_end', 2147483647, 1, 12),
+('bx_event_view_full', 'time', 2147483647, 1, 13),
+('bx_event_view_full', 'timezone', 0, 1, 14),
+('bx_event_view_full', 'event_desc', 2147483647, 0, 15);
+
+-- PRE-VALUES
+
+INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
+('bx_events_reminder', '_bx_events_pre_lists_reminder', 'bx_events', '0');
+
+INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES
+('bx_events_reminder', '0', 0, '_bx_events_reminder_none', ''),
+('bx_events_reminder', '1', 1, '_bx_events_reminder_1h', ''),
+('bx_events_reminder', '2', 2, '_bx_events_reminder_2h', ''),
+('bx_events_reminder', '3', 3, '_bx_events_reminder_3h', ''),
+('bx_events_reminder', '6', 4, '_bx_events_reminder_6h', ''),
+('bx_events_reminder', '12', 5, '_bx_events_reminder_12h', ''),
+('bx_events_reminder', '24', 6, '_bx_events_reminder_24h', '');
+
+INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
+('bx_events_cats', '_bx_events_pre_lists_cats', 'bx_events', '0');
+
+INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES
+('bx_events_cats', '', 0, '_sys_please_select', ''),
+('bx_events_cats', '1', 1, '_bx_events_cat_Conference', ''),
+('bx_events_cats', '2', 2, '_bx_events_cat_Festival', ''),
+('bx_events_cats', '3', 3, '_bx_events_cat_Fundraiser', ''),
+('bx_events_cats', '4', 4, '_bx_events_cat_Lecture', ''),
+('bx_events_cats', '5', 5, '_bx_events_cat_Market', ''),
+('bx_events_cats', '6', 6, '_bx_events_cat_Meal', ''),
+('bx_events_cats', '7', 7, '_bx_events_cat_Social_Mixer', ''),
+('bx_events_cats', '8', 8, '_bx_events_cat_Tour', ''),
+('bx_events_cats', '9', 9, '_bx_events_cat_Volunteering', ''),
+('bx_events_cats', '10', 10, '_bx_events_cat_Workshop', ''),
+('bx_events_cats', '11', 11, '_bx_events_cat_Other', '');
+
+INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
+('bx_events_repeat_year', '_bx_events_pre_lists_repeat_year', 'bx_events', '0');
+
+INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES
+('bx_events_repeat_year', '1', 1, '_bx_events_cat_repeat_year_every_year', ''),
+('bx_events_repeat_year', '2', 2, '_bx_events_cat_repeat_year_every_2_years', ''),
+('bx_events_repeat_year', '3', 3, '_bx_events_cat_repeat_year_every_3_years', ''),
+('bx_events_repeat_year', '4', 4, '_bx_events_cat_repeat_year_every_4_years', '');
+
+INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
+('bx_events_repeat_month', '_bx_events_pre_lists_repeat_month', 'bx_events', '0');
+
+INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES
+('bx_events_repeat_month', '0', 0, '_bx_events_cat_repeat_month_every_month', ''),
+('bx_events_repeat_month', '1', 1, '_bx_events_cat_repeat_month_jan', ''),
+('bx_events_repeat_month', '2', 2, '_bx_events_cat_repeat_month_feb', ''),
+('bx_events_repeat_month', '3', 3, '_bx_events_cat_repeat_month_mar', ''),
+('bx_events_repeat_month', '4', 4, '_bx_events_cat_repeat_month_apr', ''),
+('bx_events_repeat_month', '5', 5, '_bx_events_cat_repeat_month_may', ''),
+('bx_events_repeat_month', '6', 6, '_bx_events_cat_repeat_month_jun', ''),
+('bx_events_repeat_month', '7', 7, '_bx_events_cat_repeat_month_jul', ''),
+('bx_events_repeat_month', '8', 8, '_bx_events_cat_repeat_month_aug', ''),
+('bx_events_repeat_month', '9', 9, '_bx_events_cat_repeat_month_sep', ''),
+('bx_events_repeat_month', '10', 10, '_bx_events_cat_repeat_month_oct', ''),
+('bx_events_repeat_month', '11', 11, '_bx_events_cat_repeat_month_nov', ''),
+('bx_events_repeat_month', '12', 12, '_bx_events_cat_repeat_month_dec', '');
+
+
+INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
+('bx_events_repeat_week_of_month', '_bx_events_pre_lists_repeat_week_of_month', 'bx_events', '0');
+
+INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES
+('bx_events_repeat_week_of_month', '0', 0, '_bx_events_cat_repeat_week_of_month_every_week', ''),
+('bx_events_repeat_week_of_month', '1', 1, '_bx_events_cat_repeat_week_of_month_first_week_of_month', ''),
+('bx_events_repeat_week_of_month', '2', 2, '_bx_events_cat_repeat_week_of_month_second_week_of_month', ''),
+('bx_events_repeat_week_of_month', '3', 3, '_bx_events_cat_repeat_week_of_month_third_week_of_month', ''),
+('bx_events_repeat_week_of_month', '4', 4, '_bx_events_cat_repeat_week_of_month_fourth_week_of_month', ''),
+('bx_events_repeat_week_of_month', '5', 5, '_bx_events_cat_repeat_week_of_month_fifth_week_of_month', ''),
+('bx_events_repeat_week_of_month', '6', 6, '_bx_events_cat_repeat_week_of_month_sixth_week_of_month', '');
+
+
+INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
+('bx_events_repeat_day_of_month', '_bx_events_pre_lists_repeat_day_of_month', 'bx_events', '0');
+
+INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES
+('bx_events_repeat_day_of_month', '0', 0, '_bx_events_cat_repeat_day_of_month_every_day', ''),
+('bx_events_repeat_day_of_month', '1', 1, '1', ''),
+('bx_events_repeat_day_of_month', '2', 2, '2', ''),
+('bx_events_repeat_day_of_month', '3', 3, '3', ''),
+('bx_events_repeat_day_of_month', '4', 4, '4', ''),
+('bx_events_repeat_day_of_month', '5', 5, '5', ''),
+('bx_events_repeat_day_of_month', '6', 6, '6', ''),
+('bx_events_repeat_day_of_month', '7', 7, '7', ''),
+('bx_events_repeat_day_of_month', '8', 8, '8', ''),
+('bx_events_repeat_day_of_month', '9', 9, '9', ''),
+('bx_events_repeat_day_of_month', '10', 10, '10', ''),
+('bx_events_repeat_day_of_month', '11', 11, '11', ''),
+('bx_events_repeat_day_of_month', '12', 12, '12', ''),
+('bx_events_repeat_day_of_month', '13', 13, '13', ''),
+('bx_events_repeat_day_of_month', '14', 14, '14', ''),
+('bx_events_repeat_day_of_month', '15', 15, '15', ''),
+('bx_events_repeat_day_of_month', '16', 16, '16', ''),
+('bx_events_repeat_day_of_month', '17', 17, '17', ''),
+('bx_events_repeat_day_of_month', '18', 18, '18', ''),
+('bx_events_repeat_day_of_month', '19', 19, '19', ''),
+('bx_events_repeat_day_of_month', '20', 20, '20', ''),
+('bx_events_repeat_day_of_month', '21', 21, '21', ''),
+('bx_events_repeat_day_of_month', '22', 22, '22', ''),
+('bx_events_repeat_day_of_month', '23', 23, '23', ''),
+('bx_events_repeat_day_of_month', '24', 24, '24', ''),
+('bx_events_repeat_day_of_month', '25', 25, '25', ''),
+('bx_events_repeat_day_of_month', '26', 26, '26', ''),
+('bx_events_repeat_day_of_month', '27', 27, '27', ''),
+('bx_events_repeat_day_of_month', '28', 28, '28', ''),
+('bx_events_repeat_day_of_month', '29', 29, '29', ''),
+('bx_events_repeat_day_of_month', '30', 30, '30', ''),
+('bx_events_repeat_day_of_month', '31', 31, '31', '');
+
+
+INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
+('bx_events_repeat_day_of_week', '_bx_events_pre_lists_repeat_day_of_week', 'bx_events', '0');
+
+INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES
+('bx_events_repeat_day_of_week', '0', 0, '_bx_events_cat_repeat_day_of_week_every_day', ''),
+('bx_events_repeat_day_of_week', '1', 1, '_bx_events_cat_repeat_day_of_week_mon', ''),
+('bx_events_repeat_day_of_week', '2', 2, '_bx_events_cat_repeat_day_of_week_tue', ''),
+('bx_events_repeat_day_of_week', '3', 3, '_bx_events_cat_repeat_day_of_week_wed', ''),
+('bx_events_repeat_day_of_week', '4', 4, '_bx_events_cat_repeat_day_of_week_thu', ''),
+('bx_events_repeat_day_of_week', '5', 5, '_bx_events_cat_repeat_day_of_week_fri', ''),
+('bx_events_repeat_day_of_week', '6', 6, '_bx_events_cat_repeat_day_of_week_sat', ''),
+('bx_events_repeat_day_of_week', '7', 7, '_bx_events_cat_repeat_day_of_week_sun', '');
+
+-- STUDIO PAGE & WIDGET
+
+INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
+(3, 'bx_events', '_bx_events', '_bx_events', 'bx_events@modules/boonex/events/|std-icon.svg');
+SET @iPageId = LAST_INSERT_ID();
+
+SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
+SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
+INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
+(@iPageId, 'bx_events', '{url_studio}module.php?name=bx_events', '', 'bx_events@modules/boonex/events/|std-icon.svg', '_bx_events', '', '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));
+

+ 37 - 0
modules/boonex/events/updates/9.0.2_9.0.3/source/install/sql/uninstall.sql

@@ -0,0 +1,37 @@
+
+-- TABLES
+
+DROP TABLE IF EXISTS `bx_events_data`, `bx_events_intervals`, `bx_events_pics`, `bx_events_pics_resized`, `bx_events_cmts`, `bx_events_views_track`, `bx_events_meta_keywords`, `bx_events_meta_locations`, `bx_events_fans`, `bx_events_admins`, `bx_events_votes`, `bx_events_votes_track`, `bx_events_reports`, `bx_events_reports_track`, `bx_events_favorites_track`;
+
+-- PROFILES
+
+DELETE FROM sys_profiles WHERE `type` = 'bx_events';
+
+-- STORAGES & TRANSCODERS
+
+DELETE FROM `sys_objects_storage` WHERE `object` IN('bx_events_pics', 'bx_events_pics_resized');
+DELETE FROM `sys_storage_tokens` WHERE `object` IN('bx_events_pics', 'bx_events_pics_resized');
+
+DELETE FROM `sys_objects_transcoder` WHERE `object` IN('bx_events_icon', 'bx_events_thumb', 'bx_events_avatar', 'bx_events_picture', 'bx_events_cover', 'bx_events_cover_thumb', 'bx_events_gallery');
+DELETE FROM `sys_transcoder_filters` WHERE `transcoder_object` IN('bx_events_icon', 'bx_events_thumb', 'bx_events_avatar', 'bx_events_picture', 'bx_events_cover', 'bx_events_cover_thumb', 'bx_events_gallery');
+DELETE FROM `sys_transcoder_images_files` WHERE `transcoder_object` IN('bx_events_icon', 'bx_events_thumb', 'bx_events_avatar', 'bx_events_picture', 'bx_events_cover', 'bx_events_cover_thumb', 'bx_events_gallery');
+
+-- FORMS
+
+DELETE FROM `sys_objects_form` WHERE `module` = 'bx_events';
+DELETE FROM `sys_form_displays` WHERE `module` = 'bx_events';
+DELETE FROM `sys_form_inputs` WHERE `module` = 'bx_events';
+DELETE FROM `sys_form_display_inputs` WHERE `display_name` IN('bx_event_add', 'bx_event_delete', 'bx_event_edit', 'bx_event_edit_cover', 'bx_event_view', 'bx_event_view_full', 'bx_event_invite');
+
+-- PRE-VALUES
+
+DELETE FROM `sys_form_pre_lists` WHERE `module` = 'bx_events';
+
+DELETE FROM `sys_form_pre_values` WHERE `Key` IN('bx_events_cats');
+
+-- STUDIO PAGE & WIDGET
+
+DELETE FROM `tp`, `tw`, `tpw`
+USING `sys_std_pages` AS `tp`, `sys_std_widgets` AS `tw`, `sys_std_pages_widgets` AS `tpw`
+WHERE `tp`.`id` = `tw`.`page_id` AND `tw`.`id` = `tpw`.`widget_id` AND `tp`.`name` = 'bx_events';
+

+ 62 - 0
modules/boonex/events/updates/9.0.2_9.0.3/source/js/manage_tools.js

@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Events Events
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+function BxEventsManageTools(oOptions) {
+	this._iSearchTimeoutId = false;
+	this._sActionsUrl = oOptions.sActionUrl;
+	this._sObjNameGrid = oOptions.sObjNameGrid;
+    this._sObjName = oOptions.sObjName == undefined ? 'oBxEventsManageTools' : 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;
+}
+
+BxEventsManageTools.prototype.onChangeFilter = function(oFilter) {
+	var $this = this;
+	var oFilter1 = $('#bx-grid-filter1-' + this._sObjNameGrid);
+	var sValueFilter1 = oFilter1.length > 0 ? oFilter1.val() : '';
+
+	var oSearch = $('#bx-grid-search-' + this._sObjNameGrid);
+	var sValueSearch = oSearch.length > 0 ? oSearch.val() : '';
+	if(sValueSearch == _t('_sys_grid_search'))
+		sValueSearch = '';
+
+	clearTimeout($this._iSearchTimeoutId);
+    $this._iSearchTimeoutId = setTimeout(function () {
+        glGrids[$this._sObjNameGrid].setFilter(sValueFilter1 + $this._sParamsDivider + sValueSearch, true);
+    }, 500);
+};
+
+BxEventsManageTools.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')
+	});
+};
+
+BxEventsManageTools.prototype.onClickDelete = function(iContentId) {
+	$('.bx-popup-applied:visible').dolPopupHide();
+
+	glGrids[this._sObjNameGrid].actionWithId(iContentId, 'delete', {}, '', false, 1);
+};
+
+BxEventsManageTools.prototype.onClickDeleteWithContent = function(iContentId) {
+	$('.bx-popup-applied:visible').dolPopupHide();
+
+	glGrids[this._sObjNameGrid].actionWithId(iContentId, 'delete_with_content', {}, '', false, 1);
+};
+
+/** @} */

+ 68 - 0
modules/boonex/facebook_connect/updates/9.0.2_9.0.3/source/install/config.php

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

+ 24 - 0
modules/boonex/facebook_connect/updates/9.0.2_9.0.3/source/install/langs/en.xml

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+	<string name="_sys_module_facebook_connect"><![CDATA[Facebook Connect]]></string>
+	<string name="_bx_facebook"><![CDATA[Facebook Connect]]></string>
+	<string name="_bx_facebook_settings"><![CDATA[Facebook Connect]]></string>
+	<string name="_bx_facebook_information_block"><![CDATA[To get your "App ID" and "App Secret", you need to <a href="https://developers.facebook.com/apps/" target="_blank">make Facebook app</a>. <br /><br />Please follow <a href="http://www.boonex.com/forums/topic/How-to-setup-Facebook-Connect-module.htm" target="_blank">these instructions</a> on how to create and setup the app. <br /><br />Your "Site URL" for the app: <b>{0}</b> <br /><br />After completing these steps, insert your "App ID" and "App Secret" below:]]></string>
+	<string name="_bx_facebook_profile_error_api_keys"><![CDATA[Please configure the module in admin panel (can't define facebook api keys)]]></string>
+	<string name="_bx_facebook_chart"><![CDATA[Facebook Profiles]]></string>
+	<string name="_bx_facebook_auth_title"><![CDATA[Facebook Connect]]></string>
+	<string name="_bx_facebook_error"><![CDATA[Error]]></string>
+
+    <string name="_bx_facebook_adm_stg_cpt_type"><![CDATA[Facebook Connect]]></string>
+    <string name="_bx_facebook_option_app_id"><![CDATA[Facebook App ID]]></string>
+    <string name="_bx_facebook_option_app_secret"><![CDATA[Facebook App Secret]]></string>
+    <string name="_bx_facebook_option_auto_friends"><![CDATA[Auto-friend members if they are already friends on Facebook]]></string>
+    <string name="_bx_facebook_option_fetch_extended_info"><![CDATA[Fetch extended profile info (facebook app review is required)]]></string>
+
+	<string name="_bx_facebook_conect_et_password_generated"><![CDATA[Facebook connect temporary password]]></string>
+	<string name="_bx_facebook_conect_et_password_generated_subject"><![CDATA[Temporary password]]></string>
+	<string name="_bx_facebook_conect_et_password_generated_body"><![CDATA[{email_header}
+<p>Temporary password - <b>{password}</b></p>
+<p>Change it after logging-in.</p>
+{email_footer}]]></string>
+</resources>

+ 52 - 0
modules/boonex/facebook_connect/updates/9.0.2_9.0.3/source/install/sql/enable.sql

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

+ 143 - 0
modules/boonex/files/updates/9.0.0_9.0.1/source/classes/BxFilesConfig.php

@@ -0,0 +1,143 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Files Files
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxFilesConfig extends BxBaseModTextConfig
+{
+    function __construct($aModule)
+    {
+        parent::__construct($aModule);
+
+        $aMenuItems2Methods = array (
+            'download-file' => 'checkAllowedView',
+            'edit-file' => 'checkAllowedEdit',
+            'delete-file' => 'checkAllowedDelete',
+        );
+
+        $this->CNF = array (
+
+            // module icon
+            'ICON' => 'file-o col-red3',
+
+            // database tables
+            'TABLE_ENTRIES' => $aModule['db_prefix'] . 'main',
+            'TABLE_ENTRIES_FULLTEXT' => 'search_fields',
+            'TABLE_FILES' => $aModule['db_prefix'] . 'files',
+
+            // database fields
+            'FIELD_ID' => 'id',
+            'FIELD_AUTHOR' => 'author',
+            'FIELD_ADDED' => 'added',
+            'FIELD_CHANGED' => 'changed',
+            'FIELD_FILE_ID' => 'file_id',
+            'FIELD_TITLE' => 'title',
+            'FIELD_CATEGORY' => 'cat',
+            'FIELD_TEXT' => 'desc',
+            'FIELD_TEXT_ID' => 'file-desc',
+            'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
+            'FIELD_PHOTO' => 'attachments',
+            'FIELD_COMMENTS' => 'comments',
+	        'FIELD_STATUS' => 'status',
+        	'FIELD_STATUS_ADMIN' => 'status_admin',
+            'FIELD_LOCATION_PREFIX' => 'location',
+            'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
+
+            // page URIs
+            'URI_VIEW_ENTRY' => 'view-file',
+            'URI_AUTHOR_ENTRIES' => 'files-author',
+            'URI_GROUP_ENTRIES' => 'group-files',
+            'URI_ADD_ENTRY' => 'create-file',
+        	'URI_EDIT_ENTRY' => 'edit-file',
+        	'URI_MANAGE_COMMON' => 'files-manage',
+
+            'URL_HOME' => 'page.php?i=files-home',
+            'URL_POPULAR' => 'page.php?i=files-popular',
+            'URL_UPDATED' => 'page.php?i=files-updated',
+        	'URL_MANAGE_COMMON' => 'page.php?i=files-manage',
+        	'URL_MANAGE_ADMINISTRATION' => 'page.php?i=files-administration',
+
+            // some params
+            'PARAM_CHARS_SUMMARY' => 'bx_files_summary_chars',
+            'PARAM_CHARS_SUMMARY_PLAIN' => '',
+            'PARAM_NUM_RSS' => 'bx_files_rss_num',
+        	'PARAM_SEARCHABLE_FIELDS' => 'bx_files_searchable_fields',
+
+            // objects
+            'OBJECT_STORAGE' => 'bx_files_files',
+            'OBJECT_IMAGES_TRANSCODER_PREVIEW' => 'bx_files_preview',
+            'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_files_gallery',
+            'OBJECT_VIDEOS_TRANSCODERS' => array(),
+        	'OBJECT_REPORTS' => 'bx_files',
+            'OBJECT_VIEWS' => 'bx_files',
+            'OBJECT_VOTES' => 'bx_files',
+        	'OBJECT_FAVORITES' => 'bx_files',
+        	'OBJECT_FEATURED' => 'bx_files',
+            'OBJECT_METATAGS' => 'bx_files',
+            'OBJECT_COMMENTS' => 'bx_files',
+            'OBJECT_PRIVACY_VIEW' => 'bx_files_allow_view_to',
+            'OBJECT_FORM_ENTRY' => 'bx_files',
+            'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_files_entry_view',
+            'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_files_entry_edit',
+            'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_files_entry_edit',
+            'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_files_entry_delete',
+            'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_files_view', // actions menu on view entry page
+            'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_files_my', // actions menu on my entries page
+            'OBJECT_MENU_SUBMENU' => 'bx_files_submenu', // main module submenu
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_files_view_submenu', // view entry submenu
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'files-home', // first item in view entry submenu from main module submenu
+            'OBJECT_MENU_MANAGE_TOOLS' => 'bx_files_menu_manage_tools', //manage menu in content administration tools
+            'OBJECT_GRID_ADMINISTRATION' => 'bx_files_administration',
+        	'OBJECT_GRID_COMMON' => 'bx_files_common',
+            'OBJECT_UPLOADERS' => array('sys_simple', 'sys_html5'),
+
+            // menu items which visibility depends on custom visibility checking
+            'MENU_ITEM_TO_METHOD' => array (
+                'bx_files_my' => array (
+                    'create-file' => 'checkAllowedAdd',
+                ),
+                'bx_files_view' => $aMenuItems2Methods,
+            ),
+
+            // some language keys
+            'T' => array (
+                'txt_sample_single' => '_bx_files_txt_sample_single',
+            	'txt_sample_single_with_article' => '_bx_files_txt_sample_single_with_article',
+            	'txt_sample_comment_single' => '_bx_files_txt_sample_comment_single',
+            	'txt_sample_vote_single' => '_bx_files_txt_sample_vote_single',
+             	'form_field_author' => '_bx_files_form_entry_input_author',
+            	'grid_action_err_delete' => '_bx_files_grid_action_err_delete',
+            	'grid_txt_account_manager' => '_bx_files_grid_txt_account_manager',
+				'filter_item_active' => '_bx_files_grid_filter_item_title_adm_active',
+            	'filter_item_hidden' => '_bx_files_grid_filter_item_title_adm_hidden',
+            	'filter_item_select_one_filter1' => '_bx_files_grid_filter_item_title_adm_select_one_filter1',
+            	'menu_item_manage_my' => '_bx_files_menu_item_title_manage_my',
+            	'menu_item_manage_all' => '_bx_files_menu_item_title_manage_all',
+                'txt_all_entries_by' => '_bx_files_txt_all_entries_by',
+                'txt_all_entries_by_author' => '_bx_files_page_title_browse_by_author',
+            ),
+        );
+
+        $this->_aJsClasses = array(
+        	'manage_tools' => 'BxFilesManageTools'
+        );
+
+        $this->_aJsObjects = array(
+        	'manage_tools' => 'oBxFilesManageTools'
+        );
+
+        $this->_aGridObjects = array(
+        	'common' => $this->CNF['OBJECT_GRID_COMMON'],
+        	'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
+        	
+        );
+    }
+}
+
+/** @} */

+ 222 - 0
modules/boonex/files/updates/9.0.0_9.0.1/source/classes/BxFilesModule.php

@@ -0,0 +1,222 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Files Files
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Files module
+ */
+class BxFilesModule extends BxBaseModTextModule
+{
+    function __construct(&$aModule)
+    {
+        parent::__construct($aModule);
+    }
+
+    /**
+     * Display entries of the author
+     * @return HTML string
+     */
+    public function serviceBrowseGroupAuthor ($iProfileId = 0, $aParams = array())
+    {
+        if (!$iProfileId)
+            $iProfileId = bx_process_input(bx_get('profile_id'), BX_DATA_INT);
+        if (!$iProfileId)
+            return '';
+        if (!($oGroupProfile = BxDolProfile::getInstance($iProfileId)))
+            return '';
+        if (!BxDolService::call($oGroupProfile->getModule(), 'is_group_profile'))
+            return '';
+        
+        return $this->_serviceBrowse ('group_author', array_merge(array('author' => $iProfileId), $aParams), BX_DB_PADDING_DEF, true);
+    }
+
+
+    public function serviceIsAllowedAddContentToProfile($iGroupProfileId)
+    {
+        if (!$iGroupProfileId || !($oProfile = BxDolProfile::getInstance((int)$iGroupProfileId)))
+            return false;
+
+        if ($iGroupProfileId == bx_get_logged_profile_id())
+            return true;
+
+        $sProfileModule = $oProfile->getModule();
+
+        $aContentInfo = BxDolService::call($sProfileModule, 'get_content_info_by_id', array($oProfile->getContentId()));
+        if (BxDolService::call($sProfileModule, 'is_group_profile') && (BxDolService::call($sProfileModule, 'is_fan', array($iGroupProfileId)) || bx_get_logged_profile_id() == $aContentInfo['author']))
+            return true;
+
+        return false;
+    }
+
+    public function serviceMyEntriesActions ($iProfileId = 0)
+    {
+        if (!$iProfileId)
+            $iProfileId = bx_process_input(bx_get('profile_id'), BX_DATA_INT);
+
+        if (!$this->serviceIsAllowedAddContentToProfile($iProfileId))
+            return false;
+
+        $oMenu = BxTemplMenu::getObjectInstance($this->_oConfig->CNF['OBJECT_MENU_ACTIONS_MY_ENTRIES']);
+        return $oMenu ? $oMenu->getCode() : false;
+    }
+
+    public function checkAllowedSetThumb ()
+    {
+        return _t('_sys_txt_access_denied');
+    }
+
+    public function actionDownload($sToken, $iContentId) 
+    {
+        $CNF = $this->_oConfig->CNF;
+        
+        $aData = $this->_oDb->getContentInfoById((int)$iContentId);
+        if (!$aData) {
+            $this->_oTemplate->displayPageNotFound();
+            return;
+        }
+
+        if (CHECK_ACTION_RESULT_ALLOWED !== $this->checkAllowedView($aData)) {
+            $this->_oTemplate->displayAccessDenied();
+            return;
+        }
+
+        $aFile = $this->getContentFile($aData);
+        if (!$aFile) {
+            $this->_oTemplate->displayPageNotFound();
+            return;
+        }
+
+        $oStorage = BxDolStorage::getObjectInstance($CNF['OBJECT_STORAGE']);
+        if (!$oStorage) {
+            $this->_oTemplate->displayErrorOccured();
+            return;
+        }
+
+        if (!$oStorage->download($aFile['remote_id'], $sToken)) {
+            $this->_oTemplate->displayErrorOccured();
+            return;
+        }
+        
+        exit;   
+    }
+    
+    public function getContentFile($aData) 
+    {
+        $CNF = $this->_oConfig->CNF;
+
+        if (!isset($aData[$CNF['FIELD_AUTHOR']]) || !isset($aData[$CNF['FIELD_ID']]))
+            return false;
+
+        $oStorage = BxDolStorage::getObjectInstance($CNF['OBJECT_STORAGE']);
+        if (!$oStorage)
+            return false;
+
+        if (isset($aData[$CNF['FIELD_FILE_ID']]) && $aData[$CNF['FIELD_FILE_ID']]) 
+            return $this->_addFileFields($oStorage->getFile($aData[$CNF['FIELD_FILE_ID']]));
+        
+        $aGhostFiles = $oStorage->getGhosts ($aData[$CNF['FIELD_AUTHOR']], $aData[$CNF['FIELD_ID']]);
+        if (!$aGhostFiles)
+            return false;
+
+        return $this->_addFileFields(array_pop($aGhostFiles));
+    }
+
+    protected function _addFileFields($aFile) 
+    {
+        if (is_array($aFile))
+            $aFile['is_image'] = in_array($aFile['ext'], array('jpg', 'jpeg', 'png', 'gif', /* when ImageMagick is used - 'tif', 'tiff', 'bmp', 'ico', 'psd' */));
+        return $aFile;
+    }
+
+    public function serviceEntityFilePreview($iContentId = 0)
+    {
+        return $this->_serviceTemplateFunc ('entryFilePreview', $iContentId);
+    }
+
+    public function serviceProcessFilesData($iNumberOfFilesToProcessAtOnce = 3)
+    {
+        $CNF = $this->_oConfig->CNF;
+        
+        if (!defined('BX_SYSTEM_JAVA') || !constant('BX_SYSTEM_JAVA'))
+            return;
+        
+        $a = $this->_oDb->getNotProcessedFiles($iNumberOfFilesToProcessAtOnce);
+        if (!$a)
+            return;
+
+        $oStorage = BxDolStorage::getObjectInstance($CNF['OBJECT_STORAGE']);
+        if (!$oStorage)
+            return false;
+        
+        foreach ($a as $aContentInfo) {
+            $aFile = $this->getContentFile($aContentInfo);
+            if (!$aFile) {
+                $this->_oDb->updateFileData ($aContentInfo[$CNF['FIELD_ID']], '');
+                continue;
+            }
+
+            $sFileUrl = $oStorage->getFileUrlById($aFile['id']);
+            $sFilePath = BX_DIRECTORY_PATH_TMP . $aFile['remote_id'] . '.' . $aFile['ext'];
+            @file_put_contents($sFilePath, file_get_contents($sFileUrl));
+            if (!file_exists($sFilePath)) {
+                $this->_oDb->updateFileData ($aContentInfo[$CNF['FIELD_ID']], '');
+                continue;
+            }
+            
+            $sCommand = '"' . constant('BX_SYSTEM_JAVA') . '" -jar "' . $this->_oConfig->getHomePath() . 'data/tika-app.jar" --encoding=UTF-8 --text "' . $sFilePath . '"';
+            $sData = `$sCommand`;
+
+            @unlink($sFilePath);
+
+            $this->_oDb->updateFileData ($aContentInfo[$CNF['FIELD_ID']], $sData);
+        }
+    }
+
+    protected function _getContentForTimelinePost($aEvent, $aContentInfo)
+    {
+        $aResult = parent::_getContentForTimelinePost($aEvent, $aContentInfo);
+
+        $aFile = $this->getContentFile($aContentInfo);
+        if (!$aFile['is_image']) {
+            $oStorage = BxDolStorage::getObjectInstance($this->_oConfig->CNF['OBJECT_STORAGE']);
+            $sIcon = $oStorage ? $oStorage->getFontIconNameByFileName($aFile['file_name']) : 'file-o';
+
+            $aResult['raw'] = $this->_oTemplate->parseHtmlByName('timeline_post.html', array(
+                'title' => $aResult['title'],
+                'title_attr' => bx_html_attribute($aResult['title']),
+                'url' => $aResult['url'],
+                'icon' => $sIcon,
+            ));
+            $aResult['title'] = '';
+        }
+
+        return $aResult;
+    }
+
+    protected function _getImagesForTimelinePost($aEvent, $aContentInfo, $sUrl)
+    {
+        $aFile = $this->getContentFile($aContentInfo);
+        if (!$aFile)
+            return array();
+
+        if (!$aFile['is_image'])
+            return array();
+
+        $sPhotoThumb = '';
+        if ($oImagesTranscoder = BxDolTranscoderImage::getObjectInstance($this->_oConfig->CNF['OBJECT_IMAGES_TRANSCODER_GALLERY']))
+            $sPhotoThumb = $oImagesTranscoder->getFileUrl($aFile['id']);
+
+        return array(
+		    array('url' => $sUrl, 'src' => $sPhotoThumb),
+		);
+    }
+}
+
+/** @} */

+ 126 - 0
modules/boonex/files/updates/9.0.0_9.0.1/source/install/config.php

@@ -0,0 +1,126 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Files Files
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_files',
+    'title' => 'Files',
+    'note' => 'Basic blogging module.',
+    'version' => '9.0.1',
+    'vendor' => 'BoonEx',
+	'help_url' => 'http://feed.boonex.com/?section={module_name}',
+
+    'compatible_with' => array(
+        '9.0.0-RC1'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/files/',
+    'home_uri' => 'files',
+
+    'db_prefix' => 'bx_files_',
+    'class_prefix' => 'BxFiles',
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => 'Files',
+
+    /**
+     * List of page triggers.
+     */
+    'page_triggers' => array (
+    	'trigger_page_profile_view_entry',
+    	'trigger_page_group_view_entry',
+    ),
+    
+    /**
+     * Menu triggers.
+     */
+    'menu_triggers' => array(
+    	'trigger_profile_view_submenu',
+    	'trigger_group_view_submenu',
+    ),
+
+    /**
+     * Storages.
+     */
+    'storages' => array(
+    	'bx_files_files',
+    ),
+
+    /**
+     * Transcoders.
+     */
+    'transcoders' => array(
+		'bx_files_preview',
+        'bx_files_gallery',
+    ),
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+        'execute_sql' => 1,
+        'update_languages' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'uninstall' => array (
+    	'process_storages' => 1,
+        'execute_sql' => 1,
+        'update_languages' => 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,
+    	'register_transcoders' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'disable' => array (
+        'execute_sql' => 1,
+    	'update_relations' => 1,
+    	'unregister_transcoders' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'disable_failed' => array (
+    	'register_transcoders' => 1,
+    	'clear_db_cache' => 1,
+    ),
+
+    /**
+     * Dependencies Section
+     */
+    'dependencies' => array(),
+
+    /**
+     * Relations Section
+     */
+    'relations' => array(
+    	'bx_timeline',
+    	'bx_notifications',
+    ),
+
+);
+
+/** @} */

+ 207 - 0
modules/boonex/files/updates/9.0.0_9.0.1/source/install/langs/en.xml

@@ -0,0 +1,207 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+
+	<string name="_bx_files"><![CDATA[Files]]></string>
+	<string name="_bx_files_cmts"><![CDATA[Files' Comments]]></string>
+
+	<string name="_bx_files_option_summary_chars"><![CDATA[Number of characters in auto-cropped file summary]]></string>
+	<string name="_bx_files_option_per_page_browse"><![CDATA[Number of items per page]]></string>
+    <string name="_bx_files_option_per_page_profile"><![CDATA[Number of items per page on profile/group page]]></string>
+	<string name="_bx_files_option_rss_num"><![CDATA[Number of items in RSS feed]]></string>
+	<string name="_bx_files_option_searchable_fields"><![CDATA[Searchable fields for keyword search]]></string>
+
+	<string name="_bx_files_form_upload"><![CDATA[Files Upload]]></string>
+	<string name="_bx_files_form_entry"><![CDATA[Files]]></string>
+	<string name="_bx_files_form_entry_display_add"><![CDATA[Add Files]]></string>
+	<string name="_bx_files_form_entry_display_edit"><![CDATA[Edit File]]></string>
+	<string name="_bx_files_form_entry_display_delete"><![CDATA[Delete File]]></string>
+	<string name="_bx_files_form_entry_display_view"><![CDATA[View File]]></string>
+	<string name="_bx_files_form_entry_input_author"><![CDATA[Author]]></string>
+	<string name="_bx_files_form_entry_input_sys_do_submit"><![CDATA[Submit]]></string>
+	<string name="_bx_files_form_entry_input_do_submit"><![CDATA[Submit]]></string>
+	<string name="_bx_files_form_entry_input_sys_do_publish"><![CDATA[Publish]]></string>
+	<string name="_bx_files_form_entry_input_do_publish"><![CDATA[Publish]]></string>
+	<string name="_bx_files_form_entry_input_sys_title"><![CDATA[Title]]></string>
+	<string name="_bx_files_form_entry_input_title"><![CDATA[Title]]></string>
+	<string name="_bx_files_form_entry_input_title_err"><![CDATA[Title is essential. Please, fill in this field]]></string>
+	<string name="_bx_files_form_entry_input_sys_cat"><![CDATA[Category]]></string>
+	<string name="_bx_files_form_entry_input_cat"><![CDATA[Category]]></string>
+    <string name="_bx_files_form_entry_input_cat_err"><![CDATA[Please select category]]></string>
+	<string name="_bx_files_form_entry_input_sys_desc"><![CDATA[Description]]></string>
+    <string name="_bx_files_form_entry_input_desc"><![CDATA[Description]]></string>
+	<string name="_bx_files_form_entry_input_sys_data"><![CDATA[File data]]></string>
+	<string name="_bx_files_form_entry_input_data"><![CDATA[File data]]></string>
+	<string name="_bx_files_form_entry_input_sys_delete_confirm"><![CDATA[Delete confirmation]]></string>
+	<string name="_bx_files_form_entry_input_delete_confirm"><![CDATA[I am sure I want to delete this file]]></string>
+	<string name="_bx_files_form_entry_input_delete_confirm_info"><![CDATA[This action can not be undone]]></string>
+	<string name="_bx_files_form_entry_input_delete_confirm_error"><![CDATA[Please check this checkbox if you really want to delete the file]]></string>
+	<string name="_bx_files_form_entry_input_sys_attachment"><![CDATA[File]]></string>
+    <string name="_bx_files_form_entry_input_attachment"><![CDATA[File]]></string>
+	<string name="_bx_files_form_entry_input_sys_attachments"><![CDATA[Files]]></string>
+	<string name="_bx_files_form_entry_input_attachments"><![CDATA[Files]]></string>    
+    <string name="_bx_files_form_entry_input_sys_allow_view_to"><![CDATA[Visibility]]></string>
+    <string name="_bx_files_form_entry_input_allow_view_to"><![CDATA[Visibility]]></string>
+    <string name="_bx_files_form_entry_input_picture_use_as_thumb"><![CDATA[Cover Image]]></string>
+    <string name="_bx_files_form_entry_input_sys_date_added"><![CDATA[Created]]></string>
+    <string name="_bx_files_form_entry_input_date_added"><![CDATA[Created]]></string>
+    <string name="_bx_files_form_entry_input_sys_date_changed"><![CDATA[Updated]]></string>
+    <string name="_bx_files_form_entry_input_date_changed"><![CDATA[Updated]]></string>
+
+	<string name="_bx_files_acl_action_create_entry"><![CDATA[Create File]]></string>
+	<string name="_bx_files_acl_action_delete_entry"><![CDATA[Delete File]]></string>
+	<string name="_bx_files_acl_action_view_entry"><![CDATA[View File]]></string>
+	<string name="_bx_files_acl_action_edit_any_entry"><![CDATA[Edit Any File]]></string>
+
+	<string name="_bx_files_page_title_sys_create_entry"><![CDATA[Upload Files]]></string>
+	<string name="_bx_files_page_title_create_entry"><![CDATA[Upload Files]]></string>
+	<string name="_bx_files_page_block_title_create_entry"><![CDATA[Upload Files]]></string>
+	<string name="_bx_files_page_title_sys_edit_entry"><![CDATA[Edit]]></string>
+	<string name="_bx_files_page_title_edit_entry"><![CDATA[Edit]]></string>
+	<string name="_bx_files_page_block_title_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_files_page_title_sys_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_files_page_title_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_files_page_block_title_delete_entry"><![CDATA[Delete]]></string>
+	<string name="_bx_files_page_title_sys_view_entry"><![CDATA[View File]]></string>
+	<string name="_bx_files_page_title_view_entry"><![CDATA[{title}]]></string>
+	<string name="_bx_files_page_block_title_entry_text"><![CDATA[File Description]]></string>
+	<string name="_bx_files_page_title_browse"><![CDATA[Files]]></string>
+	<string name="_bx_files_page_title_search_results"><![CDATA[Files matching "{0}"]]></string>
+	<string name="_bx_files_page_title_browse_by_author"><![CDATA[Files of {display_name}]]></string>
+	<string name="_bx_files_page_title_browse_featured"><![CDATA[Featured]]></string>
+    <string name="_bx_files_page_title_browse_recent"><![CDATA[Latest]]></string>
+    <string name="_bx_files_page_title_browse_popular"><![CDATA[Popular]]></string>
+    <string name="_bx_files_page_title_browse_updated"><![CDATA[Updated Files]]></string>
+    <string name="_bx_files_page_title_sys_home"><![CDATA[Files Home]]></string>
+    <string name="_bx_files_page_title_home"><![CDATA[Files]]></string>
+    <string name="_bx_files_page_block_title_featured_entries_view_extended"><![CDATA[Featured]]></string>
+    <string name="_bx_files_page_block_title_recent_entries"><![CDATA[Latest (Gallery View)]]></string>
+    <string name="_bx_files_page_block_title_recent_entries_view_extended"><![CDATA[Latest]]></string>
+    <string name="_bx_files_page_block_title_entry_social_sharing"><![CDATA[Share]]></string>
+    <string name="_bx_files_page_block_title_entry_author"><![CDATA[Author]]></string>
+    <string name="_bx_files_page_block_title_entry_actions"><![CDATA[Actions]]></string>
+    <string name="_bx_files_page_block_title_entry_comments"><![CDATA[Comments]]></string>
+    <string name="_bx_files_page_block_title_entry_comments_link"><![CDATA[Comments to <a href="{entry_link}">{title}</a>]]></string>
+    <string name="_bx_files_page_block_title_entry_location"><![CDATA[Location]]></string>
+    <string name="_bx_files_page_block_title_entry_attachments"><![CDATA[Attachments]]></string>
+    <string name="_bx_files_page_block_title_entry_all_actions"><![CDATA[All Actions]]></string>
+    <string name="_bx_files_page_title_sys_entries_popular"><![CDATA[Popular]]></string>
+    <string name="_bx_files_page_title_entries_popular"><![CDATA[Popular]]></string>
+    <string name="_bx_files_page_title_sys_entries_updated"><![CDATA[Updated Files]]></string>
+    <string name="_bx_files_page_title_entries_updated"><![CDATA[Updated Files]]></string>
+    <string name="_bx_files_page_block_title_popular_entries"><![CDATA[Popular]]></string>
+    <string name="_bx_files_page_block_title_popular_entries_view_extended"><![CDATA[Popular (Extended View)]]></string>
+    <string name="_bx_files_page_block_title_updated_entries"><![CDATA[Updated Files]]></string>
+    <string name="_bx_files_page_title_sys_view_entry_comments"><![CDATA[File Comments]]></string>
+    <string name="_bx_files_page_title_view_entry_comments"><![CDATA[Comments to {title}]]></string>
+    <string name="_bx_files_page_title_sys_entries_of_author"><![CDATA[Files of author]]></string>
+    <string name="_bx_files_page_title_entries_of_author"><![CDATA[Files by {display_name}]]></string>
+    <string name="_bx_files_page_block_title_favorites_of_author"><![CDATA[Favorites by <a href="{profile_link}">{display_name}</a>]]></string>
+    <string name="_bx_files_page_block_title_sys_favorites_of_author"><![CDATA[Favorites of author]]></string>
+    <string name="_bx_files_page_block_title_entries_of_author"><![CDATA[Files by <a href="{profile_link}">{display_name}</a>]]></string>
+    <string name="_bx_files_page_block_title_sys_entries_of_author"><![CDATA[Files of author]]></string>   
+    <string name="_bx_files_page_block_title_entries_actions"><![CDATA[Files actions]]></string>
+    <string name="_bx_files_page_block_title_browse_cmts"><![CDATA[Files' Comments]]></string>
+	<string name="_bx_files_page_title_sys_manage"><![CDATA[Manage Own]]></string>
+	<string name="_bx_files_page_title_sys_manage_administration"><![CDATA[Manage All]]></string>
+	<string name="_bx_files_page_title_manage"><![CDATA[Manage]]></string>
+	<string name="_bx_files_page_block_title_system_manage"><![CDATA[Manage Own]]></string>
+	<string name="_bx_files_page_block_title_system_manage_administration"><![CDATA[Manage All]]></string>
+	<string name="_bx_files_page_block_title_manage"><![CDATA[Manage]]></string>    
+	<string name="_bx_files_page_block_title_popular_keywords"><![CDATA[Popular Hashtags]]></string>
+	<string name="_bx_files_page_block_title_cats"><![CDATA[Files Categories]]></string>
+	<string name="_bx_files_page_block_title_entry_info"><![CDATA[Info]]></string>
+	<string name="_bx_files_page_block_title_my_entries"><![CDATA[My Files]]></string>
+	<string name="_bx_files_page_block_title_entry_file_preview"><![CDATA[File Preview]]></string>
+	<string name="_bx_files_page_block_title_group_entries"><![CDATA[Files]]></string>
+	<string name="_bx_files_page_title_sys_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_files_page_title_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_files_page_block_title_search_form"><![CDATA[Search Form]]></string>
+    <string name="_bx_files_page_block_title_search_results"><![CDATA[Search Results]]></string>
+    <string name="_bx_files_page_block_title_search_form_cmts"><![CDATA[Comments Search Form]]></string>
+    <string name="_bx_files_page_block_title_search_results_cmts"><![CDATA[Comments Search Results]]></string>
+
+    <string name="_bx_files_menu_set_title_view_entry"><![CDATA[File Actions]]></string>
+    <string name="_bx_files_menu_title_view_entry"><![CDATA[File Actions]]></string>
+    <string name="_bx_files_menu_title_submenu"><![CDATA[Files Submenu]]></string>
+    <string name="_bx_files_menu_set_title_submenu"><![CDATA[Files Submenu]]></string>
+    <string name="_bx_files_menu_item_title_system_create_entry"><![CDATA[Upload Files]]></string>
+    <string name="_bx_files_menu_item_title_create_entry"><![CDATA[Upload Files]]></string>
+    <string name="_bx_files_menu_item_title_system_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_files_menu_item_title_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_files_menu_item_title_system_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_files_menu_item_title_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_files_menu_item_title_system_view_entry"><![CDATA[View File]]></string>
+    <string name="_bx_files_menu_item_title_system_entries_home"><![CDATA[Files]]></string>
+    <string name="_bx_files_menu_item_title_entries_home"><![CDATA[Files]]></string>
+    <string name="_bx_files_menu_item_title_system_entries_public"><![CDATA[Latest]]></string>
+    <string name="_bx_files_menu_item_title_entries_public"><![CDATA[Latest]]></string>
+    <string name="_bx_files_menu_item_title_system_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_files_menu_item_title_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_files_menu_item_title_system_entries_manage"><![CDATA[Manage]]></string>
+    <string name="_bx_files_menu_item_title_entries_manage"><![CDATA[Manage]]></string>
+    <string name="_bx_files_menu_item_title_system_entries_popular"><![CDATA[Popular]]></string>
+    <string name="_bx_files_menu_item_title_entries_popular"><![CDATA[Popular]]></string>
+    <string name="_bx_files_menu_title_view_entry_submenu"><![CDATA[View File Submenu]]></string>
+    <string name="_bx_files_menu_set_title_view_entry_submenu"><![CDATA[View File Submenu]]></string>
+    <string name="_bx_files_menu_item_title_view_entry_submenu_entry"><![CDATA[File]]></string>
+    <string name="_bx_files_menu_item_title_view_entry_submenu_comments"><![CDATA[Comments]]></string>
+    <string name="_bx_files_menu_item_title_system_view_entry_comments"><![CDATA[File Comments]]></string>
+    <string name="_bx_files_menu_item_title_system_view_entries_author"><![CDATA[Files]]></string>
+    <string name="_bx_files_menu_item_title_view_entries_author"><![CDATA[Files]]></string>
+    <string name="_bx_files_menu_title_entries_my"><![CDATA[My Files Action Menu]]></string>
+    <string name="_bx_files_menu_set_title_entries_my"><![CDATA[My Files Menu]]></string>
+	<string name="_bx_files_menu_item_title_system_manage_my_files"><![CDATA[My files]]></string>
+    <string name="_bx_files_menu_item_title_manage_my_files"><![CDATA[{addon} files]]></string>
+    <string name="_bx_files_menu_set_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string>
+    <string name="_bx_files_menu_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string>
+    <string name="_bx_files_menu_item_title_system_manage_account"><![CDATA[Manage account]]></string>
+    <string name="_bx_files_menu_item_title_manage_account"><![CDATA[Manage account]]></string>
+	<string name="_bx_files_menu_item_title_system_admt_files"><![CDATA[Files]]></string>
+	<string name="_bx_files_menu_item_title_admt_files"><![CDATA[Files - {addon} hidden]]></string>
+	<string name="_bx_files_menu_item_title_manage_my"><![CDATA[My Files]]></string>
+	<string name="_bx_files_menu_item_title_manage_all"><![CDATA[All Files]]></string>
+	<string name="_bx_files_menu_item_title_system_download_file"><![CDATA[Download]]></string>
+	<string name="_bx_files_menu_item_title_download_file"><![CDATA[Download]]></string>
+
+	<string name="_bx_files_grid_filter_item_title_adm_select_one_filter1"><![CDATA[All Statuses]]></string>
+	<string name="_bx_files_grid_filter_item_title_adm_active"><![CDATA[Active]]></string>
+	<string name="_bx_files_grid_filter_item_title_adm_hidden"><![CDATA[Hidden]]></string>
+	<string name="_bx_files_grid_column_title_adm_active"><![CDATA[Active]]></string>
+    <string name="_bx_files_grid_column_title_adm_title"><![CDATA[Title]]></string>
+    <string name="_bx_files_grid_column_title_adm_added"><![CDATA[Added]]></string>
+    <string name="_bx_files_grid_column_title_adm_author"><![CDATA[Author]]></string>
+    <string name="_bx_files_grid_action_title_adm_edit"><![CDATA[Edit]]></string>
+    <string name="_bx_files_grid_action_title_adm_delete"><![CDATA[Delete]]></string>
+    <string name="_bx_files_grid_action_title_adm_more_actions"><![CDATA[More Actions]]></string>
+    <string name="_bx_files_grid_action_err_delete"><![CDATA[Cannot delete the selected file(s).]]></string>
+    <string name="_bx_files_grid_txt_account_manager"><![CDATA[Redirect to manage account.]]></string>
+
+    <string name="_bx_files_chart_growth"><![CDATA[Files: Growth]]></string>
+    <string name="_bx_files_chart_growth_speed"><![CDATA[Files: Growth Speed]]></string>
+
+    <string name="_bx_files_search_extended"><![CDATA[Files Search]]></string>
+    <string name="_bx_files_search_extended_cmts"><![CDATA[Files Comments Search]]></string>
+
+    <string name="_bx_files_pre_lists_cats"><![CDATA[File categories]]></string>
+    <string name="_bx_files_cat_documentation"><![CDATA[Documentation]]></string>
+    <string name="_bx_files_cat_presentation"><![CDATA[Presentation]]></string>
+    <string name="_bx_files_cat_report"><![CDATA[Report]]></string>
+    <string name="_bx_files_cat_proposal"><![CDATA[Proposal]]></string>
+    <string name="_bx_files_cat_list"><![CDATA[List]]></string>
+    <string name="_bx_files_cat_record"><![CDATA[Audio record]]></string>
+    <string name="_bx_files_cat_screencast"><![CDATA[Screencast]]></string>
+    <string name="_bx_files_cat_screenshot"><![CDATA[Screenshot]]></string>
+    <string name="_bx_files_cat_sketch"><![CDATA[Sketch]]></string>
+    <string name="_bx_files_cat_archive"><![CDATA[Archive]]></string>
+    <string name="_bx_files_cat_backup"><![CDATA[Backup]]></string>
+
+    <string name="_bx_files_txt_all_entries_by"><![CDATA[<a href="{0}">All Files by {1} ({2})</a>]]></string>
+    <string name="_bx_files_txt_preview_not_available"><![CDATA[Preview isn't available]]></string>
+    <string name="_bx_files_txt_sample_single"><![CDATA[file]]></string>
+    <string name="_bx_files_txt_sample_single_with_article"><![CDATA[a file]]></string>
+    <string name="_bx_files_txt_sample_comment_single"><![CDATA[file's comment]]></string>
+    <string name="_bx_files_txt_sample_vote_single"><![CDATA[file's vote]]></string>
+
+    <string name="_bx_files_privacy_public"><![CDATA[Public]]></string>
+    <string name="_bx_files_privacy_participants"><![CDATA[Participants]]></string>
+</resources>

+ 63 - 0
modules/boonex/files/updates/9.0.0_9.0.1/source/install/sql/disable.sql

@@ -0,0 +1,63 @@
+
+-- SETTINGS
+SET @iTypeId = (SELECT `ID` FROM `sys_options_types` WHERE `name` = 'bx_files' 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_files';
+DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_files' OR `object` IN('bx_files_create_entry', 'bx_files_edit_entry', 'bx_files_delete_entry', 'bx_files_view_entry', 'bx_files_view_entry_comments', 'bx_files_home', 'bx_files_popular', 'bx_files_updated', 'bx_files_author', 'bx_files_group', 'bx_files_search', 'bx_files_manage');
+
+-- MENU
+DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_files';
+DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_files';
+DELETE FROM `sys_menu_items` WHERE `module` = 'bx_files' OR `set_name` IN('bx_files_view', 'bx_files_submenu', 'bx_files_view_submenu', 'bx_files_my');
+
+-- PRIVACY 
+DELETE FROM `sys_objects_privacy` WHERE `object` = 'bx_files_allow_view_to';
+
+-- 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_files';
+DELETE FROM `sys_acl_actions` WHERE `Module` = 'bx_files';
+
+-- SEARCH
+DELETE FROM `sys_objects_search` WHERE `ObjectName` IN ('bx_files', 'bx_files_cmts');
+
+-- SEARCH EXTENDED
+DELETE FROM `sys_objects_search_extended` WHERE `module` = 'bx_files';
+
+-- METATAGS
+DELETE FROM `sys_objects_metatags` WHERE `object` = 'bx_files';
+
+-- CATEGORY
+DELETE FROM `sys_objects_category` WHERE `object` = 'bx_files_cats';
+
+-- CONTENT INFO
+DELETE FROM `sys_objects_content_info` WHERE `name` IN ('bx_files', 'bx_files_cmts');
+
+DELETE FROM `sys_content_info_grids` WHERE `object` IN ('bx_files');
+
+-- STATS
+DELETE FROM `sys_statistics` WHERE `name` LIKE 'bx_files%';
+
+-- CHARTS
+DELETE FROM `sys_objects_chart` WHERE `object` LIKE 'bx_files%';
+
+-- GRIDS
+DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_files_administration', 'bx_files_common');
+DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_files_administration', 'bx_files_common');
+DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_files_administration', 'bx_files_common');
+
+-- UPLOADERS
+DELETE FROM `sys_objects_uploader` WHERE `object` IN('bx_files_simple', 'bx_files_html5');
+
+-- ALERTS
+SET @iHandler := (SELECT `id` FROM `sys_alerts_handlers` WHERE `name` = 'bx_files' LIMIT 1);
+DELETE FROM `sys_alerts` WHERE `handler_id` = @iHandler;
+DELETE FROM `sys_alerts_handlers` WHERE `id` = @iHandler;
+
+-- CRON
+DELETE FROM `sys_cron_jobs` WHERE `name` = 'bx_files_process_data';
+

+ 416 - 0
modules/boonex/files/updates/9.0.0_9.0.1/source/install/sql/enable.sql

@@ -0,0 +1,416 @@
+
+-- 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_files', '_bx_files', 'bx_files@modules/boonex/files/|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_files', '_bx_files', 1);
+SET @iCategId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_error`, `extra`, `order`) VALUES
+('bx_files_summary_chars', '700', @iCategId, '_bx_files_option_summary_chars', 'digit', '', '', '', 1),
+('bx_files_per_page_browse', '12', @iCategId, '_bx_files_option_per_page_browse', 'digit', '', '', '', 10),
+('bx_files_per_page_profile', '3', @iCategId, '_bx_files_option_per_page_profile', 'digit', '', '', '', 12),
+('bx_files_rss_num', '10', @iCategId, '_bx_files_option_rss_num', 'digit', '', '', '', 20),
+('bx_files_searchable_fields', 'title,desc,data', @iCategId, '_bx_files_option_searchable_fields', 'list', '', '', 'a:2:{s:6:"module";s:8:"bx_files";s:6:"method";s:21:"get_searchable_fields";}', 30);
+
+-- PAGE: create entry
+
+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_files_create_entry', '_bx_files_page_title_sys_create_entry', '_bx_files_page_title_create_entry', 'bx_files', 5, 2147483647, 1, 'create-file', 'page.php?i=create-file', '', '', '', 0, 1, 0, 'BxFilesPageBrowse', 'modules/boonex/files/classes/BxFilesPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_files_create_entry', 1, 'bx_files', '_bx_files_page_block_title_create_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_files";s:6:"method";s:13:"entity_create";}', 0, 1, 1);
+
+
+-- PAGE: edit entry
+
+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_files_edit_entry', '_bx_files_page_title_sys_edit_entry', '_bx_files_page_title_edit_entry', 'bx_files', 5, 2147483647, 1, 'edit-file', '', '', '', '', 0, 1, 0, 'BxFilesPageEntry', 'modules/boonex/files/classes/BxFilesPageEntry.php');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_files_edit_entry', 1, 'bx_files', '_bx_files_page_block_title_edit_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_files";s:6:"method";s:11:"entity_edit";}', 0, 0, 0);
+
+
+-- PAGE: delete entry
+
+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_files_delete_entry', '_bx_files_page_title_sys_delete_entry', '_bx_files_page_title_delete_entry', 'bx_files', 5, 2147483647, 1, 'delete-file', '', '', '', '', 0, 1, 0, 'BxFilesPageEntry', 'modules/boonex/files/classes/BxFilesPageEntry.php');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_files_delete_entry', 1, 'bx_files', '_bx_files_page_block_title_delete_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_files";s:6:"method";s:13:"entity_delete";}', 0, 0, 0);
+
+
+-- PAGE: view entry
+
+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_files_view_entry', '_bx_files_page_title_sys_view_entry', '_bx_files_page_title_view_entry', 'bx_files', 10, 2147483647, 1, 'view-file', '', '', '', '', 0, 1, 0, 'BxFilesPageEntry', 'modules/boonex/files/classes/BxFilesPageEntry.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_files_view_entry', 1, 'bx_files', '', '_bx_files_page_block_title_entry_text', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:17:\"entity_text_block\";}', 0, 0, 1, 1),
+('bx_files_view_entry', 1, 'bx_files', '', '_bx_files_page_block_title_entry_file_preview', 3, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:19:\"entity_file_preview\";}', 0, 0, 1, 2),
+('bx_files_view_entry', 2, 'bx_files', '', '_bx_files_page_block_title_entry_author', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:13:\"entity_author\";}', 0, 0, 1, 0),
+('bx_files_view_entry', 3, 'bx_files', '', '_bx_files_page_block_title_entry_info', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:11:\"entity_info\";}', 0, 0, 1, 1),
+('bx_files_view_entry', 3, 'bx_files', '', '_bx_files_page_block_title_entry_location', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:15:\"entity_location\";}', 0, 0, 0, 2),
+('bx_files_view_entry', 4, 'bx_files', '', '_bx_files_page_block_title_entry_all_actions', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:18:\"entity_all_actions\";}', 0, 0, 1, 0),
+('bx_files_view_entry', 4, 'bx_files', '', '_bx_files_page_block_title_entry_actions', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:14:\"entity_actions\";}', 0, 0, 0, 1),
+('bx_files_view_entry', 4, 'bx_files', '', '_bx_files_page_block_title_entry_social_sharing', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:21:\"entity_social_sharing\";}', 0, 0, 0, 2),
+('bx_files_view_entry', 4, 'bx_files', '', '_bx_files_page_block_title_entry_comments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 1, 4),
+('bx_files_view_entry', 4, 'bx_files', '', '_bx_files_page_block_title_entry_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:8:\"bx_files\";i:1;s:4:\"{id}\";}s:5:\"class\";s:20:\"TemplServiceMetatags\";}', 0, 0, 1, 5);
+
+
+-- 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_files_view_entry_comments', '_bx_files_page_title_sys_view_entry_comments', '_bx_files_page_title_view_entry_comments', 'bx_files', 5, 2147483647, 1, 'view-file-comments', '', '', '', '', 0, 1, 0, 'BxFilesPageEntry', 'modules/boonex/files/classes/BxFilesPageEntry.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_files_view_entry_comments', 1, 'bx_files', '_bx_files_page_block_title_entry_comments', '_bx_files_page_block_title_entry_comments_link', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 1);
+
+
+-- PAGE: popular 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_files_popular', '_bx_files_page_title_sys_entries_popular', '_bx_files_page_title_entries_popular', 'bx_files', 5, 2147483647, 1, 'files-popular', 'page.php?i=files-popular', '', '', '', 0, 1, 0, 'BxFilesPageBrowse', 'modules/boonex/files/classes/BxFilesPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_files_popular', 1, 'bx_files', '_bx_files_page_block_title_popular_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_files";s:6:"method";s:14:"browse_popular";s:6:"params";a:3:{s:9:"unit_view";s:7:"gallery";s:13:"empty_message";b:1;s:13:"ajax_paginate";b:0;}}', 0, 1, 1);
+
+
+-- PAGE: recently updated 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_files_updated', '_bx_files_page_title_sys_entries_updated', '_bx_files_page_title_entries_updated', 'bx_files', 5, 2147483647, 1, 'files-updated', 'page.php?i=files-updated', '', '', '', 0, 1, 0, 'BxFilesPageBrowse', 'modules/boonex/files/classes/BxFilesPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_files_updated', 1, 'bx_files', '_bx_files_page_block_title_updated_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_files";s:6:"method";s:14:"browse_updated";s:6:"params";a:3:{s:9:"unit_view";s:7:"gallery";s:13:"empty_message";b:1;s:13:"ajax_paginate";b:0;}}', 0, 1, 1);
+
+
+-- PAGE: entries of author
+
+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_files_author', 'files-author', '_bx_files_page_title_sys_entries_of_author', '_bx_files_page_title_entries_of_author', 'bx_files', 5, 2147483647, 1, '', '', '', '', 0, 1, 0, 'BxFilesPageAuthor', 'modules/boonex/files/classes/BxFilesPageAuthor.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_files_author', 1, 'bx_files', '', '_bx_files_page_block_title_entries_actions', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:18:\"my_entries_actions\";}', 0, 0, 1, 1),
+('bx_files_author', 1, 'bx_files', '_bx_files_page_block_title_sys_favorites_of_author', '_bx_files_page_block_title_favorites_of_author', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:15:\"browse_favorite\";s:6:"params";a:1:{i:0;s:12:"{profile_id}";}}', 0, 1, 1, 2),
+('bx_files_author', 1, 'bx_files', '_bx_files_page_block_title_sys_entries_of_author', '_bx_files_page_block_title_entries_of_author', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:13:\"browse_author\";}', 0, 0, 1, 3);
+
+-- PAGE: entries of group
+
+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_files_group', 'group-files', '_bx_files_page_title_sys_entries_of_author', '_bx_files_page_title_entries_of_author', 'bx_files', 5, 2147483647, 1, '', '', '', '', 0, 1, 0, 'BxFilesPageAuthor', 'modules/boonex/files/classes/BxFilesPageAuthor.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_files_group', 1, 'bx_files', '', '_bx_files_page_block_title_entries_actions', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:18:\"my_entries_actions\";}', 0, 0, 1, 1),
+('bx_files_group', 1, 'bx_files', '_bx_files_page_block_title_sys_entries_of_author', '_bx_files_page_block_title_entries_of_author', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:19:\"browse_group_author\";}', 0, 0, 1, 3);
+
+-- PAGE: module home
+
+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_files_home', 'files-home', '_bx_files_page_title_sys_home', '_bx_files_page_title_home', 'bx_files', 2, 2147483647, 1, 'page.php?i=files-home', '', '', '', 0, 1, 0, 'BxFilesPageBrowse', 'modules/boonex/files/classes/BxFilesPageBrowse.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_files_home', 1, 'bx_files', '', '_bx_files_page_block_title_featured_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_files";s:6:"method";s:15:"browse_featured";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 1, 1, 0),
+('bx_files_home', 1, 'bx_files', '', '_bx_files_page_block_title_recent_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_files";s:6:"method";s:13:"browse_public";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 1, 1, 1),
+('bx_files_home', 2, 'bx_files', '', '_bx_files_page_block_title_popular_keywords', 11, 2147483647, 'service', 'a:4:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:14:\"keywords_cloud\";s:6:\"params\";a:2:{i:0;s:8:\"bx_files\";i:1;s:8:\"bx_files\";}s:5:\"class\";s:20:\"TemplServiceMetatags\";}', 0, 1, 1, 0),
+('bx_files_home', 2, 'bx_files', '', '_bx_files_page_block_title_cats', 11, 2147483647, 'service', 'a:4:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:15:\"categories_list\";s:6:\"params\";a:2:{i:0;s:13:\"bx_files_cats\";i:1;a:1:{s:10:\"show_empty\";b:1;}}s:5:\"class\";s:20:\"TemplServiceCategory\";}', 0, 1, 1, 1);
+
+-- 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_files_search', '_bx_files_page_title_sys_entries_search', '_bx_files_page_title_entries_search', 'bx_files', 5, 2147483647, 1, 'files-search', 'page.php?i=files-search', '', '', '', 0, 1, 0, 'BxFilesPageBrowse', 'modules/boonex/files/classes/BxFilesPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_files_search', 1, 'bx_files', '_bx_files_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:8:"bx_files";}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 1, 1),
+('bx_files_search', 1, 'bx_files', '_bx_files_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:8:"bx_files";s:10:"show_empty";b:1;}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 1, 2),
+('bx_files_search', 1, 'bx_files', '_bx_files_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:13:"bx_files_cmts";}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 0, 3),
+('bx_files_search', 1, 'bx_files', '_bx_files_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:13:"bx_files_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_files_manage', '_bx_files_page_title_sys_manage', '_bx_files_page_title_manage', 'bx_files', 5, 2147483647, 1, 'files-manage', 'page.php?i=files-manage', '', '', '', 0, 1, 0, 'BxFilesPageBrowse', 'modules/boonex/files/classes/BxFilesPageBrowse.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_files_manage', 1, 'bx_files', '_bx_files_page_block_title_system_manage', '_bx_files_page_block_title_manage', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";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_files_administration', '_bx_files_page_title_sys_manage_administration', '_bx_files_page_title_manage', 'bx_files', 5, 192, 1, 'files-administration', 'page.php?i=files-administration', '', '', '', 0, 1, 0, 'BxFilesPageBrowse', 'modules/boonex/files/classes/BxFilesPageBrowse.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_files_administration', 1, 'bx_files', '_bx_files_page_block_title_system_manage_administration', '_bx_files_page_block_title_manage', 11, 192, 'service', 'a:3:{s:6:\"module\";s:8:\"bx_files\";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`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('sys_home', 1, 'bx_files', '_bx_files_page_block_title_recent_entries', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:13:\"browse_public\";}', 1, 0, 0, IFNULL(@iBlockOrder, 0) + 1);
+
+-- PAGES: add page block to profiles modules (trigger* page objects are processed separately upon modules enable/disable)
+SET @iPBCellProfile = 3;
+SET @iPBCellGroup = 4;
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('trigger_page_profile_view_entry', @iPBCellProfile, 'bx_files', '_bx_files_page_block_title_my_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_files";s:6:"method";s:13:"browse_author";s:6:"params";a:2:{i:0;s:12:"{profile_id}";i:1;a:1:{s:8:"per_page";s:25:"bx_files_per_page_profile";}}}', 0, 0, 0),
+('trigger_page_group_view_entry', @iPBCellGroup, 'bx_files', '_bx_files_page_block_title_group_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_files";s:6:"method";s:19:"browse_group_author";s:6:"params";a:2:{i:0;s:12:"{profile_id}";i:1;a:1:{s:8:"per_page";s:25:"bx_files_per_page_profile";}}}', 0, 0, 0);
+
+-- 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`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('', 0, 'bx_files', '_bx_files_page_block_title_recent_entries', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:13:\"browse_public\";s:6:\"params\";a:3:{s:9:\"unit_view\";s:7:\"gallery\";s:13:\"empty_message\";b:1;s:13:\"ajax_paginate\";b:0;}}', 0, 1, IFNULL(@iBlockOrder, 0) + 1),
+
+('', 0, 'bx_files', '_bx_files_page_block_title_popular_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_files";s:6:"method";s:14:"browse_popular";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 1, IFNULL(@iBlockOrder, 0) + 2);
+
+
+-- MENU: add to site menu
+
+SET @iSiteMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_site' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('sys_site', 'bx_files', 'files-home', '_bx_files_menu_item_title_system_entries_home', '_bx_files_menu_item_title_entries_home', 'page.php?i=files-home', '', '', 'file-o col-red3', 'bx_files_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_files', 'files-home', '_bx_files_menu_item_title_system_entries_home', '_bx_files_menu_item_title_entries_home', 'page.php?i=files-home', '', '', 'file-o col-red3', 'bx_files_submenu', 2147483647, 1, 1, IFNULL(@iHomepageMenuOrder, 0) + 1);
+
+-- MENU: add to "add content" menu
+
+SET @iAddMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_add_content_links' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('sys_add_content_links', 'bx_files', 'create-file', '_bx_files_menu_item_title_system_create_entry', '_bx_files_menu_item_title_create_entry', 'page.php?i=create-file', '', '', 'file-o col-red3', '', 2147483647, 1, 1, IFNULL(@iAddMenuOrder, 0) + 1);
+
+
+-- MENU: actions menu for view entry 
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_files_view', '_bx_files_menu_title_view_entry', 'bx_files_view', 'bx_files', 9, 0, 1, 'BxFilesMenuView', 'modules/boonex/files/classes/BxFilesMenuView.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_files_view', 'bx_files', '_bx_files_menu_set_title_view_entry', 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_files_view', 'bx_files', 'download-file', '_bx_files_menu_item_title_system_download_file', '_bx_files_menu_item_title_download_file', 'modules/?r=files/download/{file_download_token}/{content_id}.{file_ext}', '', '_blank', 'download', '', 2147483647, 1, 0, 1),
+('bx_files_view', 'bx_files', 'edit-file', '_bx_files_menu_item_title_system_edit_entry', '_bx_files_menu_item_title_edit_entry', 'page.php?i=edit-file&id={content_id}', '', '', 'pencil', '', 2147483647, 1, 0, 2),
+('bx_files_view', 'bx_files', 'delete-file', '_bx_files_menu_item_title_system_delete_entry', '_bx_files_menu_item_title_delete_entry', 'page.php?i=delete-file&id={content_id}', '', '', 'remove', '', 2147483647, 1, 0, 3);
+
+
+-- MENU: actions menu for my entries
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_files_my', '_bx_files_menu_title_entries_my', 'bx_files_my', 'bx_files', 9, 0, 1, 'BxFilesMenu', 'modules/boonex/files/classes/BxFilesMenu.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_files_my', 'bx_files', '_bx_files_menu_set_title_entries_my', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('bx_files_my', 'bx_files', 'create-file', '_bx_files_menu_item_title_system_create_entry', '_bx_files_menu_item_title_create_entry', 'page.php?i=create-file&profile_id={profile_id}', '', '', 'plus', '', 2147483647, 1, 0, 0);
+
+
+-- MENU: module sub-menu
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_files_submenu', '_bx_files_menu_title_submenu', 'bx_files_submenu', 'bx_files', 8, 0, 1, '', '');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_files_submenu', 'bx_files', '_bx_files_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_files_submenu', 'bx_files', 'files-home', '_bx_files_menu_item_title_system_entries_public', '_bx_files_menu_item_title_entries_public', 'page.php?i=files-home', '', '', '', '', 2147483647, 1, 1, 1),
+('bx_files_submenu', 'bx_files', 'files-popular', '_bx_files_menu_item_title_system_entries_popular', '_bx_files_menu_item_title_entries_popular', 'page.php?i=files-popular', '', '', '', '', 2147483647, 1, 1, 2),
+('bx_files_submenu', 'bx_files', 'files-search', '_bx_files_menu_item_title_system_entries_search', '_bx_files_menu_item_title_entries_search', 'page.php?i=files-search', '', '', '', '', 2147483647, 1, 1, 3),
+('bx_files_submenu', 'bx_files', 'files-manage', '_bx_files_menu_item_title_system_entries_manage', '_bx_files_menu_item_title_entries_manage', 'page.php?i=files-manage', '', '', '', '', 2147483646, 1, 1, 4);
+
+-- MENU: sub-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_files_view_submenu', '_bx_files_menu_title_view_entry_submenu', 'bx_files_view_submenu', 'bx_files', 8, 0, 1, 'BxFilesMenuView', 'modules/boonex/files/classes/BxFilesMenuView.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_files_view_submenu', 'bx_files', '_bx_files_menu_set_title_view_entry_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_files_view_submenu', 'bx_files', 'view-file', '_bx_files_menu_item_title_system_view_entry', '_bx_files_menu_item_title_view_entry_submenu_entry', 'page.php?i=view-file&id={content_id}', '', '', '', '', 2147483647, 0, 0, 1),
+('bx_files_view_submenu', 'bx_files', 'view-file-comments', '_bx_files_menu_item_title_system_view_entry_comments', '_bx_files_menu_item_title_view_entry_submenu_comments', 'page.php?i=view-file-comments&id={content_id}', '', '', '', '', 2147483647, 0, 0, 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`, `active`, `copyable`, `order`) VALUES
+('sys_profile_stats', 'bx_files', 'profile-stats-manage-files', '_bx_files_menu_item_title_system_manage_my_files', '_bx_files_menu_item_title_manage_my_files', 'page.php?i=files-manage', '', '_self', 'file-o col-red3', 'a:2:{s:6:"module";s:8:"bx_files";s:6:"method";s:41:"get_menu_addon_manage_tools_profile_stats";}', '', 2147483646, 1, 0, @iNotifMenuOrder + 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_files_menu_manage_tools', '_bx_files_menu_title_manage_tools', 'bx_files_menu_manage_tools', 'bx_files', 6, 0, 1, 'BxFilesMenuManageTools', 'modules/boonex/files/classes/BxFilesMenuManageTools.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_files_menu_manage_tools', 'bx_files', '_bx_files_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_files_menu_manage_tools', 'bx_files', 'delete-with-content', '_bx_files_menu_item_title_system_delete_with_content', '_bx_files_menu_item_title_delete_with_content', 'javascript:void(0)', 'javascript:{js_object}.onClickDeleteWithContent({content_id});', '_self', 'trash-o', '', 128, 1, 0, 0);
+
+-- 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_files', 'files-administration', '_bx_files_menu_item_title_system_admt_files', '_bx_files_menu_item_title_admt_files', 'page.php?i=files-administration', '', '_self', '', 'a:2:{s:6:"module";s:8:"bx_files";s:6:"method";s:27:"get_menu_addon_manage_tools";}', '', 192, 1, 0, @iManageMenuOrder + 1);
+
+-- MENU: add menu item to profile & group based modules (trigger* menu sets are processed separately upon modules enable/disable)
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('trigger_profile_view_submenu', 'bx_files', 'files-author', '_bx_files_menu_item_title_system_view_entries_author', '_bx_files_menu_item_title_view_entries_author', 'page.php?i=files-author&profile_id={profile_id}', '', '', 'file-o col-red3', '', 2147483647, 1, 0, 0),
+('trigger_group_view_submenu', 'bx_files', 'group-files', '_bx_files_menu_item_title_system_view_entries_author', '_bx_files_menu_item_title_view_entries_author', 'page.php?i=group-files&profile_id={profile_id}', '', '', 'file-o col-red3', '', 2147483647, 1, 0, 0);
+
+
+-- PRIVACY 
+
+INSERT INTO `sys_objects_privacy` (`object`, `module`, `action`, `title`, `default_group`, `table`, `table_field_id`, `table_field_author`, `override_class_name`, `override_class_file`) VALUES
+('bx_files_allow_view_to', 'bx_files', 'view', '_bx_files_form_entry_input_allow_view_to', '3', 'bx_files_main', 'id', 'author', 'BxFilesPrivacy', 'modules/boonex/files/classes/BxFilesPrivacy.php');
+
+
+-- ACL
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_files', 'create entry', NULL, '_bx_files_acl_action_create_entry', '', 1, 3);
+SET @iIdActionEntryCreate = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_files', 'delete entry', NULL, '_bx_files_acl_action_delete_entry', '', 1, 3);
+SET @iIdActionEntryDelete = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_files', 'view entry', NULL, '_bx_files_acl_action_view_entry', '', 1, 0);
+SET @iIdActionEntryView = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_files', 'edit any entry', NULL, '_bx_files_acl_action_edit_any_entry', '', 1, 3);
+SET @iIdActionEntryEditAny = 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
+
+-- entry create
+(@iStandard, @iIdActionEntryCreate),
+(@iModerator, @iIdActionEntryCreate),
+(@iAdministrator, @iIdActionEntryCreate),
+(@iPremium, @iIdActionEntryCreate),
+
+-- entry delete
+(@iStandard, @iIdActionEntryDelete),
+(@iModerator, @iIdActionEntryDelete),
+(@iAdministrator, @iIdActionEntryDelete),
+(@iPremium, @iIdActionEntryDelete),
+
+-- entry view
+(@iUnauthenticated, @iIdActionEntryView),
+(@iAccount, @iIdActionEntryView),
+(@iStandard, @iIdActionEntryView),
+(@iUnconfirmed, @iIdActionEntryView),
+(@iPending, @iIdActionEntryView),
+(@iModerator, @iIdActionEntryView),
+(@iAdministrator, @iIdActionEntryView),
+(@iPremium, @iIdActionEntryView),
+
+-- edit any entry
+(@iModerator, @iIdActionEntryEditAny),
+(@iAdministrator, @iIdActionEntryEditAny);
+
+
+-- SEARCH
+SET @iSearchOrder = (SELECT IFNULL(MAX(`Order`), 0) FROM `sys_objects_search`);
+INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `Order`, `ClassName`, `ClassPath`) VALUES
+('bx_files', '_bx_files', @iSearchOrder + 1, 'BxFilesSearchResult', 'modules/boonex/files/classes/BxFilesSearchResult.php'),
+('bx_files_cmts', '_bx_files_cmts', @iSearchOrder + 2, 'BxFilesCmtsSearchResult', 'modules/boonex/files/classes/BxFilesCmtsSearchResult.php');
+
+-- SEARCH EXTENDED
+INSERT INTO `sys_objects_search_extended` (`object`, `object_content_info`, `module`, `title`, `active`, `class_name`, `class_file`) VALUES
+('bx_files', 'bx_files', 'bx_files', '_bx_files_search_extended', 1, '', ''),
+('bx_files_cmts', 'bx_files_cmts', 'bx_files', '_bx_files_search_extended_cmts', 1, 'BxTemplSearchExtendedCmts', '');
+
+-- METATAGS
+INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_files', 'bx_files_meta_keywords', '', '', '', '');
+
+-- CATEGORY
+INSERT INTO `sys_objects_category` (`object`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
+('bx_files_cats', 'bx_files', 'bx_files', 'bx_files_cats', 'bx_files_main', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = `bx_files_main`.`author`)', 'AND `sys_profiles`.`status` = ''active''', '', '');
+
+-- 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_files', '_bx_files', 'bx_files', 'added', 'edited', 'deleted', '', ''),
+('bx_files_cmts', '_bx_files_cmts', 'bx_files', 'commentPost', 'commentUpdated', 'commentRemoved', 'BxDolContentInfoCmts', '');
+
+INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`, `condition`, `selection`) VALUES
+('bx_files', 'bx_files_administration', 'id', '', ''),
+('bx_files', 'bx_files_common', 'id', '', '');
+
+-- STATS
+SET @iMaxOrderStats = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_statistics`);
+INSERT INTO `sys_statistics` (`module`, `name`, `title`, `link`, `icon`, `query`, `order`) VALUES 
+('bx_files', 'bx_files', '_bx_files', 'page.php?i=files-home', 'file-o col-red3', 'SELECT COUNT(*) FROM `bx_files_main` WHERE 1 AND `status` = ''active'' AND `status_admin` = ''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_files_growth', '_bx_files_chart_growth', 'bx_files_main', 'added', '', 'status,status_admin', '', 1, @iMaxOrderCharts + 1, 'BxDolChartGrowth', ''),
+('bx_files_growth_speed', '_bx_files_chart_growth_speed', 'bx_files_main', 'added', '', 'status,status_admin', '', 1, @iMaxOrderCharts + 2, 'BxDolChartGrowthSpeed', '');
+
+-- GRIDS: moderation tools
+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_files_administration', 'Sql', 'SELECT * FROM `bx_files_main` WHERE 1 ', 'bx_files_main', 'id', 'added', 'status_admin', '', 20, NULL, 'start', '', 'title,desc', '', 'like', '', '', 192, 'BxFilesGridAdministration', 'modules/boonex/files/classes/BxFilesGridAdministration.php'),
+('bx_files_common', 'Sql', 'SELECT * FROM `bx_files_main` WHERE 1 ', 'bx_files_main', 'id', 'added', 'status', '', 20, NULL, 'start', '', 'title,desc', '', 'like', '', '', 2147483647, 'BxFilesGridCommon', 'modules/boonex/files/classes/BxFilesGridCommon.php');
+
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('bx_files_administration', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
+('bx_files_administration', 'switcher', '_bx_files_grid_column_title_adm_active', '8%', 0, '', '', 2),
+('bx_files_administration', 'title', '_bx_files_grid_column_title_adm_title', '25%', 0, '', '', 3),
+('bx_files_administration', 'added', '_bx_files_grid_column_title_adm_added', '20%', 1, '25', '', 4),
+('bx_files_administration', 'author', '_bx_files_grid_column_title_adm_author', '25%', 0, '25', '', 5),
+('bx_files_administration', 'actions', '', '20%', 0, '', '', 6),
+('bx_files_common', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
+('bx_files_common', 'switcher', '_bx_files_grid_column_title_adm_active', '8%', 0, '', '', 2),
+('bx_files_common', 'title', '_bx_files_grid_column_title_adm_title', '40%', 0, '', '', 3),
+('bx_files_common', 'added', '_bx_files_grid_column_title_adm_added', '30%', 1, '25', '', 4),
+('bx_files_common', 'actions', '', '20%', 0, '', '', 5);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon_only`, `confirm`, `order`) VALUES
+('bx_files_administration', 'bulk', 'delete', '_bx_files_grid_action_title_adm_delete', '', 0, 1, 1),
+('bx_files_administration', 'single', 'edit', '_bx_files_grid_action_title_adm_edit', 'pencil', 1, 0, 1),
+('bx_files_administration', 'single', 'delete', '_bx_files_grid_action_title_adm_delete', 'remove', 1, 1, 2),
+('bx_files_administration', 'single', 'settings', '_bx_files_grid_action_title_adm_more_actions', 'cog', 1, 0, 3),
+('bx_files_common', 'bulk', 'delete', '_bx_files_grid_action_title_adm_delete', '', 0, 1, 1),
+('bx_files_common', 'single', 'edit', '_bx_files_grid_action_title_adm_edit', 'pencil', 1, 0, 1),
+('bx_files_common', 'single', 'delete', '_bx_files_grid_action_title_adm_delete', 'remove', 1, 1, 2),
+('bx_files_common', 'single', 'settings', '_bx_files_grid_action_title_adm_more_actions', 'cog', 1, 0, 3);
+
+-- UPLOADERS
+INSERT INTO `sys_objects_uploader` (`object`, `active`, `override_class_name`, `override_class_file`) VALUES
+('bx_files_simple', 1, 'BxFilesUploaderSimple', 'modules/boonex/files/classes/BxFilesUploaderSimple.php'),
+('bx_files_html5', 1, 'BxFilesUploaderHTML5', 'modules/boonex/files/classes/BxFilesUploaderHTML5.php');
+
+-- ALERTS
+
+INSERT INTO `sys_alerts_handlers` (`name`, `class`, `file`, `service_call`) VALUES 
+('bx_files', 'BxFilesAlertsResponse', 'modules/boonex/files/classes/BxFilesAlertsResponse.php', '');
+SET @iHandler := LAST_INSERT_ID();
+
+INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
+('system', 'save_setting', @iHandler),
+('profile', 'delete', @iHandler);
+
+-- CRON
+
+INSERT INTO `sys_cron_jobs` (`name`, `time`, `class`, `file`, `service_call`) VALUES
+('bx_files_process_data', '* * * * *', 'BxFilesCronProcessData', 'modules/boonex/files/classes/BxFilesCronProcessData.php', '');
+

+ 296 - 0
modules/boonex/files/updates/9.0.0_9.0.1/source/install/sql/install.sql

@@ -0,0 +1,296 @@
+
+SET @sStorageEngine = (SELECT `value` FROM `sys_options` WHERE `name` = 'sys_storage_default');
+
+-- TABLE: entries
+
+CREATE TABLE IF NOT EXISTS `bx_files_main` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `author` int(10) unsigned NOT NULL,
+  `added` int(11) NOT NULL,
+  `changed` int(11) NOT NULL,
+  `file_id` int(11) NOT NULL,
+  `title` varchar(255) NOT NULL,
+  `cat` int(11) NOT NULL,
+  `desc` text NOT NULL,
+  `data` text NOT NULL,
+  `data_processed` tinyint(4) NOT NULL DEFAULT '0',
+  `views` int(11) NOT NULL default '0',
+  `rate` float NOT NULL default '0',
+  `votes` 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',
+  `status` enum('active','hidden') NOT NULL DEFAULT 'active',
+  `status_admin` enum('active','hidden') NOT NULL DEFAULT 'active',
+  PRIMARY KEY (`id`),
+  FULLTEXT KEY `search_fields` (`title`,`desc`,`data`)
+);
+
+-- TABLE: storages & transcoders
+
+CREATE TABLE IF NOT EXISTS `bx_files_files` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `profile_id` int(10) unsigned NOT NULL,
+  `remote_id` varchar(128) NOT NULL,
+  `path` varchar(255) NOT NULL,
+  `file_name` varchar(255) NOT NULL,
+  `mime_type` varchar(128) NOT NULL,
+  `ext` varchar(32) NOT NULL,
+  `size` int(11) NOT NULL,
+  `added` int(11) NOT NULL,
+  `modified` int(11) NOT NULL,
+  `private` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `remote_id` (`remote_id`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_files_photos_resized` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `profile_id` int(10) unsigned NOT NULL,
+  `remote_id` varchar(128) NOT NULL,
+  `path` varchar(255) NOT NULL,
+  `file_name` varchar(255) NOT NULL,
+  `mime_type` varchar(128) NOT NULL,
+  `ext` varchar(32) NOT NULL,
+  `size` int(11) NOT NULL,
+  `added` int(11) NOT NULL,
+  `modified` int(11) NOT NULL,
+  `private` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `remote_id` (`remote_id`)
+);
+
+-- TABLE: comments
+
+CREATE TABLE IF NOT EXISTS `bx_files_cmts` (
+  `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
+  `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_object_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_author_id` int(10) unsigned NOT NULL DEFAULT '0',
+  `cmt_level` int(11) NOT NULL DEFAULT '0',
+  `cmt_text` text NOT NULL,
+  `cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
+  `cmt_rate` int(11) NOT NULL DEFAULT '0',
+  `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
+  `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
+  `cmt_replies` int(11) NOT NULL DEFAULT '0',
+  PRIMARY KEY (`cmt_id`),
+  KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
+  FULLTEXT KEY `search_fields` (`cmt_text`)
+);
+
+-- TABLE: votes
+
+CREATE TABLE IF NOT EXISTS `bx_files_votes` (
+  `object_id` int(11) NOT NULL default '0',
+  `count` int(11) NOT NULL default '0',
+  `sum` int(11) NOT NULL default '0',
+  UNIQUE KEY `object_id` (`object_id`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `bx_files_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`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+-- TABLE: views
+
+CREATE TABLE `bx_files_views_track` (
+  `object_id` int(11) NOT NULL default '0',
+  `viewer_id` int(11) NOT NULL default '0',
+  `viewer_nip` int(11) unsigned NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- TABLE: metas
+
+CREATE TABLE `bx_files_meta_keywords` (
+  `object_id` int(10) unsigned NOT NULL,
+  `keyword` varchar(255) NOT NULL,
+  KEY `object_id` (`object_id`),
+  KEY `keyword` (`keyword`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- TABLE: reports
+
+CREATE TABLE IF NOT EXISTS `bx_files_reports` (
+  `object_id` int(11) NOT NULL default '0',
+  `count` int(11) NOT NULL default '0',
+  UNIQUE KEY `object_id` (`object_id`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `bx_files_reports_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `author_nip` int(11) unsigned NOT NULL default '0',
+  `type` varchar(32) NOT NULL default '',
+  `text` text NOT NULL default '',
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `report` (`object_id`, `author_nip`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+-- TABLE: favorites
+
+CREATE TABLE `bx_files_favorites_track` (
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  KEY `id` (`object_id`,`author_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+
+-- 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_files_files', @sStorageEngine, '', 360, 2592000, 3, 'bx_files_files', 'deny-allow', '', 'action,apk,app,bat,bin,cmd,com,command,cpl,csh,exe,gadget,inf,ins,inx,ipa,isu,job,jse,ksh,lnk,msc,msi,msp,mst,osx,out,paf,pif,prg,ps1,reg,rgs,run,sct,shb,shs,u3p,vb,vbe,vbs,vbscript,workflow,ws,wsf', 0, 0, 0, 0, 0, 0),
+('bx_files_photos_resized', @sStorageEngine, '', 360, 2592000, 3, 'bx_files_photos_resized', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0);
+
+INSERT INTO `sys_objects_transcoder` (`object`, `storage_object`, `source_type`, `source_params`, `private`, `atime_tracking`, `atime_pruning`, `ts`) VALUES 
+('bx_files_preview', 'bx_files_photos_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_files_files";}', 'no', '1', '2592000', '0'),
+('bx_files_gallery', 'bx_files_photos_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_files_files";}', 'no', '1', '2592000', '0');
+
+INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES 
+('bx_files_preview', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:11:"crop_resize";s:1:"1";}', '0'),
+('bx_files_gallery', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0');
+
+-- FORMS
+
+INSERT INTO `sys_objects_form`(`object`, `module`, `title`, `action`, `form_attrs`, `table`, `key`, `uri`, `uri_title`, `submit_name`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_files', 'bx_files', '_bx_files_form_entry', '', 'a:1:{s:7:\"enctype\";s:19:\"multipart/form-data\";}', 'bx_files_main', 'id', '', '', 'do_submit', '', 0, 1, 'BxFilesFormEntry', 'modules/boonex/files/classes/BxFilesFormEntry.php'),
+('bx_files_upload', 'bx_files', '_bx_files_form_upload', '', 'a:1:{s:7:\"enctype\";s:19:\"multipart/form-data\";}', 'bx_files_main', 'id', '', '', 'do_submit', '', 0, 1, 'BxFilesFormUpload', 'modules/boonex/files/classes/BxFilesFormUpload.php');
+
+INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES 
+('bx_files', 'bx_files_entry_delete', 'bx_files', 0, '_bx_files_form_entry_display_delete'),
+('bx_files', 'bx_files_entry_edit', 'bx_files', 0, '_bx_files_form_entry_display_edit'),
+('bx_files', 'bx_files_entry_view', 'bx_files', 1, '_bx_files_form_entry_display_view'),
+('bx_files_upload', 'bx_files_entry_upload', 'bx_files', 0, '_bx_files_form_entry_display_add');
+
+INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES 
+('bx_files', 'bx_files', 'allow_view_to', '', '', 0, 'custom', '_bx_files_form_entry_input_sys_allow_view_to', '_bx_files_form_entry_input_allow_view_to', '', 1, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_files', 'bx_files', 'delete_confirm', 1, '', 0, 'checkbox', '_bx_files_form_entry_input_sys_delete_confirm', '_bx_files_form_entry_input_delete_confirm', '_bx_files_form_entry_input_delete_confirm_info', 1, 0, 0, '', '', '', 'Avail', '', '_bx_files_form_entry_input_delete_confirm_error', '', '', 1, 0),
+('bx_files', 'bx_files', 'do_publish', '_bx_files_form_entry_input_do_publish', '', 0, 'submit', '_bx_files_form_entry_input_sys_do_publish', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_files', 'bx_files', 'do_submit', '_bx_files_form_entry_input_do_submit', '', 0, 'submit', '_bx_files_form_entry_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_files', 'bx_files', 'attachments', 'a:1:{i:0;s:14:"bx_files_html5";}', 'a:2:{s:15:"bx_files_simple";s:26:"_sys_uploader_simple_title";s:14:"bx_files_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_files_form_entry_input_sys_attachments', '_bx_files_form_entry_input_attachments', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_files', 'bx_files', 'desc', '', '', 0, 'textarea', '_bx_files_form_entry_input_sys_desc', '_bx_files_form_entry_input_desc', '', 0, 0, 2, '', '', '', '', '', '', 'XssHtml', '', 1, 0),
+('bx_files', 'bx_files', 'data', '', '', 0, 'textarea', '_bx_files_form_entry_input_sys_data', '_bx_files_form_entry_input_data', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_files', 'bx_files', 'title', '', '', 0, 'text', '_bx_files_form_entry_input_sys_title', '_bx_files_form_entry_input_title', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_files_form_entry_input_title_err', 'Xss', '', 1, 0),
+('bx_files', 'bx_files', 'cat', '', '#!bx_files_cats', 0, 'select', '_bx_files_form_entry_input_sys_cat', '_bx_files_form_entry_input_cat', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_files_form_entry_input_cat_err', 'Xss', '', 1, 0),
+('bx_files', 'bx_files', 'added', '', '', 0, 'datetime', '_bx_files_form_entry_input_sys_date_added', '_bx_files_form_entry_input_date_added', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_files', 'bx_files', 'changed', '', '', 0, 'datetime', '_bx_files_form_entry_input_sys_date_changed', '_bx_files_form_entry_input_date_changed', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+
+('bx_files_upload', 'bx_files', 'attachments', 'a:1:{i:0;s:14:"bx_files_html5";}', 'a:2:{s:15:"bx_files_simple";s:26:"_sys_uploader_simple_title";s:14:"bx_files_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_files_form_entry_input_sys_attachment', '_bx_files_form_entry_input_attachment', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_files_upload', 'bx_files', 'cat', '', '#!bx_files_cats', 0, 'select', '_bx_files_form_entry_input_sys_cat', '_bx_files_form_entry_input_cat', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_files_form_entry_input_cat_err', 'Xss', '', 1, 0),
+('bx_files_upload', 'bx_files', 'allow_view_to', '', '', 0, 'custom', '_bx_files_form_entry_input_sys_allow_view_to', '_bx_files_form_entry_input_allow_view_to', '', 1, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_files_upload', 'bx_files', 'do_submit', '_bx_files_form_entry_input_do_submit', '', 0, 'submit', '_bx_files_form_entry_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_files_upload', 'bx_files', 'profile_id', '0', '', 0, 'hidden', '_bx_files_form_entry_input_sys_profile_id', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0);
+
+
+INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES 
+('bx_files_entry_delete', 'cat', 2147483647, 0, 0),
+('bx_files_entry_delete', 'attachments', 2147483647, 0, 0),
+('bx_files_entry_delete', 'desc', 2147483647, 0, 0),
+('bx_files_entry_delete', 'do_publish', 2147483647, 0, 0),
+('bx_files_entry_delete', 'title', 2147483647, 0, 0),
+('bx_files_entry_delete', 'allow_view_to', 2147483647, 0, 0),
+('bx_files_entry_delete', 'delete_confirm', 2147483647, 1, 1),
+('bx_files_entry_delete', 'do_submit', 2147483647, 1, 2),
+('bx_files_entry_edit', 'do_publish', 2147483647, 0, 1),
+('bx_files_entry_edit', 'delete_confirm', 2147483647, 0, 2),
+('bx_files_entry_edit', 'title', 2147483647, 1, 3),
+('bx_files_entry_edit', 'cat', 2147483647, 1, 4),
+('bx_files_entry_edit', 'desc', 2147483647, 1, 5),
+('bx_files_entry_edit', 'data', 0, 1, 6),
+('bx_files_entry_edit', 'attachments', 2147483647, 1, 7),
+('bx_files_entry_edit', 'allow_view_to', 2147483647, 1, 8),
+('bx_files_entry_edit', 'do_submit', 2147483647, 1, 9),
+('bx_files_entry_view', 'attachments', 2147483647, 0, 0),
+('bx_files_entry_view', 'delete_confirm', 2147483647, 0, 0),
+('bx_files_entry_view', 'desc', 2147483647, 0, 0),
+('bx_files_entry_view', 'do_publish', 2147483647, 0, 0),
+('bx_files_entry_view', 'title', 2147483647, 0, 0),
+('bx_files_entry_view', 'do_submit', 2147483647, 0, 0),
+('bx_files_entry_view', 'allow_view_to', 2147483647, 0, 0),
+('bx_files_entry_view', 'cat', 2147483647, 1, 1),
+('bx_files_entry_view', 'added', 2147483647, 1, 2),
+('bx_files_entry_view', 'changed', 2147483647, 1, 3),
+
+('bx_files_entry_upload', 'profile_id', 2147483647, 1, 1),
+('bx_files_entry_upload', 'attachments', 2147483647, 1, 2),
+('bx_files_entry_upload', 'cat', 2147483647, 1, 3),
+('bx_files_entry_upload', 'allow_view_to', 2147483647, 1, 4),
+('bx_files_entry_upload', 'do_submit', 2147483647, 1, 5);
+
+-- PRE-VALUES
+
+INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
+('bx_files_cats', '_bx_files_pre_lists_cats', 'bx_files', '0');
+
+INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES
+('bx_files_cats', '', 0, '_sys_please_select', ''),
+('bx_files_cats', '1', 1, '_bx_files_cat_documentation', ''),
+('bx_files_cats', '2', 2, '_bx_files_cat_presentation', ''),
+('bx_files_cats', '3', 3, '_bx_files_cat_report', ''),
+('bx_files_cats', '4', 4, '_bx_files_cat_proposal', ''),
+('bx_files_cats', '5', 5, '_bx_files_cat_list', ''),
+('bx_files_cats', '6', 6, '_bx_files_cat_record', ''),
+('bx_files_cats', '7', 7, '_bx_files_cat_screencast', ''),
+('bx_files_cats', '8', 8, '_bx_files_cat_screenshot', ''),
+('bx_files_cats', '9', 9, '_bx_files_cat_sketch', ''),
+('bx_files_cats', '10', 10, '_bx_files_cat_archive', ''),
+('bx_files_cats', '11', 11, '_bx_files_cat_backup', '');
+
+-- COMMENTS
+
+INSERT INTO `sys_objects_cmts` (`Name`, `Module`, `Table`, `CharsPostMin`, `CharsPostMax`, `CharsDisplayMax`, `Nl2br`, `PerView`, `PerViewReplies`, `BrowseType`, `IsBrowseSwitch`, `PostFormPosition`, `NumberOfLevels`, `IsDisplaySwitch`, `IsRatable`, `ViewingThreshold`, `IsOn`, `RootStylePrefix`, `BaseUrl`, `ObjectVote`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldTitle`, `TriggerFieldComments`, `ClassName`, `ClassFile`) VALUES
+('bx_files', 'bx_files', 'bx_files_cmts', 1, 5000, 1000, 1, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-file&id={object_id}', '', 'bx_files_main', 'id', 'author', 'title', 'comments', '', '');
+
+-- VOTES
+
+INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES 
+('bx_files', 'bx_files_votes', 'bx_files_votes_track', '604800', '1', '1', '0', '1', 'bx_files_main', 'id', 'author', 'rate', 'votes', '', '');
+
+-- REPORTS
+
+INSERT INTO `sys_objects_report` (`name`, `table_main`, `table_track`, `is_on`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_files', 'bx_files_reports', 'bx_files_reports_track', '1', 'page.php?i=view-file&id={object_id}', 'bx_files_main', 'id', 'author', 'reports', '', '');
+
+-- VIEWS
+
+INSERT INTO `sys_objects_view` (`name`, `table_track`, `period`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_files', 'bx_files_views_track', '86400', '1', 'bx_files_main', 'id', 'author', 'views', '', '');
+
+-- 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_files', 'bx_files_favorites_track', '1', '1', '1', 'page.php?i=view-file&id={object_id}', 'bx_files_main', 'id', 'author', 'favorites', '', '');
+
+-- FEATURED
+
+INSERT INTO `sys_objects_feature` (`name`, `is_on`, `is_undo`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_flag`, `class_name`, `class_file`) VALUES 
+('bx_files', '1', '1', 'page.php?i=view-file&id={object_id}', 'bx_files_main', 'id', 'author', 'featured', '', '');
+
+-- STUDIO: page & widget
+
+INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
+(3, 'bx_files', '_bx_files', '_bx_files', 'bx_files@modules/boonex/files/|std-icon.svg');
+SET @iPageId = LAST_INSERT_ID();
+
+SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
+SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
+INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
+(@iPageId, 'bx_files', '{url_studio}module.php?name=bx_files', '', 'bx_files@modules/boonex/files/|std-icon.svg', '_bx_files', '', '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/files/updates/9.0.0_9.0.1/source/js/manage_tools.js

@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Files Files
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+function BxFilesManageTools(oOptions) {
+	this._iSearchTimeoutId = false;
+	this._sActionsUrl = oOptions.sActionUrl;
+	this._sObjNameGrid = oOptions.sObjNameGrid;
+    this._sObjName = oOptions.sObjName == undefined ? 'oBxFilesManageTools' : 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;
+}
+
+BxFilesManageTools.prototype.onChangeFilter = function(oFilter) {
+	var $this = this;
+	var oFilter1 = $('#bx-grid-filter1-' + this._sObjNameGrid);
+	var sValueFilter1 = oFilter1.length > 0 ? oFilter1.val() : '';
+
+	var oSearch = $('#bx-grid-search-' + this._sObjNameGrid);
+	var sValueSearch = oSearch.length > 0 ? oSearch.val() : '';
+	if(sValueSearch == _t('_sys_grid_search'))
+		sValueSearch = '';
+
+	clearTimeout($this._iSearchTimeoutId);
+    $this._iSearchTimeoutId = setTimeout(function () {
+        glGrids[$this._sObjNameGrid].setFilter(sValueFilter1 + $this._sParamsDivider + sValueSearch, true);
+    }, 500);
+};
+
+BxFilesManageTools.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')
+	});
+};
+
+BxFilesManageTools.prototype.onClickDelete = function(iContentId) {
+	$('.bx-popup-applied:visible').dolPopupHide();
+
+	glGrids[this._sObjNameGrid].actionWithId(iContentId, 'delete', {}, '', false, 1);
+};
+
+/** @} */

+ 5 - 0
modules/boonex/files/updates/9.0.0_9.0.1/source/template/timeline_post.html

@@ -0,0 +1,5 @@
+<div class="bx-tl-item-text">
+    <div class="bx-tl-title bx-def-margin-sec-bottom bx-def-font-h3">
+        <a href="__url__" title="__title_attr__" class="bx-tl-title"><i class="sys-icon __icon__"></i> __title__</a>
+    </div>
+</div>

+ 88 - 0
modules/boonex/forum/updates/9.0.2_9.0.3/source/classes/BxForumAlertsResponse.php

@@ -0,0 +1,88 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Forum Forum
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxForumAlertsResponse extends BxBaseModTextAlertsResponse
+{
+    public function __construct()
+    {
+        $this->MODULE = 'bx_forum';
+        parent::__construct();        
+    }
+
+    public function response($oAlert)
+    {
+        $sMethod = 'process' . bx_gen_method_name($oAlert->sUnit . '_' . $oAlert->sAction);
+    	if(method_exists($this, $sMethod))
+    		$this->$sMethod($oAlert);
+
+        parent::response($oAlert);
+    }
+
+    protected function processBxForumCommentPost($oAlert)
+    {
+        $this->updateCommentsSummary($oAlert->iObject);
+
+        $this->_oModule->serviceTriggerCommentPost($oAlert->iObject, $oAlert->aExtras['comment_author_id'], $oAlert->aExtras['comment_id'], 0, $oAlert->aExtras['comment_text']);
+    }
+    
+    protected function processBxForumCommentUpdated($oAlert)
+    {
+        $this->updateCommentsSummary($oAlert->iObject);
+    }
+
+    protected function processBxForumCommentRemoved($oAlert)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        $this->updateCommentsSummary($oAlert->iObject);
+
+        $aEntry = $this->_oModule->_oDb->getContentInfoById($oAlert->iObject);
+        if((int)$aEntry['lr_comment_id'] == (int)$oAlert->aExtras['comment_id']) {
+            $iLrCommentId = $iLrTimestamp = $iLrProfileId = 0;
+
+            $aComment = $this->_oModule->_oDb->getComments(array('type' => 'entry_last', 'entry_id' => $oAlert->iObject));
+            if(!empty($aComment) && is_array($aComment)) {
+                $iLrCommentId = $aComment['cmt_id'];
+                $iLrTimestamp = $aComment['cmt_time'];
+                $iLrProfileId = $aComment['cmt_author_id'];
+            }
+
+            $this->_oModule->_oDb->updateEntries(array(
+                'lr_timestamp' => $iLrTimestamp,
+                'lr_profile_id' => $iLrProfileId,
+                'lr_comment_id' => $iLrCommentId
+            ), array($CNF['FIELD_ID'] => $oAlert->iObject));
+        }
+    }
+
+    protected function updateCommentsSummary($iContentId)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        $aCmts = BxDolCmts::getObjectInstance($CNF['OBJECT_COMMENTS'], $iContentId)->getQueryObject()->getCommentsBy(array(
+        	'type' => 'object_id', 
+        	'object_id' => $iContentId
+        ));
+        if(empty($aCmts) || !is_array($aCmts))
+            return;
+
+        $sResult = '';
+        foreach($aCmts as $aCmt)
+            $sResult .= strip_tags($aCmt['cmt_text']) . "\n\r";
+
+        if(empty($sResult))
+            return;
+
+        $this->_oModule->_oDb->updateEntries(array($CNF['FIELD_TEXT_COMMENTS'] => $sResult), array($CNF['FIELD_ID'] => $iContentId));
+    }
+}
+
+/** @} */

+ 90 - 0
modules/boonex/forum/updates/9.0.2_9.0.3/source/classes/BxForumCmts.php

@@ -0,0 +1,90 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Forum Forum
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxForumCmts extends BxTemplCmts
+{
+	protected $MODULE;
+	protected $_oModule;
+
+	public function __construct($sSystem, $iId, $iInit = 1)
+    {
+    	$this->MODULE = 'bx_forum';
+    	$this->_oModule = BxDolModule::getInstance($this->MODULE);
+
+        parent::__construct($sSystem, $iId, $iInit, $this->_oModule->_oTemplate);
+
+        $this->setTableNameFiles('bx_forum_files');
+    }
+
+	public function isPostReplyAllowed($isPerformAction = false)
+    {
+    	$aContentInfo = $this->_oModule->_oDb->getContentInfoById($this->_iId);
+        if(!$aContentInfo || (int)$aContentInfo[$this->_oModule->_oConfig->CNF['FIELD_LOCK']] == 1)
+            return false;
+
+    	return parent::isPostReplyAllowed($isPerformAction);
+    }
+
+    public function onPostAfter($iId)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        if(!parent::onPostAfter($iId))
+            return false;
+
+        if(getParam($CNF['PARAM_AUTOSUBSCRIBE_REPLIED']) == 'on')
+            BxDolConnection::getObjectInstance($CNF['OBJECT_CONNECTION_SUBSCRIBERS'])->actionAdd((int)$this->getId(), (int)$this->_getAuthorId());
+    }
+
+    public function getCommentsBlock($aBp = array(), $aDp = array())
+    {
+        $mixedBlock = parent::getCommentsBlock($aBp, $aDp);
+        if (is_array($mixedBlock) && isset($mixedBlock['title']))
+            $mixedBlock['title'] = _t('_bx_forum_page_block_title_entry_comments', $this->getCommentsCount());
+        return $mixedBlock;
+    }
+
+    public function getComment($mixedCmt, $aBp = array(), $aDp = array())
+    {
+    	return parent::getComment($mixedCmt, $aBp, array_merge($aDp, array(
+    		'class_comment' => ' bx-def-box bx-def-padding bx-def-round-corners bx-def-color-bg-box'
+    	)));
+    }
+
+	protected function _getFormObject($sAction = BX_CMT_ACTION_POST)
+    {
+    	$CNF = &$this->_oModule->_oConfig->CNF;
+
+    	$oResult = parent::_getFormObject($sAction);
+    	if(!isset($oResult->aInputs['cmt_image']))
+    		return $oResult;
+
+		$oResult->aInputs['cmt_image']['storage_object'] = $CNF['OBJECT_STORAGE_CMTS']; 
+		$oResult->aInputs['cmt_image']['images_transcoder'] = $CNF['OBJECT_IMAGES_TRANSCODER_PREVIEW_CMTS'];
+		$oResult->aInputs['cmt_image']['upload_buttons_titles'] = array('Simple' => 'paperclip');
+
+        return $oResult;
+    }
+
+    protected function _getForm($sAction, $iId)
+    {
+    	$oForm = parent::_getForm($sAction, $iId);
+
+    	if(isset($oForm->aInputs['cmt_text'])) {
+    		$oForm->aInputs['cmt_text']['html'] = 3;
+    		$oForm->aInputs['cmt_text']['db']['pass'] = 'XssHtml';
+    	}
+
+    	return $oForm;
+    }
+}
+
+/** @} */

+ 169 - 0
modules/boonex/forum/updates/9.0.2_9.0.3/source/classes/BxForumConfig.php

@@ -0,0 +1,169 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Forum Forum
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxForumConfig extends BxBaseModTextConfig
+{
+    function __construct($aModule)
+    {
+        parent::__construct($aModule);
+
+        $aMenuItems2Methods = array (
+            'subscribe-discussion' => 'checkAllowedSubscribe',
+            'unsubscribe-discussion' => 'checkAllowedUnsubscribe',
+        	'stick-discussion' => 'checkAllowedStickAnyEntry',
+        	'unstick-discussion' => 'checkAllowedUnstickAnyEntry',
+        	'lock-discussion' => 'checkAllowedLockAnyEntry',
+        	'unlock-discussion' => 'checkAllowedUnlockAnyEntry',
+        	'hide-discussion' => 'checkAllowedHideAnyEntry',
+        	'unhide-discussion' => 'checkAllowedUnhideAnyEntry',
+        	'edit-discussion' => 'checkAllowedEdit',
+            'delete-discussion' => 'checkAllowedDelete'
+        );
+
+        $this->CNF = array (
+
+            // module icon
+            'ICON' => 'comments-o col-blue2',
+
+            // database tables
+            'TABLE_ENTRIES' => $aModule['db_prefix'] . 'discussions',
+        	'TABLE_ENTRIES_FULLTEXT' => 'title_text',
+
+            // database fields
+            'FIELD_ID' => 'id',
+            'FIELD_AUTHOR' => 'author',
+            'FIELD_ADDED' => 'added',
+            'FIELD_CHANGED' => 'changed',
+            'FIELD_TITLE' => 'title',
+            'FIELD_TEXT' => 'text',
+            'FIELD_TEXT_ID' => 'discussion-text',
+            'FIELD_TEXT_COMMENTS' => 'text_comments',
+        	'FIELD_CATEGORY' => 'cat',
+            'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
+            'FIELD_PHOTO' => 'attachments',
+            'FIELD_THUMB' => '',
+            'FIELD_COMMENTS' => 'comments',
+        	'FIELD_STICK' => 'stick',
+        	'FIELD_LOCK' => 'lock',
+        	'FIELD_STATUS' => 'status',
+        	'FIELD_STATUS_ADMIN' => 'status_admin',
+	        '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-discussion',
+            'URI_AUTHOR_ENTRIES' => 'discussions-author',
+        	'URI_CATEGORY_ENTRIES' => 'discussions-category',
+        	'URI_KEYWORD_ENTRIES' => 'discussions-keyword',
+            'URI_ADD_ENTRY' => 'create-discussion',
+        	'URI_EDIT_ENTRY' => 'edit-discussion',
+        	'URI_MANAGE_COMMON' => 'discussions-manage',
+
+            'URL_HOME' => 'page.php?i=discussions-home',
+        	'URL_UPDATED' => 'page.php?i=discussions-updated',
+        	'URL_NEW' => 'page.php?i=discussions-new',
+            'URL_TOP' => 'page.php?i=discussions-top',
+        	'URL_POPULAR' => 'page.php?i=discussions-popular',
+        	'URL_MANAGE_COMMON' => 'page.php?i=discussions-manage',
+        	'URL_MANAGE_ADMINISTRATION' => 'page.php?i=discussions-administration',
+
+            // some params
+            'PARAM_CHARS_SUMMARY' => 'bx_forum_summary_chars',
+            'PARAM_CHARS_SUMMARY_PLAIN' => 'bx_forum_plain_summary_chars',
+            'PARAM_NUM_RSS' => 'bx_forum_rss_num',
+        	'PARAM_SEARCHABLE_FIELDS' => 'bx_forum_searchable_fields',
+        	'PARAM_AUTOSUBSCRIBE_CREATED' => 'bx_forum_autosubscribe_created',
+        	'PARAM_AUTOSUBSCRIBE_REPLIED' => 'bx_forum_autosubscribe_replied',
+
+            // objects
+            'OBJECT_GRID' => 'bx_forum',
+        	'OBJECT_GRID_FAVORITE' => 'bx_forum_favorite',
+            'OBJECT_GRID_FEATURE' => 'bx_forum_feature',
+        	'OBJECT_GRID_ADMINISTRATION' => 'bx_forum_administration',
+        	'OBJECT_GRID_COMMON' => 'bx_forum_common',
+        	'OBJECT_GRID_CATEGORIES' => 'bx_forum_categories',
+            'OBJECT_STORAGE' => 'bx_forum_files',
+        	'OBJECT_STORAGE_CMTS' => 'bx_forum_files_cmts',
+            'OBJECT_IMAGES_TRANSCODER_PREVIEW' => 'bx_forum_preview',
+        	'OBJECT_IMAGES_TRANSCODER_PREVIEW_CMTS' => 'bx_forum_preview_cmts',
+            'OBJECT_IMAGES_TRANSCODER_GALLERY' => '',
+            'OBJECT_VIDEOS_TRANSCODERS' => array(),
+            'OBJECT_VIEWS' => 'bx_forum',
+            'OBJECT_VOTES' => 'bx_forum',
+        	'OBJECT_FAVORITES' => 'bx_forum',
+        	'OBJECT_FEATURED' => 'bx_forum',
+        	'OBJECT_CATEGORY' => 'bx_forum_cats',
+            'OBJECT_COMMENTS' => 'bx_forum',
+        	'OBJECT_METATAGS' => 'bx_forum',
+            'OBJECT_PRIVACY_VIEW' => 'bx_forum_allow_view_to',
+            'OBJECT_FORM_ENTRY' => 'bx_forum',
+            'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_forum_entry_view',
+            'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_forum_entry_add',
+            'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_forum_entry_edit',
+            'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_forum_entry_delete',
+        	'OBJECT_FORM_SEARCH' => 'bx_forum_search',
+            'OBJECT_FORM_SEARCH_DISPLAY_FULL' => 'bx_forum_search_full',
+            'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_forum_view', // actions menu on view entry page
+            'OBJECT_MENU_ACTIONS_VIEW_ENTRY_MORE' => 'bx_forum_view_more', // more actions menu on view entry page
+            'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_forum_my', // actions menu on my entries page
+            'OBJECT_MENU_MANAGE_TOOLS' => 'bx_forum_menu_manage_tools', //manage menu in content administration tools
+            'OBJECT_MENU_SUBMENU' => 'bx_forum_submenu', // main module submenu
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => '', // view entry submenu
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'forum', // first item in view entry submenu from main module submenu
+            'OBJECT_UPLOADERS' => array('sys_simple', 'sys_html5'),
+            'OBJECT_CONNECTION_SUBSCRIBERS' => 'bx_forum_subscribers',
+
+            // menu items which visibility depends on custom visibility checking
+            'MENU_ITEM_TO_METHOD' => array (
+                'bx_forum_view' => $aMenuItems2Methods,
+        		'bx_forum_view_more' => $aMenuItems2Methods,
+            ),
+
+            // some language keys
+            'T' => array (
+                'txt_sample_single' => '_bx_forum_txt_sample_single',
+            	'txt_sample_single_with_article' => '_bx_forum_txt_sample_single_with_article',
+            	'txt_sample_comment_single' => '_bx_forum_txt_sample_comment_single',
+            	'txt_sample_vote_single' => '_bx_forum_txt_sample_vote_single',
+            	'form_field_author' => '_bx_forum_form_entry_input_author',
+            	'grid_action_err_delete' => '_bx_forum_grid_action_err_delete',
+            	'grid_txt_account_manager' => '_bx_forum_grid_txt_account_manager',
+            	'filter_item_active' => '_bx_forum_grid_filter_item_title_adm_active',
+            	'filter_item_hidden' => '_bx_forum_grid_filter_item_title_adm_hidden',
+            	'filter_item_select_one_filter1' => '_bx_forum_grid_filter_item_title_adm_select_one_filter1',
+            	'menu_item_manage_my' => '_bx_forum_menu_item_title_manage_my',
+            	'menu_item_manage_all' => '_bx_forum_menu_item_title_manage_all',
+            	'txt_all_entries_by_author' => '_bx_forum_page_title_browse_by_author',
+            ),
+        );
+
+        $this->_aJsClasses = array(
+        	'main' => 'BxForumMain',
+        	'entry' => 'BxForumEntry',
+        	'manage_tools' => 'BxForumManageTools',
+        	'studio' => 'BxForumStudio'
+        );
+
+        $this->_aJsObjects = array(
+        	'main' => 'oBxForumMain',
+        	'entry' => 'oBxForumEntry',
+        	'manage_tools' => 'oBxForumManageTools',
+        	'studio' => 'oBxForumStudio'
+        );
+
+        $this->_aGridObjects = array(
+        	'common' => $this->CNF['OBJECT_GRID_COMMON'],
+        	'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
+        	
+        );
+    }
+}
+
+/** @} */

+ 154 - 0
modules/boonex/forum/updates/9.0.2_9.0.3/source/classes/BxForumDb.php

@@ -0,0 +1,154 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Forum Forum
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/*
+ * Module database queries
+ */
+class BxForumDb extends BxBaseModTextDb
+{
+    public function __construct(&$oConfig)
+    {
+        parent::__construct($oConfig);
+    }
+
+	public function updateEntries($aSet, $aWhere)
+    {
+        $sQuery = "UPDATE `" . $this->_oConfig->CNF['TABLE_ENTRIES'] . "` SET " . $this->arrayToSQL($aSet) . " WHERE " . (!empty($aWhere) ? $this->arrayToSQL($aWhere, ' AND ') : "1");
+        return (int)$this->query($sQuery) > 0;
+    }
+
+    public function updateLastCommentTimeProfile($iConversationId, $iProfileId, $iCommentId, $iTimestamp)
+    {
+        $sQuery = $this->prepare("UPDATE `" . $this->getPrefix() . "discussions` SET `lr_profile_id` = ?, `lr_timestamp` = ?, `lr_comment_id` = ? WHERE `id` = ?", $iProfileId, $iTimestamp, $iCommentId, $iConversationId);
+        return $this->query($sQuery);
+    }
+
+    public function getComments($aParams)
+    {
+    	$CNF = &$this->_oConfig->CNF;
+
+    	$aMethod = array('name' => 'getAll', 'params' => array(0 => 'query'));
+
+    	$sFieldsClause = "`te`.*"; 
+    	$sJoinClause = $sWhereClause = $sGroupClause = $sOrderClause = $sLimitClause = "";
+
+    	switch($aParams['type']) {
+    	    case 'entry_last':
+    	        $aMethod['name'] = 'getRow';
+    	        $aMethod['params'][1]['cmt_object_id'] = $aParams['entry_id'];
+    	        $sWhereClause = " AND `te`.`cmt_object_id` = :cmt_object_id";
+    	        $sOrderClause = "`te`.`cmt_time` DESC";
+    	        $sLimitClause = "1";
+    	        break;
+
+    	    case 'entries_author_search':
+    			$aMethod['name'] = 'getColumn';
+    			$sFieldsClause = "`te`.`cmt_object_id`"; 
+    			$sWhereClause = " AND `te`.`cmt_author_id` IN (" . $this->implode_escape($aParams['author']) . ")";
+    			$sGroupClause = "`te`.`cmt_object_id`";
+    			break;
+
+    		case 'entries_keyword_search':
+    			$aMethod['name'] = 'getColumn';
+    			$sFieldsClause = "`te`.`cmt_object_id`"; 
+    			$sWhereClause = " AND `te`.`cmt_text` LIKE " . $this->escape("%" . $aParams['keyword'] . "%");
+    			$sGroupClause = "`te`.`cmt_object_id`";
+    			break;
+
+			case 'author_comments':
+				$aMethod['name'] = 'getPairs';
+				$sFieldsClause = "`te`.`cmt_author_id`, COUNT(`te`.`cmt_id`) AS `cmt_count`";
+				$sWhereClause = $this->prepareAsString(" AND `te`.`cmt_object_id`=? ", $aParams['object_id']);
+				$sGroupClause = "`te`.`cmt_author_id`";
+				$aMethod['params'][1] = "cmt_author_id";
+				$aMethod['params'][2] = "cmt_count";
+				break;
+    	}
+
+    	$sGroupClause = $sGroupClause ? "GROUP BY " . $sGroupClause : "";
+		$sOrderClause = $sOrderClause ? "ORDER BY " . $sOrderClause : "";
+		$sLimitClause = $sLimitClause ? "LIMIT " . $sLimitClause : "";
+
+		$aMethod['params'][0] = "SELECT
+				" . $sFieldsClause . "
+            FROM `" . $this->getPrefix() . "cmts` AS `te`" . $sJoinClause . "
+            WHERE 1" . $sWhereClause . " " . $sGroupClause . " " . $sOrderClause . " " . $sLimitClause;
+
+        return call_user_func_array(array($this, $aMethod['name']), $aMethod['params']);
+    }
+
+    public function getUnrepliedDiscussionsNum ($iProfileId)
+    {
+    	$CNF = &$this->_oConfig->CNF;
+
+        $sQuery = $this->prepare("SELECT COUNT(`te`.`id`)
+            FROM `" . $CNF['TABLE_ENTRIES'] . "` AS `te`
+            WHERE `te`.`author`=? AND `te`.`lr_profile_id`<>?", $iProfileId, $iProfileId);
+
+		return $this->getOne($sQuery);
+    }
+
+	public function updateStatus($sAction, $aContentInfo)
+	{
+		$CNF = &$this->_oConfig->CNF;
+
+		$aActions = array(
+			'stick' => array($CNF['FIELD_STICK'] => 1),
+			'unstick' => array($CNF['FIELD_STICK'] => 0),
+			'lock' =>  array($CNF['FIELD_LOCK'] => 1),
+			'unlock' =>  array($CNF['FIELD_LOCK'] => 0),
+			'hide' =>  array($CNF['FIELD_STATUS_ADMIN'] => 'hidden'),
+			'unhide' =>  array($CNF['FIELD_STATUS_ADMIN'] => 'active')
+		);
+
+		return $this->updateEntries($aActions[$sAction], array($CNF['FIELD_ID'] => $aContentInfo[$CNF['FIELD_ID']]));
+	}
+
+	public function insertCategory($aSet)
+    {
+        $sQuery = "INSERT INTO `" . $this->getPrefix() . "categories` SET " . $this->arrayToSQL($aSet);
+        return (int)$this->query($sQuery) > 0;
+    }
+
+	public function getCategories($aParams)
+    {
+        $aMethod = array('name' => 'getAll', 'params' => array(0 => 'query'));
+        $sSelectClause = $sJoinClause = $sWhereClause = $sGroupClause = $sOrderClause = $sLimitClause = "";
+
+        if(!isset($aParams['order']) || empty($aParams['order']))
+           $sOrderClause = "ORDER BY `tc`.`category` ASC";
+
+        switch($aParams['type']) {
+            case 'by_category':
+                $aMethod['name'] = 'getRow';
+                $aMethod['params'][1] = array(
+                	'category' => $aParams['category']
+                );
+
+                $sWhereClause = " AND `tc`.`category`=:category ";
+                break;
+
+            case 'all_pairs':
+            	$aMethod['name'] = 'getPairs';
+                $aMethod['params'][1] = 'category';
+                $aMethod['params'][2] = 'visible_for_levels';
+            	break;
+        }
+
+        $aMethod['params'][0] = "SELECT 
+                `tc`.*" . $sSelectClause . " 
+            FROM `" . $this->getPrefix() . "categories` AS `tc` " . $sJoinClause . "
+            WHERE 1 " . $sWhereClause . " " . $sGroupClause . " " . $sOrderClause . " " . $sLimitClause;
+        return call_user_func_array(array($this, $aMethod['name']), $aMethod['params']);
+    }
+}
+
+/** @} */

+ 257 - 0
modules/boonex/forum/updates/9.0.2_9.0.3/source/classes/BxForumGrid.php

@@ -0,0 +1,257 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Forum Forum
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
+
+class BxForumGrid extends BxTemplGrid
+{
+    protected $_oModule;
+    protected $_sDefaultSource; 
+
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+        $this->_oModule = BxDolModule::getInstance('bx_forum');
+
+        parent::__construct ($aOptions, $oTemplate);
+
+        $this->_aOptions['paginate_per_page'] = (int)$this->_oModule->_oDb->getParam('bx_forum_per_page_browse');
+
+        $this->_sDefaultSortingOrder = 'DESC';
+        $this->_sDefaultSource = $this->_aOptions['source'];
+    }
+
+    public function setBrowseParams($aParams)
+    {
+        parent::setBrowseParams($aParams);
+
+    	$sField = 'added';
+    	if(!empty($this->_aBrowseParams['type']))
+	    	switch($this->_aBrowseParams['type']) {
+	    		case 'new':
+	    		case 'author':
+                case 'favorite':
+	    		case 'category':
+	                $sField = 'added';
+	                break;
+
+                case 'featured':
+					$sField = 'featured';
+	                break;
+	
+				case 'updated':
+					$sField = 'changed';
+	                break;
+	
+				case 'latest':
+					$sField = 'lr_timestamp';
+	                break;
+	
+				case 'top':
+					$sField = 'comments';
+	                break;
+	
+	            case 'popular':
+	            	$sField = 'views';
+	                break;
+	    	}
+
+		$this->_aOptions['field_order'] = $sField;
+		$this->_aOptions['paginate_per_page'] = !empty($this->_aBrowseParams['per_page']) ? (int)$this->_aBrowseParams['per_page'] : (int)$this->_oModule->_oDb->getParam('bx_forum_per_page_browse');
+    }
+
+    public function getCode ($isDisplayHeader = true)
+    {
+    	return $this->_oModule->_oTemplate->getJsCode('main') . parent::getCode($isDisplayHeader);
+    }
+
+    protected function _getActionAdd ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
+    {
+        $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->_oModule->_oConfig->CNF['URI_ADD_ENTRY']);
+
+        unset($a['attr']['bx_grid_action_independent']);
+        $a['attr'] = array_merge($a['attr'], array(
+    		"onclick" => "window.open('" . $sUrl . "','_self');"
+    	));
+
+        return parent::_getActionDefault ($sType, $sKey, $a, $isSmall, $isDisabled, $aRow);
+    }
+
+    protected function _getRowHead ()
+    {
+    	return array();
+    }
+
+    protected function _getCellAuthor($mixedValue, $sKey, $aField, $aRow)
+    {
+    	$mixedValue = $this->_oModule->_oTemplate->getEntryAuthor($aRow);
+
+        return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow);
+    }
+
+    protected function _getCellLrTimestamp($mixedValue, $sKey, $aField, $aRow)
+    {
+        $mixedValue = $this->_oModule->_oTemplate->getEntryPreview($aRow);
+
+        return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow);
+    }
+
+    protected function _getCellComments($mixedValue, $sKey, $aField, $aRow)
+    {
+        $mixedValue = $this->_oModule->_oTemplate->getEntryLabel($aRow, array('show_count' => 1));
+
+        return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow);
+    }
+
+    protected function _addJsCss()
+    {
+        parent::_addJsCss();
+
+        $this->_oModule->_oTemplate->addJs(array('main.js'));
+        $this->_oModule->_oTemplate->addCss(array('main-media-tablet.css', 'main-media-desktop.css'));
+    }
+
+    protected function _getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage)
+    {
+    	$sJoinClause = $sWhereClause = '';
+
+    	//--- Check status
+    	$sWhereClause .= " AND `" . $this->_oModule->_oConfig->CNF['FIELD_STATUS'] . "`='active'";
+    	$sWhereClause .= " AND `" . $this->_oModule->_oConfig->CNF['FIELD_STATUS_ADMIN'] . "`='active'";
+
+    	//--- Check privacy
+    	$iAuthorId = 0;
+    	if(!empty($this->_aBrowseParams['author'])) {
+    		$oProfileAuthor = BxDolProfile::getInstance((int)$this->_aBrowseParams['author']);
+    		if($oProfileAuthor)
+    			$iAuthorId = $oProfileAuthor->id();
+    	}
+
+		$sPrivacy = $this->_oModule->_oConfig->CNF['OBJECT_PRIVACY_VIEW'];
+		$oPrivacy = BxDolPrivacy::getObjectInstance($sPrivacy);
+		$aCondition = $oPrivacy ? $oPrivacy->getContentPublicAsSQLPart($iAuthorId) : array();
+		if(isset($aCondition['join']))
+			$sJoinClause .= $aCondition['join'];
+		if(isset($aCondition['where']))
+			$sWhereClause .= $aCondition['where'];
+
+		//--- Check browse params
+        if(!empty($this->_aBrowseParams['join']) && is_array($this->_aBrowseParams['join'])) {
+			$sJoinClauseBrowse = $this->_getSqlJoinGroup($this->_aBrowseParams['join']);
+			if(!empty($sJoinClauseBrowse))
+				$sJoinClause .= " " . $sJoinClauseBrowse;
+		}
+
+		if(!empty($this->_aBrowseParams['where']) && is_array($this->_aBrowseParams['where'])) {
+			$sWhereClauseBrowse = $this->_getSqlWhereFromGroup($this->_aBrowseParams['where']);
+			if(!empty($sWhereClauseBrowse))
+				$sWhereClause .= " AND " . $sWhereClauseBrowse;
+		}
+
+		$this->_aOptions['source'] = sprintf($this->_sDefaultSource, $sJoinClause, $sWhereClause);
+		return parent::_getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage);
+    }
+
+    protected function _getDataSqlOrderClause($sOrderByFilter, $sOrderField, $sOrderDir, $bFieldsOnly = false)
+    {
+    	$sOrder = parent::_getDataSqlOrderClause($sOrderByFilter, $sOrderField, $sOrderDir, true);
+
+    	return " ORDER BY `" . $this->_oModule->_oConfig->CNF['FIELD_STICK'] . "` DESC, " . $sOrder;
+    }
+
+    protected function _getSqlJoinGroup($aGrp)
+    {
+    	if(!isset($aGrp['grp']) || (bool)$aGrp['grp'] !== true)
+			return $this->_getSqlJoinCondition($aGrp);
+
+		$sResult = "";
+    	if(empty($aGrp['cnds']) || !is_array($aGrp['cnds']))
+    		return $sResult;
+
+		$sOprGrp = " ";
+    	foreach($aGrp['cnds'] as $aCnd) {
+    		$sResultCnd = $this->_getSqlJoinCondition($aCnd);
+    		if(!empty($sResultCnd))
+				$sResult .= $sOprGrp . $sResultCnd;
+    	}
+
+    	return trim($sResult, $sOprGrp);
+    }
+
+    protected function _getSqlJoinCondition($aCnd)
+    {
+    	$sResult = "";
+    	if(!isset($aCnd['tp'], $aCnd['tbl1'], $aCnd['fld1'], $aCnd['fld2']))
+    		return $sResult;
+
+        $sField1 = "`" . $aCnd['tbl1'] . "`.`" . $aCnd['fld1'] . "`";
+
+        $sField2 = "`" . $aCnd['fld2'] . "`";
+        if(!empty($aCnd['tbl2']))
+            $sField2 = "`" . $aCnd['tbl2'] . "`." . $sField2;
+
+		return $aCnd['tp'] . " JOIN `" . $aCnd['tbl1'] . "` ON (" . $sField1 . " = " . $sField2 . ")";
+    }
+
+    protected function _getSqlWhereFromGroup($aGrp)
+    {
+    	if(!isset($aGrp['grp']) || (bool)$aGrp['grp'] !== true)
+			return $this->_getSqlWhereFromCondition($aGrp);
+
+		$sResult = "";
+    	if(!isset($aGrp['opr'], $aGrp['cnds']) || empty($aGrp['cnds']) || !is_array($aGrp['cnds']))
+    		return $sResult;
+
+		$sOprGrp = " " . $aGrp['opr'] . " ";
+    	foreach($aGrp['cnds'] as $aCnd) {
+    		$sMethod = '_getSqlWhereFrom' . (isset($aGrp['grp']) && (bool)$aGrp['grp'] === true ? 'Group' : 'Condition');
+    		$sResultCnd = $this->$sMethod($aCnd);
+    		if(!empty($sResultCnd))
+				$sResult .= $sOprGrp . $sResultCnd;
+    	}
+
+    	$sResult = trim($sResult, $sOprGrp);
+    	if(!empty($sResult))
+    		$sResult = "(" . $sResult . ")";
+
+    	return $sResult;
+    }
+
+    protected function _getSqlWhereFromCondition($aCnd)
+    {
+    	$sResult = "";
+    	if(!isset($aCnd['fld'], $aCnd['val'], $aCnd['opr']))
+    		return $sResult;
+
+        $sField = "`" . $aCnd['fld'] . "`";
+        if(!empty($aCnd['tbl']))
+            $sField = "`" . $aCnd['tbl'] . "`." . $sField;
+
+		switch($aCnd['opr']) {
+			case 'IN':
+				if(empty($aCnd['val']) || !is_array($aCnd['val']))
+					break;
+
+				$sResult .= $sField . " IN (" . $this->_oModule->_oDb->implode_escape($aCnd['val']) . ")";
+				break;
+
+			case 'LIKE':
+				$sResult .= $sField . " LIKE " . $this->_oModule->_oDb->escape('%' . $aCnd['val'] . '%');
+				break;
+
+			default:
+			    $sResult .= $sField . " " . $aCnd['opr'] . " " . $this->_oModule->_oDb->escape($aCnd['val']);
+		}
+
+		return $sResult;
+    }
+}
+
+/** @} */

+ 61 - 0
modules/boonex/forum/updates/9.0.2_9.0.3/source/classes/BxForumMenuView.php

@@ -0,0 +1,61 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Forum Forum
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * View entry menu
+ */
+class BxForumMenuView extends BxBaseModTextMenuView
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_forum';
+        parent::__construct($aObject, $oTemplate);
+
+        $this->addMarkers(array(
+        	'js_object' => $this->_oModule->_oConfig->getJsObject('entry') 
+        ));
+    }
+    
+    /**
+     * Check if menu items is visible.
+     * @param $a menu item array
+     * @return boolean
+     */
+    protected function _isVisible ($a)
+    {
+        if(!parent::_isVisible($a))
+            return false;
+
+        $sCheckFuncName = '';
+        $aCheckFuncParams = array();
+        switch ($a['name']) {
+            case 'more':
+            	$sCheckFuncName = '_isVisibleMore';
+            	break;
+        }
+
+        if(!$sCheckFuncName || !method_exists($this, $sCheckFuncName))
+            return true;
+
+        return call_user_func_array(array($this, $sCheckFuncName), $aCheckFuncParams) === true;
+    }
+
+    protected function _isVisibleMore()
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        $oMenu = BxDolMenu::getObjectInstance($CNF['OBJECT_MENU_ACTIONS_VIEW_ENTRY_MORE']);
+        $oMenu->setContentId($this->_iContentId);
+    	return $oMenu->isVisible();
+    }
+}
+
+/** @} */

+ 535 - 0
modules/boonex/forum/updates/9.0.2_9.0.3/source/classes/BxForumModule.php

@@ -0,0 +1,535 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Forum Forum
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxForumModule extends BxBaseModTextModule
+{
+    function __construct(&$aModule)
+    {
+        parent::__construct($aModule);
+    }
+
+    public function sortParticipants ($aParticipants, $iProfileIdLastComment, $iProfileIdAuthor, $iProfileIdCurrent = 0)
+    {
+        if (!$iProfileIdCurrent)
+            $iProfileIdCurrent = bx_get_logged_profile_id();
+
+        $aMoveUp = array($iProfileIdCurrent, $iProfileIdLastComment, $iProfileIdAuthor);
+
+        asort($aParticipants, SORT_NUMERIC);
+
+        foreach ($aMoveUp as $iProfileId) {
+            if (!isset($aParticipants[$iProfileId]))
+                continue;
+
+            $a = array($iProfileId => $aParticipants[$iProfileId]);
+            unset($aParticipants[$iProfileId]);
+            $aParticipants = $a + $aParticipants;
+        }
+
+        return $aParticipants;
+    }
+
+    /**
+     * Action methods
+     */
+    public function actionUpdateStatus($sAction = '', $iContentId = 0)
+    {
+    	if(empty($sAction) && bx_get('action') !== false)
+   			$sAction = bx_process_input(bx_get('action'));
+
+		if(empty($iContentId) && bx_get('id') !== false)
+    		$iContentId = (int)bx_get('id');
+
+    	$aContentInfo = $this->_oDb->getContentInfoById($iContentId);
+        if(empty($aContentInfo) || !is_array($aContentInfo))
+			return echoJson(array('code' => 1, 'message' => _t('_bx_forum_err_not_found')));
+
+		$sMethodCheck = 'checkAllowed' . bx_gen_method_name($sAction) . 'AnyEntry';
+		$sResult = $this->$sMethodCheck($aContentInfo);
+        if($sResult !== CHECK_ACTION_RESULT_ALLOWED)
+        	return echoJson(array('code' => 2, 'message' => $sResult));
+
+        if(!$this->_oDb->updateStatus($sAction, $aContentInfo))
+        	return echoJson(array('code' => 3, 'message' => _t('_error occured')));
+
+    	echoJson(array('code' => 0, 'id' => $iContentId, 'reload' => 1));
+    }
+
+    public function actionAjaxGetAuthors()
+    {
+        $aResult = BxDolService::call('system', 'profiles_search', array(bx_get('term')), 'TemplServiceProfiles');
+
+        header('Content-Type:text/javascript; charset=utf-8');
+        echo json_encode($aResult);
+    }
+
+    /**
+     * Service methods
+     */
+    public function serviceGetInfo ($iContentId, $bSearchableFieldsOnly = true)
+    {
+        $aContentInfo = $this->_getFields($iContentId);
+        if(empty($aContentInfo))
+            return array();
+
+        return $aContentInfo;
+    }
+
+	public function serviceBrowseNew ($sUnitView = false, $bEmptyMessage = true, $bAjaxPaginate = true)
+    {
+    	$sType = 'new';
+
+    	if($sUnitView != 'table')   
+        	return $this->_serviceBrowse($sType, $sUnitView ? array('unit_view' => $sUnitView) : false, BX_DB_PADDING_DEF, $bEmptyMessage, $bAjaxPaginate);
+
+        return $this->_serviceBrowseTable(array('type' => $sType));
+    }
+
+	public function serviceBrowseLatest($sUnitView = false, $bEmptyMessage = true, $bAjaxPaginate = true, $bShowHeader = true)
+    {
+    	$sType = 'latest';
+
+    	if($sUnitView != 'table')
+        	return $this->_serviceBrowse($sType, $sUnitView ? array('unit_view' => $sUnitView) : false, BX_DB_PADDING_DEF, $bEmptyMessage, $bAjaxPaginate);
+
+		return $this->_serviceBrowseTable(array('type' => $sType), $bShowHeader);
+    }
+
+    public function serviceBrowseFeatured($sUnitView = false, $bEmptyMessage = true, $bAjaxPaginate = true, $bShowHeader = true)
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+    	$sType = 'featured';
+
+    	if($sUnitView != 'table')
+        	return $this->_serviceBrowse($sType, $sUnitView ? array('unit_view' => $sUnitView) : false, BX_DB_PADDING_DEF, $bEmptyMessage, $bAjaxPaginate);
+
+		return $this->_serviceBrowseTable(array(
+			'grid' => $CNF['OBJECT_GRID_FEATURE'],
+			'type' => $sType, 
+			'where' => array('fld' => 'featured', 'val' => 0, 'opr' => '<>')
+		), $bShowHeader);
+    }
+
+	public function serviceBrowseTop($sUnitView = false, $bEmptyMessage = true, $bAjaxPaginate = true)
+    {
+    	$sType = 'top';
+
+    	if($sUnitView != 'table')
+        	return $this->_serviceBrowse($sType, $sUnitView ? array('unit_view' => $sUnitView) : false, BX_DB_PADDING_DEF, $bEmptyMessage, $bAjaxPaginate);
+
+		return $this->_serviceBrowseTable(array('type' => $sType));
+    }
+
+    public function serviceBrowsePopular ($sUnitView = false, $bEmptyMessage = true, $bAjaxPaginate = true)
+    {
+        $sType = 'popular';
+
+        if($sUnitView != 'table')
+            $this->_serviceBrowse($sType, $sUnitView ? array('unit_view' => $sUnitView) : false, BX_DB_PADDING_DEF, $bEmptyMessage, $bAjaxPaginate);
+
+        return $this->_serviceBrowseTable(array('type' => $sType));
+    }
+
+    public function serviceBrowseUpdated ($sUnitView = false, $bEmptyMessage = true, $bAjaxPaginate = true)
+    {
+        $sType = 'updated';
+
+        if($sUnitView != 'table')
+            $this->_serviceBrowse($sType, $sUnitView ? array('unit_view' => $sUnitView) : false, BX_DB_PADDING_DEF, $bEmptyMessage, $bAjaxPaginate);
+
+        return $this->_serviceBrowseTable(array('type' => $sType));
+    }
+
+	public function serviceBrowseIndex($sUnitView = false, $bEmptyMessage = true, $bAjaxPaginate = true, $bShowHeader = true)
+    {
+    	$sType = 'index';
+
+    	if($sUnitView != 'table')
+        	return $this->_serviceBrowse($sType, $sUnitView ? array('unit_view' => $sUnitView) : false, BX_DB_PADDING_DEF, $bEmptyMessage, $bAjaxPaginate);
+
+		return $this->_serviceBrowseTable(array(
+			'type' => $sType,
+			'per_page' => (int)$this->_oDb->getParam('bx_forum_per_page_index')
+		), $bShowHeader);
+    }
+
+	public function serviceBrowseAuthor ($iProfileId = 0, $aParams = array())
+    {
+        if(!$iProfileId)
+            $iProfileId = bx_process_input(bx_get('profile_id'), BX_DATA_INT);
+
+        if(!$iProfileId)
+            return '';
+
+        return $this->_serviceBrowseTable(array(
+        	'type' => 'author', 
+        	'author' => $iProfileId, 
+        	'where' => array('fld' => 'author', 'val' => $iProfileId, 'opr' => '='), 
+        	'per_page' => (int)$this->_oDb->getParam('bx_forum_per_page_profile')
+        ), false);
+    }
+
+    public function serviceBrowseFavorite ($iProfileId = 0, $aParams = array())
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        $oProfile = null;
+        if((int)$iProfileId)
+            $oProfile = BxDolProfile::getInstance($iProfileId);
+        if(!$oProfile && bx_get('profile_id') !== false)
+            $oProfile = BxDolProfile:: getInstance(bx_process_input(bx_get('profile_id'), BX_DATA_INT));
+        if(!$oProfile)
+            $oProfile = BxDolProfile::getInstance();
+        if(!$oProfile)
+            return '';
+
+        $iProfileAuthor = $oProfile->id();
+        $oFavorite = $this->getObjectFavorite();
+        if(!$oFavorite->isPublic() && $iProfileAuthor != bx_get_logged_profile_id())
+            return '';
+
+        $aConditions = $oFavorite->getConditionsTrack($CNF['TABLE_ENTRIES'], 'id', $iProfileAuthor);
+        if(empty($aConditions) || !is_array($aConditions)) 
+            return '';
+
+        $aJoinGroup = array('grp' => true, 'cnds' => array());
+        if(!empty($aConditions['join']))
+            foreach($aConditions['join'] as $aCondition)
+                $aJoinGroup['cnds'][] = array(
+                    'tp' => $aCondition['type'],
+                    'tbl1' => $aCondition['table'],
+                    'fld1' => $aCondition['onField'],
+                    'tbl2' => $aCondition['mainTable'],
+                	'fld2' => $aCondition['mainField']
+                );
+
+        $aWhereGroup = array('grp' => true, 'opr' => 'AND', 'cnds' => array());
+        if(!empty($aConditions['restriction']))
+            foreach($aConditions['restriction'] as $aCondition)
+                $aWhereGroup['cnds'][] = array(
+                	'tbl' => (!empty($aCondition['table']) ? $aCondition['table'] : ''), 
+                	'fld' => $aCondition['field'], 
+                	'val' => $aCondition['value'], 
+                	'opr' => $aCondition['operator']
+                );
+
+        return $this->_serviceBrowseTable(array(
+			'grid' => $CNF['OBJECT_GRID_FAVORITE'],
+        	'type' => 'favorite', 
+        	'author' => $iProfileId, 
+            'join' => $aJoinGroup,
+        	'where' => $aWhereGroup, 
+        	'per_page' => (int)$this->_oDb->getParam('bx_forum_per_page_profile')
+        ), false);
+    }
+
+    public function serviceBrowseCategory($sUnitView = false, $bEmptyMessage = true, $bAjaxPaginate = true)
+    {
+    	$sType = 'category';
+    	$iCategory = bx_process_input(bx_get('category'), BX_DATA_INT);
+
+    	$aCategory = $this->_oDb->getCategories(array('type' => 'by_category', 'category' => $iCategory));
+    	if(!empty($aCategory['visible_for_levels']) && !BxDolAcl::getInstance()->isMemberLevelInSet($aCategory['visible_for_levels']))
+    		return $bEmptyMessage ? MsgBox(_t('_sys_txt_access_denied')) : '';
+
+    	if($sUnitView != 'table')   
+        	return $this->_serviceBrowse($sType, $sUnitView ? array('unit_view' => $sUnitView) : false, BX_DB_PADDING_DEF, $bEmptyMessage, $bAjaxPaginate);
+
+		return $this->_serviceBrowseTable(array('type' => $sType, 'where' => array('fld' => 'cat', 'val' => $iCategory, 'opr' => '=')));
+    }
+
+	public function serviceBrowseKeyword($sUnitView = false, $bEmptyMessage = true, $bAjaxPaginate = true)
+    {
+    	$sType = 'keyword';
+    	$sKeyword = bx_process_input(bx_get('keyword'));
+
+    	if($sUnitView != 'table')   
+        	return $this->_serviceBrowse($sType, $sUnitView ? array('unit_view' => $sUnitView) : false, BX_DB_PADDING_DEF, $bEmptyMessage, $bAjaxPaginate);
+
+		return $this->_serviceBrowseTable(array('type' => $sType, 'where' => $this->_getSearchKeywordDescriptor('#' . $sKeyword)));
+    }
+
+    public function serviceBrowseSearchResults($sUnitView = false, $bEmptyMessage = true, $bAjaxPaginate = true)
+    {
+    	$sType = 'search';
+
+    	$aAutors = bx_process_input(bx_get('author'));
+    	$iCategory = bx_process_input(bx_get('category'), BX_DATA_INT);
+    	$sKeyword = bx_process_input(bx_get('keyword'));
+
+    	$aCategory = $this->_oDb->getCategories(array('type' => 'by_category', 'category' => $iCategory));
+    	if(!empty($aCategory['visible_for_levels']) && !BxDolAcl::getInstance()->isMemberLevelInSet($aCategory['visible_for_levels']))
+    		return $bEmptyMessage ? MsgBox(_t('_sys_txt_access_denied')) : '';
+
+    	if($sUnitView != 'table')   
+        	return $this->_serviceBrowse('', $sUnitView ? array('unit_view' => $sUnitView) : false, BX_DB_PADDING_DEF, $bEmptyMessage, $bAjaxPaginate);
+
+        $aWhereGroupAnd = array('grp' => true, 'opr' => 'AND', 'cnds' => array());
+        if(!empty($aAutors) && is_array($aAutors))
+        	$aWhereGroupAnd['cnds'][] = $this->_getSearchAuthorDescriptor($aAutors);
+
+        if(!empty($iCategory))
+        	$aWhereGroupAnd['cnds'][] = array('fld' => 'cat', 'val' => $iCategory, 'opr' => '=');
+
+        if(!empty($sKeyword))
+        	$aWhereGroupAnd['cnds'][] = $this->_getSearchKeywordDescriptor($sKeyword);
+
+		return $this->_serviceBrowseTable(array('type' => $sType, 'where' => $aWhereGroupAnd), false);
+    }
+
+	/**
+     * Get number of discussions for some profile
+     * @param $iProfileId - profile to get discussions for, if omitted then currently logged in profile is used
+     * @return integer
+     */
+    public function serviceGetDiscussionsNum ($iProfileId = 0)
+    {
+        if (!$iProfileId)
+            $iProfileId = bx_get_logged_profile_id();
+
+        return $this->_oDb->getEntriesNumByAuthor((int)$iProfileId);
+    }
+
+    /**
+     * Get number of unreplied discussions for some profile
+     * @param $iProfileId - profile to get unreplied discussions for, if omitted then currently logged is profile is used
+     * @return integer
+     */
+    public function serviceGetUnrepliedDiscussionsNum ($iProfileId = 0)
+    {
+        if (!$iProfileId)
+            $iProfileId = bx_get_logged_profile_id();
+
+        return $this->_oDb->getUnrepliedDiscussionsNum((int)$iProfileId);
+    }
+
+    /**
+     * Update last comment time and author
+     */
+    public function serviceTriggerCommentPost ($iContentId, $iProfileId, $iCommentId, $iTimestamp = 0, $sCommentText = '')
+    {
+    	$CNF = $this->_oConfig->CNF;
+
+    	$iContentId = (int)$iContentId;
+        if(!$iContentId)
+            return false;
+
+        $aContentInfo = $this->_oDb->getContentInfoById($iContentId);
+        if(!$aContentInfo)
+			return false;
+
+        if(!$iTimestamp)
+			$iTimestamp = time();
+
+        if(!$this->_oDb->updateLastCommentTimeProfile((int)$iContentId, (int)$iProfileId, $iCommentId, $iTimestamp))
+			return false;
+
+        // send notification to author
+        if($iProfileId != $aContentInfo[$CNF['FIELD_AUTHOR']]) {
+	        $oProfile = BxDolProfile::getInstance($iProfileId);
+	        if($oProfile)
+                sendMailTemplate('bx_forum_new_reply', 0, $aContentInfo[$CNF['FIELD_AUTHOR']], array(
+                    'SenderDisplayName' => $oProfile->getDisplayName(),
+                    'SenderUrl' => $oProfile->getUrl(),
+                    'Message' => $sCommentText,
+                ), BX_EMAIL_NOTIFY);
+        }
+
+        return true;
+    }
+
+    /**
+     * Entry collaborators block
+     */
+    public function serviceEntityParticipants ($iContentId = 0)
+    {
+        if (!$iContentId)
+            $iContentId = bx_process_input(bx_get('id'), BX_DATA_INT);
+        if (!$iContentId)
+            return false;
+        $aContentInfo = $this->_oDb->getContentInfoById($iContentId);
+        if (!$aContentInfo)
+            return false;
+
+        return $this->_oTemplate->entryParticipants ($aContentInfo, 5, 'right');
+    }
+
+	public function serviceSearch()
+    {
+    	$CNF = $this->_oConfig->CNF;
+    	$oForm = BxDolForm::getObjectInstance($CNF['OBJECT_FORM_SEARCH'], $CNF['OBJECT_FORM_SEARCH_DISPLAY_FULL'], $this->_oTemplate);
+    	$oForm->initChecker();
+
+        return $oForm->getCode();
+    }
+
+    /**
+     * No thumbs for discussions
+     */
+    public function checkAllowedSetThumb()
+    {
+        return _t('_sys_txt_access_denied');
+    }
+
+    public function checkAllowedSubscribe(&$aDataEntry, $isPerformAction = false)
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        $sMsg = $this->checkAllowedView($aDataEntry);
+        if($sMsg !== CHECK_ACTION_RESULT_ALLOWED)
+            return $sMsg;
+
+        return $this->_checkAllowedConnect ($aDataEntry, $isPerformAction, $CNF['OBJECT_CONNECTION_SUBSCRIBERS'], false, false);
+    }
+
+    public function checkAllowedUnsubscribe(&$aDataEntry, $isPerformAction = false)
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        return $this->_checkAllowedConnect ($aDataEntry, $isPerformAction, $CNF['OBJECT_CONNECTION_SUBSCRIBERS'], false, true);
+    }
+
+    public function checkAllowedStickAnyEntry($aDataEntry, $isPerformAction = false)
+    {
+    	$CNF = &$this->_oConfig->CNF;
+
+    	if((int)$aDataEntry[$CNF['FIELD_STICK']] != 0)
+    		return false;
+
+		return $this->_checkAllowedAction('stick any entry', $aDataEntry, $isPerformAction);
+    }
+
+    public function checkAllowedUnstickAnyEntry($aDataEntry, $isPerformAction = false)
+    {
+    	$CNF = $this->_oConfig->CNF;
+
+    	if((int)$aDataEntry[$CNF['FIELD_STICK']] != 1)
+			return false;
+
+    	return $this->_checkAllowedAction('stick any entry', $aDataEntry, $isPerformAction);
+    }
+
+    public function checkAllowedLockAnyEntry($aDataEntry, $isPerformAction = false)
+    {
+    	$CNF = $this->_oConfig->CNF;
+
+    	if((int)$aDataEntry[$CNF['FIELD_LOCK']] != 0)
+    		return false;
+
+		return $this->_checkAllowedAction('lock any entry', $aDataEntry, $isPerformAction);
+    }
+
+	public function checkAllowedUnlockAnyEntry($aDataEntry, $isPerformAction = false)
+    {
+    	$CNF = $this->_oConfig->CNF;
+
+    	if((int)$aDataEntry[$CNF['FIELD_LOCK']] != 1)
+    		return false;
+
+		return $this->_checkAllowedAction('lock any entry', $aDataEntry, $isPerformAction);
+    }
+
+    public function checkAllowedHideAnyEntry($aDataEntry, $isPerformAction = false)
+    {
+    	$CNF = $this->_oConfig->CNF;
+
+    	if($aDataEntry[$CNF['FIELD_STATUS_ADMIN']] == 'hidden')
+    		return false;
+
+		return $this->_checkAllowedAction('hide any entry', $aDataEntry, $isPerformAction);
+    }
+
+	public function checkAllowedUnhideAnyEntry($aDataEntry, $isPerformAction = false)
+    {
+    	$CNF = &$this->_oConfig->CNF;
+
+    	if($aDataEntry[$CNF['FIELD_STATUS_ADMIN']] != 'hidden')
+    		return false;
+
+		return $this->_checkAllowedAction('hide any entry', $aDataEntry, $isPerformAction);
+    }
+
+    protected function _checkAllowedConnect (&$aDataEntry, $isPerformAction, $sObjConnection, $isMutual, $isInvertResult)
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        if(!$this->_iProfileId)
+            return _t('_sys_txt_access_denied');
+
+        $isConnected = BxDolConnection::getObjectInstance($sObjConnection)->isConnected($this->_iProfileId, $aDataEntry[$CNF['FIELD_ID']], $isMutual);
+        if($isInvertResult)
+            $isConnected = !$isConnected;
+
+        return $isConnected ? _t('_sys_txt_access_denied') : CHECK_ACTION_RESULT_ALLOWED;
+    }
+
+	/**
+     * @return CHECK_ACTION_RESULT_ALLOWED if access is granted or error message if access is forbidden. So make sure to make strict(===) checking.
+     */
+    protected function _checkAllowedAction($sAction, $aDataEntry, $isPerformAction = false)
+    {
+        if($this->_isModerator($isPerformAction))
+			return CHECK_ACTION_RESULT_ALLOWED;
+
+		$aCheck = checkActionModule($this->_iProfileId, $sAction, $this->getName(), $isPerformAction);
+    	if($aCheck[CHECK_ACTION_RESULT] === CHECK_ACTION_RESULT_ALLOWED)
+    		return CHECK_ACTION_RESULT_ALLOWED;
+
+        return _t('_sys_txt_access_denied');
+    }
+
+	protected function _serviceBrowseTable($aParams, $isDisplayHeader = true)
+    {
+        $sGrid = $this->_oConfig->CNF['OBJECT_GRID'];
+        if(!empty($aParams['grid'])) {
+            $sGrid = $aParams['grid'];
+            unset($aParams['grid']);
+        }
+
+        $oGrid = BxDolGrid::getObjectInstance($sGrid);
+        if(!$oGrid)
+			return false;
+
+		$oGrid->setBrowseParams($aParams);
+
+        return $oGrid->getCode($isDisplayHeader);
+    }
+
+    protected function _getSearchAuthorDescriptor($aAutor)
+    {
+        $aWhereGroupOr = array('grp' => true, 'opr' => 'OR', 'cnds' => array(
+            array('fld' => 'author', 'val' => $aAutor, 'opr' => 'IN')
+        ));
+
+        $aEntriesIds = $this->_oDb->getComments(array('type' => 'entries_author_search', 'author' => $aAutor));
+		if(!empty($aEntriesIds) && is_array($aEntriesIds))
+			$aWhereGroupOr['cnds'][] = array('fld' => 'id', 'val' => $aEntriesIds, 'opr' => 'IN');
+
+        return $aWhereGroupOr;
+    }
+
+    protected function _getSearchKeywordDescriptor($sKeyword)
+    {
+		$aWhereGroupOr = array('grp' => true, 'opr' => 'OR', 'cnds' => array(
+			array('fld' => 'title', 'val' => $sKeyword, 'opr' => 'LIKE'),
+			array('fld' => 'text', 'val' => $sKeyword, 'opr' => 'LIKE')
+		));
+		
+		$aEntriesIds = $this->_oDb->getComments(array('type' => 'entries_keyword_search', 'keyword' => $sKeyword));
+		if(!empty($aEntriesIds) && is_array($aEntriesIds))
+			$aWhereGroupOr['cnds'][] = array('fld' => 'id', 'val' => $aEntriesIds, 'opr' => 'IN');
+			
+		return $aWhereGroupOr;
+    }
+}
+
+/** @} */

+ 223 - 0
modules/boonex/forum/updates/9.0.2_9.0.3/source/classes/BxForumTemplate.php

@@ -0,0 +1,223 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Forum Forum
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/*
+ * Module representation.
+ */
+class BxForumTemplate extends BxBaseModTextTemplate
+{
+    /**
+     * Constructor
+     */
+    function __construct(&$oConfig, &$oDb)
+    {
+        $this->MODULE = 'bx_forum';
+        parent::__construct($oConfig, $oDb);
+    }
+
+    public function entryBreadcrumb($aContentInfo, $aTmplVarsItems = array())
+    {
+    	$CNF = &BxDolModule::getInstance($this->MODULE)->_oConfig->CNF;
+
+        $oPermalink = BxDolPermalinks::getInstance();
+        $oCategory = BxDolCategory::getObjectInstance($CNF['OBJECT_CATEGORY']);
+
+    	$aTmplVarsItems = array(array(
+        	'url' => bx_append_url_params($oPermalink->permalink('page.php?i=' . $CNF['URI_CATEGORY_ENTRIES']), array(
+        		'category' => $aContentInfo[$CNF['FIELD_CATEGORY']]
+        	)),
+        	'title' => $oCategory->getCategoryTitle($aContentInfo[$CNF['FIELD_CATEGORY']])
+        ), array(
+        	'url' => $oPermalink->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]),
+        	'title' => $aContentInfo[$CNF['FIELD_TITLE']]
+        ));
+
+    	return parent::entryBreadcrumb($aContentInfo, $aTmplVarsItems);
+    }
+
+    public function entryParticipants($aContentInfo, $iMaxVisible = 2, $sFloat = 'left')
+    {
+        $oModule = BxDolModule::getInstance($this->MODULE);
+        $CNF = &$oModule->_oConfig->CNF;
+
+        $iAuthorId = $aContentInfo[$CNF['FIELD_AUTHOR']];
+        $aParticipants = $this->_oDb->getComments(array('type' => 'author_comments', 'object_id' => $aContentInfo[$CNF['FIELD_ID']]));
+        $aParticipants[$iAuthorId] = !empty($aParticipants[$iAuthorId]) ? $aParticipants[$iAuthorId] + 1 : 1;
+
+        // sort participants: first - current user, second - last replier, third - author, all others sorted by max number of posts
+        $aParticipants = $oModule->sortParticipants($aParticipants, $aContentInfo['lr_profile_id'], $iAuthorId);
+        $iParticipantsNum = count($aParticipants);
+
+        // prepare template variables
+        $aVarsPopup = array (
+            'float' => 'none',
+            'bx_repeat:participants' => array(),
+            'bx_if:participants_more' => array(
+                'condition' => false,
+                'content' => array(),
+            ),
+        );
+        $aVars = array (
+            'float' => $sFloat,
+            'bx_repeat:participants' => array(),
+            'bx_if:participants_more' => array(
+                'condition' => $iParticipantsNum > $iMaxVisible,
+                'content' => array(
+                    'popup' => '',
+                    'title_more' => _t('_bx_forum_more', $iParticipantsNum - $iMaxVisible),
+                    'float' => $sFloat,
+                    'id' => $this->MODULE . '-popup-' . $aContentInfo[$CNF['FIELD_ID']],
+                ),
+            ),
+        );
+        $i = 0;
+        foreach ($aParticipants as $iProfileId => $iComments) {
+            $oProfile = BxDolProfile::getInstance($iProfileId);
+            if (!$oProfile)
+                continue;
+
+            $sInfo = '';
+            if ($iAuthorId == $iProfileId)
+                $sInfo = _t('_bx_forum_participant_author');
+            if ($aContentInfo['lr_profile_id'] == $iProfileId)
+                $sInfo .= ', ' . _t('_bx_forum_participant_last_replier');
+            $sInfo = trim($sInfo, ', ');
+            $sInfo = $sInfo ? _t('_bx_forum_participant_info', $oProfile->getDisplayName(), $sInfo) : $oProfile->getDisplayName();
+
+            $aParticipant = array (
+                'id' => $oProfile->id(),
+                'url' => $oProfile->getUrl(),
+                'thumb_url' => $oProfile->getThumb(),
+                'title' => $oProfile->getDisplayName(),
+                'title_attr' =>  bx_html_attribute($sInfo),
+                'float' => $sFloat,
+                'class' => $iAuthorId == $iProfileId ? 'bx-forum-participant-author' : '',
+            	'bx_if:replies_count' => array(
+            		'condition' => $iComments > 0,
+            		'content' => array(
+            			'count' => $iComments
+            		)
+            	),
+                'bx_if:last_replier' => array (
+                    'condition' => ($aContentInfo['lr_profile_id'] == $iProfileId),
+                    'content' => array (
+                        'id' => $oProfile->id(),
+                    ),
+                ),
+                'bx_if:author'  => array (
+                    'condition' => $iAuthorId == $iProfileId,
+                    'content' => array (
+                        'id' => $oProfile->id(),
+                    ),
+                ),
+            );
+
+            if ($i < $iMaxVisible)
+                $aVars['bx_repeat:participants'][] = $aParticipant;
+            if ($i >= $iMaxVisible)
+                $aVarsPopup['bx_repeat:participants'][] = $aParticipant;
+
+            ++$i;
+        }
+
+        if ($aVarsPopup['bx_repeat:participants']) {
+            $aVars['bx_if:participants_more']['content']['popup'] = BxTemplFunctions::getInstance()->transBox('', '<div class="bx-def-padding">' . $this->parseHtmlByName('participants.html', $aVarsPopup) . '</div>');
+        }
+
+        return $this->parseHtmlByName('participants.html', $aVars);
+    }
+
+	function getEntryAuthor($aRow)
+    {
+    	$oProfileAuthor = BxDolProfile::getInstance($aRow['author']);
+		if(!$oProfileAuthor)
+			$oProfileAuthor = BxDolProfileUndefined::getInstance();
+
+    	return $this->parseHtmlByName('entry-author.html', array(
+			'id' => $oProfileAuthor->id(),
+			'url' => $oProfileAuthor->getUrl(),
+			'title' => $oProfileAuthor->getDisplayName(),
+			'title_attr' => bx_html_attribute($oProfileAuthor->getDisplayName()),
+			'thumb_url' => $oProfileAuthor->getThumb(),
+    	));
+    }
+
+	function getEntryLabel($aRow, $aParams = array())
+    {
+    	$bShowCount = isset($aParams['show_count']) ? (int)$aParams['show_count'] == 1 : false;
+
+		$oProfileLast = BxDolProfile::getInstance($aRow['lr_profile_id']);
+		if(!$oProfileLast)
+			$oProfileLast = BxDolProfileUndefined::getInstance();
+
+        return $this->parseHtmlByName('entry-label.html', array(
+        	'bx_if:show_count' => array(
+        		'condition' => $bShowCount,
+        		'content' => array(
+        			'count' => (int)$aRow['comments'] + 1
+				)
+        	),
+            'bx_if:show_viewer_is_last_replier' => array(
+                'condition' => $oProfileLast->id() == bx_get_logged_profile_id(),
+                'content' => array (),
+            )
+        ));
+    }
+
+    function getEntryPreview($aRow)
+    {
+        $oModule = BxDolModule::getInstance($this->MODULE);
+        $CNF = &$oModule->_oConfig->CNF;
+
+        $oProfileLast = BxDolProfile::getInstance($aRow['lr_profile_id']);
+        if(!$oProfileLast)
+            $oProfileLast = BxDolProfileUndefined::getInstance();
+
+		$sTitle = strmaxtextlen($aRow['title'], 100);
+        $sText = strmaxtextlen(!empty($aRow['cmt_text']) ? $aRow['cmt_text'] : $aRow['text'], 100);
+
+        return $this->parseHtmlByName('entry-preview.html', array(
+        	'bx_if:show_stick' => array(
+        		'condition' => (int)$aRow[$CNF['FIELD_STICK']] == 1,
+        		'content' => array()
+        	),
+        	'bx_if:show_lock' => array(
+        		'condition' => (int)$aRow[$CNF['FIELD_LOCK']] == 1,
+        		'content' => array()
+        	),
+            'url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $oModule->_oConfig->CNF['URI_VIEW_ENTRY'] . '&id=' . $aRow['id']),
+            'title' => $sTitle ? $sTitle : _t('_Empty'),
+            'text' => $sText,
+            'lr_time_and_replier' => _t('_bx_forum_x_date_by_x_replier', bx_time_js($aRow['lr_timestamp'], BX_FORMAT_DATE), $oProfileLast->getDisplayName()),
+        ));
+    }
+
+    function getAuthorDesc ($aData)
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        return bx_time_js($aData[$CNF['FIELD_ADDED']]);
+    }
+
+    function getAuthorAddon ($aData, $oProfile)
+    {
+        return '';
+    }
+
+    protected function getUnit ($aData, $aParams = array())
+    {
+    	$aUnit = parent::getUnit($aData, $aParams);
+		$aUnit['label'] = $this->getEntryLabel($aData, array('show_count' => 0));
+    	return $aUnit;
+    }
+}
+
+/** @} */

+ 122 - 0
modules/boonex/forum/updates/9.0.2_9.0.3/source/install/config.php

@@ -0,0 +1,122 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Forum Forum
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_forum',
+    'title' => 'Discussions',
+    'note' => 'Discussions module.',
+    'version' => '9.0.3',
+    'vendor' => 'BoonEx',
+	'help_url' => 'http://feed.boonex.com/?section={module_name}',
+
+    'compatible_with' => array(
+        '9.0.0-RC1'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/forum/',
+    'home_uri' => 'forum',
+
+    'db_prefix' => 'bx_forum_',
+    'class_prefix' => 'BxForum',
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => 'Discussions',
+    
+    /**
+     * List of page triggers.
+     */
+    'page_triggers' => array (
+    	'trigger_page_profile_view_entry',
+    ),
+    
+    /**
+     * Menu triggers.
+     */
+    'menu_triggers' => array(
+    	'trigger_profile_view_submenu'
+    ),
+
+    /**
+     * Storages.
+     */
+    'storages' => array(
+    	'bx_forum_files'
+    ),
+
+	/**
+     * Transcoders.
+     */
+    'transcoders' => array(
+		'bx_forum_preview'
+    ),
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+        'execute_sql' => 1,
+        'update_languages' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'uninstall' => array (
+    	'process_storages' => 1,
+        'execute_sql' => 1,
+        'update_languages' => 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,
+    	'register_transcoders' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'disable' => array (
+        'execute_sql' => 1,
+    	'update_relations' => 1,
+    	'unregister_transcoders' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'disable_failed' => array (
+    	'register_transcoders' => 1,
+    	'clear_db_cache' => 1,
+    ),
+
+    /**
+     * Dependencies Section
+     */
+    'dependencies' => array(),
+
+    /**
+     * Relations Section
+     */
+    'relations' => array(
+    	'bx_timeline',
+    	'bx_notifications'
+    ),
+);
+
+/** @} */

Некоторые файлы не были показаны из-за большого количества измененных файлов