Explorar el Código

Modules' updates.

AntonLV hace 11 años
padre
commit
3709f4eb8c
Se han modificado 100 ficheros con 8325 adiciones y 0 borrados
  1. 53 0
      modules/boonex/accounts/updates/8.0.0_8.0.1/install/config.php
  2. 13 0
      modules/boonex/accounts/updates/8.0.0_8.0.1/install/installer.php
  3. 8 0
      modules/boonex/accounts/updates/8.0.0_8.0.1/install/langs/en.xml
  4. 50 0
      modules/boonex/accounts/updates/8.0.0_8.0.1/install/sql/enable.sql
  5. 85 0
      modules/boonex/accounts/updates/8.0.0_8.0.1/source/classes/BxAccntConfig.php
  6. 23 0
      modules/boonex/accounts/updates/8.0.0_8.0.1/source/classes/BxAccntDb.php
  7. 126 0
      modules/boonex/accounts/updates/8.0.0_8.0.1/source/classes/BxAccntGridAdministration.php
  8. 53 0
      modules/boonex/accounts/updates/8.0.0_8.0.1/source/classes/BxAccntMenuManageTools.php
  9. 51 0
      modules/boonex/accounts/updates/8.0.0_8.0.1/source/classes/BxAccntModule.php
  10. 69 0
      modules/boonex/accounts/updates/8.0.0_8.0.1/source/classes/BxAccntSearchResult.php
  11. 27 0
      modules/boonex/accounts/updates/8.0.0_8.0.1/source/classes/BxAccntStudioPage.php
  12. 81 0
      modules/boonex/accounts/updates/8.0.0_8.0.1/source/classes/BxAccntTemplate.php
  13. 72 0
      modules/boonex/accounts/updates/8.0.0_8.0.1/source/install/config.php
  14. 20 0
      modules/boonex/accounts/updates/8.0.0_8.0.1/source/install/installer.php
  15. 47 0
      modules/boonex/accounts/updates/8.0.0_8.0.1/source/install/langs/en.xml
  16. 23 0
      modules/boonex/accounts/updates/8.0.0_8.0.1/source/install/sql/disable.sql
  17. 72 0
      modules/boonex/accounts/updates/8.0.0_8.0.1/source/install/sql/enable.sql
  18. 18 0
      modules/boonex/accounts/updates/8.0.0_8.0.1/source/request.php
  19. 51 0
      modules/boonex/antispam/updates/8.0.2_8.0.3/install/config.php
  20. 13 0
      modules/boonex/antispam/updates/8.0.2_8.0.3/install/installer.php
  21. 71 0
      modules/boonex/antispam/updates/8.0.2_8.0.3/source/classes/BxAntispamConfig.php
  22. 20 0
      modules/boonex/antispam/updates/8.0.2_8.0.3/source/classes/BxAntispamCronPruning.php
  23. 181 0
      modules/boonex/antispam/updates/8.0.2_8.0.3/source/classes/BxAntispamDNSURIBlacklists.php
  24. 20 0
      modules/boonex/antispam/updates/8.0.2_8.0.3/source/classes/BxAntispamDb.php
  25. 44 0
      modules/boonex/antispam/updates/8.0.2_8.0.3/source/classes/BxAntispamGridBlockLog.php
  26. 316 0
      modules/boonex/antispam/updates/8.0.2_8.0.3/source/classes/BxAntispamGridDNSBL.php
  27. 151 0
      modules/boonex/antispam/updates/8.0.2_8.0.3/source/classes/BxAntispamGridIpTable.php
  28. 283 0
      modules/boonex/antispam/updates/8.0.2_8.0.3/source/classes/BxAntispamModule.php
  29. 24 0
      modules/boonex/antispam/updates/8.0.2_8.0.3/source/classes/BxAntispamPage.php
  30. 43 0
      modules/boonex/antispam/updates/8.0.2_8.0.3/source/classes/BxAntispamStudioPage.php
  31. 20 0
      modules/boonex/antispam/updates/8.0.2_8.0.3/source/classes/BxAntispamTemplate.php
  32. 68 0
      modules/boonex/antispam/updates/8.0.2_8.0.3/source/install/config.php
  33. 20 0
      modules/boonex/antispam/updates/8.0.2_8.0.3/source/install/installer.php
  34. 16 0
      modules/boonex/antispam/updates/8.0.2_8.0.3/source/request.php
  35. 51 0
      modules/boonex/contact/updates/8.0.2_8.0.3/install/config.php
  36. 13 0
      modules/boonex/contact/updates/8.0.2_8.0.3/install/installer.php
  37. 6 0
      modules/boonex/contact/updates/8.0.2_8.0.3/install/langs/en.xml
  38. 14 0
      modules/boonex/contact/updates/8.0.2_8.0.3/install/sql/install.sql
  39. 51 0
      modules/boonex/contact/updates/8.0.2_8.0.3/source/classes/BxContactConfig.php
  40. 27 0
      modules/boonex/contact/updates/8.0.2_8.0.3/source/classes/BxContactDb.php
  41. 125 0
      modules/boonex/contact/updates/8.0.2_8.0.3/source/classes/BxContactModule.php
  42. 20 0
      modules/boonex/contact/updates/8.0.2_8.0.3/source/classes/BxContactTemplate.php
  43. 72 0
      modules/boonex/contact/updates/8.0.2_8.0.3/source/install/config.php
  44. 20 0
      modules/boonex/contact/updates/8.0.2_8.0.3/source/install/installer.php
  45. 46 0
      modules/boonex/contact/updates/8.0.2_8.0.3/source/install/langs/en.xml
  46. 51 0
      modules/boonex/contact/updates/8.0.2_8.0.3/source/install/sql/install.sql
  47. 18 0
      modules/boonex/contact/updates/8.0.2_8.0.3/source/request.php
  48. 51 0
      modules/boonex/convos/updates/8.0.4_8.0.5/install/config.php
  49. 13 0
      modules/boonex/convos/updates/8.0.4_8.0.5/install/installer.php
  50. 2 0
      modules/boonex/convos/updates/8.0.4_8.0.5/install/sql/install.sql
  51. 29 0
      modules/boonex/convos/updates/8.0.4_8.0.5/source/classes/BxCnvAlertsResponse.php
  52. 72 0
      modules/boonex/convos/updates/8.0.4_8.0.5/source/classes/BxCnvCmts.php
  53. 87 0
      modules/boonex/convos/updates/8.0.4_8.0.5/source/classes/BxCnvConfig.php
  54. 117 0
      modules/boonex/convos/updates/8.0.4_8.0.5/source/classes/BxCnvDb.php
  55. 221 0
      modules/boonex/convos/updates/8.0.4_8.0.5/source/classes/BxCnvFormEntry.php
  56. 39 0
      modules/boonex/convos/updates/8.0.4_8.0.5/source/classes/BxCnvFormsEntryHelper.php
  57. 105 0
      modules/boonex/convos/updates/8.0.4_8.0.5/source/classes/BxCnvGrid.php
  58. 24 0
      modules/boonex/convos/updates/8.0.4_8.0.5/source/classes/BxCnvMenu.php
  59. 24 0
      modules/boonex/convos/updates/8.0.4_8.0.5/source/classes/BxCnvMenuView.php
  60. 322 0
      modules/boonex/convos/updates/8.0.4_8.0.5/source/classes/BxCnvModule.php
  61. 25 0
      modules/boonex/convos/updates/8.0.4_8.0.5/source/classes/BxCnvPageBrowse.php
  62. 43 0
      modules/boonex/convos/updates/8.0.4_8.0.5/source/classes/BxCnvPageEntry.php
  63. 24 0
      modules/boonex/convos/updates/8.0.4_8.0.5/source/classes/BxCnvPageFolder.php
  64. 245 0
      modules/boonex/convos/updates/8.0.4_8.0.5/source/classes/BxCnvTemplate.php
  65. 103 0
      modules/boonex/convos/updates/8.0.4_8.0.5/source/install/config.php
  66. 20 0
      modules/boonex/convos/updates/8.0.4_8.0.5/source/install/installer.php
  67. 173 0
      modules/boonex/convos/updates/8.0.4_8.0.5/source/install/sql/install.sql
  68. 18 0
      modules/boonex/convos/updates/8.0.4_8.0.5/source/request.php
  69. 66 0
      modules/boonex/convos/updates/8.0.4_8.0.5/source/template/css/main.css
  70. 4 0
      modules/boonex/convos/updates/8.0.4_8.0.5/source/template/message_label.html
  71. 46 0
      modules/boonex/developer/updates/8.0.5_8.0.6/install/config.php
  72. 13 0
      modules/boonex/developer/updates/8.0.5_8.0.6/install/installer.php
  73. 6 0
      modules/boonex/developer/updates/8.0.5_8.0.6/install/langs/en.xml
  74. 11 0
      modules/boonex/developer/updates/8.0.5_8.0.6/install/sql/install.sql
  75. 423 0
      modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevBuilderPage.php
  76. 105 0
      modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevConfig.php
  77. 70 0
      modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevDb.php
  78. 20 0
      modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevFormView.php
  79. 39 0
      modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevForms.php
  80. 144 0
      modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevFormsDisplays.php
  81. 275 0
      modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevFormsField.php
  82. 46 0
      modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevFormsFields.php
  83. 183 0
      modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevFormsForms.php
  84. 166 0
      modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevFormsPreLists.php
  85. 157 0
      modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevFormsPreValues.php
  86. 91 0
      modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevFunctions.php
  87. 98 0
      modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevModule.php
  88. 37 0
      modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevNavigation.php
  89. 117 0
      modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevNavigationItems.php
  90. 175 0
      modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevNavigationMenus.php
  91. 113 0
      modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevNavigationSets.php
  92. 25 0
      modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevPermissions.php
  93. 75 0
      modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevPolyglot.php
  94. 103 0
      modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevPolyglotManage.php
  95. 132 0
      modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevStudioPage.php
  96. 41 0
      modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevTemplate.php
  97. 69 0
      modules/boonex/developer/updates/8.0.5_8.0.6/source/install/config.php
  98. 385 0
      modules/boonex/developer/updates/8.0.5_8.0.6/source/install/langs/en.xml
  99. 535 0
      modules/boonex/developer/updates/8.0.5_8.0.6/source/install/sql/install.sql
  100. 52 0
      modules/boonex/english/updates/8.0.8_8.0.9/install/config.php

+ 53 - 0
modules/boonex/accounts/updates/8.0.0_8.0.1/install/config.php

@@ -0,0 +1,53 @@
+<?php
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ */
+
+$aConfig = array(
+    /**
+     * Main Section.
+     */
+    'title' => 'Accounts Manager',
+    'version_from' => '8.0.0',
+	'version_to' => '8.0.1',
+    'vendor' => 'BoonEx',
+
+	'compatible_with' => array(
+        '8.0.0.A11'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/accounts/updates/update_8.0.0_8.0.1/',
+	'home_uri' => 'accounts_update_800_801',
+
+	'module_dir' => 'boonex/accounts/',
+	'module_uri' => 'accounts',
+
+    'db_prefix' => 'bx_accnt_',
+    'class_prefix' => 'BxAccnt',
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+		'execute_sql' => 1,
+        'update_files' => 1,
+        'update_languages' => 1,
+		'clear_db_cache' => 1,
+    ),
+
+	/**
+     * Category for language keys.
+     */
+    'language_category' => 'Accounts',
+
+	/**
+     * Files Section
+     */
+    'delete_files' => array(
+		'classes/BxAccntGridModeration.php'
+	),
+);

+ 13 - 0
modules/boonex/accounts/updates/8.0.0_8.0.1/install/installer.php

@@ -0,0 +1,13 @@
+<?php
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ */
+
+class BxSMTPUpdater extends BxDolStudioUpdater
+{
+    function __construct($aConfig)
+	{
+        parent::__construct($aConfig);
+    }
+}

+ 8 - 0
modules/boonex/accounts/updates/8.0.0_8.0.1/install/langs/en.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+	<string_add name="_bx_accnt_page_title_sys_manage_administration"><![CDATA[Manage All Accounts]]></string_add>
+	<string_add name="_bx_accnt_page_block_title_system_manage_administration"><![CDATA[Manage All Accounts]]></string_add>
+	<string_add name="_bx_accnt_acl_action_edit_any_account"><![CDATA[Edit Any Account]]></string_add>
+
+	<string_del name="_bx_accnt_page_title_sys_manage" />
+</resources>

+ 50 - 0
modules/boonex/accounts/updates/8.0.0_8.0.1/install/sql/enable.sql

@@ -0,0 +1,50 @@
+SET @sName = 'bx_accounts';
+
+-- PAGES
+DELETE FROM `sys_objects_page` WHERE `object`='bx_accounts_moderation';
+DELETE FROM `sys_pages_blocks` WHERE `object`='bx_accounts_moderation';
+
+UPDATE `sys_objects_page` SET `title_system`='_bx_accnt_page_title_sys_manage_administration', `visible_for_levels`='192' WHERE `object`='bx_accounts_administration';
+UPDATE `sys_pages_blocks` SET `title_system`='_bx_accnt_page_block_title_system_manage_administration', `visible_for_levels`='192' WHERE `object`='bx_accounts_administration' AND `title`='_bx_accnt_page_block_title_manage';
+
+
+-- MENUS
+UPDATE `sys_menu_items` SET `visible_for_levels`='192' WHERE `set_name`='bx_accounts_menu_manage_tools' AND `name` IN ('delete', 'delete-with-content');
+
+DELETE FROM `sys_menu_items` WHERE `set_name`='sys_account_dashboard_manage_tools' AND `name`='accounts-moderation';
+UPDATE `sys_menu_items` SET `visible_for_levels`='192' WHERE `set_name`='sys_account_dashboard_manage_tools' AND `name`='accounts-administration';
+
+
+-- 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` = @sName;
+DELETE FROM `sys_acl_actions` WHERE `Module` = @sName;
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+(@sName, 'edit any entry', NULL, '_bx_accnt_acl_action_edit_any_account', '', 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
+
+-- edit any entry 
+(@iModerator, @iIdActionProfileEditAny),
+(@iAdministrator, @iIdActionProfileEditAny);
+
+
+-- GRIDS
+DELETE FROM `sys_objects_grid` WHERE `object`='bx_accounts_moderation';
+DELETE FROM `sys_grid_fields` WHERE `object`='bx_accounts_moderation';
+DELETE FROM `sys_grid_actions` WHERE `object`='bx_accounts_moderation';
+
+UPDATE `sys_objects_grid` SET `field_order`='logged' WHERE `object`='bx_accounts_administration';
+
+UPDATE `sys_grid_actions` SET `order`='1' WHERE `object`='bx_accounts_administration' AND `type`='single' AND `name`='settings';

+ 85 - 0
modules/boonex/accounts/updates/8.0.0_8.0.1/source/classes/BxAccntConfig.php

@@ -0,0 +1,85 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Accounts Accounts
+ * @ingroup     DolphinModules
+ *
+ * @{
+ */
+
+class BxAccntConfig extends BxBaseModGeneralConfig
+{
+    protected $_oDb;
+    protected $_aHtmlIds;
+
+    /**
+     * Constructor
+     */
+    public function __construct($aModule)
+    {
+        parent::__construct($aModule);
+
+        $this->CNF = array (
+        	// page URIs
+        	'URL_MANAGE_COMMON' => 'page.php?i=accounts-manage',
+        	'URL_MANAGE_MODERATION' => 'page.php?i=accounts-moderation',
+        	'URL_MANAGE_ADMINISTRATION' => 'page.php?i=accounts-administration',
+
+	        // objects
+	        'OBJECT_MENU_MANAGE_TOOLS' => 'bx_accounts_menu_manage_tools', //manage menu in content administration tools
+        	'OBJECT_GRID_ADMINISTRATION' => 'bx_accounts_administration',
+        	'OBJECT_GRID_MODERATION' => 'bx_accounts_moderation',
+
+        	// some language keys
+            'T' => array (
+        		'grid_action_err_delete' => '_bx_accnt_grid_action_err_delete',
+        		'grid_action_err_perform' => '_bx_accnt_grid_action_err_perform',
+            	'filter_item_active' => '_bx_accnt_grid_filter_item_title_adm_active',
+            	'filter_item_pending' => '_bx_accnt_grid_filter_item_title_adm_pending',
+            	'filter_item_suspended' => '_bx_accnt_grid_filter_item_title_adm_suspended',
+            	'filter_item_select_one_filter1' => '_bx_accnt_grid_filter_item_title_adm_select_one_filter1',
+        	)
+        );
+
+        $this->_aObjects = array(
+        	'alert' => $this->_sName,
+        );
+
+        $this->_aJsClass = array(
+        	'manage_tools' => 'BxAccntManageTools'
+        );
+
+        $this->_aJsObjects = array(
+        	'manage_tools' => 'oBxAccntManageTools'
+        );
+
+        $this->_aGridObjects = array(
+        	'moderation' => $this->CNF['OBJECT_GRID_MODERATION'],
+        	'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
+        	
+        );
+
+        $sHtmlPrefix = str_replace('_', '-', $this->_sName);
+        $this->_aHtmlIds = array(
+        	'profile' => $sHtmlPrefix . '-profile-',
+        	'profile_more_popup' => $sHtmlPrefix . '-profile-more-popup-',
+        );
+    }
+
+    public function init(&$oDb)
+    {
+        $this->_oDb = &$oDb;
+    }
+
+	public function getHtmlIds($sKey = '')
+    {
+        if(empty($sKey))
+            return $this->_aHtmlIds;
+
+        return isset($this->_aHtmlIds[$sKey]) ? $this->_aHtmlIds[$sKey] : '';
+    }
+}
+
+/** @} */

+ 23 - 0
modules/boonex/accounts/updates/8.0.0_8.0.1/source/classes/BxAccntDb.php

@@ -0,0 +1,23 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Accounts Accounts
+ * @ingroup     DolphinModules
+ *
+ * @{
+ */
+
+class BxAccntDb extends BxBaseModGeneralDb
+{
+    /*
+     * Constructor.
+     */
+    function __construct(&$oConfig)
+    {
+        parent::__construct($oConfig);
+    }
+}
+
+/** @} */

+ 126 - 0
modules/boonex/accounts/updates/8.0.0_8.0.1/source/classes/BxAccntGridAdministration.php

@@ -0,0 +1,126 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Accounts Accounts
+ * @ingroup     TridentModules
+ * 
+ * @{
+ */
+
+
+class BxAccntGridAdministration extends BxBaseModProfileGridAdministration
+{
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+    	$this->MODULE = 'bx_accounts';
+        parent::__construct ($aOptions, $oTemplate);
+    }
+
+    public function performActionActivate()
+    {
+    	$this->_performActionEnable(true);
+    }
+
+	public function performActionSuspend()
+    {
+    	$this->_performActionEnable(false);
+    }
+
+    public function performActionResendCemail()
+    {
+    	$CNF = &$this->_oModule->_oConfig->CNF;
+
+    	$aIds = bx_get('ids');
+        if(!$aIds || !is_array($aIds)) {
+            $this->_echoResultJson(array());
+            return;
+        }
+
+        $oAccount = BxDolAccount::getInstance();
+
+        $iAffected = 0;
+        $aIdsAffected = array();
+        foreach($aIds as $iId)
+			if($oAccount->sendConfirmationEmail($iId)) {
+				$aIdsAffected[] = $iId;
+        		$iAffected++;
+			}
+
+		$this->_echoResultJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t($CNF['T']['grid_action_err_perform'])));
+    }
+
+    public function resetQueryParams()
+    {
+        $aKeys = array('order_field', 'order_dir', $this->_aOptions['paginate_get_start'], $this->_aOptions['paginate_get_per_page']);
+        foreach ($aKeys as $sKey) {
+            unset($_GET[$sKey]);
+            unset($_POST[$sKey]);
+        }
+    }
+
+	protected function _performActionEnable($isChecked)
+    {
+    	$CNF = &$this->_oModule->_oConfig->CNF;
+
+    	$aIds = bx_get('ids');
+        if(!$aIds || !is_array($aIds)) {
+            $this->_echoResultJson(array());
+            return;
+        }
+
+        $iAffected = 0;
+        $aIdsAffected = array();
+        foreach($aIds as $iId)
+        	if($this->_enable($iId, $isChecked)) {
+        		$aIdsAffected[] = $iId;
+        		$iAffected++;
+        	}
+
+        $this->_echoResultJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t($CNF['T']['grid_action_err_perform'])));
+    }
+
+    protected function _enable($mixedId, $isChecked)
+    {
+    	$iAction = BX_PROFILE_ACTION_MANUAL;
+    	$oProfile = BxDolProfile::getInstanceAccountProfile($mixedId);
+    	return $isChecked ? $oProfile->activate($iAction) : $oProfile->suspend($iAction);
+    }
+
+    //--- Layout methods ---//
+    protected function _getCellEmailConfirmed($mixedValue, $sKey, $aField, $aRow)
+    {
+    	$mixedValue = (int)$mixedValue == 1 ? '_Yes' : '_No';
+        return parent::_getCellDefault(_t($mixedValue), $sKey, $aField, $aRow);
+    }
+
+	protected function _getCellProfiles($mixedValue, $sKey, $aField, $aRow)
+    {
+        $s = $this->_oModule->_oTemplate->getProfilesByAccount($aRow);
+
+        return parent::_getCellDefault ($s, $sKey, $aField, $aRow);
+    }
+
+    protected function _getCellLogged($mixedValue, $sKey, $aField, $aRow)
+    {
+        return parent::_getCellDefault(bx_time_js($mixedValue), $sKey, $aField, $aRow);
+    }
+
+    protected function _isCheckboxDisabled($aRow)
+    {
+        return false;
+    }
+
+	protected function _getContentInfo($iId)
+    {
+    	return BxDolAccountQuery::getInstance()->getInfoById($iId);
+    }
+
+	protected function _doDelete($iId, $aParams = array())
+    {
+    	return BxDolAccount::getInstance($iId)->delete(isset($aParams['with_content']) && $aParams['with_content'] === true);
+    }
+}
+
+/** @} */

+ 53 - 0
modules/boonex/accounts/updates/8.0.0_8.0.1/source/classes/BxAccntMenuManageTools.php

@@ -0,0 +1,53 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Accounts Accounts
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+/**
+ * 'Persons manage tools' menu.
+ */
+class BxAccntMenuManageTools extends BxBaseModGeneralMenuManageTools
+{
+
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_accounts';
+        parent::__construct($aObject, $oTemplate);
+    }
+
+    /**
+     * Check if menu items is visible.
+     * @param $a menu item array
+     * @return boolean
+     */
+    protected function _isVisible ($a)
+    {
+        if(!parent::_isVisible($a))
+            return false;
+
+        $aDataEntry = BxDolAccountQuery::getInstance()->getInfoById($this->_iContentId);
+        if(empty($aDataEntry) || !is_array($aDataEntry))
+        	return false;
+
+        $sCheckFuncName = '';
+        switch ($a['name']) {
+            case 'delete':
+            case 'delete-with-content':
+                $sCheckFuncName = 'checkAllowedDelete';
+                break;
+        }
+
+        if(!$sCheckFuncName || !method_exists($this->_oModule, $sCheckFuncName))
+            return true;
+
+        return $this->_oModule->{$sCheckFuncName}($aDataEntry) === CHECK_ACTION_RESULT_ALLOWED;
+    }
+}
+
+/** @} */

+ 51 - 0
modules/boonex/accounts/updates/8.0.0_8.0.1/source/classes/BxAccntModule.php

@@ -0,0 +1,51 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Accounts Accounts
+ * @ingroup     DolphinModules
+ *
+ * @{
+ */
+
+class BxAccntModule extends BxBaseModGeneralModule
+{
+    /**
+     * Constructor
+     */
+    function __construct($aModule)
+    {
+        parent::__construct($aModule);
+
+        $this->_oConfig->init($this->_oDb);
+    }
+
+	public function serviceGetMenuAddonManageTools()
+	{
+		bx_import('SearchResult', $this->_aModule);
+        $sClass = $this->_aModule['class_prefix'] . 'SearchResult';
+        $o = new $sClass();
+        $o->fillFilters(array(
+			'unconfirmed' => 1
+        ));
+        $o->unsetPaginate();
+
+        return $o->getNum();
+	}
+
+    public function checkAllowedDelete(&$aDataEntry, $isPerformAction = false)
+    {
+    	if(isAdmin() && (int)$aDataEntry['id'] == getLoggedId())
+    		return _t('_sys_txt_access_denied');
+
+        // check ACL
+        $aCheck = checkActionModule($this->_iProfileId, 'delete account', 'system', $isPerformAction);
+        if($aCheck[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED)
+            return $aCheck[CHECK_ACTION_MESSAGE];
+
+        return CHECK_ACTION_RESULT_ALLOWED;
+    }
+}
+
+/** @} */

+ 69 - 0
modules/boonex/accounts/updates/8.0.0_8.0.1/source/classes/BxAccntSearchResult.php

@@ -0,0 +1,69 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Persons Persons
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxAccntSearchResult extends BxBaseModGeneralSearchResult
+{
+    function __construct($sMode = '', $aParams = false)
+    {
+        parent::__construct($sMode, $aParams);
+
+        $this->aCurrent =  array(
+            'name' => 'bx_accounts',
+            'object_metatags' => '',
+            'title' => _t('_bx_accnt_page_title_browse'),
+            'table' => 'sys_accounts',
+            'tableSearch' => 'sys_accounts',
+            'ownFields' => array(),
+            'searchFields' => array('name', 'email'),
+            'restriction' => array(
+                'confirmed' => array('value' => '', 'field' => 'email_confirmed', 'operator' => '='),
+        		'unconfirmed' => array('value' => '', 'field' => 'email_confirmed', 'operator' => '<>'),
+            ),
+            'join' => array (),
+            'paginate' => array('perPage' => 20, 'start' => 0),
+            'sorting' => 'none',
+            'rss' => array(
+                'title' => '',
+                'link' => '',
+                'image' => '',
+                'profile' => 0,
+                'fields' => array (
+                    'Guid' => 'link',
+                    'Link' => 'link',
+                    'Title' => 'fullname',
+                    'DateTimeUTS' => 'added',
+                    'Desc' => 'fullname',
+                    'Picture' => 'picture',
+                ),
+            ),
+            'ident' => 'id'
+        );
+
+        $this->sFilterName = 'bx_accounts_filter';
+        $this->oModule = $this->getMain();
+
+        switch ($sMode) {
+            case '': // search results
+                $this->sBrowseUrl = BX_DOL_SEARCH_KEYWORD_PAGE;
+                $this->aCurrent['title'] = _t('_bx_accnt');
+                $this->aCurrent['paginate']['perPage'] = 5;
+                unset($this->aCurrent['rss']);
+                break;
+
+            default:
+                $this->isError = true;
+        }
+
+        parent::__construct();
+    }
+}
+
+/** @} */

+ 27 - 0
modules/boonex/accounts/updates/8.0.0_8.0.1/source/classes/BxAccntStudioPage.php

@@ -0,0 +1,27 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Accounts Accounts
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxAccntStudioPage extends BxTemplStudioModule
+{
+    function __construct($sModule = "", $sPage = "")
+    {
+        parent::__construct($sModule, $sPage);
+
+        $oPermalink = BxDolPermalinks::getInstance();
+
+        $this->aMenuItems = array(
+            array('name' => 'settings', 'icon' => 'cogs', 'title' => '_adm_lmi_cpt_settings'),
+            array('name' => 'manage', 'icon' => 'wrench', 'title' => '_bx_accnt_menu_item_title_manage', 'link' => BX_DOL_URL_ROOT . $oPermalink->permalink('page.php?i=accounts-administration')),
+        );
+    }
+}
+
+/** @} */

+ 81 - 0
modules/boonex/accounts/updates/8.0.0_8.0.1/source/classes/BxAccntTemplate.php

@@ -0,0 +1,81 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Accounts Accounts
+ * @ingroup     DolphinModules
+ *
+ * @{
+ */
+
+class BxAccntTemplate extends BxBaseModGeneralTemplate
+{
+    function __construct(&$oConfig, &$oDb)
+    {
+    	$this->MODULE = 'bx_accounts';
+        parent::__construct($oConfig, $oDb);
+    }
+
+    public function getProfilesByAccount($aContentInfo, $iMaxVisible = 2)
+    {
+        $oProfilesQuery = BxDolProfileQuery::getInstance();
+
+        $aProfiles = $oProfilesQuery->getProfilesByAccount($aContentInfo['id']);
+        $iProfiles = count($aProfiles);
+
+        $aTmplVars = array (
+        	'class_cnt' => '',
+            'bx_repeat:profiles' => array(),
+            'bx_if:profiles_more' => array(
+                'condition' => $iProfiles > $iMaxVisible,
+                'content' => array(
+        			'html_id' => $this->_oConfig->getHtmlIds('profile_more_popup') . $aContentInfo['id'],
+                    'more' => _t('_bx_accnt_txt_more', $iProfiles - $iMaxVisible),
+        			'more_attr' => bx_html_attribute(_t('_bx_accnt_txt_see_more')),
+                    'popup' => '',
+                ),
+            ),
+        );
+
+        $aTmplVarsPopup = array (
+        	'class_cnt' => ' bx-def-padding',
+            'bx_repeat:profiles' => array(),
+            'bx_if:profiles_more' => array(
+                'condition' => false,
+                'content' => array(),
+            ),
+        );
+
+        $i = 0;
+        foreach ($aProfiles as $iProfileId => $aProfile) {
+            $oProfile = BxDolProfile::getInstance($iProfileId);
+            if(!$oProfile)
+				continue;
+
+			$sName = $oProfile->getDisplayName();
+            $aTmplVarsProfile = array (
+            	'html_id' => $this->_oConfig->getHtmlIds('profile') . $aProfile['id'],
+                'id' => $oProfile->id(),
+                'url' => $oProfile->getUrl(),
+                'name' => $sName,
+                'name_attr' =>  bx_html_attribute($sName)
+            );
+
+            if($i < $iMaxVisible)
+				$aTmplVars['bx_repeat:profiles'][] = $aTmplVarsProfile;
+            if($i >= $iMaxVisible)
+                $aTmplVarsPopup['bx_repeat:profiles'][] = $aTmplVarsProfile;
+
+            ++$i;
+        }
+
+        if($aTmplVarsPopup['bx_repeat:profiles']) {
+            $aTmplVars['bx_if:profiles_more']['content']['popup'] = BxTemplFunctions::getInstance()->transBox('', $this->parseHtmlByName('profiles.html', $aTmplVarsPopup));
+        }
+
+        return $this->parseHtmlByName('profiles.html', $aTmplVars);
+    }
+}
+
+/** @} */

+ 72 - 0
modules/boonex/accounts/updates/8.0.0_8.0.1/source/install/config.php

@@ -0,0 +1,72 @@
+<?php
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Accounts Accounts
+ * @ingroup     DolphinModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_accounts',
+    'title' => 'Accounts Manager',
+    'note' => 'Accounts Manager module.',
+    'version' => '8.0.1',
+    'vendor' => 'BoonEx',
+	'help_url' => 'http://feed.boonex.com/?section={module_name}',
+    
+
+    'compatible_with' => array(
+        '8.0.x'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/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(),
+
+);
+
+/** @} */

+ 20 - 0
modules/boonex/accounts/updates/8.0.0_8.0.1/source/install/installer.php

@@ -0,0 +1,20 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Accounts Accounts
+ * @ingroup     DolphinModules
+ *
+ * @{
+ */
+
+class BxAccntInstaller extends BxDolStudioInstaller
+{
+    function __construct($aConfig)
+    {
+        parent::__construct($aConfig);
+    }
+}
+
+/** @} */

+ 47 - 0
modules/boonex/accounts/updates/8.0.0_8.0.1/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_accnt"><![CDATA[Accounts]]></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[Confirm Email]]></string>
+    <string name="_bx_accnt_menu_item_title_resend_cemail"><![CDATA[Confirm Email]]></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_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_resend_cemail"><![CDATA[Confirm Email]]></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>
+</resources>

+ 23 - 0
modules/boonex/accounts/updates/8.0.0_8.0.1/source/install/sql/disable.sql

@@ -0,0 +1,23 @@
+SET @sName = 'bx_accounts';
+
+
+-- PAGES
+DELETE FROM `sys_objects_page` WHERE `module` = @sName;
+DELETE FROM `sys_pages_blocks` WHERE `module` = @sName;
+
+
+-- MENU
+DELETE FROM `sys_objects_menu` WHERE `module` = @sName;
+DELETE FROM `sys_menu_sets` WHERE `module` = @sName;
+DELETE FROM `sys_menu_items` WHERE `module` = @sName;
+
+
+-- 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` = @sName;
+DELETE FROM `sys_acl_actions` WHERE `Module` = @sName;
+
+
+-- GRIDS
+DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_accounts_administration');
+DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_accounts_administration');
+DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_accounts_administration');

+ 72 - 0
modules/boonex/accounts/updates/8.0.0_8.0.1/source/install/sql/enable.sql

@@ -0,0 +1,72 @@
+SET @sName = 'bx_accounts';
+
+
+-- PAGE: module administration
+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_accounts_administration', '_bx_accnt_page_title_sys_manage_administration', '_bx_accnt_page_title_manage', @sName, 5, 192, 1, 'accounts-administration', 'page.php?i=accounts-administration', '', '', '', 0, 1, 0, '', '');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_accounts_administration', 1, @sName, '_bx_accnt_page_block_title_system_manage_administration', '_bx_accnt_page_block_title_manage', 11, 192, 'service', 'a:3:{s:6:\"module\";s:11:\"bx_accounts\";s:6:\"method\";s:12:\"manage_tools\";s:6:\"params\";a:1:{i:0;s:14:\"administration\";}}', 0, 1, 0);
+
+
+-- 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_accounts_menu_manage_tools', '_bx_accnt_menu_title_manage_tools', 'bx_accounts_menu_manage_tools', @sName, 6, 0, 1, 'BxAccntMenuManageTools', 'modules/boonex/accounts/classes/BxAccntMenuManageTools.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_accounts_menu_manage_tools', @sName, '_bx_accnt_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_accounts_menu_manage_tools', @sName, 'resend-cemail', '_bx_accnt_menu_item_title_system_resend_cemail', '_bx_accnt_menu_item_title_resend_cemail', 'javascript:void(0)', 'javascript:{js_object}.onClickResendCemail({content_id});', '_self', 'envelope-o', '', 192, 1, 0, 1),
+('bx_accounts_menu_manage_tools', @sName, 'delete', '_bx_accnt_menu_item_title_system_delete', '_bx_accnt_menu_item_title_delete', 'javascript:void(0)', 'javascript:{js_object}.onClickDelete({content_id});', '_self', 'trash-o', '', 192, 1, 0, 2),
+('bx_accounts_menu_manage_tools', @sName, 'delete-with-content', '_bx_accnt_menu_item_title_system_delete_with_content', '_bx_accnt_menu_item_title_delete_with_content', 'javascript:void(0)', 'javascript:{js_object}.onClickDeleteWithContent({content_id});', '_self', 'trash-o', '', 192, 1, 0, 3);
+
+-- MENU: dashboard manage tools
+SET @iManageMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name`='sys_account_dashboard_manage_tools' LIMIT 1);
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('sys_account_dashboard_manage_tools', @sName, 'accounts-administration', '_bx_accnt_menu_item_title_system_admt_accounts', '_bx_accnt_menu_item_title_admt_accounts', 'page.php?i=accounts-administration', '', '_self', '', 'a:2:{s:6:"module";s:11:"bx_accounts";s:6:"method";s:27:"get_menu_addon_manage_tools";}', '', 192, 1, 0, @iManageMenuOrder + 1);
+
+
+-- ACL
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+(@sName, 'edit any entry', NULL, '_bx_accnt_acl_action_edit_any_account', '', 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
+
+-- edit any entry 
+(@iModerator, @iIdActionProfileEditAny),
+(@iAdministrator, @iIdActionProfileEditAny);
+
+
+-- 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`, `override_class_name`, `override_class_file`) VALUES
+('bx_accounts_administration', 'Sql', 'SELECT `ta`.*, `tp`.`status` AS `status` FROM `sys_accounts` AS `ta` LEFT JOIN `sys_profiles` AS `tp` ON `ta`.`id`=`tp`.`account_id` AND `tp`.`type`=''system'' WHERE 1 ', 'sys_accounts', 'id', 'logged', 'status', '', 20, NULL, 'start', '', 'name,email', '', 'like', '', '', 'BxAccntGridAdministration', 'modules/boonex/accounts/classes/BxAccntGridAdministration.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('bx_accounts_administration', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
+('bx_accounts_administration', 'switcher', '_bx_accnt_grid_column_title_adm_active', '6%', 0, '', '', 2),
+('bx_accounts_administration', 'name', '_bx_accnt_grid_column_title_adm_name', '22%', 0, '22', '', 3),
+('bx_accounts_administration', 'email', '_bx_accnt_grid_column_title_adm_email', '22%', 0, '22', '', 4),
+('bx_accounts_administration', 'email_confirmed', '_bx_accnt_grid_column_title_adm_email_confirmed', '5%', 0, '', '', 5),
+('bx_accounts_administration', 'profiles', '_bx_accnt_grid_column_title_adm_profiles', '22%', 0, '22', '', 5),
+('bx_accounts_administration', 'logged', '_bx_accnt_grid_column_title_adm_logged', '15%', 0, '15', '', 7),
+('bx_accounts_administration', 'actions', '', '6%', 0, '', '', 8);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon_only`, `confirm`, `order`) VALUES
+('bx_accounts_administration', 'bulk', 'activate', '_bx_accnt_grid_action_title_adm_activate', '', 0, 0, 1),
+('bx_accounts_administration', 'bulk', 'suspend', '_bx_accnt_grid_action_title_adm_suspend', '', 0, 0, 2),
+('bx_accounts_administration', 'bulk', 'resend_cemail', '_bx_accnt_grid_action_title_adm_resend_cemail', '', 0, 0, 3),
+('bx_accounts_administration', 'bulk', 'delete', '_bx_accnt_grid_action_title_adm_delete', '', 0, 1, 4),
+('bx_accounts_administration', 'bulk', 'delete_with_content', '_bx_accnt_grid_action_title_adm_delete_with_content', '', 0, 1, 5),
+('bx_accounts_administration', 'single', 'settings', '_bx_accnt_grid_action_title_adm_more_actions', 'cog', 1, 0, 1);

+ 18 - 0
modules/boonex/accounts/updates/8.0.0_8.0.1/source/request.php

@@ -0,0 +1,18 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Accounts Accounts
+ * @ingroup     DolphinModules
+ *
+ * @{
+ */
+
+require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
+
+bx_import('BxDolLanguages');
+
+BxDolRequest::processAsAction($GLOBALS['aModule'], $GLOBALS['aRequest']);
+
+/** @} */

+ 51 - 0
modules/boonex/antispam/updates/8.0.2_8.0.3/install/config.php

@@ -0,0 +1,51 @@
+<?php
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ */
+
+$aConfig = array(
+    /**
+     * Main Section.
+     */
+    'title' => 'Antispam',
+    'version_from' => '8.0.2',
+	'version_to' => '8.0.3',
+    'vendor' => 'BoonEx',
+
+	'compatible_with' => array(
+        '8.0.0.A11'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/antispam/updates/update_8.0.2_8.0.3/',
+	'home_uri' => 'antispam_update_802_803',
+
+	'module_dir' => 'boonex/antispam/',
+	'module_uri' => 'antispam',
+
+    'db_prefix' => 'bx_antispam_',
+    'class_prefix' => 'BxAntispam',
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+		'execute_sql' => 0,
+        'update_files' => 1,
+        'update_languages' => 0,
+		'clear_db_cache' => 0,
+    ),
+
+	/**
+     * Category for language keys.
+     */
+    'language_category' => 'Antispam',
+
+	/**
+     * Files Section
+     */
+    'delete_files' => array(),
+);

+ 13 - 0
modules/boonex/antispam/updates/8.0.2_8.0.3/install/installer.php

@@ -0,0 +1,13 @@
+<?php
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ */
+
+class BxAntispamUpdater extends BxDolStudioUpdater
+{
+    function __construct($aConfig)
+	{
+        parent::__construct($aConfig);
+    }
+}

+ 71 - 0
modules/boonex/antispam/updates/8.0.2_8.0.3/source/classes/BxAntispamConfig.php

@@ -0,0 +1,71 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Antispam Antispam
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+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',
+    );
+    /**
+     * 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/8.0.2_8.0.3/source/classes/BxAntispamCronPruning.php

@@ -0,0 +1,20 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Antispam Antispam
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxAntispamCronPruning extends BxDolCron
+{
+    function processing()
+    {
+        BxDolService::call('bx_antispam', 'pruning');
+    }
+}
+
+/** @} */

+ 181 - 0
modules/boonex/antispam/updates/8.0.2_8.0.3/source/classes/BxAntispamDNSURIBlacklists.php

@@ -0,0 +1,181 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Antispam Antispam
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+/**
+ * Spam detection based on URIs in the message
+ */
+class BxAntispamDNSURIBlacklists extends BxDol
+{
+    protected $aZonesUrls = array (
+        2 => "http://www.surbl.org/tld/two-level-tlds",
+        3 => "http://www.surbl.org/tld/three-level-tlds",
+    );
+
+    protected $oDb;
+
+    /**
+     * Constructor
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->aZonesUrls = array ( // for some reason original urls are restricted to fetch, so copies are created locally
+            2 => BX_DIRECTORY_PATH_MODULES . "boonex/antispam/data/two-level-tlds",
+            3 => BX_DIRECTORY_PATH_MODULES . "boonex/antispam/data/three-level-tlds",
+        );
+
+        $this->oDb = BxDolDb::getInstance();;
+        $this->initZones();
+    }
+
+    public function isSpam ($s)
+    {
+        $aURIs = $this->parseUrls ($s);
+        if (!$aURIs)
+            return false;
+
+        $aURIs = $this->validateUrls ($aURIs);
+        if (!$aURIs)
+            return false;
+
+        $oModule = BxDolModule::getInstance('bx_antispam');
+        $o = bx_instance('BxAntispamDNSBlacklists', array(), $oModule->_aModule);
+        foreach ($aURIs as $sURI) {
+            if (BX_DOL_DNSBL_POSITIVE == $o->dnsbl_lookup_uri ($sURI))
+                return true;
+        }
+
+        return false;
+    }
+
+    public function parseUrls (&$s)
+    {
+        $aMatches = array ();
+        if (!preg_match_all("!(https?|ftp|gopher|telnet|file|notes|ms-help):[/\\\\]+([\w\d\.-]*)!", $s, $aMatches))
+            return false;
+
+        if (!$aMatches || !isset($aMatches[2]) || !$aMatches[2])
+            return false;
+
+        $aUrlsUniq = array ();
+        foreach ($aMatches[2] as $sUrl) {
+            if (isset($aUrlsUniq[$sUrl]))
+                continue;
+            $aUrlsUniq[$sUrl] = $sUrl;
+        }
+
+        return $aUrlsUniq;
+    }
+
+    public function validateUrls ($aUrlsUniq)
+    {
+        $aUrls = array ();
+        foreach ($aUrlsUniq as $sUrl) {
+
+            if (0 == strncasecmp('www.', $sUrl, 4))
+                $sUrl = substr($sUrl, 4);
+
+            $aZones = explode ('.', $sUrl);
+            $iLevels = count($aZones);
+
+            if ($iLevels <= 2) {
+
+                $aUrls[] = $sUrl;
+
+            } elseif (3 == $iLevels) {
+
+                if ($this->isDbZoneMatch (2, $aZones[1] . '.' . $aZones[2]))
+                    $aUrls[] = $sUrl;
+                else
+                    $aUrls[] = $aZones[1] . '.' . $aZones[2];
+
+            } else {
+
+                $iExt = count($aZones) - 1;
+                $iDom = $iExt - 1;
+                $iSubDom = $iExt - 2;
+                $iSubSubDom = $iExt - 3;
+
+                if ($this->isDbZoneMatch (3, $aZones[$iSubDom] . '.' . $aZones[$iDom] . '.' . $aZones[$iExt])) {
+                    $aUrls[] = $aZones[$iSubSubDom] . '.' . $aZones[$iSubDom] . '.' . $aZones[$iDom] . '.' . $aZones[$iExt];
+                } else {
+
+                    if ($this->isDbZoneMatch (2, $aZones[$iDom] . '.' . $aZones[$iExt]))
+                        $aUrls[] = $aZones[$iSubDom] . '.' . $aZones[$iDom] . '.' . $aZones[$iExt];
+                    else
+                        $aUrls[] = $aZones[$iDom] . '.' . $aZones[$iExt];
+                }
+            }
+
+        }
+
+        $aUrlsUniq = array ();
+        foreach ($aUrls as $sUrl) {
+            if (isset($aUrlsUniq[$sUrl]))
+                continue;
+            $aUrlsUniq[$sUrl] = $sUrl;
+        }
+
+        return array_values($aUrlsUniq);
+    }
+
+    public function onPositiveDetection ($sExtraData = '')
+    {
+        $oModule = BxDolModule::getInstance('bx_antispam');
+        $o = bx_instance('BxAntispamDNSBlacklists', array(), $oModule->_aModule);
+
+        $o->onPositiveDetection (getVisitorIP(false), $sExtraData, 'dnsbluri');
+    }
+
+    public function getURIDNSBLConfigValues ()
+    {
+        return array (
+            'block' => _t('_bx_antispam_dnsbl_behaviour_join_block'),
+            'approval' => _t('_bx_antispam_dnsbl_behaviour_join_approval'),
+        );
+    }
+
+    /*************** private function ***************/
+
+    private function isDbZoneMatch ($iLevel, $sZone)
+    {
+        $sQuery = $this->oDb->prepare("SELECT `level` FROM `bx_antispam_dnsbluri_zones` WHERE `level` = ? AND `zone` = ? LIMIT 1", $iLevel, $sZone);
+        return $this->oDb->getOne($sQuery) ? true : false;
+    }
+
+    private function initZones()
+    {
+        if (0 == $this->oDb->getOne("SELECT COUNT(*) FROM `bx_antispam_dnsbluri_zones`")) {
+
+            $this->oDb->query("TRUNCATE TABLE `bx_antispam_dnsbluri_zones`");
+
+            foreach ($this->aZonesUrls as $iLevel => $sUrl) {
+                $f = fopen ($sUrl, 'r');
+                if (!$f)
+                    return false;
+                while (!feof($f)) {
+                    $sZone = fgets($f);
+                    $sZone = trim($sZone);
+                    if ($sZone) {
+                        $sQuery = $this->oDb->prepare("INSERT INTO `bx_antispam_dnsbluri_zones` SET `level` = ?, `zone` = ?", $iLevel, $sZone);
+                        $this->oDb->query($sQuery);
+                    }
+                }
+                fclose($f);
+            }
+        }
+
+        return true;
+    }
+
+}
+
+/** @} */

+ 20 - 0
modules/boonex/antispam/updates/8.0.2_8.0.3/source/classes/BxAntispamDb.php

@@ -0,0 +1,20 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Antispam Antispam
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxAntispamDb extends BxDolModuleDb
+{
+    function __construct(&$oConfig)
+    {
+        parent::__construct($oConfig);
+    }
+}
+
+/** @} */

+ 44 - 0
modules/boonex/antispam/updates/8.0.2_8.0.3/source/classes/BxAntispamGridBlockLog.php

@@ -0,0 +1,44 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Antispam Antispam
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
+
+class BxAntispamGridBlockLog extends BxTemplGrid
+{
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+        parent::__construct ($aOptions, $oTemplate);
+        $this->_sDefaultSortingOrder = 'DESC';
+    }
+
+    protected function _getCellIp ($mixedValue, $sKey, $aField, $aRow)
+    {
+        return parent::_getCellDefault (long2ip($mixedValue), $sKey, $aField, $aRow);
+    }
+    protected function _getCellProfileId ($mixedValue, $sKey, $aField, $aRow)
+    {
+        $s = '<span class="bx-def-font-grayed">' . _t('_undefined') . '</span>';
+        if ($mixedValue && ($oProfile = BxDolProfile::getInstance((int)$mixedValue)))
+            $s = '<a href="' . $oProfile->getUrl() . '">' . $oProfile->getDisplayName() . '</span>';
+
+        return parent::_getCellDefault ($s, $sKey, $aField, $aRow);
+    }
+    protected function _getCellType ($mixedValue, $sKey, $aField, $aRow)
+    {
+        return parent::_getCellDefault (_t('_bx_antispam_type_' . $mixedValue), $sKey, $aField, $aRow);
+    }
+    protected function _getCellAdded ($mixedValue, $sKey, $aField, $aRow)
+    {
+        return parent::_getCellDefault (bx_time_js($mixedValue, BX_FORMAT_DATE), $sKey, $aField, $aRow);
+    }
+}
+
+/** @} */

+ 316 - 0
modules/boonex/antispam/updates/8.0.2_8.0.3/source/classes/BxAntispamGridDNSBL.php

@@ -0,0 +1,316 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Antispam Antispam
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxAntispamGridDNSBL extends BxTemplGrid
+{
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+        parent::__construct ($aOptions, $oTemplate);
+    }
+
+    /**
+     * add js file for AJAX form submission
+     */
+    protected function _addJsCss()
+    {
+        parent::_addJsCss();
+
+        $this->_oTemplate->addJs('jquery.form.min.js');
+
+        $oForm = new BxTemplFormView(array());
+        $oForm->addCssJs();
+    }
+
+    /**
+     * 'help' action handler
+     */
+    public function performActionHelp()
+    {
+        $s = BxTemplFunctions::getInstance()->popupBox(
+            'bx_antispam_poppup_help',
+            _t('_bx_antispam_popup_help'),
+            _t('_bx_antispam_help_dnsbl')
+        );
+
+        $this->_echoResultJson(array('popup' => array('html' => $s)), true);
+    }
+
+    /**
+     * 'log' action handler
+     */
+    public function performActionLog()
+    {
+        $oModule = BxDolModule::getInstance('bx_antispam');
+        $sGrid = $oModule->serviceBlockLog();
+
+        if (!$sGrid) {
+            $this->_echoResultJson(array('msg' => _t('_sys_txt_error_occured')), true);
+            exit;
+        }
+
+        $s = BxTemplFunctions::getInstance()->popupBox(
+            'bx_antispam_popup_block_log',
+            _t('_bx_antispam_popup_block_log'),
+            $sGrid . '<button class="bx-btn" style="float:none;" onclick ="$(\'.bx-popup-applied:visible\').dolPopupHide();">' . _t('_sys_close') . '</button>'
+        );
+
+        $this->_echoResultJson(array('popup' => array('html' => $s)), true);
+
+    }
+
+    /**
+     * 'recheck' action handler
+     */
+    public function performActionRecheckItem()
+    {
+        $oModule = BxDolModule::getInstance('bx_antispam');
+        $o = bx_instance('BxAntispamDNSBlacklists', array(), $oModule->_aModule);
+
+        $aChain = $o->getRule((int)bx_get('id'));
+
+        $iRet = BX_DOL_DNSBL_FAILURE;
+        if ($aChain) {
+            if (bx_get('chain') == 'dnsbl') {
+                $iRet = $o->dnsbl_lookup_ip($aChain, bx_process_input(bx_get('test')));
+            } elseif (bx_get('chain') == 'uridnsbl') {
+                $sUrl = preg_replace('/^\w+:\/\//', '', bx_process_input(bx_get('test')));
+                $sUrl = preg_replace('/^www\./', '', $sUrl);
+                $oBxDolDNSURIBlacklists = bx_instance('BxAntispamDNSURIBlacklists', array(), $oModule->_aModule);
+                $aUrls = $oBxDolDNSURIBlacklists->validateUrls(array($sUrl));
+                if ($aUrls)
+                    $iRet = $o->dnsbl_lookup_uri($aUrls[0], $aChain);
+            }
+        }
+
+        $s = '';
+        switch ($iRet) {
+            case BX_DOL_DNSBL_POSITIVE:
+                $s = 'LISTED';
+                break;
+            case BX_DOL_DNSBL_NEGATIVE:
+                $s = 'NOT LISTED';
+                break;
+            default:
+            case BX_DOL_DNSBL_FAILURE:
+                $s = 'FAIL';
+        }
+
+        echo $s;
+        exit;
+    }
+
+    /**
+     * 'recheck' action handler
+     */
+    public function performActionRecheck()
+    {
+        $oModule = BxDolModule::getInstance('bx_antispam');
+        $oDNSBlacklists = bx_instance('BxAntispamDNSBlacklists', array(), $oModule->_aModule);
+
+        $aForm = array(
+            'form_attrs' => array(
+                'id' => 'bx_antispam_form_dnsbl_recheck',
+                'action' => BX_DOL_URL_ROOT . 'grid.php?o=bx_antispam_grid_dnsbl&a=recheck',
+                'onsubmit' => "return bx_antispam_recheck($('#bx_antispam_ip_url').val(), $('[name=dnsbl_uridnsbl]:checked').val());",
+                'method' => 'post',
+            ),
+            'params' => array (
+                'db' => array(
+                    'submit_name' => 'do_submit',
+                ),
+            ),
+            'inputs' => array(
+
+                'ip_url' => array(
+                    'type' => 'text',
+                    'name' => 'ip_url',
+                    'value' => getVisitorIP(),
+                    'caption' => _t('_bx_antispam_field_ip_url'),
+                    'attrs' => array('id' => 'bx_antispam_ip_url'),
+                ),
+
+                'dnsbl_uridnsbl' => array(
+                    'type' => 'radio_set',
+                    'name' => 'dnsbl_uridnsbl',
+                    'caption' => _t('_bx_antispam_field_dnsbl_uridnsbl'),
+                    'values' => array ('dnsbl' => _t('_bx_antispam_dnsbl'), 'uridnsbl' => _t('_bx_antispam_uri_dnsbl')),
+                    'value' => 'dnsbl',
+                ),
+
+                'submit' => array(
+                    'type' => 'input_set',
+                    0 => array (
+                        'type' => 'submit',
+                        'name' => 'do_submit',
+                        'value' => _t('_sys_submit'),
+                    ),
+                    1 => array (
+                        'type' => 'reset',
+                        'name' => 'close',
+                        'value' => _t('_sys_close'),
+                        'attrs' => array('class' => 'bx-def-margin-sec-left', 'onclick' => '$(\'.bx-popup-applied:visible\').dolPopupHide();'),
+                    ),
+                ),
+
+            ),
+        );
+
+        $oForm = new BxTemplFormView($aForm);
+
+        $s = $oModule->_oTemplate->parseHtmlByName('recheck.html', array (
+            'form' => $oForm->getCode(),
+            'url_recheck_item' => BX_DOL_URL_ROOT . 'grid.php?o=bx_antispam_grid_dnsbl&a=recheck_item',
+            'bx_repeat:items' => $oDNSBlacklists->getRules(array(BX_DOL_DNSBL_CHAIN_SPAMMERS, BX_DOL_DNSBL_CHAIN_WHITELIST, BX_DOL_DNSBL_CHAIN_URIDNS)),
+        ));
+
+        $s = BxTemplFunctions::getInstance()->popupBox($oForm->getId() . '_form', _t('_bx_antispam_popup_dnsbl_recheck'), $s);
+
+        $this->_echoResultJson(array('popup' => array('html' => $s, 'options' => array('closeOnOuterClick' => false))), true);
+    }
+
+    /**
+     * 'recheck' action handler
+     */
+    public function performActionAdd()
+    {
+        $aForm = array(
+            'form_attrs' => array(
+                'id' => 'bx_antispam_form_dnsbl_add',
+                'action' => BX_DOL_URL_ROOT . 'grid.php?o=bx_antispam_grid_dnsbl&a=add',
+                'method' => 'post',
+            ),
+            'params' => array (
+                'db' => array(
+                    'table' => 'bx_antispam_dnsbl_rules',
+                    'key' => 'id',
+                    'submit_name' => 'do_submit',
+                ),
+            ),
+            'inputs' => array(
+
+                'country' => array(
+                    'type' => 'select',
+                    'name' => 'country',
+                    'caption' => _t('_bx_antispam_field_country'),
+                    'values' => BxDolForm::getDataItems('Country'),
+                ),
+
+                'chain' => array(
+                    'type' => 'radio_set',
+                    'name' => 'chain',
+                    'caption' => _t('_bx_antispam_field_action'),
+                    'values' => array ('spammers' => _t('_bx_antispam_chain_spammers'), 'whitelist' => _t('_bx_antispam_chain_whitelist')),
+                    'value' => 'spammers',
+                ),
+
+                'submit' => array(
+                    'type' => 'input_set',
+                    0 => array (
+                        'type' => 'submit',
+                        'name' => 'do_submit',
+                        'value' => _t('_sys_submit'),
+                    ),
+                    1 => array (
+                        'type' => 'reset',
+                        'name' => 'close',
+                        'value' => _t('_sys_close'),
+                        'attrs' => array('class' => 'bx-def-margin-sec-left', 'onclick' => '$(\'.bx-popup-applied:visible\').dolPopupHide();'),
+                    ),
+                ),
+
+            ),
+        );
+
+        $oForm = new BxTemplFormView($aForm);
+        $oForm->initChecker();
+
+        if ($oForm->isSubmittedAndValid()) { // if form is submitted and all fields are valid
+
+            $aCustomValues = array(
+                'chain' => $oForm->getCleanValue('chain'),
+                'zonedomain' => sprintf("%s.countries.nerd.dk.", strtolower($oForm->getCleanValue('country'))),
+                'postvresp' => '127.0.0.2',
+                'url' => 'http://countries.nerd.dk/',
+                'comment' => '_bx_antispam_rule_note_country',
+                'added' => time(),
+                'active' => 1,
+
+            );
+
+            $iRecentId = $oForm->insert ($aCustomValues, true); // insert new record
+
+            if ($iRecentId)
+                $aRes = array('grid' => $this->getCode(false), 'blink' => $iRecentId); // if record is successfully added, reload grid and highlight added row
+            else
+                $aRes = array('msg' => _t('_sys_txt_error_occured')); // if record adding failed, display error message
+
+            $this->_echoResultJson($aRes, true);
+
+        } else { // if form is not submitted or some fields are invalid, display popup with form
+
+            $s = BxTemplFunctions::getInstance()->popupBox($oForm->getId() . '_form', _t('_bx_antispam_popup_dnsbl_add'), $oForm->getCode() . '
+                <script>
+                    $(document).ready(function () {
+                        $("#' . $oForm->getId() . '").ajaxForm({
+                            dataType: "json",
+                            beforeSubmit: function (formData, jqForm, options) {
+                                bx_loading($("#' . $oForm->getId() . '"), true);
+                            },
+                            success: function (data) {
+                                $(".bx-popup-applied:visible").dolPopupHide();
+                                glGrids.' . $this->_sObject . '.processJson(data, "add");
+                            }
+                        });
+                    });
+                </script>');
+
+            $this->_echoResultJson(array('popup' => array('html' => $s, 'options' => array('closeOnOuterClick' => false))), true);
+
+        }
+    }
+
+    protected function _getCellChain ($mixedValue, $sKey, $aField, $aRow)
+    {
+        return parent::_getCellDefault (_t('_bx_antispam_chain_' . $mixedValue), $sKey, $aField, $aRow);
+    }
+
+    protected function _getCellZonedomain ($mixedValue, $sKey, $aField, $aRow)
+    {
+        $s = $mixedValue;
+        if ($aRow['url'])
+            $s = '<a target="_blank" href="' . $aRow['url'] . '">' . $mixedValue . '</a>';
+        return parent::_getCellDefault ($s, $sKey, $aField, $aRow);
+    }
+
+    protected function _getCellComment ($mixedValue, $sKey, $aField, $aRow)
+    {
+        $sCountry = '';
+        $aMatches = array();
+        if (preg_match('/^(\w{2})\.countries\.nerd\.dk\.$/', $aRow['zonedomain'], $aMatches) && isset($aMatches[1])) {
+            $sCountry = $aMatches[1];
+        }
+
+        return parent::_getCellDefault (_t($mixedValue, $sCountry), $sKey, $aField, $aRow);
+    }
+
+    protected function _getCellActions ($mixedValue, $sKey, $aField, $aRow)
+    {
+        if (preg_match('/^(\w{2})\.countries\.nerd\.dk\.$/', $aRow['zonedomain'], $aMatches)) {
+            $aRow['active'] = 1;
+            return parent::_getCellActions ($mixedValue, $sKey, $aField, $aRow);
+        }
+
+        return parent::_getCellDefault ('', $sKey, $aField, $aRow);
+    }
+
+}
+
+/** @} */

+ 151 - 0
modules/boonex/antispam/updates/8.0.2_8.0.3/source/classes/BxAntispamGridIpTable.php

@@ -0,0 +1,151 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Antispam Antispam
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
+
+class BxAntispamGridIpTable extends BxTemplGrid
+{
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+        parent::__construct ($aOptions, $oTemplate);
+    }
+
+    /**
+     * add js file for AJAX form submission
+     */
+    protected function _addJsCss()
+    {
+        parent::_addJsCss();
+
+        $this->_oTemplate->addJs('jquery.form.min.js');
+
+        $oForm = new BxTemplFormView(array());
+        $oForm->addCssJs();
+    }
+
+    /**
+     * 'add' action handler
+     */
+    public function performActionAdd()
+    {
+        $this->_performAction('add', 'bx_antispam_ip_table_form_add');
+    }
+
+    /**
+     * 'edit' action handler
+     */
+    public function performActionEdit()
+    {
+        $iId = 0;
+        $aIds = bx_get('ids');
+        if ($aIds && is_array($aIds))
+            $iId = (int)array_pop($aIds);
+        if (!$iId)
+            $iId = (int)bx_get('ID');
+
+        if (!$iId) {
+            $this->_echoResultJson(array('msg' => _t('_sys_txt_error_occured')), true);
+            exit;
+        }
+
+        $this->_performAction('edit', 'bx_antispam_ip_table_form_edit', $iId);
+    }
+
+    protected function _performAction($sAction, $sDisplay, $iId = 0)
+    {
+        $oForm = BxDolForm::getObjectInstance('bx_antispam_ip_table_form', $sDisplay); // get form instance for specified form object and display
+        if (!$oForm) {
+            $this->_echoResultJson(array('msg' => _t('_sys_txt_error_occured')), true);
+            exit;
+        }
+
+        $oForm->addMarkers(array(
+            'grid_object' => $this->_sObject,
+            'grid_action' => $sAction,
+        ));
+
+        $aIpTableDirective = array();
+        if ($iId) {
+            $oModule = BxDolModule::getInstance('bx_antispam');
+            $oAntispamIp = bx_instance('BxAntispamIP', array(), $oModule->_aModule);
+            $aIpTableDirective = $oAntispamIp->getIpTableDirective($iId);
+            $aIpTableDirective['From'] = long2ip($aIpTableDirective['From']);
+            $aIpTableDirective['To'] = long2ip($aIpTableDirective['To']);
+        }
+        $oForm->initChecker($aIpTableDirective);
+
+        if ($oForm->isSubmittedAndValid()) { // if form is submitted and all fields are valid
+
+            $aCustomValues = array(
+                'From' => sprintf("%u", ip2long($oForm->getCleanValue('From'))),
+                'To' => sprintf("%u", ip2long($oForm->getCleanValue('To'))),
+            );
+
+            if ($iId) {
+                if ($oForm->update ($iId, $aCustomValues)) // update record
+                    $iRecentId = $iId;
+            } else {
+                $iRecentId = $oForm->insert ($aCustomValues, true); // insert new record
+            }
+
+            if ($iRecentId)
+                $aRes = array('grid' => $this->getCode(false), 'blink' => $iRecentId); // if record is successfully added, reload grid and highlight added row
+            else
+                $aRes = array('msg' => _t('_sys_txt_error_occured')); // if record adding failed, display error message
+
+            $this->_echoResultJson($aRes, true);
+
+        } else { // if form is not submitted or some fields are invalid, display popup with form
+
+            $s = BxTemplFunctions::getInstance()->popupBox($oForm->getId() . '_form', _t('_bx_antispam_form_ip_table_add'), $oForm->getCode() . '
+                <script>
+                    $(document).ready(function () {
+                        $("#' . $oForm->getId() . '").ajaxForm({
+                            dataType: "json",
+                            beforeSubmit: function (formData, jqForm, options) {
+                                bx_loading($("#' . $oForm->getId() . '"), true);
+                            },
+                            success: function (data) {
+                                $(".bx-popup-applied:visible").dolPopupHide();
+                                glGrids.' . $this->_sObject . '.processJson(data, "' . $sAction . '");
+                            }
+                        });
+                    });
+                </script>');
+
+            $this->_echoResultJson(array('popup' => array('html' => $s, 'options' => array('closeOnOuterClick' => false))), true);
+
+        }
+    }
+
+    protected function _getCellType ($mixedValue, $sKey, $aField, $aRow)
+    {
+        return parent::_getCellDefault ('allow' == $mixedValue ? _t('_bx_antispam_ip_allow') : _t('_bx_antispam_ip_deny'), $sKey, $aField, $aRow);
+    }
+
+    protected function _getCellLastDT ($mixedValue, $sKey, $aField, $aRow)
+    {
+        return parent::_getCellDefault (bx_time_js($mixedValue, BX_FORMAT_DATE), $sKey, $aField, $aRow);
+    }
+
+    protected function _getCellFrom ($mixedValue, $sKey, $aField, $aRow)
+    {
+        return parent::_getCellDefault (long2ip($mixedValue), $sKey, $aField, $aRow);
+    }
+
+    protected function _getCellTo ($mixedValue, $sKey, $aField, $aRow)
+    {
+        return parent::_getCellDefault (long2ip($mixedValue), $sKey, $aField, $aRow);
+    }
+
+}
+
+/** @} */

+ 283 - 0
modules/boonex/antispam/updates/8.0.2_8.0.3/source/classes/BxAntispamModule.php

@@ -0,0 +1,283 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Antispam Antispam
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxAntispamModule extends BxDolModule
+{
+    public function __construct(&$aModule)
+    {
+        parent::__construct($aModule);
+    }
+
+    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();
+
+        if (!$sErrorMsg && $this->serviceIsIpBlocked($sIp))
+            $sErrorMsg = $this->getErrorMessageIpBlocked();
+
+        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();
+        }
+
+        if (!$sErrorMsg) {
+            $oStopForumSpam = bx_instance('BxAntispamStopForumSpam', array(), $this->_aModule);
+            if ($oStopForumSpam->isSpammer(array('email' => $sEmail, 'ip' => $sIp), $sNote))
+                $sErrorMsg = $this->getErrorMessageSpam();
+        }
+
+        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();
+        }
+    }
+
+    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() : '';
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/antispam/updates/8.0.2_8.0.3/source/classes/BxAntispamPage.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Antispam Antispam
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+/**
+ * Antispam module pages.
+ */
+class BxAntispamPage extends BxTemplPage
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        parent::__construct($aObject, $oTemplate);
+    }
+
+}
+
+/** @} */

+ 43 - 0
modules/boonex/antispam/updates/8.0.2_8.0.3/source/classes/BxAntispamStudioPage.php

@@ -0,0 +1,43 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Antispam Antispam
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxAntispamStudioPage extends BxTemplStudioModule
+{
+    protected $oModule;
+
+    function __construct($sModule = "", $sPage = "")
+    {
+        parent::__construct($sModule, $sPage);
+
+        $this->oModule = BxDolModule::getInstance('bx_antispam');
+
+        $this->aMenuItems = array(
+            array('name' => 'settings', 'icon' => 'cogs', 'title' => '_adm_lmi_cpt_settings'),
+            array('name' => 'ip_table', 'icon' => 'align-justify', 'title' => '_bx_antispam_ip_table', 'link' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=antispam-ip-table')),
+            array('name' => 'dnsbl_list', 'icon' => 'align-justify', 'title' => '_bx_antispam_dnsbl_list', 'link' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=antispam-dnsbl-list')),
+            array('name' => 'block_log', 'icon' => 'clock-o', 'title' => '_bx_antispam_block_log', 'link' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=antispam-block-log')),
+        );
+    }
+
+    function getHelp ()
+    {
+        return _t('_bx_antispam_help_text');
+    }
+
+    protected function getPageCaptionHelp()
+    {
+        $oTemplate = BxDolStudioTemplate::getInstance();
+        $sContent = '<a href="' . BX_DOL_URL_STUDIO . 'module.php?name=bx_antispam&page=help">' . _t('_bx_antispam_help') . "</a>";
+        return $oTemplate->parseHtmlByName('page_caption_help.html', array('content' => $sContent));
+    }
+}
+
+/** @} */

+ 20 - 0
modules/boonex/antispam/updates/8.0.2_8.0.3/source/classes/BxAntispamTemplate.php

@@ -0,0 +1,20 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Antispam Antispam
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxAntispamTemplate extends BxDolModuleTemplate
+{
+    function __construct(&$oConfig, &$oDb)
+    {
+        parent::__construct($oConfig, $oDb);
+    }
+}
+
+/** @} */

+ 68 - 0
modules/boonex/antispam/updates/8.0.2_8.0.3/source/install/config.php

@@ -0,0 +1,68 @@
+<?php
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Antispam Antispam
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_antispam',
+    'title' => 'Antispam',
+    'note' => 'Antispam tools',
+    'version' => '8.0.3',
+    'vendor' => 'BoonEx',
+	'help_url' => 'http://feed.boonex.com/?section={module_name}',
+
+    'compatible_with' => array(
+        '8.0.x'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/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(),
+);
+
+/** @} */

+ 20 - 0
modules/boonex/antispam/updates/8.0.2_8.0.3/source/install/installer.php

@@ -0,0 +1,20 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Antispam Antispam
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxAntispamInstaller extends BxDolStudioInstaller
+{
+    function __construct($aConfig)
+    {
+        parent::__construct($aConfig);
+    }
+}
+
+/** @} */

+ 16 - 0
modules/boonex/antispam/updates/8.0.2_8.0.3/source/request.php

@@ -0,0 +1,16 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Antispam Antispam
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+check_logged();
+
+BxDolRequest::processAsAction($GLOBALS['aModule'], $GLOBALS['aRequest']);
+
+/** @} */

+ 51 - 0
modules/boonex/contact/updates/8.0.2_8.0.3/install/config.php

@@ -0,0 +1,51 @@
+<?php
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ */
+
+$aConfig = array(
+    /**
+     * Main Section.
+     */
+    'title' => 'Contact',
+    'version_from' => '8.0.2',
+	'version_to' => '8.0.3',
+    'vendor' => 'BoonEx',
+
+	'compatible_with' => array(
+        '8.0.0.A11'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/contact/updates/update_8.0.2_8.0.3/',
+	'home_uri' => 'contact_update_802_803',
+
+	'module_dir' => 'boonex/contact/',
+	'module_uri' => 'contact',
+
+    'db_prefix' => 'bx_contact_',
+    'class_prefix' => 'BxContact',
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+		'execute_sql' => 1,
+        'update_files' => 1,
+        'update_languages' => 1,
+		'clear_db_cache' => 1,
+    ),
+
+	/**
+     * Category for language keys.
+     */
+    'language_category' => 'Contact',
+
+	/**
+     * Files Section
+     */
+    'delete_files' => array(),
+);

+ 13 - 0
modules/boonex/contact/updates/8.0.2_8.0.3/install/installer.php

@@ -0,0 +1,13 @@
+<?php
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ */
+
+class BxContactUpdater extends BxDolStudioUpdater
+{
+    function __construct($aConfig)
+	{
+        parent::__construct($aConfig);
+    }
+}

+ 6 - 0
modules/boonex/contact/updates/8.0.2_8.0.3/install/langs/en.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+	<string_add name="_bx_contact_form_contact_input_sys_captcha"><![CDATA[Captcha]]></string_add>
+	<string_add name="_bx_contact_form_contact_input_captcha"><![CDATA[Security Image]]></string_add>
+	<string_add name="_bx_contact_form_contact_input_captcha_err"><![CDATA[Security image input failed. Please, try again.]]></string_add>
+</resources>

+ 14 - 0
modules/boonex/contact/updates/8.0.2_8.0.3/install/sql/install.sql

@@ -0,0 +1,14 @@
+SET @sName = 'bx_contact';
+
+-- FORMS
+UPDATE `sys_form_inputs` SET `editable`='1' WHERE `object`='bx_contact_contact';
+
+DELETE FROM `sys_form_inputs` WHERE `object`='bx_contact_contact' AND `name`='captcha';
+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_contact_contact', @sName, 'captcha', '', '', 0, 'captcha', '_bx_contact_form_contact_input_sys_captcha', '_bx_contact_form_contact_input_captcha', '', 1, 0, 0, '', '', '', 'Captcha', '', '_bx_contact_form_contact_input_captcha_err', '', '', 1, 0);
+
+UPDATE `sys_form_display_inputs` SET `order`='6' WHERE `display_name`='bx_contact_contact_send' AND `input_name`='do_submit';
+
+DELETE FROM `sys_form_display_inputs` WHERE `display_name`='bx_contact_contact_send' AND `input_name`='captcha';
+INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
+('bx_contact_contact_send', 'captcha', 2147483647, 1, 5);

+ 51 - 0
modules/boonex/contact/updates/8.0.2_8.0.3/source/classes/BxContactConfig.php

@@ -0,0 +1,51 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Contact Contact
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+bx_import('BxDolPrivacy');
+
+class BxContactConfig extends BxBaseModGeneralConfig
+{
+    protected $_oDb;
+
+    protected $_sEmail;
+
+    /**
+     * Constructor
+     */
+    public function __construct($aModule)
+    {
+        parent::__construct($aModule);
+
+        $this->_aObjects = array(
+        	'alert' => $this->_sName,
+        	'form_contact' => $this->_sName . '_contact',
+        	'form_display_contact_send' => $this->_sName . '_contact_send'
+        );
+
+        $this->_sEmail = '';
+    }
+
+    public function init(&$oDb)
+    {
+        $this->_oDb = &$oDb;
+
+        $this->_sEmail = getParam('bx_contact_email');
+        if(empty($this->_sEmail))
+            $this->_sEmail = getParam('site_email');
+    }
+
+    public function getEmail()
+    {
+        return $this->_sEmail;
+    }
+}
+
+/** @} */

+ 27 - 0
modules/boonex/contact/updates/8.0.2_8.0.3/source/classes/BxContactDb.php

@@ -0,0 +1,27 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Contact Contact
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxContactDb extends BxDolModuleDb
+{
+    protected $_oConfig;
+
+    /*
+     * Constructor.
+     */
+    function __construct(&$oConfig)
+    {
+        parent::__construct($oConfig);
+
+        $this->_oConfig = $oConfig;
+    }
+}
+
+/** @} */

+ 125 - 0
modules/boonex/contact/updates/8.0.2_8.0.3/source/classes/BxContactModule.php

@@ -0,0 +1,125 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Contact Contact
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+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();
+                if(sendMail($sRecipientEmail, $aMessage['Subject'], $aMessage['Body'], 0, array(), BX_EMAIL_SYSTEM)) {
+                    $this->onContact();
+
+                    $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;
+    }
+}
+
+/** @} */

+ 20 - 0
modules/boonex/contact/updates/8.0.2_8.0.3/source/classes/BxContactTemplate.php

@@ -0,0 +1,20 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Contact Contact
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxContactTemplate extends BxDolModuleTemplate
+{
+    function __construct(&$oConfig, &$oDb)
+    {
+        parent::__construct($oConfig, $oDb);
+    }
+}
+
+/** @} */

+ 72 - 0
modules/boonex/contact/updates/8.0.2_8.0.3/source/install/config.php

@@ -0,0 +1,72 @@
+<?php
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Contact Contact
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_contact',
+    'title' => 'Contact',
+    'note' => 'Contact module.',
+    'version' => '8.0.3',
+    'vendor' => 'BoonEx',
+	'help_url' => 'http://feed.boonex.com/?section={module_name}',
+    
+
+    'compatible_with' => array(
+        '8.0.x'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/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(),
+
+);
+
+/** @} */

+ 20 - 0
modules/boonex/contact/updates/8.0.2_8.0.3/source/install/installer.php

@@ -0,0 +1,20 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Contact Contact
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxContactInstaller extends BxDolStudioInstaller
+{
+    function __construct($aConfig)
+    {
+        parent::__construct($aConfig);
+    }
+}
+
+/** @} */

+ 46 - 0
modules/boonex/contact/updates/8.0.2_8.0.3/source/install/langs/en.xml

@@ -0,0 +1,46 @@
+<?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 Us]]></string>
+    <string name="_bx_contact_menu_item_title_contact"><![CDATA[Contact Us]]></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_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[<bx_include_auto:_email_header.html />
+<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>
+<bx_include_auto:_email_footer.html />]]></string>
+</resources>

+ 51 - 0
modules/boonex/contact/updates/8.0.2_8.0.3/source/install/sql/install.sql

@@ -0,0 +1,51 @@
+SET @sName = 'bx_contact';
+
+
+-- TABLES
+CREATE TABLE IF NOT EXISTS `bx_contact_entries` (
+  `id` int(11) NOT NULL auto_increment,
+  `name` varchar(255) collate utf8_unicode_ci NOT NULL,
+  `email` varchar(128) collate utf8_unicode_ci NOT NULL,
+  `subject` varchar(128) collate utf8_unicode_ci NOT NULL,
+  `body` text collate utf8_unicode_ci NOT NULL,
+  `uri` varchar(255) collate utf8_unicode_ci NOT NULL,
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY  (`id`)
+);
+
+
+-- 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_contact_contact', @sName, '_bx_contact_form_contact', '', '', 'do_submit', 'bx_contact_entries', 'id', 'uri', 'subject', '', 0, 1, '', '');
+
+INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
+('bx_contact_contact_send', @sName, 'bx_contact_contact', '_bx_contact_form_contact_display_send', 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_contact_contact', @sName, 'name', '', '', 0, 'text', '_bx_contact_form_contact_input_sys_name', '_bx_contact_form_contact_input_name', '', 1, 0, 0, '', '', '', 'Length', 'a:2:{s:3:"min";i:1;s:3:"max";i:150;}', '_bx_contact_form_contact_input_name_err', 'Xss', '', 1, 0),
+('bx_contact_contact', @sName, 'email', '', '', 0, 'text', '_bx_contact_form_contact_input_sys_email', '_bx_contact_form_contact_input_email', '', 1, 0, 0, '', '', '', 'Email', '', '_bx_contact_form_contact_input_email_err', 'Xss', '', 1, 0),
+('bx_contact_contact', @sName, 'subject', '', '', 0, 'text', '_bx_contact_form_contact_input_sys_subject', '_bx_contact_form_contact_input_subject', '', 1, 0, 0, '', '', '', 'Length', 'a:2:{s:3:"min";i:5;s:3:"max";i:250;}', '_bx_contact_form_contact_input_subject_err', 'Xss', '', 1, 0),
+('bx_contact_contact', @sName, 'body', '', '', 0, 'textarea', '_bx_contact_form_contact_input_sys_body', '_bx_contact_form_contact_input_body', '', 1, 0, 0, '', '', '', 'Length', 'a:2:{s:3:"min";i:10;s:3:"max";i:5000;}', '_bx_contact_form_contact_input_body_err', 'Xss', '', 1, 0),
+('bx_contact_contact', @sName, 'captcha', '', '', 0, 'captcha', '_bx_contact_form_contact_input_sys_captcha', '_bx_contact_form_contact_input_captcha', '', 1, 0, 0, '', '', '', 'Captcha', '', '_bx_contact_form_contact_input_captcha_err', '', '', 1, 0),
+('bx_contact_contact', @sName, 'do_submit', '_bx_contact_form_contact_input_do_submit', '', 0, 'submit', '_bx_contact_form_contact_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0);
+
+INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
+('bx_contact_contact_send', 'name', 2147483647, 1, 1),
+('bx_contact_contact_send', 'email', 2147483647, 1, 2),
+('bx_contact_contact_send', 'subject', 2147483647, 1, 3),
+('bx_contact_contact_send', 'body', 2147483647, 1, 4),
+('bx_contact_contact_send', 'captcha', 2147483647, 1, 5),
+('bx_contact_contact_send', 'do_submit', 2147483647, 1, 6);
+
+
+-- STUDIO PAGE & WIDGET
+INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
+(3, @sName, '_bx_contact', '_bx_contact', 'bx_contact@modules/boonex/contact/|std-pi.png');
+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_contact', '', 'bx_contact@modules/boonex/contact/|std-wi.png', '_bx_contact', '', '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));

+ 18 - 0
modules/boonex/contact/updates/8.0.2_8.0.3/source/request.php

@@ -0,0 +1,18 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Contact Contact
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
+
+bx_import('BxDolLanguages');
+
+BxDolRequest::processAsAction($GLOBALS['aModule'], $GLOBALS['aRequest']);
+
+/** @} */

+ 51 - 0
modules/boonex/convos/updates/8.0.4_8.0.5/install/config.php

@@ -0,0 +1,51 @@
+<?php
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ */
+
+$aConfig = array(
+    /**
+     * Main Section.
+     */
+    'title' => 'Conversations',
+    'version_from' => '8.0.4',
+	'version_to' => '8.0.5',
+    'vendor' => 'BoonEx',
+
+    'compatible_with' => array(
+        '8.0.0.A11'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/convos/updates/update_8.0.4_8.0.5/',
+	'home_uri' => 'convos_update_804_805',
+
+	'module_dir' => 'boonex/convos/',
+	'module_uri' => 'convos',
+
+    'db_prefix' => 'bx_convos_',
+    'class_prefix' => 'BxCnv',
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+		'execute_sql' => 1,
+        'update_files' => 1,
+        'update_languages' => 0,
+		'clear_db_cache' => 1,
+    ),
+
+	/**
+     * Category for language keys.
+     */
+    'language_category' => 'Conversations',
+
+	/**
+     * Files Section
+     */
+    'delete_files' => array(),
+);

+ 13 - 0
modules/boonex/convos/updates/8.0.4_8.0.5/install/installer.php

@@ -0,0 +1,13 @@
+<?php
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ */
+
+class BxCnvUpdater extends BxDolStudioUpdater
+{
+    function __construct($aConfig)
+	{
+        parent::__construct($aConfig);
+    }
+}

+ 2 - 0
modules/boonex/convos/updates/8.0.4_8.0.5/install/sql/install.sql

@@ -0,0 +1,2 @@
+-- STORAGES & TRANSCODERS
+UPDATE `sys_transcoder_filters` SET `filter_params`='a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:11:"crop_resize";s:1:"1";}' WHERE `transcoder_object`='bx_convos_preview' AND `filter`='Resize';

+ 29 - 0
modules/boonex/convos/updates/8.0.4_8.0.5/source/classes/BxCnvAlertsResponse.php

@@ -0,0 +1,29 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Convos Convos
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxCnvAlertsResponse extends BxBaseModTextAlertsResponse
+{
+    public function __construct()
+    {
+        $this->MODULE = 'bx_convos';
+        parent::__construct();        
+    }
+
+    public function response($oAlert)
+    {
+        if ($this->MODULE == $oAlert->sUnit && 'commentPost' == $oAlert->sAction)
+            BxDolService::call($this->MODULE, 'trigger_comment_post', array($oAlert->iObject, $oAlert->aExtras['comment_author_id'], $oAlert->aExtras['comment_id']));
+
+        parent::response($oAlert);
+    }
+}
+
+/** @} */

+ 72 - 0
modules/boonex/convos/updates/8.0.4_8.0.5/source/classes/BxCnvCmts.php

@@ -0,0 +1,72 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Convos Convos
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+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($iParentId = 0, $iVParentId = 0, $bInDesignbox = true)
+    {
+        $mixedBlock = parent::getCommentsBlock($iParentId, $iVParentId, $bInDesignbox);
+        if (is_array($mixedBlock) && isset($mixedBlock['title']))
+            $mixedBlock['title'] = _t('_bx_cnv_page_block_title_entry_comments', $this->getCommentsCount());
+        return $mixedBlock;
+    }
+}
+
+/** @} */

+ 87 - 0
modules/boonex/convos/updates/8.0.4_8.0.5/source/classes/BxCnvConfig.php

@@ -0,0 +1,87 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Convos Convos
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxCnvConfig extends BxBaseModTextConfig
+{
+    function __construct($aModule)
+    {
+        parent::__construct($aModule);
+
+        $this->CNF = array (
+
+            // database tables
+            'TABLE_ENTRIES' => $aModule['db_prefix'] . 'conversations',
+
+            // database fields
+            'FIELD_ID' => 'id',
+            'FIELD_AUTHOR' => 'author',
+            'FIELD_ADDED' => 'added',
+            'FIELD_CHANGED' => 'changed',
+            'FIELD_TITLE' => '',
+            'FIELD_TEXT' => 'text',
+            'FIELD_TEXT_ID' => 'convo-text',
+            'FIELD_ALLOW_VIEW_TO' => '',
+            'FIELD_PHOTO' => 'attachments',
+            'FIELD_THUMB' => '',
+            'FIELD_COMMENTS' => 'comments',
+
+            // page URIs
+            'URI_VIEW_ENTRY' => 'view-convo',
+            'URI_AUTHOR_ENTRIES' => 'convos',
+            'URI_ADD_ENTRY' => 'start-convo',
+
+            'URL_HOME' => 'modules/?r=convos/folder/1',
+
+            // some params
+            'PARAM_CHARS_SUMMARY' => '',
+            'PARAM_CHARS_SUMMARY_PLAIN' => '',
+            'PARAM_NUM_RSS' => '',
+
+            // objects
+            'OBJECT_GRID' => 'bx_convos',
+            'OBJECT_STORAGE' => 'bx_convos_files',
+            'OBJECT_IMAGES_TRANSCODER_PREVIEW' => 'bx_convos_preview',
+            'OBJECT_IMAGES_TRANSCODER_GALLERY' => '',
+            'OBJECT_VIDEOS_TRANSCODERS' => array(),
+            'OBJECT_VIEWS' => 'bx_convos',
+            'OBJECT_VOTES' => '',
+            'OBJECT_COMMENTS' => 'bx_convos',
+            'OBJECT_PRIVACY_VIEW' => '',
+            'OBJECT_FORM_ENTRY' => 'bx_convos',
+            'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_convos_entry_view',
+            'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_convos_entry_add',
+            'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => '',
+            'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_convos_entry_delete',
+            'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_convos_view', // actions menu on view entry page
+            'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_convos_my', // actions menu on my entries page
+            'OBJECT_MENU_SUBMENU' => 'bx_convos_submenu', // main module submenu
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => '', // view entry submenu
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'convos', // first item in view entry submenu from main module submenu
+            'OBJECT_UPLOADERS' => array('sys_simple', 'sys_html5'),
+
+            // menu items which visibility depends on custom visibility checking
+            'MENU_ITEM_TO_METHOD' => array (
+                'bx_convos_view' => array (
+                    'delete-convos' => 'checkAllowedDelete',
+                    'mark-unread-convo' => 'checkAllowedView',
+                ),
+            ),
+
+            // some language keys
+            'T' => array (
+                'txt_sample_single' => '_bx_cnv_txt_sample_single',
+            ),
+        );
+
+    }
+}
+
+/** @} */

+ 117 - 0
modules/boonex/convos/updates/8.0.4_8.0.5/source/classes/BxCnvDb.php

@@ -0,0 +1,117 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Convos Convos
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+/*
+ * Module database queries
+ */
+class BxCnvDb extends BxBaseModTextDb
+{
+    public function __construct(&$oConfig)
+    {
+        parent::__construct($oConfig);
+    }
+
+    public function conversationToFolder($iConversationId, $iFolderId, $iProfileCollaborator, $iReadCommentsNum = -1)
+    {
+        $sQuery = $this->prepare("INSERT INTO `" . $this->getPrefix() . "conv2folder` SET `conv_id` = ?, `folder_id` = ?, `collaborator` = ?, `read_comments` = ?", $iConversationId, $iFolderId, $iProfileCollaborator, $iReadCommentsNum);
+        return $this->query($sQuery);
+    }
+
+    public function getFolder($iFolderId)
+    {
+        $sQuery = $this->prepare("SELECT `id`, `author`, `name` FROM `" . $this->getPrefix() . "folders` WHERE `id` = ?", $iFolderId);
+        return $this->getRow($sQuery);
+    }
+
+    public function getConversationFolder($iConversationId, $iProfileCollaborator)
+    {
+        $sQuery = $this->prepare("SELECT `folder_id` FROM `" . $this->getPrefix() . "conv2folder` WHERE `conv_id` = ? AND `collaborator` = ?", $iConversationId, $iProfileCollaborator);
+        return $this->getOne($sQuery);
+    }
+
+    public function getCollaborators($iConversationId)
+    {
+        $sQuery = $this->prepare("SELECT `collaborator`, `read_comments` FROM `" . $this->getPrefix() . "conv2folder` WHERE `conv_id` = ?", $iConversationId);
+        return $this->getPairs($sQuery, 'collaborator', 'read_comments');
+    }
+
+    public function updateReadComments($iProfileId, $iConversationId, $iReadComments)
+    {
+        $sQuery = $this->prepare("UPDATE `" . $this->getPrefix() . "conv2folder` SET `read_comments` = ? WHERE `conv_id` = ? AND `collaborator` = ?", $iReadComments, $iConversationId, $iProfileId);
+        return $this->query($sQuery);
+    }
+
+    public function updateLastCommentTimeProfile($iConversationId, $iProfileId, $iCommentId, $iTimestamp)
+    {
+        $sQuery = $this->prepare("UPDATE `" . $this->getPrefix() . "conversations` SET `last_reply_profile_id` = ?, `last_reply_timestamp` = ?, `last_reply_comment_id` = ? WHERE `id` = ?", $iProfileId, $iTimestamp, $iCommentId, $iConversationId);
+        return $this->query($sQuery);
+    }
+
+    public function moveConvo($iConversationId, $iProfileId, $iFolderId)
+    {
+        $sQuery = $this->prepare("SELECT `folder_id` FROM `" . $this->getPrefix() . "conv2folder` WHERE `conv_id` = ? AND `collaborator` = ?", $iConversationId, $iProfileId);
+        $iFolderIdOld = $this->getOne($sQuery);
+        if (BX_CNV_FOLDER_TRASH == $iFolderIdOld) // if convo is already in trash folder - delete it
+            return $this->deleteConvo($iConversationId, $iProfileId);
+
+        $sQuery = $this->prepare("UPDATE `" . $this->getPrefix() . "conv2folder` SET `folder_id` = ? WHERE `conv_id` = ? AND `collaborator` = ?", $iFolderId, $iConversationId, $iProfileId);
+        return $this->query($sQuery);
+    }
+
+    public function deleteConvo($iConversationId, $iProfileId = 0)
+    {
+        $aContentInfo = $this->getContentInfoById ($iConversationId);
+        if (!$aContentInfo)
+            return true;
+
+        // delete convo
+        $sWhere = '';
+        if ($iProfileId)
+            $sWhere = $this->prepare(" AND `collaborator` = ?", $iProfileId);
+
+        $sQuery = $this->prepare("DELETE FROM `" . $this->getPrefix() . "conv2folder` WHERE `conv_id` = ?", $iConversationId);
+        if (!$this->query($sQuery . $sWhere))
+            return false;
+
+        // delete whole conversation if there is no refencences to the conversation in conv2folder table
+        $sQuery = $this->prepare("SELECT `id` FROM `" . $this->getPrefix() . "conv2folder` WHERE `conv_id` = ?", $iConversationId);
+        if (!$this->getOne($sQuery)) {
+            $CNF = &$this->_oConfig->CNF;
+            $oForm = BxDolForm::getObjectInstance($CNF['OBJECT_FORM_ENTRY'], $CNF['OBJECT_FORM_ENTRY_DISPLAY_ADD']);
+            return $oForm->delete((int)$iConversationId, $aContentInfo);
+        }
+
+        return true;
+    }
+
+    public function getUnreadMessagesNum ($iProfileId, $iFolderId = BX_CNV_FOLDER_INBOX)
+    {
+        $sQuery = $this->prepare("SELECT SUM(`c`.`comments` - `f`.`read_comments`)
+            FROM `" . $this->getPrefix() . "conv2folder` as `f`
+            INNER JOIN `" . $this->getPrefix() . "conversations` AS `c` ON (`c`.`id` = `f`.`conv_id`)
+            WHERE `f`.`collaborator` = ? AND `f`.`folder_id` = ?", $iProfileId, $iFolderId);
+        return $this->getOne($sQuery);
+    }
+
+    public function getMessagesPreviews ($iProfileId, $iStart = 0, $iLimit = 4, $iFolderId = BX_CNV_FOLDER_INBOX)
+    {
+        $sQuery = $this->prepare("SELECT `c`.`id`, `c`.`text`, `c`.`author`, `cmts`.`cmt_text`, `c`.`last_reply_profile_id`, `c`.`comments`, (`c`.`comments` - `f`.`read_comments`) AS `unread_messages`, `last_reply_timestamp`
+            FROM `" . $this->getPrefix() . "conv2folder` as `f`
+            INNER JOIN `" . $this->getPrefix() . "conversations` AS `c` ON (`c`.`id` = `f`.`conv_id`)
+            LEFT JOIN `" . $this->getPrefix() . "cmts` AS `cmts` ON (`cmts`.`cmt_id` = `c`.`last_reply_comment_id`)
+            WHERE `f`.`collaborator` = ? AND `f`.`folder_id` = ?
+            ORDER BY `c`.`last_reply_timestamp` DESC
+            LIMIT ?, ?", $iProfileId, $iFolderId, $iStart, $iLimit);
+        return $this->getAll($sQuery);
+    }
+}
+
+/** @} */

+ 221 - 0
modules/boonex/convos/updates/8.0.4_8.0.5/source/classes/BxCnvFormEntry.php

@@ -0,0 +1,221 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Convos Convos
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+/**
+ * Create/Edit entry form
+ */
+class BxCnvFormEntry extends BxBaseModTextFormEntry
+{
+    public function __construct($aInfo, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_convos';
+        parent::__construct($aInfo, $oTemplate);
+
+        $oTemplate = BxDolTemplate::getInstance();
+        $oTemplate->addJs(array (
+            'jquery-ui/jquery-ui.custom.min.js',
+            'jquery.form.min.js',
+        ));
+        $oTemplate->addJsTranslation(array(
+            '_bx_cnv_draft_saving_error',
+            '_bx_cnv_draft_saved_success',
+        ));
+    }
+
+    public function insert ($aValsToAdd = array(), $isIgnore = false)
+    {
+        $aValsToAdd['last_reply_timestamp'] = time();
+        $aValsToAdd['last_reply_profile_id'] = bx_get_logged_profile_id();
+
+        $bSaveToDrafts = bx_get('draft_save');
+        $iContentId = bx_get('draft_id');
+        $bDraft = $iContentId ? BX_CNV_FOLDER_DRAFTS == $this->_oModule->_oDb->getConversationFolder($iContentId, bx_get_logged_profile_id()) : false;
+
+        if ($iContentId) {
+
+            if (!$bDraft)
+                return 0;
+
+            if (!parent::update ($iContentId, $aValsToAdd, $isIgnore))
+                return 0;
+
+        } else {
+            $iContentId = parent::insert ($aValsToAdd, $isIgnore);
+            if (!$iContentId)
+                return 0;
+        }
+
+        if ($bSaveToDrafts) {
+
+            if (!$bDraft)
+                $this->_oModule->_oDb->conversationToFolder($iContentId, BX_CNV_FOLDER_DRAFTS, bx_get_logged_profile_id(), 0);
+
+            // draft is saved via ajax call only, upon successfull draft saving content id is returned
+            echo $iContentId;
+            exit;
+
+        } else {
+
+            // check for spam
+            $bSpam = false;
+            bx_alert('system', 'check_spam', 0, getLoggedId(), array('is_spam' => &$bSpam, 'content' => $this->getCleanValue('text'), 'where' => $this->MODULE));
+            $iFolder = $bSpam ? BX_CNV_FOLDER_SPAM : BX_CNV_FOLDER_INBOX;
+
+            // place conversation to "inbox" (or "spam" - in case of spam) folder
+            $aRecipients = array_unique(array_merge($this->getCleanValue('recipients'), array(bx_get_logged_profile_id())), SORT_NUMERIC);
+            foreach ($aRecipients as $iProfile) {
+                $oProfile = BxDolProfile::getInstance($iProfile);
+                if (!$oProfile)
+                    continue;
+
+                if ($bDraft && $oProfile->id() == bx_get_logged_profile_id())
+                    $this->_oModule->_oDb->moveConvo($iContentId, $oProfile->id(), $iFolder);
+                else
+                    $this->_oModule->_oDb->conversationToFolder($iContentId, $iFolder, $oProfile->id(), $oProfile->id() == bx_get_logged_profile_id() ? 0 : -1);
+            }
+        }
+
+        return $iContentId;
+    }
+
+    protected function genCustomInputRecipients ($aInput)
+    {
+        $sVals = '';
+        if (!empty($aInput['value']) && is_array($aInput['value'])) {
+            foreach ($aInput['value'] as $sVal) {
+                if (!$sVal || !($oProfile = BxDolProfile::getInstance($sVal)))
+                    continue;
+               $sVals .= '<b class="val bx-def-color-bg-hl bx-def-round-corners">' . $oProfile->getDisplayName() . '<input type="hidden" name="' . $aInput['name'] . '[]" value="' . $sVal . '" /></b>';
+            }
+            $sVals = trim($sVals, ',');
+        }
+        $sId = $aInput['name'] . time();
+        $sPlaceholderText = bx_html_attribute(_t('_bx_cnv_form_entry_input_recipients_placeholder'), BX_ESCAPE_STR_QUOTE);
+        $sUrlGetRecipients = BX_DOL_URL_ROOT . "modules/?r=convos/ajax_get_recipients";
+        return <<<EOS
+<script>
+    $(function() {
+
+        $('#{$sId} input[type=text]').autocomplete({
+            source: "{$sUrlGetRecipients}",
+            select: function(e, ui) {
+                $(this).val(ui.item.label);
+                $(this).trigger('superselect', ui.item);
+                e.preventDefault();
+            }
+        });
+
+        $('#{$sId} input[type=text]').on('superselect', function(e, item) {
+            $(this).hide();
+            if ('undefined' != typeof(item))
+                $(this).before('<b class="bx-def-color-bg-hl bx-def-round-corners">'+ item.label +'<input type="hidden" name="{$aInput['name']}[]" value="'+ item.value +'" /></b>');
+            fAutoShrinkInput();
+            $(this).show();
+            this.value = '';
+
+        }).on('keydown', function(e) {
+
+            // if: comma,enter (delimit more keyCodes with | pipe)
+            if (/(13)/.test(e.which))
+                e.preventDefault();
+
+        });
+
+        $('#{$sId}').on('click', 'b', function() {
+            $(this).remove();
+            fAutoShrinkInput();
+        });
+
+        fAutoShrinkInput = function () {
+            var iWidthCont = $('#{$sId}.bx-form-input-autotoken').innerWidth();
+            var iWidthExisting = 0;
+            $('#{$sId}.bx-form-input-autotoken b').each(function () {
+                iWidthExisting += $(this).outerWidth(true);
+            });
+            $('#{$sId}.bx-form-input-autotoken input').width(parseInt(iWidthCont - iWidthExisting > 180 ? iWidthCont - iWidthExisting : 180) - 5);
+        };
+
+        fAutoShrinkInput();
+    });
+</script>
+<style>
+    .bx-form-input-autotoken {
+        float:left;
+        padding:0px;
+        height:auto;
+    }
+    .bx-form-input-autotoken b {
+        cursor:pointer;
+        display:block;
+        float:left;
+        padding:0.5em;
+        padding-right:1.5em;
+        margin:0.1em;
+        font-weight:normal;
+    }
+    .bx-form-input-autotoken b:hover {
+        opacity:0.7;
+    }
+    .bx-form-input-autotoken b:after {
+        position:absolute;
+        content:"x";
+        padding:0 0.5em;
+        margin:0.2em 0 0.7em 0.5em;
+        font-size:0.7em;
+        font-weight:bold;
+    }
+    .bx-form-input-autotoken input {
+        border:0;
+        margin:0;
+        padding:0 0 0 5px;
+        width:auto;
+    }
+</style>
+<div id="{$sId}" class="bx-form-input-autotoken bx-def-font-inputs bx-form-input-text">
+    {$sVals}
+    <input type="text" value="" placeholder="{$sPlaceholderText}" class="bx-def-font-inputs bx-form-input-text" />
+</div>
+EOS;
+    }
+
+    protected function genCustomInputSubmitText ($aInput)
+    {
+        $aVars = array();
+        return $this->_oModule->_oTemplate->parseHtmlByName('form_submit_text.html', $aVars);
+    }
+
+    function initChecker ($aValues = array (), $aSpecificValues = array())
+    {
+        if ($iContentId = bx_get('draft_id')) { // if adding from draft, fill in existing fields info
+            $aContentInfo = $this->_oModule->_oDb->getContentInfoById($iContentId);
+            if ($aContentInfo)
+                $aValues = array_merge($aContentInfo, $aValues);
+        }
+
+        if ($sProfilesIds = bx_get('profiles')) { // if writing directly to some recipients, pre-fill them
+            $a = explode(',', $sProfilesIds);
+            $a = array_unique(BxDolFormCheckerHelper::passInt($a));
+            if ($a)
+                $aValues['recipients'] = array_merge(empty($aValues['recipients']) ? array() : $aValues['recipients'], $a);
+            
+        }
+        return parent::initChecker ($aValues, $aSpecificValues);
+    }
+
+    function isValid ()
+    {
+        if (bx_get('draft_save')) // form is always valid when saving to drafts
+            return true;
+        return parent::isValid ();
+    }
+}
+
+/** @} */

+ 39 - 0
modules/boonex/convos/updates/8.0.4_8.0.5/source/classes/BxCnvFormsEntryHelper.php

@@ -0,0 +1,39 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Convos Convos
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+/**
+ * Entry forms helper functions
+ */
+class BxCnvFormsEntryHelper extends BxBaseModTextFormsEntryHelper
+{
+    public function __construct($oModule)
+    {
+        parent::__construct($oModule);
+    }
+
+    public function deleteData ($iContentId, $aContentInfo = false, $oProfile = null, $oForm = null)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        if ($sErrorMsg = $this->_oModule->deleteConvoForever ($iContentId))
+            return $sErrorMsg;
+
+        if ($sResult = $this->onDataDeleteAfter ($aContentInfo[$CNF['FIELD_ID']], $aContentInfo, $oProfile))
+            return $sResult;
+
+        // create an alert
+        bx_alert($this->_oModule->getName(), 'deleted', $aContentInfo[$CNF['FIELD_ID']]);
+
+        return '';
+    }
+}
+
+/** @} */

+ 105 - 0
modules/boonex/convos/updates/8.0.4_8.0.5/source/classes/BxCnvGrid.php

@@ -0,0 +1,105 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Convos Convos
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
+
+class BxCnvGrid extends BxTemplGrid
+{
+    protected $MODULE;
+
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_convos';
+        parent::__construct ($aOptions, $oTemplate);
+        $this->_sDefaultSortingOrder = 'DESC';
+
+        if ($iFolderId = (int)bx_get('folder_id'))
+            $this->addMarkers(array(
+                'folder_id' => $iFolderId,
+                'profile_id' => bx_get_logged_profile_id(),
+            ));
+    }
+
+    public function performActionCompose()
+    {
+        $oModule = BxDolModule::getInstance($this->MODULE);
+        $CNF = &$oModule->_oConfig->CNF;
+
+        $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_ADD_ENTRY']);
+
+        header('Location:' . $sUrl);
+    }
+
+    protected function _getActionAdd ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
+    {
+        $oModule = BxDolModule::getInstance($this->MODULE);
+        $CNF = &$oModule->_oConfig->CNF;
+
+        $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_ADD_ENTRY']);
+
+        $a['attr']['onclick'] = "document.location='$sUrl'";
+        unset($a['attr']['bx_grid_action_independent']);
+
+        return parent::_getActionDefault ($sType, $sKey, $a, $isSmall, $isDisabled, $aRow);
+    }
+
+    protected function _getCellHeaderWrapper ($sKey, $aField, $sHeader, $sAttr)
+    {
+        $sHeader = '<span>' . $sHeader . '</span>';
+        return parent::_getCellHeaderWrapper ($sKey, $aField, $sHeader, $sAttr);
+    }
+
+    protected function _getCellPreview ($mixedValue, $sKey, $aField, $aRow)
+    {
+        return parent::_getCellDefault ('', $sKey, $aField, $aRow);
+    }
+
+    protected function _getCellLastReplyTimestamp ($mixedValue, $sKey, $aField, $aRow)
+    {
+        $oModule = BxDolModule::getInstance($this->MODULE);
+        $s = $oModule->_oTemplate->entryMessagePreviewInGrid ($aRow);
+        return parent::_getCellDefault ($s, $sKey, $aField, $aRow);
+    }
+
+    protected function _getCellCollaborators ($mixedValue, $sKey, $aField, $aRow)
+    {
+        $oModule = BxDolModule::getInstance($this->MODULE);
+        $s = $oModule->_oTemplate->entryCollaborators ($aRow);
+        return parent::_getCellDefault ($s, $sKey, $aField, $aRow);
+    }
+
+    protected function _getCellComments ($mixedValue, $sKey, $aField, $aRow)
+    {
+        $oModule = BxDolModule::getInstance($this->MODULE);
+        $s = $oModule->_oTemplate->getMessageLabel ($aRow);
+        return parent::_getCellDefault ('<div class="bx-cnv-grid-field-messages"><span>' . (1 + $mixedValue) . '</span>' . $s . '</div>', $sKey, $aField, $aRow);
+    }
+
+    protected function _delete ($mixedId)
+    {
+        $oModule = BxDolModule::getInstance($this->MODULE);
+
+        if ($sErrorMsg = $oModule->deleteConvo ($mixedId))
+            return false;
+
+        return $oModule->_oDb->moveConvo((int)$mixedId, bx_get_logged_profile_id(), BX_CNV_FOLDER_TRASH);
+    }
+
+    protected function _addJsCss()
+    {
+        parent::_addJsCss();
+        $oModule = BxDolModule::getInstance($this->MODULE);
+        $oModule->_oTemplate->addJs('main.js');
+        $oModule->_oTemplate->addCss(array('main-media-tablet.css', 'main-media-desktop.css'));
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/convos/updates/8.0.4_8.0.5/source/classes/BxCnvMenu.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Convos Convos
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+/**
+ * General class for module menu.
+ */
+class BxCnvMenu extends BxBaseModTextMenu
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_convos';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/convos/updates/8.0.4_8.0.5/source/classes/BxCnvMenuView.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Convos Convos
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+/**
+ * View entry menu
+ */
+class BxCnvMenuView extends BxBaseModTextMenuView
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_convos';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 322 - 0
modules/boonex/convos/updates/8.0.4_8.0.5/source/classes/BxCnvModule.php

@@ -0,0 +1,322 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Convos Convos
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+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);
+    }
+
+    /**
+     * Update last comment time and author
+     */
+    public function serviceTriggerCommentPost ($iContentId, $iProfileId, $iCommentId, $iTimestamp = 0)
+    {
+        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']]);
+
+        return $this->_oDb->updateLastCommentTimeProfile((int)$iContentId, (int)$iProfileId, (int)$iCommentId, $iTimestamp);
+    }
+
+    /**
+     * 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 moderators for personal convos
+     */
+    protected function _isModerator ($isPerformAction = false)
+    {
+        return false;
+    }
+
+    /**
+     * No thumbs for convos
+     */
+    public function checkAllowedSetThumb ()
+    {
+        return _t('_sys_txt_access_denied');
+    }
+
+    /**
+     * 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]);
+    }
+}
+
+/** @} */

+ 25 - 0
modules/boonex/convos/updates/8.0.4_8.0.5/source/classes/BxCnvPageBrowse.php

@@ -0,0 +1,25 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Convos Convos
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+/**
+ * Browse entries pages.
+ */
+class BxCnvPageBrowse extends BxBaseModTextPageBrowse
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_convos';
+        parent::__construct($aObject, $oTemplate);
+        $this->_oModule->setModuleSubmenu ();
+    }
+}
+
+/** @} */

+ 43 - 0
modules/boonex/convos/updates/8.0.4_8.0.5/source/classes/BxCnvPageEntry.php

@@ -0,0 +1,43 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Convos Convos
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+/**
+ * Entry create/edit pages
+ */
+class BxCnvPageEntry extends BxBaseModTextPageEntry
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_convos';
+        parent::__construct($aObject, $oTemplate);
+
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        $this->_oModule->_oDb->updateReadComments(bx_get_logged_profile_id(), $this->_aContentInfo[$CNF['FIELD_ID']], $this->_aContentInfo[$CNF['FIELD_COMMENTS']]);
+
+        $iFolder = $this->_oModule->_oDb->getConversationFolder($this->_aContentInfo[$CNF['FIELD_ID']], bx_get_logged_profile_id());
+        if (BX_CNV_FOLDER_DRAFTS == $iFolder) { // if draft is opened - redirect to compose page
+            $sUrl = BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_ADD_ENTRY']);
+            $sUrl = bx_append_url_params($sUrl, array(
+                'draft_id' => $this->_aContentInfo[$CNF['FIELD_ID']],
+            ));
+            header('Location: ' . BX_DOL_URL_ROOT . $sUrl);
+            exit;
+        }
+
+        $this->_oModule->setModuleSubmenu ($iFolder);
+
+        $this->_oModule->_oTemplate->addJs('main.js');
+        $this->_oModule->_oTemplate->addCss(array('main-media-tablet.css', 'main-media-desktop.css'));
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/convos/updates/8.0.4_8.0.5/source/classes/BxCnvPageFolder.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Convos Convos
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+/**
+ * Display conversations in the folder
+ */
+class BxCnvPageFolder extends BxTemplPage
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        parent::__construct($aObject, $oTemplate);
+    }
+
+}
+
+/** @} */

+ 245 - 0
modules/boonex/convos/updates/8.0.4_8.0.5/source/classes/BxCnvTemplate.php

@@ -0,0 +1,245 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Convos Convos
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+/*
+ * Module representation.
+ */
+class BxCnvTemplate extends BxBaseModTextTemplate
+{
+    /**
+     * Constructor
+     */
+    function __construct(&$oConfig, &$oDb)
+    {
+        $this->MODULE = 'bx_convos';
+        parent::__construct($oConfig, $oDb);
+    }
+
+    public function entryCollaborators ($aContentInfo, $iMaxVisible = 2, $sFloat = 'left')
+    {
+        $oModule = BxDolModule::getInstance($this->MODULE);
+        $CNF = &$oModule->_oConfig->CNF;
+
+        $aCollaborators = $this->_oDb->getCollaborators($aContentInfo[$CNF['FIELD_ID']]);
+        //unset($aCollaborators[$aContentInfo[$CNF['FIELD_AUTHOR']]]);
+
+        // sort collaborators: first - current user, second - last replier, third - author, all others sorted by max number of posts
+        $aCollaborators = $oModule->sortCollaborators($aCollaborators, $aContentInfo['last_reply_profile_id'], $aContentInfo[$CNF['FIELD_AUTHOR']]);
+        $iCollaboratorsNum = count($aCollaborators);
+
+        // prepare template variables
+        $aVarsPopup = array (
+            'float' => 'none',
+            'bx_repeat:collaborators' => array(),
+            'bx_if:collaborators_more' => array(
+                'condition' => false,
+                'content' => array(),
+            ),
+        );
+        $aVars = array (
+            'float' => $sFloat,
+            'bx_repeat:collaborators' => array(),
+            'bx_if:collaborators_more' => array(
+                'condition' => $iCollaboratorsNum > $iMaxVisible,
+                'content' => array(
+                    'popup' => '',
+                    'title_more' => _t('_bx_cnv_more', $iCollaboratorsNum - $iMaxVisible),
+                    'float' => $sFloat,
+                    'id' => $this->MODULE . '-popup-' . $aContentInfo[$CNF['FIELD_ID']],
+                ),
+            ),
+        );
+        $i = 0;
+        foreach ($aCollaborators as $iProfileId => $iReadComments) {
+            $oProfile = BxDolProfile::getInstance($iProfileId);
+            if (!$oProfile)
+                continue;
+
+            $sInfo = '';
+            if ($aContentInfo[$CNF['FIELD_AUTHOR']] == $iProfileId)
+                $sInfo = _t('_bx_cnv_collaborator_author');
+            if ($aContentInfo['last_reply_profile_id'] == $iProfileId)
+                $sInfo .= ', ' . _t('_bx_cnv_collaborator_last_replier');
+            $sInfo = trim($sInfo, ', ');
+            $sInfo = $sInfo ? _t('_bx_cnv_collaborator_info', $oProfile->getDisplayName(), $sInfo) : $oProfile->getDisplayName();
+
+            $aCollaborator = array (
+                'id' => $oProfile->id(),
+                'url' => $oProfile->getUrl(),
+                'thumb_url' => $oProfile->getThumb(),
+                'title' => $oProfile->getDisplayName(),
+                'title_attr' =>  bx_html_attribute($sInfo),
+                'float' => $sFloat,
+                'class' => $aContentInfo[$CNF['FIELD_AUTHOR']] == $iProfileId ? 'bx-cnv-collaborator-author' : '',
+                'bx_if:last_replier' => array (
+                    'condition' => ($aContentInfo['last_reply_profile_id'] == $iProfileId),
+                    'content' => array (
+                        'id' => $oProfile->id(),
+                    ),
+                ),
+                'bx_if:author'  => array (
+                    'condition' => $aContentInfo[$CNF['FIELD_AUTHOR']] == $iProfileId,
+                    'content' => array (
+                        'id' => $oProfile->id(),
+                    ),
+                ),
+            );
+
+            if ($i < $iMaxVisible)
+                $aVars['bx_repeat:collaborators'][] = $aCollaborator;
+            if ($i >= $iMaxVisible)
+                $aVarsPopup['bx_repeat:collaborators'][] = $aCollaborator;
+
+            ++$i;
+        }
+
+        if ($aVarsPopup['bx_repeat:collaborators']) {
+            $aVars['bx_if:collaborators_more']['content']['popup'] = BxTemplFunctions::getInstance()->transBox('', '<div class="bx-def-padding">' . $this->parseHtmlByName('collaborators.html', $aVarsPopup) . '</div>');
+        }
+
+        return $this->parseHtmlByName('collaborators.html', $aVars);
+    }
+
+    function getAuthorDesc ($aData)
+    {
+        $oModule = BxDolModule::getInstance($this->MODULE);
+        if ($aData['last_reply_timestamp'] == $aData[$oModule->_oConfig->CNF['FIELD_ADDED']])
+            return bx_time_js($aData[$oModule->_oConfig->CNF['FIELD_ADDED']], BX_FORMAT_DATE);
+
+        return _t('_bx_cnv_author_desc', bx_time_js($aData[$oModule->_oConfig->CNF['FIELD_ADDED']], BX_FORMAT_DATE), bx_time_js($aData['last_reply_timestamp'], BX_FORMAT_DATE));
+    }
+
+    function getMessageLabel ($r, $oProfileLast = null)
+    {
+        $oModule = BxDolModule::getInstance($this->MODULE);
+
+        if (!$oProfileLast) {
+            $oProfileLast = BxDolProfile::getInstance($r['last_reply_profile_id']);
+            if (!$oProfileLast)
+                $oProfileLast = BxDolProfileUndefined::getInstance();
+        }
+
+        if (!isset($r['unread_messages']))
+            $r['unread_messages'] = $r['comments'] - $r['read_comments'];
+
+        $bReadByAll = true;
+        $aCollaborators = $oModule->_oDb->getCollaborators($r['id']);
+        foreach ($aCollaborators as $iReadComments) {
+            if ($r['comments'] - $iReadComments) {
+                $bReadByAll = false;
+                break;
+            }
+        }
+
+        if (!isset($r['unread_messages']))
+            $r['unread_messages'] = $r['comments'] - $r['read_comments'];
+
+        $aVars = array (
+            'bx_if:unread_messages' => array (
+                'condition' => $r['unread_messages'] > 0,
+                'content' => array (
+                    'unread_messages' => $r['unread_messages'],
+                ),
+            ),
+            'bx_if:viewer_is_last_replier' => array (
+                'condition' => !$bReadByAll && $oProfileLast->id() == bx_get_logged_profile_id(),
+                'content' => array (),
+            ),
+            'bx_if:is_read_by_all' => array (
+                'condition' => $bReadByAll,
+                'content' => array (),
+            ),
+        );
+
+        return $this->parseHtmlByName('message_label.html', $aVars);
+    }
+
+    function getMessagesPreviews ($a)
+    {
+        if (empty($a))
+            return MsgBox(_t('_Empty'));
+
+        $oModule = BxDolModule::getInstance($this->MODULE);
+
+        $aVars = array(
+            'see_all_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($oModule->_oConfig->CNF['URL_HOME']),
+            'bx_repeat:messages' => array(),
+        );
+        foreach ($a as $r) {
+
+            $oProfileAuthor = BxDolProfile::getInstance($r['author']);
+            if (!$oProfileAuthor)
+                $oProfileAuthor = BxDolProfileUndefined::getInstance();
+
+            $oProfileLast = BxDolProfile::getInstance($r['last_reply_profile_id']);
+            if (!$oProfileLast)
+                $oProfileLast = BxDolProfileUndefined::getInstance();
+
+            $sText = strmaxtextlen($r['text'], 90);
+            $sTextCmt = strmaxtextlen($r['cmt_text'], 50);
+
+            $aVars['bx_repeat:messages'][] = array (
+                'id' => $r['id'],
+                'url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $oModule->_oConfig->CNF['URI_VIEW_ENTRY'] . '&id=' . $r['id']),
+                'text' => $sText ? $sText : $oProfileAuthor->getDisplayName(),
+                'cmt_text' => $sTextCmt,
+                'unread_messages' => $r['unread_messages'],
+                'last_reply_time_and_replier' => _t('_bx_cnv_x_date_by_x_replier', bx_time_js($r['last_reply_timestamp'], BX_FORMAT_DATE), $oProfileLast->getDisplayName()),
+                'font_weight' => $r['unread_messages'] > 0 ? 'bold' : 'normal',
+                'label' => $this->getMessageLabel($r, $oProfileLast),
+
+                'author_id' => $oProfileAuthor->id(),
+                'author_url' => $oProfileAuthor->getUrl(),
+                'author_title' => $oProfileAuthor->getDisplayName(),
+                'author_title_attr' => bx_html_attribute($oProfileAuthor->getDisplayName()),
+                'author_thumb_url' => $oProfileAuthor->getThumb(),
+
+                'last_replier_id' => $oProfileLast->id(),
+                'last_replier_url' => $oProfileLast->getUrl(),
+                'last_replier_title' => $oProfileLast->getDisplayName(),
+                'last_replier_title_attr' => bx_html_attribute($oProfileLast->getDisplayName()),
+                'last_replier_thumb_url' => $oProfileLast->getThumb(),
+            );
+        }
+        return $this->parseHtmlByName('messages_previews.html', $aVars);
+    }
+
+    function entryMessagePreviewInGrid ($r)
+    {
+        $oModule = BxDolModule::getInstance($this->MODULE);
+
+        $oProfileLast = BxDolProfile::getInstance($r['last_reply_profile_id']);
+        if (!$oProfileLast)
+            $oProfileLast = BxDolProfileUndefined::getInstance();
+
+        $sText = strmaxtextlen($r['text'], 100);
+        $sTextCmt = strmaxtextlen($r['cmt_text'], 100);
+
+        if (!isset($r['unread_messages']))
+            $r['unread_messages'] = $r['comments'] - $r['read_comments'];
+
+        $aVars = array (
+            'url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $oModule->_oConfig->CNF['URI_VIEW_ENTRY'] . '&id=' . $r['id']),
+            'text' => $sText,
+            'cmt_text' => $sTextCmt,
+            'last_reply_time_and_replier' => _t('_bx_cnv_x_date_by_x_replier', bx_time_js($r['last_reply_timestamp'], BX_FORMAT_DATE), $oProfileLast->getDisplayName()),
+            'bx_if:unread_messages' => array (
+                'condition' => $r['unread_messages'] > 0,
+                'content' => array (),
+            ),
+        );
+        $aVars['bx_if:unread_messages2'] = $aVars['bx_if:unread_messages'];
+        return $this->parseHtmlByName('message_preview_in_grid.html', $aVars);
+    }
+
+}
+
+/** @} */

+ 103 - 0
modules/boonex/convos/updates/8.0.4_8.0.5/source/install/config.php

@@ -0,0 +1,103 @@
+<?php
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Convos Convos
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_convos',
+    'title' => 'Conversations',
+    'note' => 'Conversations module.',
+    'version' => '8.0.5',
+    'vendor' => 'BoonEx',
+	'help_url' => 'http://feed.boonex.com/?section={module_name}',
+
+    'compatible_with' => array(
+        '8.0.x'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/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'
+    ),
+
+    /**
+     * 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(),
+);
+
+/** @} */

+ 20 - 0
modules/boonex/convos/updates/8.0.4_8.0.5/source/install/installer.php

@@ -0,0 +1,20 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Convos Convos
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxCnvInstaller extends BxBaseModTextInstaller
+{
+    function __construct($aConfig)
+    {
+        parent::__construct($aConfig);
+    }
+}
+
+/** @} */

+ 173 - 0
modules/boonex/convos/updates/8.0.4_8.0.5/source/install/sql/install.sql

@@ -0,0 +1,173 @@
+
+-- TABLE: entries
+
+CREATE TABLE IF NOT EXISTS `bx_convos_conversations` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `author` int(10) unsigned NOT NULL,
+  `added` int(11) NOT NULL,
+  `changed` int(11) NOT NULL,
+  `text` text NOT NULL,
+  `views` int(11) NOT NULL default '0',
+  `comments` int(11) NOT NULL default '0',
+  `last_reply_timestamp` int(11) NOT NULL,
+  `last_reply_profile_id` int(10) unsigned NOT NULL,
+  `last_reply_comment_id` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  KEY `last_reply_timestamp` (`last_reply_timestamp`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_convos_conv2folder` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `conv_id` int(10) unsigned NOT NULL,
+  `folder_id` int(10) unsigned NOT NULL,
+  `collaborator` int(10) unsigned NOT NULL,
+  `read_comments` int(11) NOT NULL default '-1',
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `collaborator_folder_conv` (`collaborator`,`folder_id`, `conv_id`),
+  KEY `conv_id` (`conv_id`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_convos_folders` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `author` int(10) unsigned NOT NULL,
+  `name` varchar(255) NOT NULL DEFAULT '',
+  PRIMARY KEY (`id`),
+  KEY `author` (`author`)
+);
+
+INSERT INTO `bx_convos_folders` (`id`, `author`, `name`) VALUES
+(1, 0, '_bx_cnv_folder_inbox'),
+(2, 0, '_bx_cnv_folder_drafts'),
+(3, 0, '_bx_cnv_folder_spam'),
+(4, 0, '_bx_cnv_folder_trash');
+
+-- TABLE: storages & transcoders
+
+CREATE TABLE IF NOT EXISTS `bx_convos_files` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `profile_id` int(10) unsigned NOT NULL,
+  `remote_id` varchar(255) 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_convos_photos_resized` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `profile_id` int(10) unsigned NOT NULL,
+  `remote_id` varchar(255) 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_convos_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`)
+);
+
+-- TABLE: views
+
+CREATE TABLE `bx_convos_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`)
+);
+
+-- 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_convos_files', 'Local', '', 360, 2592000, 3, 'bx_convos_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_convos_photos_resized', 'Local', '', 360, 2592000, 3, 'bx_convos_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_convos_preview', 'bx_convos_photos_resized', 'Storage', 'a:1:{s:6:"object";s:15:"bx_convos_files";}', 'no', '1', '2592000', '0');
+
+INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES 
+('bx_convos_preview', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:11:"crop_resize";s:1:"1";}', '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_convos', 'bx_convos', '_bx_cnv_form_entry', '', 'a:1:{s:7:\"enctype\";s:19:\"multipart/form-data\";}', 'bx_convos_conversations', 'id', '', '', 'do_submit', '', 0, 1, 'BxCnvFormEntry', 'modules/boonex/convos/classes/BxCnvFormEntry.php');
+
+INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES 
+('bx_convos', 'bx_convos_entry_add', 'bx_convos', 0, '_bx_cnv_form_entry_display_add'),
+('bx_convos', 'bx_convos_entry_delete', 'bx_convos', 0, '_bx_cnv_form_entry_display_delete'),
+('bx_convos', 'bx_convos_entry_view', 'bx_convos', 1, '_bx_cnv_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_convos', 'bx_convos', 'delete_confirm', 1, '', 0, 'checkbox', '_bx_cnv_form_entry_input_sys_delete_confirm', '_bx_cnv_form_entry_input_delete_confirm', '_bx_cnv_form_entry_input_delete_confirm_info', 1, 0, 0, '', '', '', 'Avail', '', '_bx_cnv_form_entry_input_delete_confirm_error', '', '', 1, 0),
+('bx_convos', 'bx_convos', 'do_submit', '_bx_cnv_form_entry_input_do_submit', '', 0, 'submit', '_bx_cnv_form_entry_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_convos', 'bx_convos', 'submit_text', '', '', 0, 'custom', '_bx_cnv_form_entry_input_sys_submit_text', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_convos', 'bx_convos', 'submit_block', '', 'do_submit,submit_text', 0, 'input_set', '_bx_cnv_form_entry_input_sys_submit_block', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_convos', 'bx_convos', 'draft_id', '0', '', 0, 'hidden', '_bx_cnv_form_entry_input_sys_draft_id', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_convos', 'bx_convos', 'text', '', '', 0, 'textarea', '_bx_cnv_form_entry_input_sys_text', '_bx_cnv_form_entry_input_text', '', 1, 0, 2, '', '', '', 'Avail', '', '_bx_cnv_form_entry_input_text_err', 'XssHtml', '', 1, 0),
+('bx_convos', 'bx_convos', 'recipients', '', '', 0, 'custom', '_bx_cnv_form_entry_input_sys_recipients', '_bx_cnv_form_entry_input_recipients', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_cnv_form_entry_input_recipients_err', '', '', 1, 0),
+('bx_convos', 'bx_convos', 'attachments', '', '', 0, 'files', '_bx_cnv_form_entry_input_sys_attachments', '_bx_cnv_form_entry_input_attachments', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0);
+
+INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
+('bx_convos_entry_add', 'delete_confirm', 2147483647, 0, 0),
+('bx_convos_entry_add', 'recipients', 2147483647, 1, 1),
+('bx_convos_entry_add', 'text', 2147483647, 1, 2),
+('bx_convos_entry_add', 'attachments', 2147483647, 1, 3),
+('bx_convos_entry_add', 'submit_block', 2147483647, 1, 4),
+('bx_convos_entry_add', 'do_submit', 2147483647, 1, 5),
+('bx_convos_entry_add', 'submit_text', 2147483647, 1, 6),
+('bx_convos_entry_add', 'draft_id', 2147483647, 1, 7),
+
+('bx_convos_entry_view', 'delete_confirm', 2147483647, 0, 0),
+('bx_convos_entry_view', 'do_submit', 2147483647, 0, 0),
+('bx_convos_entry_view', 'recipients', 2147483647, 0, 0),
+('bx_convos_entry_view', 'text', 2147483647, 0, 0),
+('bx_convos_entry_view', 'attachments', 2147483647, 0, 0),
+
+('bx_convos_entry_delete', 'delete_confirm', 2147483647, 1, 1),
+('bx_convos_entry_delete', 'do_submit', 2147483647, 1, 2),
+('bx_convos_entry_delete', 'attachments', 2147483647, 0, 0),
+('bx_convos_entry_delete', 'recipients', 2147483647, 0, 0),
+('bx_convos_entry_delete', 'text', 2147483647, 0, 0);
+
+-- STUDIO: page & widget
+
+INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
+(3, 'bx_convos', '_bx_cnv', '_bx_cnv', 'bx_convos@modules/boonex/convos/|std-pi.png');
+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_convos', '{url_studio}module.php?name=bx_convos', '', 'bx_convos@modules/boonex/convos/|std-wi.png', '_bx_cnv', '', '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));
+

+ 18 - 0
modules/boonex/convos/updates/8.0.4_8.0.5/source/request.php

@@ -0,0 +1,18 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Convos Convos
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
+
+check_logged();
+
+BxBaseModTextRequest::processAsAction($GLOBALS['aModule'], $GLOBALS['aRequest']);
+
+/** @} */

+ 66 - 0
modules/boonex/convos/updates/8.0.4_8.0.5/source/template/css/main.css

@@ -0,0 +1,66 @@
+
+@import url(../../../../base/text/template/css/main.css);
+
+.bx-cnv-collaborators {
+    white-space:nowrap;
+}
+
+.bx-popup-content .bx-cnv-collaborators {
+    margin-right:0px;
+}
+
+.bx-cnv-collaborator,
+.bx-grid-header-collaborators span {
+    display:none;
+}
+
+.bx-cnv-collaborator-author {
+    display:inline;
+    display:inline-block;
+}
+
+.bx-cnv-preview {
+    position:relative;
+}
+
+.bx-cnv-title {    
+    padding-right:2em;
+    white-space:nowrap;    
+    text-overflow:ellipsis;
+    overflow:hidden;
+}
+
+.bx-cnv-grid-field-label {
+    display:inline-block;
+}
+
+.bx-cnv-preview .bx-cnv-grid-field-label {
+    position: absolute;
+    right: 0;
+    top: 0;
+}
+
+.bx-cnv-grid-field-messages .bx-def-unit-alert-middle {
+    position:static;
+    display:inline-block;
+    vertical-align:middle;
+}
+
+.bx-cnv-grid-field-messages > span {
+    vertical-align:middle;
+}
+
+.bx-cnv-grid-field-messages {
+    white-space:nowrap;
+}
+
+.bx-cnv-preview .bx-def-unit-info {
+    line-height:1.15em;
+}
+
+.bx-cnv-grid-preview div {
+    white-space:nowrap;
+    text-overflow:ellipsis;
+    overflow:hidden;
+    line-height:1.4em;
+}

+ 4 - 0
modules/boonex/convos/updates/8.0.4_8.0.5/source/template/message_label.html

@@ -0,0 +1,4 @@
+
+<bx_if:unread_messages><div class="bx-cnv-grid-field-label bx-def-margin-thd-left bx-def-unit-alert-middle bg-col-blue2-dark">__unread_messages__</div></bx_if:unread_messages>
+<bx_if:viewer_is_last_replier><div class="bx-cnv-grid-field-label bx-def-margin-thd-left"><i title="<bx_text_attribute:_bx_cnv_you_are_last_replier />" class="sys-icon reply bx-def-font-grayed"></i></div></bx_if:viewer_is_last_replier>
+<bx_if:is_read_by_all><div class="bx-cnv-grid-field-label bx-def-margin-thd-left"><i title="<bx_text_attribute:_bx_cnv_read_by_all />" class="sys-icon check bx-def-font-grayed"></i></div></bx_if:is_read_by_all>

+ 46 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/install/config.php

@@ -0,0 +1,46 @@
+<?php
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ */
+
+$aConfig = array(
+    /**
+     * Main Section.
+     */
+    'title' => 'Developer',
+    'version_from' => '8.0.5',
+	'version_to' => '8.0.6',
+    'vendor' => 'BoonEx',
+
+	'compatible_with' => array(
+        '8.0.0.A11'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/developer/updates/update_8.0.5_8.0.6/',
+	'home_uri' => 'developer_update_805_806',
+
+	'module_dir' => 'boonex/developer/',
+	'module_uri' => 'developer',
+
+    'db_prefix' => 'bx_dev_',
+    'class_prefix' => 'BxDev',
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+		'execute_sql' => 1,
+        'update_files' => 1,
+        'update_languages' => 1,
+		'clear_db_cache' => 1,
+    ),
+
+	/**
+     * Category for language keys.
+     */
+    'language_category' => 'BoonEx Developer',
+);

+ 13 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/install/installer.php

@@ -0,0 +1,13 @@
+<?php
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ */
+
+class BxDevUpdater extends BxDolStudioUpdater
+{
+    function __construct($aConfig)
+	{
+        parent::__construct($aConfig);
+    }
+}

+ 6 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/install/langs/en.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+	<string_add name="_bx_dev_bp_txt_sys_block_title_system"><![CDATA[Title System]]></string_add>
+    <string_add name="_bx_dev_bp_txt_block_title_system"><![CDATA[Title System]]></string_add>
+    <string_add name="_bx_dev_bp_err_block_title_system"><![CDATA[You need to enter a value here]]></string_add>
+</resources>

+ 11 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/install/sql/install.sql

@@ -0,0 +1,11 @@
+SET @sName = 'bx_developer';
+
+-- FORMS
+DELETE FROM `sys_form_inputs` WHERE `object`='bx_developer_bp_block' AND `name`='title_system';
+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, '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);
+
+
+DELETE FROM `sys_form_display_inputs` WHERE `display_name`='bx_developer_bp_block_edit' AND `input_name`='title_system';
+INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
+('bx_developer_bp_block_edit', 'title_system', 2147483647, 1, 4);

+ 423 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevBuilderPage.php

@@ -0,0 +1,423 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxDevBuilderPage extends BxTemplStudioBuilderPage
+{
+    protected $sActionPageExport = 'page_export';
+
+    protected $oModule;
+    protected $aParams;
+
+    function __construct($aParams)
+    {
+        parent::__construct(isset($aParams['type']) ? $aParams['type'] : '',  isset($aParams['page']) ? $aParams['page'] : '');
+
+        $this->aParams = $aParams;
+        $this->sBaseUrl = $this->aParams['url'];
+        $this->sTypeUrl = $this->sBaseUrl . '&bp_type=%s';
+        $this->sPageUrl = $this->sTypeUrl . '&bp_page=%s';
+
+        $this->oModule = BxDolModule::getInstance('bx_developer');
+
+        $this->oModule->_oTemplate->addStudioCss(array('builder_page.css'));
+    }
+
+    function getBlockPanelTop($aParams = array())
+    {
+         return BxBaseStudioPage::getBlockPanelTop(
+            array('panel_top' => $this->oModule->_oTemplate->parseHtmlByName('bp_block_panel_top.html', $this->_getTmplVarsBlockPanelTop()))
+        );
+    }
+
+    protected function actionPageCreate()
+    {
+    	$sFormObject = $this->oModule->_oConfig->getObject('form_bp_page');
+        $sFormDisplay = $this->oModule->_oConfig->getObject('form_display_bp_page_add');
+
+        $oForm = BxDolForm::getObjectInstance($sFormObject, $sFormDisplay, $this->oModule->_oTemplate);
+        $oForm->aFormAttrs['action'] = sprintf($this->sPageUrl, $this->sType, $this->sPage) . '&bp_action=' . $this->sActionPageCreate;
+        $oForm->aInputs['module']['values'] = array_merge(array('' => _t('_bx_dev_bp_txt_select_module')), BxDolStudioUtils::getModules());
+
+        $oForm->aInputs['layout_id']['values'] = array(
+            array('key' => '', 'value' => _t('_bx_dev_bp_txt_page_layout_id_select'))
+        );
+
+        $aLayouts = array();
+        $this->oDb->getLayouts(array('type' => 'all'), $aLayouts, false);
+        foreach($aLayouts as $aLayout)
+            $oForm->aInputs['layout_id']['values'][] = array('key' => $aLayout['id'], 'value' => _t($aLayout['title']));
+
+        $oForm->initChecker();
+        if($oForm->isSubmittedAndValid()) {
+            $sObject = $oForm->getCleanValue('object');
+            $sModule = $oForm->getCleanValue('module');
+
+            if(($iId = (int)$oForm->insert()) != 0)
+                return array('eval' => $this->getPageJsObject() . '.onCreatePage(\'' . $sModule . '\', \'' . $sObject . '\')');
+            else
+                return array('msg' => _t('_bx_dev_bp_err_page_create'));
+        }
+
+        $sContent = BxTemplStudioFunctions::getInstance()->popupBox($this->aHtmlIds['add_popup_id'], _t('_bx_dev_bp_txt_page_create_popup'), $this->oModule->_oTemplate->parseHtmlByName('bp_add_page.html', array(
+            'form_id' => $oForm->aFormAttrs['id'],
+            'form' => $oForm->getCode(true)
+        )));
+
+        return array('popup' => $sContent);
+    }
+
+    protected function actionPageExport()
+    {
+        $sContentInsert = $sContentDelete = "";
+
+        $aPage = array();
+        $this->oDb->getPages(array('type' => 'by_object', 'value' => $this->sPage), $aPage, false);
+        if(empty($aPage) || !is_array($aPage))
+            return array();
+
+        $sContentInsert .= ($this->oModule->_oDb->getQueryInsert('sys_objects_page', array($aPage), "Dumping data for '" . $aPage['object'] . "' page"));
+        $sContentDelete .= ($this->oModule->_oDb->getQueryDelete('sys_objects_page', 'object', array($aPage), "Deleting data for '" . $aPage['object'] . "' page"));
+
+        $aBlocks = array();
+        $this->oDb->getBlocks(array('type' => 'by_object', 'value' => $aPage['object']), $aBlocks, false);
+        $sContentInsert .= $this->oModule->_oDb->getQueryInsert('sys_pages_blocks', $aBlocks, false, array('id', 'name'));
+        $sContentDelete .= $this->oModule->_oDb->getQueryDelete('sys_pages_blocks', 'object', array($aPage), false);
+
+        $aForm = array(
+            'form_attrs' => array(),
+            'inputs' => array (
+                'insert' => array(
+                    'type' => 'textarea',
+                    'name' => 'insert',
+                    'caption' => _t('_bx_dev_bp_txt_page_export_insert'),
+                    'value' => $sContentInsert,
+                ),
+                'delete' => array(
+                    'type' => 'textarea',
+                    'name' => 'delete',
+                    'caption' => _t('_bx_dev_bp_txt_page_export_delete'),
+                    'value' => $sContentDelete,
+                ),
+                'done' => array (
+                    'type' => 'button',
+                    'name' => 'done',
+                    'value' => _t('_bx_dev_bp_btn_page_done'),
+                    'attrs' => array(
+                        'onclick' => "$('.bx-popup-applied:visible').dolPopupHide()",
+                    ),
+                )
+            )
+        );
+        $oForm = new BxTemplStudioFormView($aForm);
+
+        $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-bp-page-export-popup', _t('_bx_dev_bp_txt_page_export_popup', _t($aPage['title'])), $this->oModule->_oTemplate->parseHtmlByName('bp_export.html', array(
+            'content' => $oForm->getCode()
+        )));
+
+        return array('popup' => $sContent);
+    }
+
+    protected function actionBlockEdit()
+    {
+    	$sFormObject = $this->oModule->_oConfig->getObject('form_bp_block');
+        $sFormDisplay = $this->oModule->_oConfig->getObject('form_display_bp_block_edit');
+        
+        $iId = (int)bx_get('id');
+        if(!$iId)
+            return array();
+
+        $aBlock = array();
+        $this->oDb->getBlocks(array('type' => 'by_id', 'value' => $iId), $aBlock, false);
+        if(empty($aBlock) || !is_array($aBlock))
+            return array('msg' => _t('_bx_dev_bp_err_block_not_found'));
+
+        $oForm = BxDolForm::getObjectInstance($sFormObject, $sFormDisplay, $this->oModule->_oTemplate);
+
+        $this->onLoadBlock($oForm, $aBlock);
+
+        $oForm->initChecker($aBlock);
+        if($oForm->isSubmittedAndValid()) {
+            $this->onSaveBlock($oForm, $aBlock);
+
+            if($oForm->update($iId) !== false)
+                return array('eval' => $this->getPageJsObject() . '.onEditBlock(oData)');
+            else
+                return array('msg' => _t('_bx_dev_bp_err_block_edit'));
+        }
+
+        $sContent = BxTemplStudioFunctions::getInstance()->popupBox($this->aHtmlIds['edit_block_popup_id'], _t('_bx_dev_bp_txt_block_edit_popup', _t($aBlock['title'])), $this->oModule->_oTemplate->parseHtmlByName('bp_add_block.html', array(
+            'form_id' => $oForm->aFormAttrs['id'],
+            'form' => $oForm->getCode(true)
+        )));
+
+        return array('popup' => $sContent);
+    }
+
+    protected function actionBlockDelete()
+    {
+        $sJsObject = $this->getPageJsObject();
+        $iId = (int)bx_get('id');
+
+        $aBlock = array();
+        $this->oDb->getBlocks(array('type' => 'by_id', 'value' => $iId), $aBlock, false);
+        if(empty($aBlock) || !is_array($aBlock))
+            return array('msg' => _t('_bx_dev_bp_err_block_not_found'));
+
+        if(!$this->oDb->deleteBlocks(array('type' => 'by_id', 'value' => $iId)))
+            return array('msg' => _t('_bx_dev_bp_err_block_delete'));
+
+        $this->onBlockDelete($aBlock);
+        return array('eval' => $sJsObject . '.onDeleteBlock(' . $iId . ', oData)');
+    }
+
+    protected function getSettingsOptions($aPage = array(), $bCreate = true, $bInputsOnly = false)
+    {
+        $aForm = array(
+            'form_attrs' => array(
+                'id' => 'adm-bp-settings-seo',
+            ),
+            'params' => array (
+                'remove_form' => '1',
+                'csrf' => array(
+                    'disable' => true
+                )
+            ),
+            'inputs' => array(
+                'object'  => array(
+                    'type' => 'text',
+                    'name' => 'object',
+                    'caption' => _t('_bx_dev_bp_txt_page_object'),
+                    'info' => '',
+                    'value' => $this->aPageRebuild['object'],
+                    'required' => '',
+                    'attrs' => array(
+                        'disabled' => 'disabled'
+                    ),
+                )
+            )
+        );
+
+        $aForm['inputs'] += parent::getSettingsOptions($aPage, $bCreate, true);
+
+        $aForm['inputs']['title_system']['type'] = 'text';
+        $aForm['inputs']['title_system']['caption'] = _t('_bx_dev_bp_txt_page_title_system');
+        $aForm['inputs']['title']['type'] = 'text';
+
+        $aUri = array(
+            'uri'  => array(
+                'type' => 'text',
+                'name' => 'uri',
+                'caption' => _t('_bx_dev_bp_txt_page_uri'),
+                'info' => '',
+                'value' => $this->aPageRebuild['uri'],
+                'required' => '',
+                'db' => array (
+                    'pass' => 'Xss',
+                ),
+            )
+        );
+        $aForm['inputs'] = bx_array_insert_before($aUri, $aForm['inputs'], 'url');
+
+        $aForm['inputs']['url']['caption'] = _t('_bx_dev_bp_txt_page_url');
+        $aForm['inputs']['url']['value'] = isset($aPage['url']) ? $aPage['url'] : '';
+        $aForm['inputs']['url']['db'] = array (
+            'pass' => 'Xss',
+        );
+        unset($aForm['inputs']['url']['attrs']['disabled']);
+
+        $aForm['inputs']['deletable'] = array(
+            'type' => 'switcher',
+            'name' => 'deletable',
+            'caption' => _t('_bx_dev_bp_txt_page_deletable'),
+            'info' => '',
+            'value' => '1',
+            'checked' => (int)$this->aPageRebuild['deletable'] == 1,
+            'required' => '',
+            'db' => array (
+                'pass' => 'Int',
+            )
+        );
+        $aForm['inputs']['override_class_name'] = array(
+            'type' => 'text',
+            'name' => 'override_class_name',
+            'caption' => _t('_bx_dev_bp_txt_page_override_class_name'),
+            'info' => '',
+            'value' => $this->aPageRebuild['override_class_name'],
+            'required' => '0',
+            'db' => array (
+                'pass' => 'Xss',
+            )
+        );
+        $aForm['inputs']['override_class_file'] = array(
+            'type' => 'text',
+            'name' => 'override_class_file',
+            'caption' => _t('_bx_dev_bp_txt_page_override_class_file'),
+            'info' => '',
+            'value' => $this->aPageRebuild['override_class_file'],
+            'required' => '0',
+            'db' => array (
+                'pass' => 'Xss',
+            )
+        );
+
+        if($bInputsOnly)
+            return $aForm['inputs'];
+
+        $oForm = new BxTemplStudioFormView($aForm);
+        return $oForm->getCode();
+    }
+
+    protected function getSettingsCache($aPage = array(), $bCreate = true, $bInputsOnly = false)
+    {
+        $aForm = array(
+            'form_attrs' => array(
+                'id' => 'adm-bp-settings-cache',
+            ),
+            'params' => array (
+                'remove_form' => '1',
+                'csrf' => array(
+                    'disable' => true
+                )
+            ),
+            'inputs' => parent::getSettingsCache($aPage, $bCreate, true)
+        );
+
+        unset($aForm['inputs']['cache_lifetime']['attrs']);
+
+        $aForm['inputs']['cache_editable'] = array(
+            'type' => 'switcher',
+            'name' => 'cache_editable',
+            'caption' => _t('_bx_dev_bp_txt_page_cache_editable'),
+            'info' => '',
+            'value' => '1',
+            'checked' => (int)$this->aPageRebuild['cache_editable'] == 1,
+            'required' => '',
+            'db' => array (
+                'pass' => 'Int',
+            )
+        );
+
+        if($bInputsOnly)
+            return $aForm['inputs'];
+
+        $oForm = new BxTemplStudioFormView($aForm);
+        return $oForm->getCode();
+    }
+
+    protected function getBlockModule($aBlock)
+    {
+        return $this->aPageRebuild['module'];
+    }
+
+    protected function getBlockContent($aBlock)
+    {
+        $aFields = array();
+
+        switch($aBlock['type']) {
+            case BX_DOL_STUDIO_BP_BLOCK_SERVICE:
+                $aFields = array(
+                    'content' => array(
+                        'type' => 'textarea',
+                        'name' => 'content',
+                        'caption' => _t('_bx_dev_bp_txt_block_content_service'),
+                        'info' => '',
+                        'value' => $aBlock['content'],
+                        'required' => '0',
+                        'db' => array (
+                            'pass' => 'Xss',
+                        ),
+                    )
+                );
+                break;
+
+            default:
+                $aFields = parent::getBlockContent($aBlock);
+                break;
+        }
+
+        return $aFields;
+    }
+
+    protected function getBlocks($sModule)
+    {
+        $aBlocks = parent::getBlocks($sModule);
+
+        if($sModule == BX_DOL_STUDIO_BP_SKELETONS) {
+            $aBlock = array();
+            $this->oDb->getBlocks(array('type' => 'skeleton_by_type', 'value' => 'service'), $aBlock, false);
+            if(!empty($aBlock) && is_array($aBlock))
+                $aBlocks[] = $aBlock;
+        }
+
+        return $aBlocks;
+    }
+
+    protected function onLoadBlock(&$oForm, &$aBlock)
+    {
+        $oForm->aFormAttrs['action'] = sprintf($this->sPageUrl, $this->sType, $this->sPage) . '&bp_action=' . $this->sActionBlockEdit;
+        $oForm->aInputs['module']['values'] = array_merge(array('' => _t('_bx_dev_bp_txt_select_module')), BxDolStudioUtils::getModules());
+
+        $aDBoxes = array();
+        $this->oDb->getDesignBoxes(array('type' => 'ordered'), $aDBoxes, false);
+        foreach($aDBoxes as $aDBox)
+            $oForm->aInputs['designbox_id']['values'][] = array('key' => $this->sSelectKeyPrefix . $aDBox['id'], 'value' => _t($aDBox['title']));
+
+        $oForm->aInputs['visible_for']['value'] = $aBlock['visible_for_levels'] == BX_DOL_INT_MAX ? BX_DOL_STUDIO_VISIBLE_ALL : BX_DOL_STUDIO_VISIBLE_SELECTED;
+        $oForm->aInputs['visible_for']['values'] = array(
+            array('key' => BX_DOL_STUDIO_VISIBLE_ALL, 'value' => _t('_bx_dev_bp_txt_block_visible_for_all')),
+            array('key' => BX_DOL_STUDIO_VISIBLE_SELECTED, 'value' => _t('_bx_dev_bp_txt_block_visible_for_selected')),
+        );
+        $oForm->aInputs['visible_for']['attrs']['onchange'] = $this->getPageJsObject() . '.onChangeVisibleFor(this)';
+
+        $oForm->aInputs['visible_for_levels']['tr_attrs']['style'] = $aBlock['visible_for_levels'] == BX_DOL_INT_MAX ? 'display:none' : '';
+        BxDolStudioUtils::getVisibilityValues($aBlock['visible_for_levels'], $oForm->aInputs['visible_for_levels']['values'], $oForm->aInputs['visible_for_levels']['value']);
+        $aBlock['visible_for_levels'] = $oForm->aInputs['visible_for_levels']['value'];
+
+        $oForm->aInputs = $this->addInArray($oForm->aInputs, 'visible_for_levels', $this->getBlockContent($aBlock));
+
+        $oForm->aInputs['controls'][0]['value'] = _t('_bx_dev_bp_btn_block_save');
+        $oForm->aInputs['controls'][2]['attrs']['onclick'] = $this->getPageJsObject() . ".deleteBlock(" . $aBlock['id'] . ")";
+
+        if($aBlock['type'] == BX_DOL_STUDIO_BP_BLOCK_SERVICE)
+            $aBlock['content'] = BxDevFunctions::unserializeString($aBlock['content']);
+
+        if((int)$aBlock['designbox_id'] != 0)
+            $aBlock['designbox_id'] = $this->sSelectKeyPrefix . $aBlock['designbox_id'];
+    }
+
+    protected function onSaveBlock(&$oForm, &$aBlock)
+    {
+        parent::onSaveBlock($oForm, $aBlock);
+
+        if($aBlock['type'] == BX_DOL_STUDIO_BP_BLOCK_SERVICE && isset($oForm->aInputs['content'])) {
+            $sValue = $oForm->getCleanValue('content');
+            $sValue = BxDevFunctions::serializeString($sValue);
+            BxDolForm::setSubmittedValue('content', $sValue, $oForm->aFormAttrs['method']);
+        }
+    }
+
+    protected function _getTmplVarsBlockPanelTopActions()
+    {
+        $sJsObject = $this->getPageJsObject();
+
+        $oPermalinks = BxDolPermalinks::getInstance();
+
+        return array(
+            'js_object' => $sJsObject,
+            'url_view' => BX_DOL_URL_ROOT . $oPermalinks->permalink($this->aPageRebuild['url']),
+            'action_page_export' => $this->sActionPageExport,
+            'action_page_edit' => $this->sActionPageEdit,
+            'action_block_create' => $this->sActionBlockCreate,
+        );
+    }
+}
+
+/** @} */

+ 105 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevConfig.php

@@ -0,0 +1,105 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+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',
+
+        	//--- 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',
+
+	        //--- 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;
+    }
+}
+
+/** @} */

+ 70 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevDb.php

@@ -0,0 +1,70 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxDevDb extends BxDolModuleDb
+{
+    function __construct(&$oConfig)
+    {
+        parent::__construct($oConfig);
+    }
+
+    function getQueryInsert($sTable, $aItems, $mixedComment = false, $aExclude = array('id'))
+    {
+        $bFirst = true;
+        $sContent = $sComment = "";
+        foreach($aItems as $aItem) {
+            foreach($aExclude as $sKey)
+                if(isset($aItem[$sKey]))
+                    unset($aItem[$sKey]);
+
+            $aKeys = array_keys($aItem);
+            $aValues = array_values($aItem);
+            $iValues = count($aValues);
+
+            foreach ($aValues as $iKey => $sValue)
+                $aValues[$iKey] = BxDevFunctions::dbAddSlashes($sValue, true);
+
+            if($bFirst) {
+                $sContent .= "INSERT INTO `" . $sTable . "`(`" . implode("`, `", $aKeys) . "`) VALUES \n";
+                $bFirst = false;
+            }
+
+            $sSql = "(" . implode(", ", array_fill(0, $iValues, "?")) . "),\n";
+            $sSql = call_user_func_array(array($this, 'prepare'), array_merge(array($sSql), $aValues));
+
+            $sContent .= $sSql;
+        }
+        $sContent = substr($sContent, 0, -2) . ";\n\n";
+
+        if($mixedComment === true || (is_string($mixedComment) && $mixedComment != ''))
+            $sComment = "--\n-- " . ($mixedComment === true ? "Dumping data for table `" . $sTable . "`" : $mixedComment) . "\n--\n";
+
+        return $sComment . $sContent;
+    }
+
+    function getQueryDelete($sTable, $sKey, $aItems, $mixedComment = false)
+    {
+        $sContent = $sComment = "";
+        foreach($aItems as $aItem)
+            if(isset($aItem[$sKey])) {
+                $sSql = "DELETE FROM `" . $sTable . "` WHERE `" . $sKey . "`=?;\n";
+                $sContent .= call_user_func_array(array($this, 'prepare'), array($sSql, $aItem[$sKey]));
+            }
+        $sContent .= "\n";
+
+        if($mixedComment === true || (is_string($mixedComment) && $mixedComment != ''))
+            $sComment = "--\n-- " . ($mixedComment === true ? "Delete data from table `" . $sTable . "`" : $mixedComment) . "\n--\n";
+
+        return $sComment . $sContent;
+    }
+}
+
+/** @} */

+ 20 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevFormView.php

@@ -0,0 +1,20 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxDevFormView extends BxTemplStudioFormView
+{
+    function __construct($aInfo, $oTemplate = false)
+    {
+        parent::__construct($aInfo, $oTemplate);
+    }
+}
+
+/** @} */

+ 39 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevForms.php

@@ -0,0 +1,39 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+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'),
+        );
+
+        $this->oModule->_oTemplate->addStudioCss(array('forms.css'));
+    }
+}
+
+/** @} */

+ 144 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevFormsDisplays.php

@@ -0,0 +1,144 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxDevFormsDisplays extends BxTemplStudioFormsDisplays
+{
+    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=displays';
+        $this->sUrlViewFields = BX_DOL_URL_STUDIO . 'module.php?name=' . $this->oModule->_oConfig->getName() . '&page=forms&form_page=fields&form_module=%s&form_object=%s&form_display=%s';
+
+        $sModule = bx_get('form_module');
+        if(!empty($sModule)) {
+            $this->sModule = bx_process_input($sModule);
+            $this->_aQueryAppend['module'] = $this->sModule;
+        }
+
+        $sObject = bx_get('form_object');
+        if(!empty($sObject)) {
+            $this->sObject = bx_process_input($sObject);
+            $this->_aQueryAppend['object'] = $this->sObject;
+        }
+    }
+
+    public function performActionAdd()
+    {
+        $sAction = 'add';
+        $sFormObject = $this->oModule->_oConfig->getObject('form_forms_display');
+        $sFormDisplay = $this->oModule->_oConfig->getObject('form_display_forms_display_add');
+
+        $oForm = BxDolForm::getObjectInstance($sFormObject, $sFormDisplay, $this->oModule->_oTemplate);
+        $this->_fillDisplayForm($oForm, $sAction);
+
+        $oForm->initChecker();
+        if($oForm->isSubmittedAndValid()) {
+            $sName = uriGenerate($oForm->getCleanValue('display_name'), 'sys_form_displays', 'display_name', 'display');
+            BxDolForm::setSubmittedValue('display_name', $sName, $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_displays_create'));
+
+            $this->_echoResultJson($aRes, true);
+        } else {
+            $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-frm-display-create-popup', _t('_bx_dev_frm_txt_displays_create_popup'), $this->_oTemplate->parseHtmlByName('form_add_display.html', array(
+                'form_id' => $oForm->aFormAttrs['id'],
+                'form' => $oForm->getCode(true),
+                'object' => $this->_sObject,
+                'action' => $sAction
+            )));
+
+            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+        }
+    }
+
+    public function performActionEdit()
+    {
+        $sAction = 'edit';
+        $sFormObject = $this->oModule->_oConfig->getObject('form_forms_display');
+        $sFormDisplay = $this->oModule->_oConfig->getObject('form_display_forms_display_edit');
+
+        $aIds = bx_get('ids');
+        if(!$aIds || !is_array($aIds)) {
+            $iId = (int)bx_get('id');
+            if(!$iId) {
+                $this->_echoResultJson(array());
+                exit;
+            }
+
+            $aIds = array($iId);
+        }
+
+        $iId = $aIds[0];
+
+        $aDisplay = array();
+        $iDisplay = $this->oDb->getDisplays(array('type' => 'by_id', 'value' => $iId), $aDisplay);
+        if($iDisplay != 1 || empty($aDisplay)){
+            $this->_echoResultJson(array());
+            exit;
+        }
+
+        $oForm = BxDolForm::getObjectInstance($sFormObject, $sFormDisplay, $this->oModule->_oTemplate);
+
+        $this->_fillDisplayForm($oForm, $sAction);
+        $oForm->aInputs['controls'][0]['value'] = _t('_bx_dev_frm_btn_displays_save');
+
+        $oForm->initChecker($aDisplay);
+        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_displays_edit'));
+
+            $this->_echoResultJson($aRes, true);
+        } else {
+            $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-frm-display-edit-popup', _t('_bx_dev_frm_txt_displays_edit_popup', _t($aDisplay['title'])), $this->_oTemplate->parseHtmlByName('form_add_display.html', array(
+                'form_id' => $oForm->aFormAttrs['id'],
+                'form' => $oForm->getCode(true),
+                'object' => $this->_sObject,
+                'action' => $sAction
+            )));
+
+            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+        }
+    }
+
+    protected function _getActionAdd($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
+    {
+        if($this->sObject == '')
+            $isDisabled = true;
+
+        return  parent::_getActionDefault($sType, $sKey, $a, false, $isDisabled, $aRow);
+    }
+
+    protected function _fillDisplayForm(&$oForm, $sAction)
+    {
+        $oForm->aFormAttrs['action'] = BX_DOL_URL_ROOT . 'grid.php?o=' . $this->_sObject . '&a=' . $sAction . '&object=' . $this->sObject;
+        $oForm->aInputs['module']['values'] = array_merge(array('' => _t('_bx_dev_frm_txt_select_module')), BxDolStudioUtils::getModules());
+        $oForm->aInputs['module']['value'] = $this->sModule;
+
+        $aForms = array();
+        $this->oDb->getForms(array('type' => 'by_module', 'value' => $this->sModule), $aForms, false);
+        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']);
+        $oForm->aInputs['object']['value'] = $this->sObject;
+    }
+}
+/** @} */

+ 275 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevFormsField.php

@@ -0,0 +1,275 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+require_once('BxDevFunctions.php');
+
+class BxDevFormsField extends BxTemplStudioFormsField
+{
+    function __construct($aParams = array(), $aField = array())
+    {
+        parent::__construct($aParams, $aField);
+    }
+}
+
+class BxDevFormsFieldBlockHeader extends BxTemplStudioFormsFieldBlockHeader
+{
+    function __construct($aParams = array(), $aField = array())
+    {
+        parent::__construct($aParams, $aField);
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldValue extends BxTemplStudioFormsFieldValue
+{
+    function __construct($aParams = array(), $aField = array())
+    {
+        parent::__construct($aParams, $aField);
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldText extends BxTemplStudioFormsFieldText
+{
+    function __construct($aParams = array(), $aField = array())
+    {
+        parent::__construct($aParams, $aField);
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldPassword extends BxTemplStudioFormsFieldPassword
+{
+    function __construct($aParams = array(), $aField = array())
+    {
+        parent::__construct($aParams, $aField);
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldTextarea extends BxTemplStudioFormsFieldTextarea
+{
+    function __construct($aParams = array(), $aField = array())
+    {
+        parent::__construct($aParams, $aField);
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldNumber extends BxTemplStudioFormsFieldNumber
+{
+    function __construct($aParams = array(), $aField = array())
+    {
+        parent::__construct($aParams, $aField);
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldDatepicker extends BxTemplStudioFormsFieldDatepicker
+{
+    function __construct($aParams = array(), $aField = array())
+    {
+        parent::__construct($aParams, $aField);
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldDatetime extends BxTemplStudioFormsFieldDatetime
+{
+    function __construct($aParams = array(), $aField = array())
+    {
+        parent::__construct($aParams, $aField);
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldCheckbox extends BxTemplStudioFormsFieldCheckbox
+{
+    function __construct($aParams = array(), $aField = array())
+    {
+        parent::__construct($aParams, $aField);
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+
+        $this->aForm['inputs']['value']['type'] = 'text';
+    }
+}
+
+class BxDevFormsFieldSwitcher extends BxTemplStudioFormsFieldSwitcher
+{
+    function __construct($aParams = array(), $aField = array())
+    {
+        parent::__construct($aParams, $aField);
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+
+        $this->aForm['inputs']['value']['type'] = 'text';
+    }
+}
+
+class BxDevFormsFieldFile extends BxTemplStudioFormsFieldFile
+{
+    function __construct($aParams = array(), $aField = array())
+    {
+        parent::__construct($aParams, $aField);
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldSlider extends BxTemplStudioFormsFieldSlider
+{
+    function __construct($aParams = array(), $aField = array())
+    {
+        parent::__construct($aParams, $aField);
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldDoublerange extends BxTemplStudioFormsFieldDoublerange
+{
+    function __construct($aParams = array(), $aField = array())
+    {
+        parent::__construct($aParams, $aField);
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldHidden extends BxTemplStudioFormsFieldHidden
+{
+    function __construct($aParams = array(), $aField = array())
+    {
+        parent::__construct($aParams, $aField);
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldButton extends BxTemplStudioFormsFieldButton
+{
+    function __construct($aParams = array(), $aField = array())
+    {
+        parent::__construct($aParams, $aField);
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldReset extends BxTemplStudioFormsFieldReset
+{
+    function __construct($aParams = array(), $aField = array())
+    {
+        parent::__construct($aParams, $aField);
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldSubmit extends BxTemplStudioFormsFieldSubmit
+{
+    function __construct($aParams = array(), $aField = array())
+    {
+        parent::__construct($aParams, $aField);
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldImage extends BxTemplStudioFormsFieldImage
+{
+    function __construct($aParams = array(), $aField = array())
+    {
+        parent::__construct($aParams, $aField);
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldSelect extends BxTemplStudioFormsFieldSelect
+{
+    function __construct($aParams = array(), $aField = array())
+    {
+        parent::__construct($aParams, $aField);
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldSelectMultiple extends BxTemplStudioFormsFieldSelectMultiple
+{
+    function __construct($aParams = array(), $aField = array())
+    {
+        parent::__construct($aParams, $aField);
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldCheckboxSet extends BxTemplStudioFormsFieldCheckboxSet
+{
+    function __construct($aParams = array(), $aField = array())
+    {
+        parent::__construct($aParams, $aField);
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldRadioSet extends BxTemplStudioFormsFieldRadioSet
+{
+    function __construct($aParams = array(), $aField = array())
+    {
+        parent::__construct($aParams, $aField);
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldCustom extends BxTemplStudioFormsFieldCustom
+{
+    function __construct($aParams = array(), $aField = array())
+    {
+        parent::__construct($aParams, $aField);
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldInputSet extends BxTemplStudioFormsFieldInputSet
+{
+    function __construct($aParams = array(), $aField = array())
+    {
+        parent::__construct($aParams, $aField);
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+
+class BxDevFormsFieldCaptcha extends BxTemplStudioFormsFieldCaptcha
+{
+    function __construct($aParams = array(), $aField = array())
+    {
+        parent::__construct($aParams, $aField);
+
+        BxDevFunctions::changeFormField($this->aParams, $this->aForm['inputs'], $this->oDb);
+    }
+}
+/** @} */

+ 46 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevFormsFields.php

@@ -0,0 +1,46 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+require_once('BxDevFormsField.php');
+
+class BxDevFormsFields extends BxTemplStudioFormsFields
+{
+    protected $oModule;
+
+    function __construct($aOptions, $oTemplate = false)
+    {
+        parent::__construct($aOptions, $oTemplate);
+
+        $this->oModule = BxDolModule::getInstance('bx_developer');
+        $this->sClass = 'BxDevFormsField';
+        $this->sUrlPage = BX_DOL_URL_STUDIO . 'module.php?name=' . $this->oModule->_oConfig->getName() . '&page=forms&form_page=fields';
+
+        $sModule = bx_get('form_module');
+        if(!empty($sModule)) {
+            $this->sModule = bx_process_input($sModule);
+            $this->_aQueryAppend['module'] = $this->sModule;
+        }
+
+        $sObject = bx_get('form_object');
+        if(!empty($sObject)) {
+            $this->sObject = bx_process_input($sObject);
+            $this->_aQueryAppend['object'] = $this->sObject;
+        }
+
+        $sDisplay = bx_get('form_display');
+        if(!empty($sDisplay)) {
+            $this->sDisplay = bx_process_input($sDisplay);
+            $this->_aQueryAppend['display'] = $this->sDisplay;
+        }
+    }
+}
+
+/** @} */

+ 183 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevFormsForms.php

@@ -0,0 +1,183 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+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'));
+
+            $this->_echoResultJson($aRes, true);
+        } 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
+            )));
+
+            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+        }
+    }
+
+    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) {
+                $this->_echoResultJson(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)){
+            $this->_echoResultJson(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()) {
+            $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'));
+
+            $this->_echoResultJson($aRes, true);
+        } 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
+            )));
+
+            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+        }
+    }
+
+    public function performActionExport()
+    {
+        $sContentInsert = $sContentDelete = "";
+
+        $aForm = $this->_getItem('getForms');
+        if($aForm === false) {
+            $this->_echoResultJson(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()
+        )));
+
+        $this->_echoResultJson(array('popup' => $sContent), true);
+    }
+}
+/** @} */

+ 166 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevFormsPreLists.php

@@ -0,0 +1,166 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxDevFormsPreLists extends BxTemplStudioFormsPreLists
+{
+    protected $oModule;
+
+    function __construct($aOptions, $oTemplate = false)
+    {
+        parent::__construct($aOptions, $oTemplate);
+
+        $this->oModule = BxDolModule::getInstance('bx_developer');
+        $this->sUrlViewValues = BX_DOL_URL_STUDIO . 'module.php?name=' . $this->oModule->_oConfig->getName() . '&page=forms&form_page=pre_values&form_module=%s&form_list=%s';
+    }
+
+    public function performActionAdd()
+    {
+        $sAction = 'add';
+        $sFormObject = $this->oModule->_oConfig->getObject('form_forms_prelist');
+        $sFormDisplay = $this->oModule->_oConfig->getObject('form_display_forms_prelist_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('key'), 'sys_form_pre_lists', 'key', 'key');
+            BxDolForm::setSubmittedValue('key', $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_prelists_create'));
+
+            $this->_echoResultJson($aRes, true);
+        } else {
+            $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-frm-prelist-create-popup', _t('_bx_dev_frm_txt_prelists_create_popup'), $this->oModule->_oTemplate->parseHtmlByName('form_add_list.html', array(
+                'form_id' => $oForm->aFormAttrs['id'],
+                'form' => $oForm->getCode(true),
+                'object' => $this->_sObject,
+                'action' => $sAction
+            )));
+
+            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+        }
+    }
+
+    public function performActionEdit()
+    {
+        $sAction = 'edit';
+        $sFormObject = $this->oModule->_oConfig->getObject('form_forms_prelist');
+        $sFormDisplay = $this->oModule->_oConfig->getObject('form_display_forms_prelist_edit');
+
+        $aList = $this->_getItem('getLists');
+        if($aList === false) {
+            $this->_echoResultJson(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_prelists_save');
+
+        $oForm->initChecker($aList);
+        if($oForm->isSubmittedAndValid()) {
+            if($oForm->update($aList['id']) !== false)
+                $aRes = array('grid' => $this->getCode(false), 'blink' => $aList['id']);
+            else
+                $aRes = array('msg' => _t('_bx_dev_frm_err_prelists_edit'));
+
+            $this->_echoResultJson($aRes, true);
+        } else {
+            $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-frm-prelist-edit-popup', _t('_bx_dev_frm_txt_prelists_edit_popup', _t($aList['title'])), $this->oModule->_oTemplate->parseHtmlByName('form_add_list.html', array(
+                'form_id' => $oForm->aFormAttrs['id'],
+                'form' => $oForm->getCode(true),
+                'object' => $this->_sObject,
+                'action' => $sAction
+            )));
+
+            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+        }
+    }
+
+    public function performActionExport()
+    {
+        $sContentInsert = $sContentDelete = "";
+
+        $aIds = bx_get('ids');
+        if(!$aIds || !is_array($aIds)) {
+            $iId = (int)bx_get('id');
+            if(!$iId) {
+                $this->_echoResultJson(array());
+                exit;
+            }
+
+            $aIds = array($iId);
+        }
+
+        $iId = $aIds[0];
+
+        $aList = array();
+        $this->oDb->getLists(array('type' => 'by_id', 'value' => $iId), $aList, false);
+        if(!is_array($aList) || empty($aList)){
+            $this->_echoResultJson(array());
+            exit;
+        }
+
+        $sContentInsert .= ($this->oModule->_oDb->getQueryInsert('sys_form_pre_lists', array($aList), "Dumping data for '" . $aList['key'] . "' data list"));
+        $sContentDelete .= ($this->oModule->_oDb->getQueryDelete('sys_form_pre_lists', 'key', array($aList), "Deleting data for '" . $aList['key'] . "' data list"));
+
+        $aValues = array();
+        $this->oDb->getValues(array('type' => 'by_key', 'value' => $aList['key']), $aValues, false);
+        $sContentInsert .= $this->oModule->_oDb->getQueryInsert('sys_form_pre_values', $aValues, false, array('id', 'key', 'value', 'lkey', 'lkey2', 'order'));
+        $sContentDelete .= $this->oModule->_oDb->getQueryDelete('sys_form_pre_values', 'Key', array(array('Key' => $aList['key'])), false);
+
+        $aFormStructure = array(
+            'form_attrs' => array(),
+            'inputs' => array (
+                'insert' => array(
+                    'type' => 'textarea',
+                    'name' => 'insert',
+                    'caption' => _t('_bx_dev_frm_txt_prelists_export_insert'),
+                    'value' => $sContentInsert,
+                ),
+                'delete' => array(
+                    'type' => 'textarea',
+                    'name' => 'delete',
+                    'caption' => _t('_bx_dev_frm_txt_prelists_export_delete'),
+                    'value' => $sContentDelete,
+                ),
+                'done' => array (
+                    'type' => 'button',
+                    'name' => 'done',
+                    'value' => _t('_bx_dev_frm_btn_prelists_done'),
+                    'attrs' => array(
+                        'onclick' => "$('.bx-popup-applied:visible').dolPopupHide()",
+                    ),
+                )
+            )
+        );
+        $oForm = new BxTemplStudioFormView($aFormStructure);
+
+        $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-frm-prelist-export-popup', _t('_bx_dev_frm_txt_prelists_export_popup', _t($aList['title'])), $this->oModule->_oTemplate->parseHtmlByName('form_export.html', array(
+            'content' => $oForm->getCode()
+        )));
+
+        $this->_echoResultJson(array('popup' => $sContent), true);
+    }
+
+    protected function _canDelete($aList)
+    {
+        return true;
+    }
+}
+
+/** @} */

+ 157 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevFormsPreValues.php

@@ -0,0 +1,157 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+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'));
+
+            $this->_echoResultJson($aRes, true);
+        } 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
+            )));
+
+            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+        }
+    }
+
+    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) {
+            $this->_echoResultJson(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'));
+
+            $this->_echoResultJson($aRes, true);
+        } 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
+            )));
+
+            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+        }
+    }
+
+    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)) {
+                    $this->_echoResultJson(array('msg' => _t('_bx_dev_frm_err_prevalues_create_forbidden', BX_DOL_STUDIO_FIELD_PRE_VALUE_INT_MAX)), true);
+                    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));
+    }
+}
+/** @} */

+ 91 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevFunctions.php

@@ -0,0 +1,91 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxDevFunctions
+{
+    function __construct() {}
+
+    /*
+     * Is needed to change fields in "Form's Field" creation form.
+     *
+     * @see BxDevFormsField
+     */
+    public static function changeFormField($aParams, &$aInputs, &$oDb)
+    {
+        $aInputs['module']['type'] = 'select';
+        $aInputs['module']['values'] = array_merge(array('' => _t('_bx_dev_frm_txt_select_module')), BxDolStudioUtils::getModules());
+        $aInputs['module']['value'] = $aParams['module'];
+
+        $aForms = array();
+        $oDb->getForms(array('type' => 'by_module', 'value' => $aParams['module']), $aForms, false);
+        foreach($aForms as $aForm)
+            $aInputs['object']['values'][$aForm['object']] = _t($aForm['title']);
+        asort($aInputs['object']['values']);
+
+        $aInputs['object']['type'] = 'select';
+        $aInputs['object']['values'] = array_merge(array('' => _t('_bx_dev_frm_txt_select_object')), $aInputs['object']['values']);
+        $aInputs['object']['value'] = $aParams['object'];
+
+        $sTrlTypePostfix = '_translatable';
+        $sTrlCheckFuncPostfix = 'Translatable';
+        foreach($aInputs as $sName => $aInput)
+            if(isset($aInput['type']) && stripos($aInput['type'], $sTrlTypePostfix) !== false) {
+                $aInputs[$sName]['type'] = str_ireplace($sTrlTypePostfix, '', $aInput['type']);
+
+                if(isset($aInput['checker']['func']) && stripos($aInput['checker']['func'], $sTrlCheckFuncPostfix) !== false)
+                    $aInputs[$sName]['checker']['func'] = str_ireplace($sTrlCheckFuncPostfix, '', $aInput['checker']['func']);
+            }
+    }
+
+    public static function serializeString($sValue)
+    {
+        if(empty($sValue))
+            return '';
+
+        $aValue = array();
+        @eval("\$aValue = " . $sValue . ";");
+        if(empty($aValue) || !is_array($aValue))
+            return '';
+
+        return serialize($aValue);
+    }
+
+    public static function unserializeString($sValue)
+    {
+        if(empty($sValue))
+            return '';
+
+        $aValue = @unserialize($sValue);
+        if(empty($aValue) || !is_array($aValue))
+            return '';
+
+        return var_export($aValue, true);
+    }
+
+    /**
+     * Add slashes before "'" and "\" characters that the value containing them can be used in export feature.
+     *
+     * @param  string  $sString       - the input string to add slashes
+     * @param  boolean $bDoubleEscape - whether the string needs to be two more escaped or not
+     * @return string  the slashed string
+     */
+    public static function dbAddSlashes($sString = '', $bDoubleEscape = false)
+    {
+        if ($bDoubleEscape)
+            $sString = str_replace('\\', '\\\\\\\\', $sString);
+        else
+            $sString = str_replace('\\', '\\\\', $sString);
+
+        return str_replace('\'', '\\\'', $sString);
+    }
+}
+
+/** @} */

+ 98 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevModule.php

@@ -0,0 +1,98 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+require_once('BxDevFunctions.php');
+
+define('BX_DEV_TOOLS_SETTINGS', 'settings');
+define('BX_DEV_TOOLS_FORMS', 'forms');
+define('BX_DEV_TOOLS_PAGES', 'pages');
+define('BX_DEV_TOOLS_NAVIGATION', 'navigation');
+define('BX_DEV_TOOLS_POLYGLOT', 'polyglot');
+define('BX_DEV_TOOLS_PERMISSIONS', 'permissions');
+
+class BxDevModule extends BxDolModule
+{
+    public $aTools;
+
+    function __construct($aModule)
+    {
+        parent::__construct($aModule);
+
+        $this->aTools = array(
+            array('name' => BX_DEV_TOOLS_SETTINGS, 'title' => '', 'icon' => 'cogs'),
+            array('name' => BX_DEV_TOOLS_FORMS, 'title' => '', 'icon' => 'bx-dev-mi-forms.png'),
+            array('name' => BX_DEV_TOOLS_NAVIGATION, 'title' => '', 'icon' => 'bx-dev-mi-navigation.png'),
+            array('name' => BX_DEV_TOOLS_PAGES, 'title' => '', 'icon' => 'bx-dev-mi-pages.png'),
+            array('name' => BX_DEV_TOOLS_POLYGLOT, 'title' => '', 'icon' => 'bx-dev-mi-polyglot.png'),
+            //array('name' => BX_DEV_TOOLS_PERMISSIONS, 'title' => '', 'icon' => 'bx-dev-mi-permissions.png'),
+        );
+    }
+
+    function getToolsList()
+    {
+        return $this->aTools;
+    }
+
+    public function actionResetHash($sType) {
+    	$oDb = bx_instance('BxDolStudioInstallerQuery');
+
+    	$sResult = '';
+    	switch ($sType) {
+    		case 'system':
+    			$oHasher = bx_instance('BxDolInstallerHasher');
+
+    			$oDb->deleteModuleTrackFiles(BX_SYSTEM_MODULE_ID);
+
+    			$sResult = _t('_bx_dev_hash_' . ($oHasher->hashSystemFiles() ? 'msg' : 'err') . '_reset_hash_system');    			
+    			break;
+
+    		case 'modules':
+				$aModules = BxDolModuleQuery::getInstance()->getModules();
+
+				$aTmplVarsModules = array();
+				foreach($aModules as $aModule) {
+					if($aModule['name'] == 'system')
+						continue;
+
+					$aConfig = BxDolInstallerUtils::getModuleConfig($aModule);
+					$sPathInstaller = BX_DIRECTORY_PATH_MODULES . $aModule['path'] . 'install/installer.php';
+					if(empty($aConfig) || !file_exists($sPathInstaller))
+						continue;
+
+					require_once($sPathInstaller);
+
+					$sClassName = $aConfig['class_prefix'] . 'Installer';
+					$oInstaller = new $sClassName($aConfig);
+
+					$oDb->deleteModuleTrackFiles($aModule['id']);
+
+					$aFiles = array();
+				    $oInstaller->hashFiles(BX_DIRECTORY_PATH_ROOT . 'modules/' . $aModule['path'], $aFiles);
+					foreach($aFiles as $aFile)
+				    	$oDb->insertModuleTrack($aModule['id'], $aFile);
+
+					$aTmplVarsModules[] = array(
+						'module' => $aModule['title'],
+						'files' => count($aFiles)
+					);
+				}
+
+				$sResult = $this->_oTemplate->parseHtmlByName('hash_modules.html', array(
+					'bx_repeat:modules' => $aTmplVarsModules
+				));
+				break;
+    	}
+
+    	echo $sResult;
+    	exit;
+    }
+}
+/** @} */

+ 37 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevNavigation.php

@@ -0,0 +1,37 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxDevNavigation extends BxTemplStudioNavigation
+{
+    protected $oModule;
+    protected $aParams;
+    protected $aGridObjects;
+
+    function __construct($aParams)
+    {
+        parent::__construct(isset($aParams['page']) ? $aParams['page'] : '');
+
+        $this->aParams = $aParams;
+        $this->sSubpageUrl = $this->aParams['url'] . '&nav_page=';
+
+        $this->oModule = BxDolModule::getInstance('bx_developer');
+
+        $this->aGridObjects = array(
+	        'menus' => $this->oModule->_oConfig->getObject('grid_nav_menus'),
+	        'sets' => $this->oModule->_oConfig->getObject('grid_nav_sets'),
+	        'items' => $this->oModule->_oConfig->getObject('grid_nav_items')
+	    );
+
+        $this->oModule->_oTemplate->addStudioCss(array('navigation.css'));
+    }
+}
+
+/** @} */

+ 117 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevNavigationItems.php

@@ -0,0 +1,117 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+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'));
+
+            $this->_echoResultJson($aRes, true);
+        } 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
+            )));
+
+            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+        }
+    }
+
+    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) {
+            $this->_echoResultJson(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'));
+
+            $this->_echoResultJson($aRes, true);
+        } 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
+            )));
+
+            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+        }
+    }
+
+    protected function _getActionDelete ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
+    {
+        return  parent::_getActionDefault($sType, $sKey, $a, false, $isDisabled, $aRow);
+    }
+
+    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;
+    }
+}
+/** @} */

+ 175 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevNavigationMenus.php

@@ -0,0 +1,175 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxDevNavigationMenus extends BxTemplStudioNavigationMenus
+{
+    protected $oModule;
+
+    function __construct($aOptions, $oTemplate = false)
+    {
+        parent::__construct($aOptions, $oTemplate);
+
+        $this->_aOptions['actions_single']['export']['attr']['title'] = _t('_bx_dev_nav_btn_menus_gl_export');
+
+        $this->oModule = BxDolModule::getInstance('bx_developer');
+        $this->sUrlViewItems = BX_DOL_URL_STUDIO . 'module.php?name=' . $this->oModule->_oConfig->getName() . '&page=navigation&nav_page=items&nav_module=%s&nav_set=%s';
+    }
+
+    public function performActionAdd()
+    {
+        $sAction = 'add';
+        $sFormObject = $this->oModule->_oConfig->getObject('form_nav_menu');
+        $sFormDisplay = $this->oModule->_oConfig->getObject('form_display_nav_menu_add');
+
+        $oForm = BxDolForm::getObjectInstance($sFormObject, $sFormDisplay, $this->oModule->_oTemplate);
+        $oForm->aFormAttrs['action'] = BX_DOL_URL_ROOT . 'grid.php?o=' . $this->_sObject . '&a=' . $sAction;
+        $this->fillInSelects($oForm->aInputs);
+
+        $oForm->initChecker();
+        if($oForm->isSubmittedAndValid()) {
+            $sObject = uriGenerate($oForm->getCleanValue('object'), 'sys_objects_menu', '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_nav_err_menus_create'));
+
+            $this->_echoResultJson($aRes, true);
+        } else {
+            $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-nav-menu-create-popup', _t('_bx_dev_nav_txt_menus_create_popup'), $this->oModule->_oTemplate->parseHtmlByName('nav_add_menu.html', array(
+                'form_id' => $oForm->aFormAttrs['id'],
+                'form' => $oForm->getCode(true),
+                'object' => $this->_sObject,
+                'action' => $sAction
+            )));
+
+            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+        }
+    }
+
+    public function performActionEdit()
+    {
+        $sAction = 'edit';
+        $sFormObject = $this->oModule->_oConfig->getObject('form_nav_menu');
+        $sFormDisplay = $this->oModule->_oConfig->getObject('form_display_nav_menu_edit');
+
+        $aMenu = $this->_getItem('getMenus');
+        if($aMenu === false) {
+            $this->_echoResultJson(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['controls'][0]['value'] = _t('_bx_dev_nav_btn_menus_save');
+        $this->fillInSelects($oForm->aInputs);
+
+        $oForm->initChecker($aMenu);
+        if($oForm->isSubmittedAndValid()) {
+            if($oForm->update($aMenu['id']) !== false)
+                $aRes = array('grid' => $this->getCode(false), 'blink' => $aMenu['id']);
+            else
+                $aRes = array('msg' => _t('_bx_dev_nav_err_menus_edit'));
+
+            $this->_echoResultJson($aRes, true);
+        } else {
+            $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-nav-menu-edit-popup', _t('_bx_dev_nav_txt_menus_edit_popup', _t($aMenu['title'])), $this->oModule->_oTemplate->parseHtmlByName('nav_add_menu.html', array(
+                'form_id' => $oForm->aFormAttrs['id'],
+                'form' => $oForm->getCode(true),
+                'object' => $this->_sObject,
+                'action' => $sAction
+            )));
+
+            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+        }
+    }
+
+    public function performActionExport()
+    {
+        $sContentInsert = $sContentDelete = "";
+
+        $aMenu = $this->_getItem('getMenus');
+        if($aMenu === false) {
+            $this->_echoResultJson(array());
+            exit;
+        }
+
+        $sContentInsert .= $this->oModule->_oDb->getQueryInsert('sys_objects_menu', array($aMenu), "Dumping data for '" . $aMenu['object'] . "' menu");
+        $sContentDelete .= $this->oModule->_oDb->getQueryDelete('sys_objects_menu', 'object', array($aMenu), "Deleting data for '" . $aMenu['object'] . "' menu");
+
+        $aSet = array();
+        $this->oDb->getSets(array('type' => 'dump_by_name', 'value' => $aMenu['set_name']), $aSet, false);
+        $sContentInsert .= $this->oModule->_oDb->getQueryInsert('sys_menu_sets', array($aSet), false, array('name'));
+        $sContentDelete .= $this->oModule->_oDb->getQueryDelete('sys_menu_sets', 'set_name', array($aSet), false);
+
+        $aItems = array();
+        $this->oDb->getItems(array('type' => 'by_set_name', 'value' => $aMenu['set_name']), $aItems, false);
+        $sContentInsert .= $this->oModule->_oDb->getQueryInsert('sys_menu_items', $aItems);
+        $sContentDelete .= $this->oModule->_oDb->getQueryDelete('sys_menu_items', 'set_name', array($aSet), false);
+
+        $aFormStructure = array(
+            'form_attrs' => array(),
+            'inputs' => array (
+                'insert' => array(
+                    'type' => 'textarea',
+                    'name' => 'insert',
+                    'caption' => _t('_bx_dev_nav_txt_menus_export_insert'),
+                    'value' => $sContentInsert,
+                ),
+                'delete' => array(
+                    'type' => 'textarea',
+                    'name' => 'delete',
+                    'caption' => _t('_bx_dev_nav_txt_menus_export_delete'),
+                    'value' => $sContentDelete,
+                ),
+                'done' => array (
+                    'type' => 'button',
+                    'name' => 'done',
+                    'value' => _t('_bx_dev_nav_btn_menus_done'),
+                    'attrs' => array(
+                        'onclick' => "$('.bx-popup-applied:visible').dolPopupHide()",
+                    ),
+                )
+            )
+        );
+        $oForm = new BxTemplStudioFormView($aFormStructure);
+
+        $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-nav-menu-export-popup', _t('_bx_dev_nav_txt_menus_export_popup', _t($aMenu['title'])), $this->oModule->_oTemplate->parseHtmlByName('nav_export.html', array(
+            'content' => $oForm->getCode()
+        )));
+
+        $this->_echoResultJson(array('popup' => $sContent), true);
+    }
+
+    private function fillInSelects(&$aInputs)
+    {
+        $aInputs['module']['values'] = array_merge(array('' => _t('_bx_dev_nav_txt_select_module')), BxDolStudioUtils::getModules());
+        $aInputs['set_name']['values'] = array(
+            array('key' => '', 'value' => _t('_bx_dev_nav_txt_menus_set_name_select'))
+        );
+
+        $aSets = array();
+        $this->oDb->getSets(array('type' => 'all'), $aSets, false);
+        foreach($aSets as $sSet)
+            $aInputs['set_name']['values'][] = array('key' => $sSet['name'], 'value' => _t($sSet['title']));
+
+        $aInputs['template_id']['values'] = array(
+            array('key' => '', 'value' => _t('_bx_dev_nav_txt_menus_template_id_select'))
+        );
+
+        $aTemplates = array();
+        $this->oDb->getTemplates(array('type' => 'all'), $aTemplates, false);
+        foreach($aTemplates as $aTemplate)
+            $aInputs['template_id']['values'][] = array('key' => $aTemplate['id'], 'value' => _t($aTemplate['title']));
+    }
+}
+/** @} */

+ 113 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevNavigationSets.php

@@ -0,0 +1,113 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxDevNavigationSets extends BxTemplStudioNavigationSets
+{
+    protected $oModule;
+
+    function __construct($aOptions, $oTemplate = false)
+    {
+        parent::__construct($aOptions, $oTemplate);
+
+        $this->oModule = BxDolModule::getInstance('bx_developer');
+        $this->sUrlViewItems = BX_DOL_URL_STUDIO . 'module.php?name=' . $this->oModule->_oConfig->getName() . '&page=navigation&nav_page=items&nav_module=%s&nav_set=%s';
+    }
+
+    public function performActionAdd()
+    {
+        $sAction = 'add';
+        $sFormObject = $this->oModule->_oConfig->getObject('form_nav_set');
+        $sFormDisplay = $this->oModule->_oConfig->getObject('form_display_nav_set_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_nav_txt_select_module')), BxDolStudioUtils::getModules());
+
+        $oForm->initChecker();
+        if($oForm->isSubmittedAndValid()) {
+            $sName = uriGenerate($oForm->getCleanValue('set_name'), 'sys_menu_sets', 'set_name', 'set');
+            BxDolForm::setSubmittedValue('set_name', $sName, $oForm->aFormAttrs['method']);
+
+            if($oForm->insert() !== false)
+                $aRes = array('grid' => $this->getCode(false), 'blink' => $sName);
+            else
+                $aRes = array('msg' => _t('_bx_dev_nav_err_sets_create'));
+
+            $this->_echoResultJson($aRes, true);
+        } else {
+            $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-nav-set-create-popup', _t('_bx_dev_nav_txt_sets_create_popup'), $this->_oTemplate->parseHtmlByName('nav_add_set.html', array(
+                'form_id' => $oForm->aFormAttrs['id'],
+                'form' => $oForm->getCode(true),
+                'object' => $this->_sObject,
+                'action' => $sAction
+            )));
+
+            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+        }
+    }
+
+    public function performActionEdit()
+    {
+	    $sAction = 'edit';
+	    $sFormObject = $this->oModule->_oConfig->getObject('form_nav_set');
+        $sFormDisplay = $this->oModule->_oConfig->getObject('form_display_nav_set_edit');
+
+        $aIds = bx_get('ids');
+        if(!$aIds || !is_array($aIds)) {
+            $sId = bx_get('set_name');
+            if(!$sId) {
+                $this->_echoResultJson(array());
+                exit;
+            }
+
+            $aIds = array($sId);
+        }
+
+        $sId = bx_process_input($aIds[0]);
+
+        $aSet = array();
+        $this->oDb->getSets(array('type' => 'by_name', 'value' => $sId), $aSet, false);
+        if(empty($aSet) || !is_array($aSet)) {
+            $this->_echoResultJson(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_displays_save');
+
+        $oForm->initChecker($aSet);
+        if($oForm->isSubmittedAndValid()) {
+            if($oForm->update($sId) !== false)
+                $aRes = array('grid' => $this->getCode(false), 'blink' => $sId);
+            else
+                $aRes = array('msg' => _t('_bx_dev_nav_err_sets_edit'));
+
+            $this->_echoResultJson($aRes, true);
+        } else {
+            $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-nav-set-edit-popup', _t('_bx_dev_nav_txt_sets_edit_popup', _t($aSet['title'])), $this->_oTemplate->parseHtmlByName('nav_add_set.html', array(
+                'form_id' => $oForm->aFormAttrs['id'],
+                'form' => $oForm->getCode(true),
+                'object' => $this->_sObject,
+                'action' => $sAction
+            )));
+
+            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+        }
+    }
+
+    protected function _getActionDelete ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
+    {
+        return  parent::_getActionDefault($sType, $sKey, $a, false, $isDisabled, $aRow);
+    }
+}
+/** @} */

+ 25 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevPermissions.php

@@ -0,0 +1,25 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxDevPermissions extends BxTemplStudioPermissions
+{
+    protected $aParams;
+
+    function __construct($aParams)
+    {
+        parent::__construct(isset($aParams['page']) ? $aParams['page'] : '');
+
+        $this->aParams = $aParams;
+        $this->sSubpageUrl = $this->aParams['url'] . '&prm_page=';
+    }
+}
+
+/** @} */

+ 75 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevPolyglot.php

@@ -0,0 +1,75 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxDevPolyglot extends BxTemplStudioPolyglot
+{
+    protected $oModule;
+    protected $aParams;
+    protected $aMenuItems;
+    protected $aGridObjects;
+
+    function __construct($aParams)
+    {
+        parent::__construct(isset($aParams['page']) ? $aParams['page'] : '');
+
+        $this->aParams = $aParams;
+        $this->sSubpageUrl = $this->aParams['url'] . '&pgt_page=';
+
+        $this->oModule = BxDolModule::getInstance('bx_developer');
+
+        $this->aMenuItems = array();
+
+		$this->aGridObjects = array(
+			'manage' => $this->oModule->_oConfig->getObject('grid_pgt_manage'),
+		);
+    }
+
+    function getPageCss()
+    {
+        $this->oModule->_oTemplate->addStudioCss(array('polyglot.css'));
+        return parent::getPageCss();
+    }
+
+    function getPageJs()
+    {
+        $this->oModule->_oTemplate->addStudioJs(array('polyglot.js'));
+        return parent::getPageJs();
+    }
+
+    function getPageJsClass()
+    {
+        return $this->oModule->_oConfig->getJsClass('polyglot');
+    }
+
+    function getPageJsObject()
+    {
+        return $this->oModule->_oConfig->getJsObject('polyglot');
+    }
+
+    function getPageJsCode($aOptions = array(), $bWrap = true)
+    {
+        $aOptions = array_merge($aOptions, array(
+            'sActionUrl' => BX_DOL_URL_ROOT . $this->oModule->_oConfig->getBaseUri(),
+            'sPolyglotUrl' => BX_DOL_URL_STUDIO . 'polyglot.php',
+            'sObjName' => $this->getPageJsObject(),
+            'sAnimationEffect' => $this->oModule->_oConfig->getAnimationEffect(),
+            'iAnimationSpeed' => $this->oModule->_oConfig->getAnimationSpeed()
+        ));
+
+        return parent::getPageJsCode($aOptions, $bWrap);
+    }
+
+    protected function getManager()
+    {
+        return $this->getGrid($this->aGridObjects['manage']);
+    }
+}
+/** @} */

+ 103 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevPolyglotManage.php

@@ -0,0 +1,103 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxDevPolyglotManage extends BxTemplStudioGrid
+{
+    private $sAllUri = 'all';
+    private $aActions = array(
+        'restore' => 'eraser',
+        'recompile' => 'refresh'
+    );
+
+    protected $oModule;
+    protected $aLanguage;
+
+    function __construct($aOptions, $oTemplate = false)
+    {
+        parent::__construct($aOptions, $oTemplate);
+
+        $this->oModule = BxDolModule::getInstance('bx_developer');
+
+        $this->aLanguages = BxDolLanguages::getInstance()->getLanguages();
+
+        $iWidth = floor(100 / (count($this->aLanguages) + 1));
+        $this->_aOptions['fields']['title']['width'] = $iWidth;
+
+        foreach($this->aLanguages as $sName => $sTitle)
+            $this->_aOptions['fields'][$sName] = array(
+                'title' => $sTitle,
+                'width' => $iWidth,
+                'translatable' => '0',
+                'chars_limit' => '0'
+            );
+    }
+
+    public function performActionRecompile()
+    {
+        $aResult = array('msg' => _t(BxDolStudioLanguagesUtils::getInstance()->compileLanguage() ? '_adm_pgt_scs_recompiled' : '_adm_pgt_err_cannot_recompile_lang'));
+
+        $this->_echoResultJson($aResult, true);
+    }
+
+    public function performActionRestore()
+    {
+        $aResult = array('msg' => _t(BxDolStudioLanguagesUtils::getInstance()->restoreLanguage() ? '_adm_pgt_scs_restored' : '_adm_pgt_err_cannot_restore_lang'));
+
+        $this->_echoResultJson($aResult, true);
+    }
+
+    protected function _getCellDefault($mixedValue, $sKey, $aField, $aRow)
+    {
+        $sJsObject = $this->oModule->_oConfig->getJsObject('polyglot');
+
+        $aLangNames = array_keys($this->aLanguages);
+        if(in_array($sKey, $aLangNames)) {
+            $bAll = false;
+            $aActions = array('restore');
+            $sOnclickMask = "javascript:%s.%s('%s', '%s')";
+
+            if($aRow['uri'] == $this->sAllUri) {
+                $bAll = true;
+                $aActions[] = 'recompile';
+                $sOnclickMask = "javascript:%s.%s('%s')";
+            }
+
+            $mixedValue = '';
+            foreach($aActions as $sAction) {
+                $sIcon = $this->aActions[$sAction];
+                $sTitle = _t('_bx_dev_pgt_txt_manage_' . $sAction . '_title' . ($bAll ? '_plur' : '_sing'));
+                $sContent = _t('_bx_dev_pgt_txt_manage_' . $sAction);
+
+                $mixedValue .= $this->_oTemplate->parseHtmlByName('bx_btn.html', array(
+                    'title' => sprintf($sTitle, $aField['title'], $aRow['title']),
+                    'bx_repeat:attrs' => array(
+                        array('key' => 'class', 'value' => 'bx-btn bx-def-margin-sec-left-auto'),
+                        array('key' => 'onclick', 'value' => sprintf($sOnclickMask, $sJsObject, $sAction, $sKey, $aRow['uri']))
+                    ),
+                    'content' => $this->_oTemplate->parseHtmlByName('bx_icon.html', array('name' => $sIcon))
+                ));
+            }
+        }
+
+        return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow);
+    }
+
+    protected function _getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage)
+    {
+        $this->_aOptions['source'] .= " AND `name`<>'system'";
+
+        $aData = array(
+            array('id' => 0, 'title' => _t('_bx_dev_pgt_txt_manage_modules_all'), 'uri' => $this->sAllUri)
+        );
+        return array_merge($aData, parent::_getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage));
+    }
+}
+/** @} */

+ 132 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevStudioPage.php

@@ -0,0 +1,132 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxDevStudioPage extends BxTemplStudioModule
+{
+    protected $oModule;
+    protected $sUrl;
+
+    function __construct($sModule = "", $sPage = "")
+    {
+        parent::__construct($sModule, $sPage);
+
+        $this->oModule = BxDolModule::getInstance($this->sModule);
+
+        $this->sUrl = BX_DOL_URL_STUDIO . 'module.php?name=%s&page=%s';
+    }
+
+    function getPageMenu($aMenu = array(), $aMarkers = array())
+    {
+        $this->aMenuItems = array();
+        foreach($this->oModule->aTools as $aTool)
+            $this->aMenuItems[] = array(
+                'name' => $aTool['name'],
+                'icon' => $aTool['icon'],
+                'link' => sprintf($this->sUrl, $this->sModule, $aTool['name']),
+                'title' => $aTool['title'],
+                'selected' => $aTool['name'] == $this->sPage
+            );
+
+        $oMenu = new BxTemplStudioMenu(array('template' => 'menu_main.html', 'menu_items' => $this->aMenuItems), $this->oModule->_oTemplate);
+        return $oMenu->getCode();
+    }
+
+    protected function getSettings()
+    {
+        $oContent = new BxTemplStudioSettings($this->sModule);
+
+        return $this->oModule->_oTemplate->displayPageContent($this->sPage, $oContent);
+    }
+
+    protected function getForms()
+    {
+        $sPage = bx_get('form_page');
+        $sPage = $sPage !== false ? bx_process_input($sPage) : '';
+
+		bx_import('Forms', $this->aModule);
+        $oContent = new BxDevForms(array(
+            'page' => $sPage,
+            'url' => sprintf($this->sUrl, $this->sModule, BX_DEV_TOOLS_FORMS),
+        ));
+		$oContent->init();
+
+        return $this->oModule->_oTemplate->displayPageContent($this->sPage, $oContent);
+    }
+
+    protected function getNavigation()
+    {
+        $sPage = bx_get('nav_page');
+        $sPage = $sPage !== false ? bx_process_input($sPage) : '';
+
+        bx_import('Navigation', $this->aModule);
+        $oContent = new BxDevNavigation(array(
+            'page' => $sPage,
+            'url' => sprintf($this->sUrl, $this->sModule, BX_DEV_TOOLS_NAVIGATION),
+        ));
+		$oContent->init();
+
+        return $this->oModule->_oTemplate->displayPageContent($this->sPage, $oContent);
+    }
+
+    protected function getPages()
+    {
+        $sType = bx_get('bp_type');
+        $sType = $sType !== false ? bx_process_input($sType) : '';
+
+        $sPage = bx_get('bp_page');
+        $sPage = $sPage !== false ? bx_process_input($sPage) : '';
+
+        bx_import('BuilderPage', $this->aModule);
+        $oContent = new BxDevBuilderPage(array(
+            'type' => $sType,
+            'page' => $sPage,
+            'url' => sprintf($this->sUrl, $this->sModule, BX_DEV_TOOLS_PAGES),
+        ));
+        $oContent->init();
+
+        return $this->oModule->_oTemplate->displayPageContent($this->sPage, $oContent);
+    }
+
+    protected function getPolyglot()
+    {
+        $sType = bx_get('pgt_type');
+        $sType = $sType !== false ? bx_process_input($sType) : '';
+
+        $sPage = bx_get('pgt_page');
+        $sPage = $sPage !== false ? bx_process_input($sPage) : 'manager';
+
+        bx_import('Polyglot', $this->aModule);
+        $oContent = new BxDevPolyglot(array(
+            'page' => $sPage,
+            'url' => sprintf($this->sUrl, $this->sModule, BX_DEV_TOOLS_POLYGLOT),
+        ));
+        $oContent->init();
+
+        return $this->oModule->_oTemplate->displayPageContent($this->sPage, $oContent);
+    }
+
+    protected function getPermissions()
+    {
+        $sPage = bx_get('prm_page');
+        $sPage = $sPage !== false ? bx_process_input($sPage) : '';
+
+        bx_import('Permissions', $this->aModule);
+        $oContent = new BxDevPermissions(array(
+            'page' => $sPage,
+            'url' => sprintf($this->sUrl, $this->sModule, BX_DEV_TOOLS_PERMISSIONS),
+        ));
+        $oContent->init();
+
+        return $this->oModule->_oTemplate->displayPageContent($this->sPage, $oContent);
+    }
+}
+
+/** @} */

+ 41 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/source/classes/BxDevTemplate.php

@@ -0,0 +1,41 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxDevTemplate extends BxDolModuleTemplate
+{
+    function __construct(&$oConfig, &$oDb)
+    {
+        parent::__construct($oConfig, $oDb);
+
+        $this->addStudioCss(array('main.css'));
+    }
+
+    function displayPageContent($sPage, &$oContent)
+    {
+        $this->addStudioCss($oContent->getPageCss(), false, false);
+        $this->addStudioJs($oContent->getPageJs(), false, false);
+
+        $sMenu = $oContent->getPageMenu();
+        $sContent = $oContent->getPageJsCode() . $oContent->getPageCode();
+        if(in_array($sPage, array(BX_DEV_TOOLS_SETTINGS)) || empty($sMenu)) {
+            $this->addStudioInjection('injection_body_style', 'text', ' bx-dev-page-body-single');
+            return $sContent;
+        }
+
+        $this->addStudioInjection('injection_body_style', 'text', ' bx-dev-page-body-columns');
+        return $this->parseHtmlByName('page_content.html', array(
+            'page_menu_code' => $sMenu,
+            'page_main_code' => $sContent
+        ));
+    }
+}
+
+/** @} */

+ 69 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/source/install/config.php

@@ -0,0 +1,69 @@
+<?php
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Developer Developer
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_developer',
+    'title' => 'Developer',
+    'note' => 'Developer tools...',
+    'version' => '8.0.6',
+    'vendor' => 'BoonEx',
+	'help_url' => 'http://feed.boonex.com/?section={module_name}',
+
+    'compatible_with' => array(
+        '8.0.x'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/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(),
+
+);
+
+/** @} */

+ 385 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/source/install/langs/en.xml

@@ -0,0 +1,385 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+    <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_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_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_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_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>    
+
+    <!-- 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_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>

+ 535 - 0
modules/boonex/developer/updates/8.0.5_8.0.6/source/install/sql/install.sql

@@ -0,0 +1,535 @@
+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-pi.png');
+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-wi.png', '_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`, `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', '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', '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', '', '', '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', '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', '', '', 'BxDevFormsPreValues', 'modules/boonex/developer/classes/BxDevFormsPreValues.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);
+
+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);
+
+
+--
+-- 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:6;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);
+
+--
+-- 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`, `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', '', '', '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', '', '', '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', '', '', '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`, `override_class_name`, `override_class_file`) VALUES
+('bx_developer_pgt_manage', 'Sql', 'SELECT * FROM `sys_modules` WHERE 1 ', 'sys_modules', 'id', '', '', '', 100, NULL, '', '', '', '', '', '', '', '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);

+ 52 - 0
modules/boonex/english/updates/8.0.8_8.0.9/install/config.php

@@ -0,0 +1,52 @@
+<?php
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ */
+
+$aConfig = array(
+    /**
+     * Main Section.
+     */
+    'title' => 'English',
+    'version_from' => '8.0.8',
+	'version_to' => '8.0.9',
+    'vendor' => 'BoonEx',
+
+    'compatible_with' => array(
+        '8.0.x'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/english/updates/update_8.0.8_8.0.9/',
+	'home_uri' => 'en_update_808_809',
+
+	'module_dir' => 'boonex/english/',
+	'module_uri' => 'en',
+
+    'db_prefix' => 'bx_eng_',
+    'class_prefix' => 'BxEng',
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+		'execute_sql' => 0,
+        'update_files' => 1,
+        'update_languages' => 1,
+        'restore_languages' => 0,
+		'clear_db_cache' => 0,
+    ),
+
+	/**
+     * Category for language keys.
+     */
+    'language_category' => 'System',
+
+	/**
+     * Files Section
+     */
+    'delete_files' => array(),
+);

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio