Browse Source

Merge branch 'master' of github.com:unaio/una

Alex Trofimov 9 years ago
parent
commit
c48b210d91
50 changed files with 1659 additions and 56 deletions
  1. 5 3
      inc/js/functions.js
  2. 1 1
      install/sql/system.sql
  3. 2 0
      modules/base/general/classes/BxBaseModGeneralModule.php
  4. 10 0
      modules/boonex/acl/classes/BxAclGridView.php
  5. 1 1
      modules/boonex/acl/install/sql/install.sql
  6. 1 1
      modules/boonex/events/install/sql/enable.sql
  7. 1 1
      modules/boonex/groups/install/sql/enable.sql
  8. 1 1
      modules/boonex/market/install/sql/enable.sql
  9. 1 1
      modules/boonex/organizations/install/langs/en.xml
  10. 4 4
      modules/boonex/organizations/install/sql/enable.sql
  11. 15 1
      modules/boonex/payment/classes/BxPaymentCart.php
  12. 6 1
      modules/boonex/payment/classes/BxPaymentGridCart.php
  13. 5 3
      modules/boonex/payment/classes/BxPaymentProviderStripe.php
  14. 1 0
      modules/boonex/payment/install/langs/en.xml
  15. 1 1
      modules/boonex/payment/install/sql/install.sql
  16. 1 0
      modules/boonex/protean/classes/BxProteanStudioPage.php
  17. 49 8
      modules/boonex/protean/data/template/system/css/default.less
  18. 15 0
      modules/boonex/protean/data/template/system/scripts/BxTemplConfig.php
  19. 17 0
      modules/boonex/protean/install/langs/en.xml
  20. 38 0
      modules/boonex/protean/install/sql/install.sql
  21. 1 1
      modules/boonex/russian/data/langs/bx_organizations/ru.xml
  22. 1 0
      modules/boonex/russian/data/langs/bx_payment/ru.xml
  23. 17 0
      modules/boonex/russian/data/langs/bx_protean/ru.xml
  24. 48 0
      modules/boonex/russian/data/langs/bx_stripe_connect/ru.xml
  25. 36 0
      modules/boonex/stripe_connect/classes/BxStripeConnectAlertsResponse.php
  26. 150 0
      modules/boonex/stripe_connect/classes/BxStripeConnectConfig.php
  27. 81 0
      modules/boonex/stripe_connect/classes/BxStripeConnectDb.php
  28. 46 0
      modules/boonex/stripe_connect/classes/BxStripeConnectGridAccounts.php
  29. 442 0
      modules/boonex/stripe_connect/classes/BxStripeConnectModule.php
  30. 20 0
      modules/boonex/stripe_connect/classes/BxStripeConnectPage.php
  31. 50 0
      modules/boonex/stripe_connect/classes/BxStripeConnectStudioPage.php
  32. 32 0
      modules/boonex/stripe_connect/classes/BxStripeConnectStudioSettings.php
  33. 94 0
      modules/boonex/stripe_connect/classes/BxStripeConnectTemplate.php
  34. 68 0
      modules/boonex/stripe_connect/install/config.php
  35. 20 0
      modules/boonex/stripe_connect/install/installer.php
  36. 49 0
      modules/boonex/stripe_connect/install/langs/en.xml
  37. 22 0
      modules/boonex/stripe_connect/install/sql/disable.sql
  38. 74 0
      modules/boonex/stripe_connect/install/sql/enable.sql
  39. 29 0
      modules/boonex/stripe_connect/install/sql/install.sql
  40. 11 0
      modules/boonex/stripe_connect/install/sql/uninstall.sql
  41. 79 0
      modules/boonex/stripe_connect/js/main.js
  42. 18 0
      modules/boonex/stripe_connect/request.php
  43. 11 0
      modules/boonex/stripe_connect/template/block_account.html
  44. 3 0
      modules/boonex/stripe_connect/template/block_connect.html
  45. 5 0
      modules/boonex/stripe_connect/template/css/main.css
  46. 36 0
      modules/boonex/stripe_connect/template/images/icons/std-icon.svg
  47. 1 0
      modules/boonex/stripe_connect/template/link.html
  48. 18 0
      studio/template/scripts/BxBaseStudioSettings.php
  49. 10 16
      template/css/common.css
  50. 12 12
      template/menu_account_popup.html

+ 5 - 3
inc/js/functions.js

@@ -200,9 +200,11 @@ function showPopupAnyHtml(sUrl, sId) {
     );
     );
 }
 }
 
 
-function bx_loading_svg(sType) {
+function bx_loading_svg(sType, sClass) {
+	sClass = sClass != undefined && sClass.length > 0 ? sClass : '';
+
 	var s = '';
 	var s = '';
-	s += '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 520 520" style="enable-background:new 0 0 520 520;" xml:space="preserve">';
+	s += '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 520 520" class="' + sClass + '" style="enable-background:new 0 0 520 520;" xml:space="preserve">';
 	s += '<g class="' + sType + '">';
 	s += '<g class="' + sType + '">';
 	s += '<g class="inner">';
 	s += '<g class="inner">';
 	s += '<path class="p1" d="M152,260C152,260,152,260,152,260c0-59.8,48.4-108.4,108.1-108.4c43.3,0,80.9,25.6,97.9,62.4V107.3c-28-18.3-61.9-28.9-98.1-28.9C159.8,78.4,78.6,159.9,78.6,260c0,59.5,28.4,112.4,73.4,145.6V260z"/>';
 	s += '<path class="p1" d="M152,260C152,260,152,260,152,260c0-59.8,48.4-108.4,108.1-108.4c43.3,0,80.9,25.6,97.9,62.4V107.3c-28-18.3-61.9-28.9-98.1-28.9C159.8,78.4,78.6,159.9,78.6,260c0,59.5,28.4,112.4,73.4,145.6V260z"/>';
@@ -237,7 +239,7 @@ function bx_loading_btn (oElement, bEnable) {
     if(!bEnable)
     if(!bEnable)
     	oButton.find('.bx-loading-ajax-btn').remove();
     	oButton.find('.bx-loading-ajax-btn').remove();
     else if (!oButton.find('.bx-loading-ajax-btn').length)
     else if (!oButton.find('.bx-loading-ajax-btn').length)
-    	oButton.append('<b class="bx-loading-ajax-btn">' + (bUseSvg ? bx_loading_svg('colored') : '') + '</b>');
+    	oButton.append('<b class="bx-loading-ajax-btn bx-btn-height">' + (bUseSvg ? bx_loading_svg('colored', 'bx-btn-height') : '') + '</b>');
 
 
     if(!bUseSvg)
     if(!bUseSvg)
     	bx_loading_animate(oButton.find('.bx-loading-ajax-btn'), aSpinnerSmallOpts);    
     	bx_loading_animate(oButton.find('.bx-loading-ajax-btn'), aSpinnerSmallOpts);    

+ 1 - 1
install/sql/system.sql

@@ -175,7 +175,7 @@ CREATE TABLE `sys_options` (
   `name` varchar(64) NOT NULL default '',
   `name` varchar(64) NOT NULL default '',
   `caption` varchar(255) NOT NULL default '',
   `caption` varchar(255) NOT NULL default '',
   `value` mediumtext NOT NULL,
   `value` mediumtext NOT NULL,
-  `type` enum('digit','text','checkbox','select','combobox','file','image','list','rlist','rgb','rgba') NOT NULL default 'digit',
+  `type` enum('value','digit','text','checkbox','select','combobox','file','image','list','rlist','rgb','rgba') NOT NULL default 'digit',
   `extra` text NOT NULL default '',
   `extra` text NOT NULL default '',
   `check` varchar(32) NOT NULL,
   `check` varchar(32) NOT NULL,
   `check_params` text NOT NULL,
   `check_params` text NOT NULL,

+ 2 - 0
modules/base/general/classes/BxBaseModGeneralModule.php

@@ -642,6 +642,8 @@ class BxBaseModGeneralModule extends BxDolModule
         	'email' => $oAccount->getEmail(),
         	'email' => $oAccount->getEmail(),
             'link' => $oProfile->getUrl(),
             'link' => $oProfile->getUrl(),
             'icon' => $oProfile->getIcon(),
             'icon' => $oProfile->getIcon(),
+        	'thumb' => $oProfile->getThumb(),
+        	'avatar' => $oProfile->getAvatar(),
             'unit' => $oProfile->getUnit(),
             'unit' => $oProfile->getUnit(),
         	'active' => $oProfile->isActive(),
         	'active' => $oProfile->isActive(),
         );
         );

+ 10 - 0
modules/boonex/acl/classes/BxAclGridView.php

@@ -15,6 +15,8 @@ class BxAclGridView extends BxAclGridLevels
 {
 {
 	protected $_iOwner;
 	protected $_iOwner;
 	protected $_oPayment;
 	protected $_oPayment;
+	protected $_bTypeSingle;
+	protected $_bTypeRecurring;
 
 
     public function __construct ($aOptions, $oTemplate = false)
     public function __construct ($aOptions, $oTemplate = false)
     {
     {
@@ -22,6 +24,8 @@ class BxAclGridView extends BxAclGridLevels
 
 
         $this->_iOwner = $this->_oModule->_oConfig->getOwner();
         $this->_iOwner = $this->_oModule->_oConfig->getOwner();
         $this->_oPayment = BxDolPayments::getInstance();
         $this->_oPayment = BxDolPayments::getInstance();
+        $this->_bTypeSingle = $this->_oPayment->isAcceptingPayments($this->_iOwner, BX_PAYMENT_TYPE_SINGLE);
+        $this->_bTypeRecurring = $this->_oPayment->isAcceptingPayments($this->_iOwner, BX_PAYMENT_TYPE_RECURRING);
     }
     }
 
 
     public function getCode($isDisplayHeader = true)
     public function getCode($isDisplayHeader = true)
@@ -31,6 +35,9 @@ class BxAclGridView extends BxAclGridLevels
 
 
 	protected function _getActionBuy ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
 	protected function _getActionBuy ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
     {
     {
+        if(!$this->_bTypeSingle || $this->_bTypeRecurring)
+            return '';
+
     	$aJs = $this->_oPayment->getAddToCartJs($this->_iOwner, $this->MODULE, $aRow['id'], 1, true);
     	$aJs = $this->_oPayment->getAddToCartJs($this->_iOwner, $this->MODULE, $aRow['id'], 1, true);
     	if(!empty($aJs) && is_array($aJs)) {
     	if(!empty($aJs) && is_array($aJs)) {
     		list($sJsCode, $sJsMethod) = $aJs;
     		list($sJsCode, $sJsMethod) = $aJs;
@@ -46,6 +53,9 @@ class BxAclGridView extends BxAclGridLevels
 
 
     protected function _getActionSubscribe ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
     protected function _getActionSubscribe ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
     {
     {
+        if(!$this->_bTypeRecurring)
+            return '';
+
     	$aJs = $this->_oPayment->getSubscribeJs($this->_iOwner, '', $this->MODULE, $aRow['id'], 1);
     	$aJs = $this->_oPayment->getSubscribeJs($this->_iOwner, '', $this->MODULE, $aRow['id'], 1);
 		if(!empty($aJs) && is_array($aJs)) {
 		if(!empty($aJs) && is_array($aJs)) {
 			list($sJsCode, $sJsMethod) = $aJs;
 			list($sJsCode, $sJsMethod) = $aJs;

+ 1 - 1
modules/boonex/acl/install/sql/install.sql

@@ -96,7 +96,7 @@ INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon
 ('bx_acl_administration', 'bulk', 'delete', '_bx_acl_grid_action_delete', '', 0, 1, 1),
 ('bx_acl_administration', 'bulk', 'delete', '_bx_acl_grid_action_delete', '', 0, 1, 1),
 
 
 ('bx_acl_view', 'single', 'buy', '_bx_acl_grid_action_buy', 'cart-plus', 0, 0, 1),
 ('bx_acl_view', 'single', 'buy', '_bx_acl_grid_action_buy', 'cart-plus', 0, 0, 1),
-('bx_acl_view', 'single', 'subscribe', '_bx_acl_grid_action_subscribe', 'money', 0, 0, 2);
+('bx_acl_view', 'single', 'subscribe', '_bx_acl_grid_action_subscribe', 'credit-card', 0, 0, 2);
 
 
 
 
 -- STUDIO PAGE & WIDGET
 -- STUDIO PAGE & WIDGET

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

@@ -363,7 +363,7 @@ INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `conf
 
 
 INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
 INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
 ('bx_events_administration', 'Sql', 'SELECT `td`.*, `td`.`event_name` AS `name`, `ta`.`email` AS `account`, `td`.`added` AS `added_ts`, `tp`.`status` AS `status` FROM `bx_events_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id`=`tp`.`content_id` AND `tp`.`type`=''bx_events'' LEFT JOIN `sys_accounts` AS `ta` ON `tp`.`account_id`=`ta`.`id` WHERE 1 ', 'bx_events_data', 'id', 'added', 'status', '', 20, NULL, 'start', '', 'event_name', '', 'like', '', '', 192, 'BxEventsGridAdministration', 'modules/boonex/events/classes/BxEventsGridAdministration.php'),
 ('bx_events_administration', 'Sql', 'SELECT `td`.*, `td`.`event_name` AS `name`, `ta`.`email` AS `account`, `td`.`added` AS `added_ts`, `tp`.`status` AS `status` FROM `bx_events_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id`=`tp`.`content_id` AND `tp`.`type`=''bx_events'' LEFT JOIN `sys_accounts` AS `ta` ON `tp`.`account_id`=`ta`.`id` WHERE 1 ', 'bx_events_data', 'id', 'added', 'status', '', 20, NULL, 'start', '', 'event_name', '', 'like', '', '', 192, 'BxEventsGridAdministration', 'modules/boonex/events/classes/BxEventsGridAdministration.php'),
-('bx_events_common', 'Sql', 'SELECT `td`.*, `td`.`event_name` AS `name`, `ta`.`email` AS `account`, `ta`.`added` AS `added_ts`, `tp`.`status` AS `status` FROM `bx_events_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id`=`tp`.`content_id` AND `tp`.`type`=''bx_events'' LEFT JOIN `sys_accounts` AS `ta` ON `tp`.`account_id`=`ta`.`id` WHERE 1 ', 'bx_events_data', 'id', 'added', 'status', '', 20, NULL, 'start', '', 'event_name', '', 'like', '', '', 2147483647, 'BxEventsGridCommon', 'modules/boonex/events/classes/BxEventsGridCommon.php');
+('bx_events_common', 'Sql', 'SELECT `td`.*, `td`.`event_name` AS `name`, `ta`.`email` AS `account`, `td`.`added` AS `added_ts`, `tp`.`status` AS `status` FROM `bx_events_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id`=`tp`.`content_id` AND `tp`.`type`=''bx_events'' LEFT JOIN `sys_accounts` AS `ta` ON `tp`.`account_id`=`ta`.`id` WHERE 1 ', 'bx_events_data', 'id', 'added', 'status', '', 20, NULL, 'start', '', 'event_name', '', 'like', '', '', 2147483647, 'BxEventsGridCommon', 'modules/boonex/events/classes/BxEventsGridCommon.php');
 
 
 INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
 INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
 ('bx_events_administration', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
 ('bx_events_administration', 'checkbox', '_sys_select', '2%', 0, '', '', 1),

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

@@ -350,7 +350,7 @@ INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `conf
 
 
 INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
 INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
 ('bx_groups_administration', 'Sql', 'SELECT `td`.*, `td`.`group_name` AS `name`, `ta`.`email` AS `account`, `td`.`added` AS `added_ts`, `tp`.`status` AS `status` FROM `bx_groups_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id`=`tp`.`content_id` AND `tp`.`type`=''bx_groups'' LEFT JOIN `sys_accounts` AS `ta` ON `tp`.`account_id`=`ta`.`id` WHERE 1 ', 'bx_groups_data', 'id', 'added', 'status', '', 20, NULL, 'start', '', 'group_name', '', 'like', '', '', 192, 'BxGroupsGridAdministration', 'modules/boonex/groups/classes/BxGroupsGridAdministration.php'),
 ('bx_groups_administration', 'Sql', 'SELECT `td`.*, `td`.`group_name` AS `name`, `ta`.`email` AS `account`, `td`.`added` AS `added_ts`, `tp`.`status` AS `status` FROM `bx_groups_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id`=`tp`.`content_id` AND `tp`.`type`=''bx_groups'' LEFT JOIN `sys_accounts` AS `ta` ON `tp`.`account_id`=`ta`.`id` WHERE 1 ', 'bx_groups_data', 'id', 'added', 'status', '', 20, NULL, 'start', '', 'group_name', '', 'like', '', '', 192, 'BxGroupsGridAdministration', 'modules/boonex/groups/classes/BxGroupsGridAdministration.php'),
-('bx_groups_common', 'Sql', 'SELECT `td`.*, `td`.`group_name` AS `name`, `ta`.`email` AS `account`, `ta`.`added` AS `added_ts`, `tp`.`status` AS `status` FROM `bx_groups_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id`=`tp`.`content_id` AND `tp`.`type`=''bx_groups'' LEFT JOIN `sys_accounts` AS `ta` ON `tp`.`account_id`=`ta`.`id` WHERE 1 ', 'bx_groups_data', 'id', 'added', 'status', '', 20, NULL, 'start', '', 'group_name', '', 'like', '', '', 2147483647, 'BxGroupsGridCommon', 'modules/boonex/groups/classes/BxGroupsGridCommon.php');
+('bx_groups_common', 'Sql', 'SELECT `td`.*, `td`.`group_name` AS `name`, `ta`.`email` AS `account`, `td`.`added` AS `added_ts`, `tp`.`status` AS `status` FROM `bx_groups_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id`=`tp`.`content_id` AND `tp`.`type`=''bx_groups'' LEFT JOIN `sys_accounts` AS `ta` ON `tp`.`account_id`=`ta`.`id` WHERE 1 ', 'bx_groups_data', 'id', 'added', 'status', '', 20, NULL, 'start', '', 'group_name', '', 'like', '', '', 2147483647, 'BxGroupsGridCommon', 'modules/boonex/groups/classes/BxGroupsGridCommon.php');
 
 
 INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
 INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
 ('bx_groups_administration', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
 ('bx_groups_administration', 'checkbox', '_sys_select', '2%', 0, '', '', 1),

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

@@ -202,7 +202,7 @@ INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `titl
 ('bx_market_view', 'bx_market', 'delete-product', '_bx_market_menu_item_title_system_delete_entry', '_bx_market_menu_item_title_delete_entry', 'page.php?i=delete-product&id={content_id}', '', '', 'remove', '', 2147483647, 1, 0, 2),
 ('bx_market_view', 'bx_market', 'delete-product', '_bx_market_menu_item_title_system_delete_entry', '_bx_market_menu_item_title_delete_entry', 'page.php?i=delete-product&id={content_id}', '', '', 'remove', '', 2147483647, 1, 0, 2),
 ('bx_market_view', 'bx_market', 'download', '_bx_market_menu_item_title_system_download', '_bx_market_menu_item_title_download', 'page.php?i=download-product&id={content_id}', '', '', 'download', '', 2147483647, 1, 0, 3),
 ('bx_market_view', 'bx_market', 'download', '_bx_market_menu_item_title_system_download', '_bx_market_menu_item_title_download', 'page.php?i=download-product&id={content_id}', '', '', 'download', '', 2147483647, 1, 0, 3),
 ('bx_market_view', 'bx_market', 'add-to-cart', '_bx_market_menu_item_title_system_add_to_cart', '{add_to_cart_title}', 'javascript:void(0);', 'javascript:{add_to_cart_onclick}', '', 'cart-plus', '', 2147483647, 1, 0, 4),
 ('bx_market_view', 'bx_market', 'add-to-cart', '_bx_market_menu_item_title_system_add_to_cart', '{add_to_cart_title}', 'javascript:void(0);', 'javascript:{add_to_cart_onclick}', '', 'cart-plus', '', 2147483647, 1, 0, 4),
-('bx_market_view', 'bx_market', 'subscribe', '_bx_market_menu_item_title_system_subscribe', '{subscribe_title}', 'javascript:void(0);', 'javascript:{subscribe_onclick}', '', 'money', '', 2147483647, 1, 0, 5);
+('bx_market_view', 'bx_market', 'subscribe', '_bx_market_menu_item_title_system_subscribe', '{subscribe_title}', 'javascript:void(0);', 'javascript:{subscribe_onclick}', '', 'credit-card', '', 2147483647, 1, 0, 5);
 
 
 
 
 -- MENU: actions menu for my entries
 -- MENU: actions menu for my entries

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

@@ -179,7 +179,7 @@
 	<string name="_bx_orgs_grid_filter_item_title_adm_pending"><![CDATA[Pending]]></string>
 	<string name="_bx_orgs_grid_filter_item_title_adm_pending"><![CDATA[Pending]]></string>
 	<string name="_bx_orgs_grid_filter_item_title_adm_suspended"><![CDATA[Suspended]]></string>
 	<string name="_bx_orgs_grid_filter_item_title_adm_suspended"><![CDATA[Suspended]]></string>
 	<string name="_bx_orgs_grid_column_title_adm_active"><![CDATA[Active]]></string>
 	<string name="_bx_orgs_grid_column_title_adm_active"><![CDATA[Active]]></string>
-    <string name="_bx_orgs_grid_column_title_adm_org_name"><![CDATA[Name]]></string>
+    <string name="_bx_orgs_grid_column_title_adm_fullname"><![CDATA[Name]]></string>
     <string name="_bx_orgs_grid_column_title_adm_last_online"><![CDATA[Last Online]]></string>
     <string name="_bx_orgs_grid_column_title_adm_last_online"><![CDATA[Last Online]]></string>
     <string name="_bx_orgs_grid_column_title_adm_account"><![CDATA[Account]]></string>
     <string name="_bx_orgs_grid_column_title_adm_account"><![CDATA[Account]]></string>
     <string name="_bx_orgs_grid_action_title_adm_delete"><![CDATA[Delete]]></string>
     <string name="_bx_orgs_grid_action_title_adm_delete"><![CDATA[Delete]]></string>

+ 4 - 4
modules/boonex/organizations/install/sql/enable.sql

@@ -341,18 +341,18 @@ INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `Order`, `ClassName`, `
 
 
 -- GRIDS: administration
 -- GRIDS: administration
 INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
 INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
-('bx_organizations_administration', 'Sql', 'SELECT `td`.*, `ta`.`email` AS `account`, `ta`.`logged` AS `last_online`, `tp`.`status` AS `status` FROM `bx_organizations_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id`=`tp`.`content_id` AND `tp`.`type`=''bx_organizations'' LEFT JOIN `sys_accounts` AS `ta` ON `tp`.`account_id`=`ta`.`id` WHERE 1 ', 'bx_organizations_data', 'id', 'last_online', 'status', '', 20, NULL, 'start', '', 'org_name', '', 'like', '', '', 192, 'BxOrgsGridAdministration', 'modules/boonex/organizations/classes/BxOrgsGridAdministration.php'),
-('bx_organizations_common', 'Sql', 'SELECT `td`.*, `ta`.`email` AS `account`, `ta`.`logged` AS `last_online`, `tp`.`status` AS `status` FROM `bx_organizations_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id`=`tp`.`content_id` AND `tp`.`type`=''bx_organizations'' LEFT JOIN `sys_accounts` AS `ta` ON `tp`.`account_id`=`ta`.`id` WHERE 1 ', 'bx_organizations_data', 'id', 'last_online', 'status', '', 20, NULL, 'start', '', 'org_name', '', 'like', '', '', 2147483647, 'BxOrgsGridCommon', 'modules/boonex/organizations/classes/BxOrgsGridCommon.php');
+('bx_organizations_administration', 'Sql', 'SELECT `td`.*, `td`.`org_name` AS `fullname`, `ta`.`email` AS `account`, `ta`.`logged` AS `last_online`, `tp`.`status` AS `status` FROM `bx_organizations_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id`=`tp`.`content_id` AND `tp`.`type`=''bx_organizations'' LEFT JOIN `sys_accounts` AS `ta` ON `tp`.`account_id`=`ta`.`id` WHERE 1 ', 'bx_organizations_data', 'id', 'last_online', 'status', '', 20, NULL, 'start', '', 'org_name', '', 'like', '', '', 192, 'BxOrgsGridAdministration', 'modules/boonex/organizations/classes/BxOrgsGridAdministration.php'),
+('bx_organizations_common', 'Sql', 'SELECT `td`.*, `td`.`org_name` AS `fullname`, `ta`.`email` AS `account`, `ta`.`logged` AS `last_online`, `tp`.`status` AS `status` FROM `bx_organizations_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id`=`tp`.`content_id` AND `tp`.`type`=''bx_organizations'' LEFT JOIN `sys_accounts` AS `ta` ON `tp`.`account_id`=`ta`.`id` WHERE 1 ', 'bx_organizations_data', 'id', 'last_online', 'status', '', 20, NULL, 'start', '', 'org_name', '', 'like', '', '', 2147483647, 'BxOrgsGridCommon', 'modules/boonex/organizations/classes/BxOrgsGridCommon.php');
 
 
 INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
 INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
 ('bx_organizations_administration', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
 ('bx_organizations_administration', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
 ('bx_organizations_administration', 'switcher', '_bx_orgs_grid_column_title_adm_active', '8%', 0, '', '', 2),
 ('bx_organizations_administration', 'switcher', '_bx_orgs_grid_column_title_adm_active', '8%', 0, '', '', 2),
-('bx_organizations_administration', 'org_name', '_bx_orgs_grid_column_title_adm_org_name', '25%', 0, '', '', 3),
+('bx_organizations_administration', 'fullname', '_bx_orgs_grid_column_title_adm_fullname', '25%', 0, '', '', 3),
 ('bx_organizations_administration', 'last_online', '_bx_orgs_grid_column_title_adm_last_online', '20%', 1, '25', '', 4),
 ('bx_organizations_administration', 'last_online', '_bx_orgs_grid_column_title_adm_last_online', '20%', 1, '25', '', 4),
 ('bx_organizations_administration', 'account', '_bx_orgs_grid_column_title_adm_account', '25%', 0, '25', '', 5),
 ('bx_organizations_administration', 'account', '_bx_orgs_grid_column_title_adm_account', '25%', 0, '25', '', 5),
 ('bx_organizations_administration', 'actions', '', '20%', 0, '', '', 6),
 ('bx_organizations_administration', 'actions', '', '20%', 0, '', '', 6),
 ('bx_organizations_common', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
 ('bx_organizations_common', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
-('bx_organizations_common', 'org_name', '_bx_orgs_grid_column_title_adm_org_name', '48%', 0, '', '', 2),
+('bx_organizations_common', 'fullname', '_bx_orgs_grid_column_title_adm_fullname', '48%', 0, '', '', 2),
 ('bx_organizations_common', 'last_online', '_bx_orgs_grid_column_title_adm_last_online', '30%', 1, '25', '', 3),
 ('bx_organizations_common', 'last_online', '_bx_orgs_grid_column_title_adm_last_online', '30%', 1, '25', '', 3),
 ('bx_organizations_common', 'actions', '', '20%', 0, '', '', 4);
 ('bx_organizations_common', 'actions', '', '20%', 0, '', '', 4);
 
 

+ 15 - 1
modules/boonex/payment/classes/BxPaymentCart.php

@@ -53,7 +53,7 @@ class BxPaymentCart extends BxBaseModPaymentCart
     	if(empty($iSellerId))
     	if(empty($iSellerId))
     		return MsgBox(_t($CNF['T']['ERR_UNKNOWN_VENDOR']));
     		return MsgBox(_t($CNF['T']['ERR_UNKNOWN_VENDOR']));
 
 
-		$aSeller = $this->_oModule->getProfileInfo();
+		$aSeller = $this->_oModule->getProfileInfo($iSellerId);
         return array(
         return array(
         	'title' => _t($CNF['T']['BLOCK_TITLE_CART'], $aSeller['name']),
         	'title' => _t($CNF['T']['BLOCK_TITLE_CART'], $aSeller['name']),
         	'content' => $this->_oModule->_oTemplate->displayBlockCart($iUserId, $iSellerId)
         	'content' => $this->_oModule->_oTemplate->displayBlockCart($iUserId, $iSellerId)
@@ -199,11 +199,23 @@ class BxPaymentCart extends BxBaseModPaymentCart
      */
      */
     protected function _getInfo($sType, $iClientId, $iSellerId, $aItems)
     protected function _getInfo($sType, $iClientId, $iSellerId, $aItems)
     {
     {
+        $bTypeSingle = $sType == BX_PAYMENT_TYPE_SINGLE;
+
         $iItemsCount = 0;
         $iItemsCount = 0;
         $fItemsPrice = 0;
         $fItemsPrice = 0;
         $aItemsInfo = array();
         $aItemsInfo = array();
         foreach($aItems as $aItem) {
         foreach($aItems as $aItem) {
             $aItemInfo = $this->_oModule->callGetCartItem((int)$aItem['module_id'], array($aItem['item_id']));
             $aItemInfo = $this->_oModule->callGetCartItem((int)$aItem['module_id'], array($aItem['item_id']));
+            if(empty($aItemInfo) || !is_array($aItemInfo)) {
+                if($bTypeSingle) {
+                    $sCartItems = $this->_oModule->_oDb->getCartItems($iClientId);
+                    $sCartItems = trim(preg_replace("'" . $this->_oModule->_oConfig->descriptorA2S($aItem) . ":?'", "", $sCartItems), ":");
+                    $this->_oModule->_oDb->setCartItems($iClientId, $sCartItems);
+                }
+
+                continue;
+            }
+
             $aItemInfo['module_id'] = (int)$aItem['module_id'];
             $aItemInfo['module_id'] = (int)$aItem['module_id'];
             $aItemInfo['quantity'] = (int)$aItem['item_count'];
             $aItemInfo['quantity'] = (int)$aItem['item_count'];
 
 
@@ -219,6 +231,8 @@ class BxPaymentCart extends BxBaseModPaymentCart
             'vendor_name' => $aSeller['name'],
             'vendor_name' => $aSeller['name'],
         	'vendor_link' => $aSeller['link'],
         	'vendor_link' => $aSeller['link'],
             'vendor_icon' => $aSeller['icon'],
             'vendor_icon' => $aSeller['icon'],
+        	'vendor_thumb' => $aSeller['thumb'],
+        	'vendor_avatar' => $aSeller['avatar'],
         	'vendor_unit' => $aSeller['unit'],
         	'vendor_unit' => $aSeller['unit'],
             'vendor_currency_code' => $aSeller['currency_code'],
             'vendor_currency_code' => $aSeller['currency_code'],
             'vendor_currency_sign' => $aSeller['currency_sign'],
             'vendor_currency_sign' => $aSeller['currency_sign'],

+ 6 - 1
modules/boonex/payment/classes/BxPaymentGridCart.php

@@ -61,6 +61,11 @@ class BxPaymentGridCart extends BxBaseModPaymentGridCarts
         return parent::_getCellDefault($this->_sCurrencySign . $mixedValue, $sKey, $aField, $aRow);
         return parent::_getCellDefault($this->_sCurrencySign . $mixedValue, $sKey, $aField, $aRow);
     }
     }
 
 
+    protected function _getActionCheckout ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
+    {
+        return '';
+    }
+
     protected function _getActions ($sType, $sActionData = false, $isSmall = false, $isDisabled = false, $isPermanentState = false, $aRow = array())
     protected function _getActions ($sType, $sActionData = false, $isSmall = false, $isDisabled = false, $isPermanentState = false, $aRow = array())
     {
     {
     	$CNF = &$this->_oModule->_oConfig->CNF;
     	$CNF = &$this->_oModule->_oConfig->CNF;
@@ -72,7 +77,7 @@ class BxPaymentGridCart extends BxBaseModPaymentGridCarts
     		$aProviders = $this->_oModule->_oDb->getVendorInfoProvidersSingle($this->_aQueryAppend['seller_id']);
     		$aProviders = $this->_oModule->_oDb->getVendorInfoProvidersSingle($this->_aQueryAppend['seller_id']);
     		foreach($aProviders as $aProvider) {
     		foreach($aProviders as $aProvider) {
 				$sAction = $this->_getActionDefault($sType, $sActionName, array(
 				$sAction = $this->_getActionDefault($sType, $sActionName, array(
-					'title'=> _t($CNF['T']['TXT_CART_PROVIDER'] . $aProvider['name']),
+					'title'=> _t('_bx_payment_grid_action_title_crt_checkout', _t($CNF['T']['TXT_CART_PROVIDER'] . $aProvider['name'])),
 	    			'icon' => '',
 	    			'icon' => '',
 					'icon_only' => 0,
 					'icon_only' => 0,
 	    			'confirm' => 0,
 	    			'confirm' => 0,

+ 5 - 3
modules/boonex/payment/classes/BxPaymentProviderStripe.php

@@ -205,13 +205,15 @@ class BxPaymentProviderStripe extends BxBaseModPaymentProvider implements iBxBas
 
 
     public function getButtonSingle($iClientId, $iVendorId, $aParams = array())
     public function getButtonSingle($iClientId, $iVendorId, $aParams = array())
     {
     {
-    	$aItems = array();
-    	$aCartInfo = $this->_oModule->getObjectCart()->getInfo(BX_PAYMENT_TYPE_SINGLE, $iClientId, (int)$iVendorId, $aItems);
+        $aItems = array();
+        $aCartInfo = $this->_oModule->getObjectCart()->getInfo(BX_PAYMENT_TYPE_SINGLE, $iClientId, (int)$iVendorId, $aItems);
+        if(empty($aCartInfo) || !is_array($aCartInfo))
+            return '';
 
 
     	return $this->_getButton(BX_PAYMENT_TYPE_SINGLE, $iClientId, $iVendorId, array_merge($aParams, array(
     	return $this->_getButton(BX_PAYMENT_TYPE_SINGLE, $iClientId, $iVendorId, array_merge($aParams, array(
 			'sVendorName' => _t($this->_sLangsPrefix . 'txt_payment_to', $aCartInfo['vendor_name']),
 			'sVendorName' => _t($this->_sLangsPrefix . 'txt_payment_to', $aCartInfo['vendor_name']),
 			'sVendorCurrency' => $aCartInfo['vendor_currency_code'],
 			'sVendorCurrency' => $aCartInfo['vendor_currency_code'],
-			'sVendorIcon' => $aCartInfo['vendor_icon'],
+			'sVendorIcon' => $aCartInfo['vendor_avatar'],
     	)));
     	)));
     }
     }
 
 

+ 1 - 0
modules/boonex/payment/install/langs/en.xml

@@ -109,6 +109,7 @@
 	<string name="_bx_payment_grid_action_title_sbs_view_order"><![CDATA[View]]></string>
 	<string name="_bx_payment_grid_action_title_sbs_view_order"><![CDATA[View]]></string>
 	<string name="_bx_payment_grid_action_title_crts_delete"><![CDATA[Delete]]></string>
 	<string name="_bx_payment_grid_action_title_crts_delete"><![CDATA[Delete]]></string>
 	<string name="_bx_payment_grid_action_title_crts_continue"><![CDATA[Continue]]></string>
 	<string name="_bx_payment_grid_action_title_crts_continue"><![CDATA[Continue]]></string>
+	<string name="_bx_payment_grid_action_title_crt_checkout"><![CDATA[Checkout with {0}]]></string>
 	<string name="_bx_payment_grid_action_title_crt_delete"><![CDATA[Delete]]></string>
 	<string name="_bx_payment_grid_action_title_crt_delete"><![CDATA[Delete]]></string>
 
 
     <string name="_bx_payment_popup_title_ods_order_subscription_view"><![CDATA[Subscription]]></string>
     <string name="_bx_payment_popup_title_ods_order_subscription_view"><![CDATA[Subscription]]></string>

+ 1 - 1
modules/boonex/payment/install/sql/install.sql

@@ -251,7 +251,7 @@ INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon
 ('bx_payment_grid_carts', 'single', 'continue', '_bx_payment_grid_action_title_crts_continue', 'money', 1, 0, 1),
 ('bx_payment_grid_carts', 'single', 'continue', '_bx_payment_grid_action_title_crts_continue', 'money', 1, 0, 1),
 ('bx_payment_grid_carts', 'single', 'delete', '_bx_payment_grid_action_title_crts_delete', 'remove', 1, 1, 2),
 ('bx_payment_grid_carts', 'single', 'delete', '_bx_payment_grid_action_title_crts_delete', 'remove', 1, 1, 2),
 
 
-('bx_payment_grid_cart', 'bulk', 'delete', '_bx_payment_grid_action_title_crt_delete', '', 0, 1, 1),
+('bx_payment_grid_cart', 'bulk', 'checkout', '_bx_payment_grid_action_title_crt_checkout', '', 0, 0, 1),
 ('bx_payment_grid_cart', 'single', 'delete', '_bx_payment_grid_action_title_crt_delete', 'remove', 1, 1, 1),
 ('bx_payment_grid_cart', 'single', 'delete', '_bx_payment_grid_action_title_crt_delete', 'remove', 1, 1, 1),
 
 
 ('bx_payment_grid_sbs_list', 'single', 'view_order', '_bx_payment_grid_action_title_sbs_view_order', 'ellipsis-h', 1, 0, 1),
 ('bx_payment_grid_sbs_list', 'single', 'view_order', '_bx_payment_grid_action_title_sbs_view_order', 'ellipsis-h', 1, 0, 1),

+ 1 - 0
modules/boonex/protean/classes/BxProteanStudioPage.php

@@ -42,6 +42,7 @@ class BxProteanStudioPage extends BxTemplStudioDesign
 			$sPrefix . '_styles_card',
 			$sPrefix . '_styles_card',
 			$sPrefix . '_styles_popup',
 			$sPrefix . '_styles_popup',
 			$sPrefix . '_styles_menu_main',
 			$sPrefix . '_styles_menu_main',
+			$sPrefix . '_styles_menu_account',
 			$sPrefix . '_styles_menu_page',
 			$sPrefix . '_styles_menu_page',
 			$sPrefix . '_styles_menu_slide',
 			$sPrefix . '_styles_menu_slide',
 			$sPrefix . '_styles_form',
 			$sPrefix . '_styles_form',

+ 49 - 8
modules/boonex/protean/data/template/system/css/default.less

@@ -89,6 +89,8 @@
 .bx-popup-color-bg,
 .bx-popup-color-bg,
 .bx-popup-wrapper.bx-popup-slide-wrapper,
 .bx-popup-wrapper.bx-popup-slide-wrapper,
 #bx-sliding-menu-sys_site.bx-sliding-menu-main,
 #bx-sliding-menu-sys_site.bx-sliding-menu-main,
+#bx-sliding-menu-sys_add_content.bx-sliding-menu-main,
+#bx-sliding-menu-account.bx-sliding-menu-main,
 .bx-menu-main-bar-wrapper {
 .bx-menu-main-bar-wrapper {
     background-position: center center;
     background-position: center center;
 }
 }
@@ -454,10 +456,10 @@ a.bx-def-font-h3:hover {
 .bx-popup-header h2 {
 .bx-popup-header h2 {
 	font-family: @bx-font-family-popup-title;
 	font-family: @bx-font-family-popup-title;
 	font-size: @bx-font-size-popup-title;
 	font-size: @bx-font-size-popup-title;
-	color: @bx-color-font-popup-title;
 }
 }
+.bx-popup-header h2,
 .bx-popup-header.bx-def-font-contrasted h2 {
 .bx-popup-header.bx-def-font-contrasted h2 {
-	color: @bx-font-color-contrasted-h2;
+	color: @bx-color-font-popup-title;
 }
 }
 
 
 /* slide menu */
 /* slide menu */
@@ -492,11 +494,12 @@ a.bx-def-font-h3:hover {
 }
 }
 
 
 /* main menu */
 /* main menu */
-#bx-sliding-menu-sys_site.bx-sliding-menu-main {
+#bx-sliding-menu-sys_site.bx-sliding-menu-main,
+#bx-sliding-menu-sys_add_content.bx-sliding-menu-main {
 	-webkit-box-shadow: @bx-shadow-menu-main;
 	-webkit-box-shadow: @bx-shadow-menu-main;
 	-moz-box-shadow: @bx-shadow-menu-main;
 	-moz-box-shadow: @bx-shadow-menu-main;
 	box-shadow: @bx-shadow-menu-main;
 	box-shadow: @bx-shadow-menu-main;
-	
+
 	border-width: @bx-border-width-menu-main;
 	border-width: @bx-border-width-menu-main;
 	border-style: solid;
 	border-style: solid;
 	border-color: @bx-color-border-menu-main;
 	border-color: @bx-color-border-menu-main;
@@ -507,10 +510,12 @@ a.bx-def-font-h3:hover {
 	background-repeat: @bx-image-bg-menu-main-repeat;
 	background-repeat: @bx-image-bg-menu-main-repeat;
     background-size: @bx-image-bg-menu-main-size;
     background-size: @bx-image-bg-menu-main-size;
 }
 }
-.bx-sliding-menu-main .bx-sliding-menu-main-cnt {
+#bx-sliding-menu-sys_site.bx-sliding-menu-main .bx-sliding-menu-main-cnt,
+#bx-sliding-menu-sys_add_content.bx-sliding-menu-main .bx-sliding-menu-main-cnt {
 	padding: @bx-content-padding-menu-main;
 	padding: @bx-content-padding-menu-main;
 }
 }
-.bx-sliding-menu-main .bx-sliding-menu-main-cnt li a {
+#bx-sliding-menu-sys_site.bx-sliding-menu-main .bx-sliding-menu-main-cnt li a,
+#bx-sliding-menu-sys_add_content.bx-sliding-menu-main .bx-sliding-menu-main-cnt li a {
 	text-shadow: @bx-shadow-font-menu-main;
 	text-shadow: @bx-shadow-font-menu-main;
 
 
 	font-family: @bx-font-family-menu-main;
 	font-family: @bx-font-family-menu-main;
@@ -518,13 +523,49 @@ a.bx-def-font-h3:hover {
 	font-weight: @bx-font-weight-menu-main;
 	font-weight: @bx-font-weight-menu-main;
 	color: @bx-font-color-menu-main;
 	color: @bx-font-color-menu-main;
 }
 }
-.bx-sliding-menu-main .bx-sliding-menu-main-cnt li.bx-menu-tab-active a {
+#bx-sliding-menu-sys_site.bx-sliding-menu-main .bx-sliding-menu-main-cnt li.bx-menu-tab-active a,
+#bx-sliding-menu-sys_add_content.bx-sliding-menu-main .bx-sliding-menu-main-cnt li.bx-menu-tab-active a {
 	color: @bx-font-color-menu-main-active;
 	color: @bx-font-color-menu-main-active;
 }
 }
-.bx-sliding-menu-main .bx-sliding-menu-main-cnt li a:hover {
+#bx-sliding-menu-sys_site.bx-sliding-menu-main .bx-sliding-menu-main-cnt li a:hover,
+#bx-sliding-menu-sys_add_content.bx-sliding-menu-main .bx-sliding-menu-main-cnt li a:hover {
 	color: @bx-font-color-menu-main-hover;
 	color: @bx-font-color-menu-main-hover;
 }
 }
 
 
+/* account menu */
+#bx-sliding-menu-account.bx-sliding-menu-main {
+    -webkit-box-shadow: @bx-shadow-menu-account;
+    -moz-box-shadow: @bx-shadow-menu-account;
+    box-shadow: @bx-shadow-menu-account;
+
+    border-width: @bx-border-width-menu-account;
+    border-style: solid;
+    border-color: @bx-color-border-menu-account;
+
+    background-color: @bx-color-menu-account;
+
+    background-image: url(@bx-image-bg-menu-account);
+    background-repeat: @bx-image-bg-menu-account-repeat;
+    background-size: @bx-image-bg-menu-account-size;
+}
+#bx-sliding-menu-account.bx-sliding-menu-main .bx-sliding-menu-main-cnt {
+    padding: @bx-content-padding-menu-account;
+}
+#bx-sliding-menu-account.bx-sliding-menu-main .bx-menu-account-popup li a {
+    text-shadow: @bx-shadow-font-menu-account;
+
+    font-family: @bx-font-family-menu-account;
+    font-size: @bx-font-size-menu-account;
+    font-weight: @bx-font-weight-menu-account;
+    color: @bx-font-color-menu-account;
+}
+#bx-sliding-menu-account.bx-sliding-menu-main .bx-menu-account-popup li.bx-menu-tab-active a {
+    color: @bx-font-color-menu-account-active;
+}
+#bx-sliding-menu-account.bx-sliding-menu-main .bx-menu-account-popup li a:hover {
+    color: @bx-font-color-menu-account-hover;
+}
+
 /* page menu */
 /* page menu */
 .bx-menu-main-bar-wrapper {
 .bx-menu-main-bar-wrapper {
 	-webkit-box-shadow: @bx-shadow-menu-page;
 	-webkit-box-shadow: @bx-shadow-menu-page;

+ 15 - 0
modules/boonex/protean/data/template/system/scripts/BxTemplConfig.php

@@ -43,6 +43,9 @@ class BxTemplConfig extends BxBaseConfig
         $this->_aConfig['aLessConfig']['bx-image-bg-menu-main'] = $this->_setBgUrl($sName . '_menu_main_bg_image', $oStorage);
         $this->_aConfig['aLessConfig']['bx-image-bg-menu-main'] = $this->_setBgUrl($sName . '_menu_main_bg_image', $oStorage);
         $this->_aConfig['aLessConfig']['bx-image-bg-menu-main-repeat'] = $this->_setBgRepeat($sName . '_menu_main_bg_image_repeat', 'no-repeat');
         $this->_aConfig['aLessConfig']['bx-image-bg-menu-main-repeat'] = $this->_setBgRepeat($sName . '_menu_main_bg_image_repeat', 'no-repeat');
         $this->_aConfig['aLessConfig']['bx-image-bg-menu-main-size'] = $this->_setBgSize($sName . '_menu_main_bg_image_size', 'cover');
         $this->_aConfig['aLessConfig']['bx-image-bg-menu-main-size'] = $this->_setBgSize($sName . '_menu_main_bg_image_size', 'cover');
+        $this->_aConfig['aLessConfig']['bx-image-bg-menu-account'] = $this->_setBgUrl($sName . '_menu_account_bg_image', $oStorage);
+        $this->_aConfig['aLessConfig']['bx-image-bg-menu-account-repeat'] = $this->_setBgRepeat($sName . '_menu_account_bg_image_repeat', 'no-repeat');
+        $this->_aConfig['aLessConfig']['bx-image-bg-menu-account-size'] = $this->_setBgSize($sName . '_menu_account_bg_image_size', 'cover');
         $this->_aConfig['aLessConfig']['bx-image-bg-menu-page'] = $this->_setBgUrl($sName . '_menu_page_bg_image', $oStorage);
         $this->_aConfig['aLessConfig']['bx-image-bg-menu-page'] = $this->_setBgUrl($sName . '_menu_page_bg_image', $oStorage);
         $this->_aConfig['aLessConfig']['bx-image-bg-menu-page-repeat'] = $this->_setBgRepeat($sName . '_menu_page_bg_image_repeat', 'no-repeat');
         $this->_aConfig['aLessConfig']['bx-image-bg-menu-page-repeat'] = $this->_setBgRepeat($sName . '_menu_page_bg_image_repeat', 'no-repeat');
         $this->_aConfig['aLessConfig']['bx-image-bg-menu-page-size'] = $this->_setBgSize($sName . '_menu_page_bg_image_size', 'cover');
         $this->_aConfig['aLessConfig']['bx-image-bg-menu-page-size'] = $this->_setBgSize($sName . '_menu_page_bg_image_size', 'cover');
@@ -60,6 +63,7 @@ class BxTemplConfig extends BxBaseConfig
         $this->_aConfig['aLessConfig']['bx-shadow-card'] = $this->_setShadow($sName . '_card_shadow');
         $this->_aConfig['aLessConfig']['bx-shadow-card'] = $this->_setShadow($sName . '_card_shadow');
         $this->_aConfig['aLessConfig']['bx-shadow-popup'] = $this->_setShadow($sName . '_popup_shadow');
         $this->_aConfig['aLessConfig']['bx-shadow-popup'] = $this->_setShadow($sName . '_popup_shadow');
         $this->_aConfig['aLessConfig']['bx-shadow-menu-main'] = $this->_setShadow($sName . '_menu_main_shadow');
         $this->_aConfig['aLessConfig']['bx-shadow-menu-main'] = $this->_setShadow($sName . '_menu_main_shadow');
+        $this->_aConfig['aLessConfig']['bx-shadow-menu-account'] = $this->_setShadow($sName . '_menu_account_shadow');
         $this->_aConfig['aLessConfig']['bx-shadow-menu-page'] = $this->_setShadow($sName . '_menu_page_shadow');
         $this->_aConfig['aLessConfig']['bx-shadow-menu-page'] = $this->_setShadow($sName . '_menu_page_shadow');
         $this->_aConfig['aLessConfig']['bx-shadow-menu-slide'] = $this->_setShadow($sName . '_menu_slide_shadow');
         $this->_aConfig['aLessConfig']['bx-shadow-menu-slide'] = $this->_setShadow($sName . '_menu_slide_shadow');
         $this->_aConfig['aLessConfig']['bx-shadow-form-input'] = $this->_setShadow($sName . '_form_input_shadow');
         $this->_aConfig['aLessConfig']['bx-shadow-form-input'] = $this->_setShadow($sName . '_form_input_shadow');
@@ -68,6 +72,7 @@ class BxTemplConfig extends BxBaseConfig
 
 
         $this->_aConfig['aLessConfig']['bx-shadow-text-cover'] = $this->_setShadowFont($sName . '_cover_text_shadow');
         $this->_aConfig['aLessConfig']['bx-shadow-text-cover'] = $this->_setShadowFont($sName . '_cover_text_shadow');
         $this->_aConfig['aLessConfig']['bx-shadow-font-menu-main'] = $this->_setShadowFont($sName . '_menu_main_font_shadow');
         $this->_aConfig['aLessConfig']['bx-shadow-font-menu-main'] = $this->_setShadowFont($sName . '_menu_main_font_shadow');
+        $this->_aConfig['aLessConfig']['bx-shadow-font-menu-account'] = $this->_setShadowFont($sName . '_menu_account_font_shadow');
         $this->_aConfig['aLessConfig']['bx-shadow-font-menu-page'] = $this->_setShadowFont($sName . '_menu_page_font_shadow');
         $this->_aConfig['aLessConfig']['bx-shadow-font-menu-page'] = $this->_setShadowFont($sName . '_menu_page_font_shadow');
         $this->_aConfig['aLessConfig']['bx-shadow-font-menu-slide'] = $this->_setShadowFont($sName . '_menu_slide_font_shadow');
         $this->_aConfig['aLessConfig']['bx-shadow-font-menu-slide'] = $this->_setShadowFont($sName . '_menu_slide_font_shadow');
         $this->_aConfig['aLessConfig']['bx-shadow-font-button'] = $this->_setShadowFont($sName . '_button_lg_font_shadow');
         $this->_aConfig['aLessConfig']['bx-shadow-font-button'] = $this->_setShadowFont($sName . '_button_lg_font_shadow');
@@ -90,6 +95,7 @@ class BxTemplConfig extends BxBaseConfig
         $this->_aConfig['aLessConfig']['bx-content-padding-card'] = $this->_setMargin($sName . '_card_content_padding');
         $this->_aConfig['aLessConfig']['bx-content-padding-card'] = $this->_setMargin($sName . '_card_content_padding');
         $this->_aConfig['aLessConfig']['bx-content-padding-popup'] = $this->_setMargin($sName . '_popup_content_padding');
         $this->_aConfig['aLessConfig']['bx-content-padding-popup'] = $this->_setMargin($sName . '_popup_content_padding');
         $this->_aConfig['aLessConfig']['bx-content-padding-menu-main'] = $this->_setMargin($sName . '_menu_main_content_padding');
         $this->_aConfig['aLessConfig']['bx-content-padding-menu-main'] = $this->_setMargin($sName . '_menu_main_content_padding');
+        $this->_aConfig['aLessConfig']['bx-content-padding-menu-account'] = $this->_setMargin($sName . '_menu_account_content_padding');
         $this->_aConfig['aLessConfig']['bx-content-padding-menu-page'] = $this->_setMargin($sName . '_menu_page_content_padding');
         $this->_aConfig['aLessConfig']['bx-content-padding-menu-page'] = $this->_setMargin($sName . '_menu_page_content_padding');
         $this->_aConfig['aLessConfig']['bx-content-padding-menu-slide'] = $this->_setMargin($sName . '_menu_slide_content_padding');
         $this->_aConfig['aLessConfig']['bx-content-padding-menu-slide'] = $this->_setMargin($sName . '_menu_slide_content_padding');
 
 
@@ -114,6 +120,7 @@ class BxTemplConfig extends BxBaseConfig
         $this->_aConfig['aLessConfig']['bx-color-popup'] = $this->_setColorRgba($sName . '_popup_bg_color', 'rgba(255, 255, 255, 1)');
         $this->_aConfig['aLessConfig']['bx-color-popup'] = $this->_setColorRgba($sName . '_popup_bg_color', 'rgba(255, 255, 255, 1)');
         $this->_aConfig['aLessConfig']['bx-color-popup-title'] = $this->_setColorRgba($sName . '_popup_title_bg_color', 'rgba(40, 60, 80, 0.9)');
         $this->_aConfig['aLessConfig']['bx-color-popup-title'] = $this->_setColorRgba($sName . '_popup_title_bg_color', 'rgba(40, 60, 80, 0.9)');
         $this->_aConfig['aLessConfig']['bx-color-menu-main'] = $this->_setColorRgba($sName . '_menu_main_bg_color', 'rgba(255, 255, 255, 0.9)');
         $this->_aConfig['aLessConfig']['bx-color-menu-main'] = $this->_setColorRgba($sName . '_menu_main_bg_color', 'rgba(255, 255, 255, 0.9)');
+        $this->_aConfig['aLessConfig']['bx-color-menu-account'] = $this->_setColorRgba($sName . '_menu_account_bg_color', 'rgba(255, 255, 255, 0.9)');
         $this->_aConfig['aLessConfig']['bx-color-menu-page'] = $this->_setColorRgba($sName . '_menu_page_bg_color', 'rgba(242, 242, 242, 1)');
         $this->_aConfig['aLessConfig']['bx-color-menu-page'] = $this->_setColorRgba($sName . '_menu_page_bg_color', 'rgba(242, 242, 242, 1)');
         $this->_aConfig['aLessConfig']['bx-color-menu-slide'] = $this->_setColorRgba($sName . '_menu_slide_bg_color', 'rgba(255, 255, 255, 0.9)');
         $this->_aConfig['aLessConfig']['bx-color-menu-slide'] = $this->_setColorRgba($sName . '_menu_slide_bg_color', 'rgba(255, 255, 255, 0.9)');
 		$this->_aConfig['aLessConfig']['bx-color-form-input'] = $this->_setColorRgba($sName . '_form_input_bg_color', 'rgba(255, 255, 255, 1)');
 		$this->_aConfig['aLessConfig']['bx-color-form-input'] = $this->_setColorRgba($sName . '_form_input_bg_color', 'rgba(255, 255, 255, 1)');
@@ -137,6 +144,7 @@ class BxTemplConfig extends BxBaseConfig
         $this->_aConfig['aLessConfig']['bx-color-border-box'] = $this->_setColorRgba($sName . '_card_border_color', $sDefColBorder);
         $this->_aConfig['aLessConfig']['bx-color-border-box'] = $this->_setColorRgba($sName . '_card_border_color', $sDefColBorder);
         $this->_aConfig['aLessConfig']['bx-color-border-popup'] = $this->_setColorRgba($sName . '_popup_border_color', $sDefColBorder);
         $this->_aConfig['aLessConfig']['bx-color-border-popup'] = $this->_setColorRgba($sName . '_popup_border_color', $sDefColBorder);
         $this->_aConfig['aLessConfig']['bx-color-border-menu-main'] = $this->_setColorRgba($sName . '_menu_main_border_color', $sDefColBorder);
         $this->_aConfig['aLessConfig']['bx-color-border-menu-main'] = $this->_setColorRgba($sName . '_menu_main_border_color', $sDefColBorder);
+        $this->_aConfig['aLessConfig']['bx-color-border-menu-account'] = $this->_setColorRgba($sName . '_menu_account_border_color', $sDefColBorder);
         $this->_aConfig['aLessConfig']['bx-color-border-menu-page'] = $this->_setColorRgba($sName . '_menu_page_border_color', $sDefColBorder);
         $this->_aConfig['aLessConfig']['bx-color-border-menu-page'] = $this->_setColorRgba($sName . '_menu_page_border_color', $sDefColBorder);
         $this->_aConfig['aLessConfig']['bx-color-border-menu-slide'] = $this->_setColorRgba($sName . '_menu_slide_border_color', $sDefColBorder);
         $this->_aConfig['aLessConfig']['bx-color-border-menu-slide'] = $this->_setColorRgba($sName . '_menu_slide_border_color', $sDefColBorder);
         $this->_aConfig['aLessConfig']['bx-color-border-form-input'] = $this->_setColorRgba($sName . '_form_input_border_color', 'rgba(121, 189, 154, 1)');
         $this->_aConfig['aLessConfig']['bx-color-border-form-input'] = $this->_setColorRgba($sName . '_form_input_border_color', 'rgba(121, 189, 154, 1)');
@@ -170,6 +178,7 @@ class BxTemplConfig extends BxBaseConfig
         $this->_aConfig['aLessConfig']['bx-border-width-box'] = $this->_setSize($sName . '_card_border_size');
         $this->_aConfig['aLessConfig']['bx-border-width-box'] = $this->_setSize($sName . '_card_border_size');
         $this->_aConfig['aLessConfig']['bx-border-width-popup'] = $this->_setSize($sName . '_popup_border_size');
         $this->_aConfig['aLessConfig']['bx-border-width-popup'] = $this->_setSize($sName . '_popup_border_size');
         $this->_aConfig['aLessConfig']['bx-border-width-menu-main'] = $this->_setSize($sName . '_menu_main_border_size');
         $this->_aConfig['aLessConfig']['bx-border-width-menu-main'] = $this->_setSize($sName . '_menu_main_border_size');
+        $this->_aConfig['aLessConfig']['bx-border-width-menu-account'] = $this->_setSize($sName . '_menu_account_border_size');
         $this->_aConfig['aLessConfig']['bx-border-width-menu-page'] = $this->_setSize($sName . '_menu_page_border_size');
         $this->_aConfig['aLessConfig']['bx-border-width-menu-page'] = $this->_setSize($sName . '_menu_page_border_size');
         $this->_aConfig['aLessConfig']['bx-border-width-menu-slide'] = $this->_setSize($sName . '_menu_slide_border_size');
         $this->_aConfig['aLessConfig']['bx-border-width-menu-slide'] = $this->_setSize($sName . '_menu_slide_border_size');
         $this->_aConfig['aLessConfig']['bx-border-width-form-input'] = $this->_setSize($sName . '_form_input_border_size');
         $this->_aConfig['aLessConfig']['bx-border-width-form-input'] = $this->_setSize($sName . '_form_input_border_size');
@@ -210,6 +219,7 @@ class BxTemplConfig extends BxBaseConfig
 		$this->_aConfig['aLessConfig']['bx-font-family-popup-title'] = $this->_setValue($sName . '_popup_title_font_family');
 		$this->_aConfig['aLessConfig']['bx-font-family-popup-title'] = $this->_setValue($sName . '_popup_title_font_family');
 		$this->_aConfig['aLessConfig']['bx-font-family-form-input'] = $this->_setValue($sName . '_form_input_font_family');
 		$this->_aConfig['aLessConfig']['bx-font-family-form-input'] = $this->_setValue($sName . '_form_input_font_family');
 		$this->_aConfig['aLessConfig']['bx-font-family-menu-main'] = $this->_setValue($sName . '_menu_main_font_family');
 		$this->_aConfig['aLessConfig']['bx-font-family-menu-main'] = $this->_setValue($sName . '_menu_main_font_family');
+		$this->_aConfig['aLessConfig']['bx-font-family-menu-account'] = $this->_setValue($sName . '_menu_account_font_family');
 		$this->_aConfig['aLessConfig']['bx-font-family-menu-page'] = $this->_setValue($sName . '_menu_page_font_family');
 		$this->_aConfig['aLessConfig']['bx-font-family-menu-page'] = $this->_setValue($sName . '_menu_page_font_family');
 		$this->_aConfig['aLessConfig']['bx-font-family-menu-slide'] = $this->_setValue($sName . '_menu_slide_font_family');
 		$this->_aConfig['aLessConfig']['bx-font-family-menu-slide'] = $this->_setValue($sName . '_menu_slide_font_family');
 		$this->_aConfig['aLessConfig']['bx-font-family-button'] = $this->_setValue($sName . '_button_lg_font_family');
 		$this->_aConfig['aLessConfig']['bx-font-family-button'] = $this->_setValue($sName . '_button_lg_font_family');
@@ -221,6 +231,7 @@ class BxTemplConfig extends BxBaseConfig
 		$this->_aConfig['aLessConfig']['bx-font-size-popup-title'] = $this->_setSize($sName . '_popup_title_font_size', '1.5rem');
 		$this->_aConfig['aLessConfig']['bx-font-size-popup-title'] = $this->_setSize($sName . '_popup_title_font_size', '1.5rem');
 		$this->_aConfig['aLessConfig']['bx-font-size-form-input'] = $this->_setSize($sName . '_form_input_font_size', '1.125rem');
 		$this->_aConfig['aLessConfig']['bx-font-size-form-input'] = $this->_setSize($sName . '_form_input_font_size', '1.125rem');
 		$this->_aConfig['aLessConfig']['bx-font-size-menu-main'] = $this->_setSize($sName . '_menu_main_font_size', '1.125rem');
 		$this->_aConfig['aLessConfig']['bx-font-size-menu-main'] = $this->_setSize($sName . '_menu_main_font_size', '1.125rem');
+		$this->_aConfig['aLessConfig']['bx-font-size-menu-account'] = $this->_setSize($sName . '_menu_account_font_size', '1.125rem');
 		$this->_aConfig['aLessConfig']['bx-font-size-menu-page'] = $this->_setSize($sName . '_menu_page_font_size', '1.2rem');
 		$this->_aConfig['aLessConfig']['bx-font-size-menu-page'] = $this->_setSize($sName . '_menu_page_font_size', '1.2rem');
 		$this->_aConfig['aLessConfig']['bx-font-size-menu-slide'] = $this->_setSize($sName . '_menu_slide_font_size', '1.0rem');
 		$this->_aConfig['aLessConfig']['bx-font-size-menu-slide'] = $this->_setSize($sName . '_menu_slide_font_size', '1.0rem');
 		$this->_aConfig['aLessConfig']['bx-font-size-button'] = $this->_setSize($sName . '_button_lg_font_size', '1rem');
 		$this->_aConfig['aLessConfig']['bx-font-size-button'] = $this->_setSize($sName . '_button_lg_font_size', '1rem');
@@ -236,6 +247,9 @@ class BxTemplConfig extends BxBaseConfig
 		$this->_aConfig['aLessConfig']['bx-font-color-menu-main'] = $this->_setColorRgba($sName . '_menu_main_font_color', 'rgba(62, 134, 133, 1)');
 		$this->_aConfig['aLessConfig']['bx-font-color-menu-main'] = $this->_setColorRgba($sName . '_menu_main_font_color', 'rgba(62, 134, 133, 1)');
 		$this->_aConfig['aLessConfig']['bx-font-color-menu-main-hover'] = $this->_setColorRgba($sName . '_menu_main_font_color_hover', 'rgba(62, 134, 133, 1)');
 		$this->_aConfig['aLessConfig']['bx-font-color-menu-main-hover'] = $this->_setColorRgba($sName . '_menu_main_font_color_hover', 'rgba(62, 134, 133, 1)');
 		$this->_aConfig['aLessConfig']['bx-font-color-menu-main-active'] = $this->_setColorRgba($sName . '_menu_main_font_color_active', 'rgba(0, 0, 0, 1)');
 		$this->_aConfig['aLessConfig']['bx-font-color-menu-main-active'] = $this->_setColorRgba($sName . '_menu_main_font_color_active', 'rgba(0, 0, 0, 1)');
+		$this->_aConfig['aLessConfig']['bx-font-color-menu-account'] = $this->_setColorRgba($sName . '_menu_account_font_color', 'rgba(62, 134, 133, 1)');
+		$this->_aConfig['aLessConfig']['bx-font-color-menu-account-hover'] = $this->_setColorRgba($sName . '_menu_account_font_color_hover', 'rgba(62, 134, 133, 1)');
+		$this->_aConfig['aLessConfig']['bx-font-color-menu-account-active'] = $this->_setColorRgba($sName . '_menu_account_font_color_active', 'rgba(0, 0, 0, 1)');
 		$this->_aConfig['aLessConfig']['bx-font-color-menu-page'] = $this->_setColorRgba($sName . '_menu_page_font_color', 'rgba(62, 134, 133, 1)');
 		$this->_aConfig['aLessConfig']['bx-font-color-menu-page'] = $this->_setColorRgba($sName . '_menu_page_font_color', 'rgba(62, 134, 133, 1)');
 		$this->_aConfig['aLessConfig']['bx-font-color-menu-page-hover'] = $this->_setColorRgba($sName . '_menu_page_font_color_hover', 'rgba(62, 134, 133, 1)');
 		$this->_aConfig['aLessConfig']['bx-font-color-menu-page-hover'] = $this->_setColorRgba($sName . '_menu_page_font_color_hover', 'rgba(62, 134, 133, 1)');
 		$this->_aConfig['aLessConfig']['bx-font-color-menu-page-active'] = $this->_setColorRgba($sName . '_menu_page_font_color_active', 'rgba(0, 0, 0, 1)');
 		$this->_aConfig['aLessConfig']['bx-font-color-menu-page-active'] = $this->_setColorRgba($sName . '_menu_page_font_color_active', 'rgba(0, 0, 0, 1)');
@@ -267,6 +281,7 @@ class BxTemplConfig extends BxBaseConfig
 		$this->_aConfig['aLessConfig']['bx-font-weight-cover'] = $this->_setValue($sName . '_cover_font_weight', '700');
 		$this->_aConfig['aLessConfig']['bx-font-weight-cover'] = $this->_setValue($sName . '_cover_font_weight', '700');
 		$this->_aConfig['aLessConfig']['bx-font-weight-block-title'] = $this->_setValue($sName . '_block_title_font_weight', '500');
 		$this->_aConfig['aLessConfig']['bx-font-weight-block-title'] = $this->_setValue($sName . '_block_title_font_weight', '500');
 		$this->_aConfig['aLessConfig']['bx-font-weight-menu-main'] = $this->_setValue($sName . '_menu_main_font_weight', '400');
 		$this->_aConfig['aLessConfig']['bx-font-weight-menu-main'] = $this->_setValue($sName . '_menu_main_font_weight', '400');
+		$this->_aConfig['aLessConfig']['bx-font-weight-menu-account'] = $this->_setValue($sName . '_menu_account_font_weight', '400');
 		$this->_aConfig['aLessConfig']['bx-font-weight-menu-page'] = $this->_setValue($sName . '_menu_page_font_weight', '400');
 		$this->_aConfig['aLessConfig']['bx-font-weight-menu-page'] = $this->_setValue($sName . '_menu_page_font_weight', '400');
 		$this->_aConfig['aLessConfig']['bx-font-weight-menu-slide'] = $this->_setValue($sName . '_menu_slide_font_weight', '400');
 		$this->_aConfig['aLessConfig']['bx-font-weight-menu-slide'] = $this->_setValue($sName . '_menu_slide_font_weight', '400');
 		$this->_aConfig['aLessConfig']['bx-font-weight-button'] = $this->_setValue($sName . '_button_lg_font_weight', '400');
 		$this->_aConfig['aLessConfig']['bx-font-weight-button'] = $this->_setValue($sName . '_button_lg_font_weight', '400');

+ 17 - 0
modules/boonex/protean/install/langs/en.xml

@@ -140,6 +140,23 @@
 	<string name="_bx_protean_stg_cpt_option_menu_main_font_shadow"><![CDATA[Font shadow]]></string>
 	<string name="_bx_protean_stg_cpt_option_menu_main_font_shadow"><![CDATA[Font shadow]]></string>
 	<string name="_bx_protean_stg_cpt_option_menu_main_font_weight"><![CDATA[Font weight]]></string>
 	<string name="_bx_protean_stg_cpt_option_menu_main_font_weight"><![CDATA[Font weight]]></string>
 
 
+    <string name="_bx_protean_stg_cpt_category_styles_menu_account"><![CDATA[Account Menu]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_bg_color"><![CDATA[Background color]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_bg_image"><![CDATA[Background image]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_bg_image_repeat"><![CDATA[Background image repeat]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_bg_image_size"><![CDATA[Background image size]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_content_padding"><![CDATA[Content margin]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_border_color"><![CDATA[Border color]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_border_size"><![CDATA[Border size]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_shadow"><![CDATA[Shadow]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_font_family"><![CDATA[Font stack]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_font_size"><![CDATA[Font size]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_font_color"><![CDATA[Font color]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_font_color_hover"><![CDATA[On-hover font color]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_font_color_active"><![CDATA[Active font color]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_font_shadow"><![CDATA[Font shadow]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_font_weight"><![CDATA[Font weight]]></string>
+
 	<string name="_bx_protean_stg_cpt_category_styles_menu_page"><![CDATA[Page Menu]]></string>
 	<string name="_bx_protean_stg_cpt_category_styles_menu_page"><![CDATA[Page Menu]]></string>
 	<string name="_bx_protean_stg_cpt_option_menu_page_bg_color"><![CDATA[Background color]]></string>
 	<string name="_bx_protean_stg_cpt_option_menu_page_bg_color"><![CDATA[Background color]]></string>
 	<string name="_bx_protean_stg_cpt_option_menu_page_bg_image"><![CDATA[Background image]]></string>
 	<string name="_bx_protean_stg_cpt_option_menu_page_bg_image"><![CDATA[Background image]]></string>

+ 38 - 0
modules/boonex/protean/install/sql/install.sql

@@ -201,6 +201,29 @@ INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `ex
 (@iCategoryId, CONCAT(@sName, '_menu_main_font_weight'), '_bx_protean_stg_cpt_option_menu_main_font_weight', '700', 'digit', '', '', '', 15);
 (@iCategoryId, CONCAT(@sName, '_menu_main_font_weight'), '_bx_protean_stg_cpt_option_menu_main_font_weight', '700', 'digit', '', '', '', 15);
 
 
 
 
+-- SETTINGS: Protean template Styles Account Menu
+INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `order`) VALUES 
+(@iTypeId, CONCAT(@sName, '_styles_menu_account'), '_bx_protean_stg_cpt_category_styles_menu_account', 95);
+SET @iCategoryId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
+(@iCategoryId, CONCAT(@sName, '_menu_account_bg_color'), '_bx_protean_stg_cpt_option_menu_account_bg_color', 'rgba(255, 255, 255, 0.9)', 'rgba', '', '', '', 1),
+(@iCategoryId, CONCAT(@sName, '_menu_account_bg_image'), '_bx_protean_stg_cpt_option_menu_account_bg_image', '', 'image', '', '', '', 2),
+(@iCategoryId, CONCAT(@sName, '_menu_account_bg_image_repeat'), '_bx_protean_stg_cpt_option_menu_account_bg_image_repeat', 'no-repeat', 'select', 'no-repeat,repeat,repeat-x,repeat-y', '', '', 3),
+(@iCategoryId, CONCAT(@sName, '_menu_account_bg_image_size'), '_bx_protean_stg_cpt_option_menu_account_bg_image_size', 'cover', 'select', 'auto,cover,contain', '', '', 4),
+(@iCategoryId, CONCAT(@sName, '_menu_account_content_padding'), '_bx_protean_stg_cpt_option_menu_account_content_padding', '0px', 'digit', '', '', '', 5),
+(@iCategoryId, CONCAT(@sName, '_menu_account_border_color'), '_bx_protean_stg_cpt_option_menu_account_border_color', 'rgba(0, 0, 0, 0.1)', 'rgba', '', '', '', 6),
+(@iCategoryId, CONCAT(@sName, '_menu_account_border_size'), '_bx_protean_stg_cpt_option_menu_account_border_size', '0px', 'digit', '', '', '', 7),
+(@iCategoryId, CONCAT(@sName, '_menu_account_shadow'), '_bx_protean_stg_cpt_option_menu_account_shadow', 'none', 'digit', '', '', '', 8),
+(@iCategoryId, CONCAT(@sName, '_menu_account_font_family'), '_bx_protean_stg_cpt_option_menu_account_font_family', 'Arial, sans-serif', 'digit', '', '', '', 9),
+(@iCategoryId, CONCAT(@sName, '_menu_account_font_size'), '_bx_protean_stg_cpt_option_menu_account_font_size', '1rem', 'digit', '', '', '', 10),
+(@iCategoryId, CONCAT(@sName, '_menu_account_font_color'), '_bx_protean_stg_cpt_option_menu_account_font_color', 'rgba(40, 50, 60, 0.8)', 'rgba', '', '', '', 11),
+(@iCategoryId, CONCAT(@sName, '_menu_account_font_color_hover'), '_bx_protean_stg_cpt_option_menu_account_font_color_hover', 'rgba(40, 50, 60, 0.9)', 'rgba', '', '', '', 12),
+(@iCategoryId, CONCAT(@sName, '_menu_account_font_color_active'), '_bx_protean_stg_cpt_option_menu_account_font_color_active', 'rgba(20, 30, 40, 1)', 'rgba', '', '', '', 13),
+(@iCategoryId, CONCAT(@sName, '_menu_account_font_shadow'), '_bx_protean_stg_cpt_option_menu_account_font_shadow', 'none', 'digit', '', '', '', 14),
+(@iCategoryId, CONCAT(@sName, '_menu_account_font_weight'), '_bx_protean_stg_cpt_option_menu_account_font_weight', '400', 'digit', '', '', '', 15);
+
+
 -- SETTINGS: Protean template Styles Page Menu
 -- SETTINGS: Protean template Styles Page Menu
 INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `order`) VALUES 
 INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `order`) VALUES 
 (@iTypeId, CONCAT(@sName, '_styles_menu_page'), '_bx_protean_stg_cpt_category_styles_menu_page', 100);
 (@iTypeId, CONCAT(@sName, '_styles_menu_page'), '_bx_protean_stg_cpt_category_styles_menu_page', 100);
@@ -540,6 +563,21 @@ INSERT INTO `sys_options_mixes2options` (`option`, `mix_id`, `value`) VALUES
 ('bx_protean_menu_main_font_color_active', @iMixId, 'rgba(0, 0, 0, 1)'),
 ('bx_protean_menu_main_font_color_active', @iMixId, 'rgba(0, 0, 0, 1)'),
 ('bx_protean_menu_main_font_shadow', @iMixId, 'none'),
 ('bx_protean_menu_main_font_shadow', @iMixId, 'none'),
 ('bx_protean_menu_main_font_weight', @iMixId, '400'),
 ('bx_protean_menu_main_font_weight', @iMixId, '400'),
+('bx_protean_menu_account_bg_color', @iMixId, 'rgba(255, 255, 255, 0.9)'),
+('bx_protean_menu_account_bg_image', @iMixId, '0'),
+('bx_protean_menu_account_bg_image_repeat', @iMixId, 'no-repeat'),
+('bx_protean_menu_account_bg_image_size', @iMixId, 'cover'),
+('bx_protean_menu_account_content_padding', @iMixId, '0px'),
+('bx_protean_menu_account_border_color', @iMixId, 'rgba(208, 208, 208, 1)'),
+('bx_protean_menu_account_border_size', @iMixId, '0px'),
+('bx_protean_menu_account_shadow', @iMixId, 'none'),
+('bx_protean_menu_account_font_family', @iMixId, '"Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif'),
+('bx_protean_menu_account_font_size', @iMixId, '1.0rem'),
+('bx_protean_menu_account_font_color', @iMixId, 'rgba(62, 134, 133, 1)'),
+('bx_protean_menu_account_font_color_hover', @iMixId, 'rgba(62, 134, 133, 1)'),
+('bx_protean_menu_account_font_color_active', @iMixId, 'rgba(0, 0, 0, 1)'),
+('bx_protean_menu_account_font_shadow', @iMixId, 'none'),
+('bx_protean_menu_account_font_weight', @iMixId, '400'),
 ('bx_protean_menu_page_font_family', @iMixId, '"Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif'),
 ('bx_protean_menu_page_font_family', @iMixId, '"Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif'),
 ('bx_protean_menu_page_font_size', @iMixId, '1.2rem'),
 ('bx_protean_menu_page_font_size', @iMixId, '1.2rem'),
 ('bx_protean_menu_page_font_color', @iMixId, 'rgba(62, 134, 133, 1)'),
 ('bx_protean_menu_page_font_color', @iMixId, 'rgba(62, 134, 133, 1)'),

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

@@ -179,7 +179,7 @@
 	<string name="_bx_orgs_grid_filter_item_title_adm_pending"><![CDATA[В ожидании]]></string>
 	<string name="_bx_orgs_grid_filter_item_title_adm_pending"><![CDATA[В ожидании]]></string>
 	<string name="_bx_orgs_grid_filter_item_title_adm_suspended"><![CDATA[Заблокированные]]></string>
 	<string name="_bx_orgs_grid_filter_item_title_adm_suspended"><![CDATA[Заблокированные]]></string>
 	<string name="_bx_orgs_grid_column_title_adm_active"><![CDATA[Активные]]></string>
 	<string name="_bx_orgs_grid_column_title_adm_active"><![CDATA[Активные]]></string>
-    <string name="_bx_orgs_grid_column_title_adm_org_name"><![CDATA[Название]]></string>
+    <string name="_bx_orgs_grid_column_title_adm_fullname"><![CDATA[Название]]></string>
     <string name="_bx_orgs_grid_column_title_adm_last_online"><![CDATA[Последнее посещение]]></string>
     <string name="_bx_orgs_grid_column_title_adm_last_online"><![CDATA[Последнее посещение]]></string>
     <string name="_bx_orgs_grid_column_title_adm_account"><![CDATA[Аккаунт]]></string>
     <string name="_bx_orgs_grid_column_title_adm_account"><![CDATA[Аккаунт]]></string>
     <string name="_bx_orgs_grid_action_title_adm_delete"><![CDATA[Удалить]]></string>
     <string name="_bx_orgs_grid_action_title_adm_delete"><![CDATA[Удалить]]></string>

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

@@ -109,6 +109,7 @@
 	<string name="_bx_payment_grid_action_title_sbs_view_order"><![CDATA[Детали выплаты]]></string>
 	<string name="_bx_payment_grid_action_title_sbs_view_order"><![CDATA[Детали выплаты]]></string>
 	<string name="_bx_payment_grid_action_title_crts_delete"><![CDATA[Удалить]]></string>
 	<string name="_bx_payment_grid_action_title_crts_delete"><![CDATA[Удалить]]></string>
 	<string name="_bx_payment_grid_action_title_crts_continue"><![CDATA[Продолжить]]></string>
 	<string name="_bx_payment_grid_action_title_crts_continue"><![CDATA[Продолжить]]></string>
+	<string name="_bx_payment_grid_action_title_crt_checkout"><![CDATA[Оплатить через {0}]]></string>
 	<string name="_bx_payment_grid_action_title_crt_delete"><![CDATA[Удалить]]></string>
 	<string name="_bx_payment_grid_action_title_crt_delete"><![CDATA[Удалить]]></string>
 
 
     <string name="_bx_payment_popup_title_ods_order_subscription_view"><![CDATA[Подписка]]></string>
     <string name="_bx_payment_popup_title_ods_order_subscription_view"><![CDATA[Подписка]]></string>

+ 17 - 0
modules/boonex/russian/data/langs/bx_protean/ru.xml

@@ -140,6 +140,23 @@
 	<string name="_bx_protean_stg_cpt_option_menu_main_font_shadow"><![CDATA[Тень шрифта]]></string>
 	<string name="_bx_protean_stg_cpt_option_menu_main_font_shadow"><![CDATA[Тень шрифта]]></string>
 	<string name="_bx_protean_stg_cpt_option_menu_main_font_weight"><![CDATA[Насыщенность шрифта]]></string>
 	<string name="_bx_protean_stg_cpt_option_menu_main_font_weight"><![CDATA[Насыщенность шрифта]]></string>
 
 
+    <string name="_bx_protean_stg_cpt_category_styles_menu_account"><![CDATA[Аккаунт меню]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_bg_color"><![CDATA[Цвет фона]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_bg_image"><![CDATA[Изображение фона]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_bg_image_repeat"><![CDATA[Повтор изображение фона]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_bg_image_size"><![CDATA[Размер изображение фона]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_content_padding"><![CDATA[Контентные отступы]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_border_color"><![CDATA[Цвет границы]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_border_size"><![CDATA[Размер границы]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_shadow"><![CDATA[Тень]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_font_family"><![CDATA[Набор шрифтов]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_font_size"><![CDATA[Размер шрифта]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_font_color"><![CDATA[Цвет шрифта]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_font_color_hover"><![CDATA[Цвет шрифта при наведении курсора]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_font_color_active"><![CDATA[Цвет шрифта активного пункта меню]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_font_shadow"><![CDATA[Тень шрифта]]></string>
+    <string name="_bx_protean_stg_cpt_option_menu_account_font_weight"><![CDATA[Насыщенность шрифта]]></string>
+
 	<string name="_bx_protean_stg_cpt_category_styles_menu_page"><![CDATA[Страничное меню]]></string>
 	<string name="_bx_protean_stg_cpt_category_styles_menu_page"><![CDATA[Страничное меню]]></string>
 	<string name="_bx_protean_stg_cpt_option_menu_page_bg_color"><![CDATA[Цвет фона]]></string>
 	<string name="_bx_protean_stg_cpt_option_menu_page_bg_color"><![CDATA[Цвет фона]]></string>
 	<string name="_bx_protean_stg_cpt_option_menu_page_bg_image"><![CDATA[Изображение фона]]></string>
 	<string name="_bx_protean_stg_cpt_option_menu_page_bg_image"><![CDATA[Изображение фона]]></string>

+ 48 - 0
modules/boonex/russian/data/langs/bx_stripe_connect/ru.xml

@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="ru" flag="ru" title="Russian">
+	<string name="_bx_stripe_connect"><![CDATA[Stripe Connect]]></string>
+
+	<!-- OPTIONS -->
+	<string name="_bx_stripe_connect_option_mode"><![CDATA[Режим]]></string>
+    <string name="_bx_stripe_connect_option_mode_live"><![CDATA[рабочий]]></string>
+    <string name="_bx_stripe_connect_option_mode_test"><![CDATA[тестовый]]></string>
+    <string name="_bx_stripe_connect_option_api_id_live"><![CDATA[ID клиента (рабочий)]]></string>
+    <string name="_bx_stripe_connect_option_api_public_live"><![CDATA[Открытый ключ (рабочий)]]></string>
+    <string name="_bx_stripe_connect_option_api_secret_live"><![CDATA[Секретный ключ (рабочий)]]></string>
+    <string name="_bx_stripe_connect_option_api_id_test"><![CDATA[ID клиента (тестовый)]]></string>
+    <string name="_bx_stripe_connect_option_api_public_test"><![CDATA[Открытый ключ (тестовый)]]></string>
+    <string name="_bx_stripe_connect_option_api_secret_test"><![CDATA[Секретный ключ (тестовый)]]></string>
+    <string name="_bx_stripe_connect_option_api_scope"><![CDATA[Область действия]]></string>
+    <string name="_bx_stripe_connect_option_api_scope_read_only"><![CDATA[Только чтение]]></string>
+    <string name="_bx_stripe_connect_option_api_scope_read_write"><![CDATA[Чтение и запись]]></string>
+    <string name="_bx_stripe_connect_option_pmode_single"><![CDATA[Режим обработки единовременных выплат]]></string>
+    <string name="_bx_stripe_connect_option_fee_single"><![CDATA[Комиссия с единовременных выплат (в центах, процент)]]></string>
+    <string name="_bx_stripe_connect_option_pmode_recurring"><![CDATA[Режим обработки выплат по подписке]]></string>
+    <string name="_bx_stripe_connect_option_pmode_direct"><![CDATA[Прямой]]></string>
+    <string name="_bx_stripe_connect_option_pmode_platform"><![CDATA[Платформа]]></string>
+    <string name="_bx_stripe_connect_option_fee_recurring"><![CDATA[Комиссия с выплат по подписке (только процент)]]></string>
+    <string name="_bx_stripe_connect_option_redirect_url"><![CDATA[URL перенаправления]]></string>
+
+	<!-- PAGES and BLOCKS -->
+	<string name="_bx_stripe_connect_page_title_sys_result"><![CDATA[Stripe Connect: Результаты]]></string>
+	<string name="_bx_stripe_connect_page_title_result"><![CDATA[Stripe Connect: Результаты]]></string>
+	<string name="_bx_stripe_connect_page_block_title_result"><![CDATA[Stripe Connect: Результаты]]></string>
+	<string name="_bx_stripe_connect_page_block_title_connect"><![CDATA[Stripe Connect]]></string>
+
+	<!-- MENUS -->
+	<string name="_bx_stripe_connect_menu_item_title_accounts"><![CDATA[Аккаунты]]></string>
+
+	<!-- GRIDS -->
+	<string name="_bx_stripe_connect_grid_column_title_author"><![CDATA[Автор]]></string>
+	<string name="_bx_stripe_connect_grid_column_title_user_id"><![CDATA[Stripe Клиент ID]]></string>
+	<string name="_bx_stripe_connect_grid_column_title_public_key"><![CDATA[Публичный ключ]]></string>
+	<string name="_bx_stripe_connect_grid_column_title_access_token"><![CDATA[Секретный ключ]]></string>
+	<string name="_bx_stripe_connect_grid_column_title_added"><![CDATA[Присоединен]]></string>
+	<string name="_bx_stripe_connect_action_title_delete"><![CDATA[Отсоединиться]]></string>
+	
+	<!-- OTHER -->
+	<string name="_bx_stripe_connect_btn_connect"><![CDATA[Присоединиться]]></string>
+	<string name="_bx_stripe_connect_msg_connected"><![CDATA[Вы были успешно присоединены.]]></string>
+	<string name="_bx_stripe_connect_wrn_disconnect"><![CDATA[Вы уверены, что хотите отсоединиться?]]></string>
+	<string name="_bx_stripe_connect_err_perform"><![CDATA[Не удается выполнить действие. Пожалуйста сообщите.]]></string>
+</resources>

+ 36 - 0
modules/boonex/stripe_connect/classes/BxStripeConnectAlertsResponse.php

@@ -0,0 +1,36 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    StripeConnect Stripe Connect
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxStripeConnectAlertsResponse extends BxBaseModGeneralAlertsResponse
+{
+    public function __construct()
+    {
+    	$this->MODULE = 'bx_stripe_connect';
+
+        parent::__construct();
+    }
+
+    public function response($oAlert)
+    {
+        parent::response($oAlert);
+
+        if($oAlert->sUnit != 'bx_payment')
+            return;
+
+        $sMethod = 'processAlert' . bx_gen_method_name($oAlert->sAction);
+        if(!method_exists($this->_oModule, $sMethod))
+            return;
+
+        $this->_oModule->$sMethod($oAlert->iObject, $oAlert->iSender, $oAlert->aExtras);
+    }
+}
+
+/** @} */

+ 150 - 0
modules/boonex/stripe_connect/classes/BxStripeConnectConfig.php

@@ -0,0 +1,150 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    StripeConnect Stripe Connect
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxStripeConnectConfig extends BxBaseModConnectConfig
+{
+    protected $_oDb;
+
+    protected $_sMode;
+
+    protected $_sApiId;
+    protected $_sApiPublicKey;
+    protected $_sApiSecretKey;
+
+	protected $_sLogFile;
+
+    function __construct($aModule)
+    {
+        parent::__construct($aModule);
+
+        $this->CNF = array (
+	        // module icon
+            'ICON' => 'cc-stripe col-blue1',
+
+            // database tables
+            'TABLE_ENTRIES' => $aModule['db_prefix'] . 'accounts',
+
+        	// page URIs
+        	'URL_API_AUTHORIZE' => 'https://connect.stripe.com/oauth/authorize',
+        	'URL_API_DEAUTHORIZE' => 'https://connect.stripe.com/oauth/deauthorize',
+        	'URL_API_TOKEN' => 'https://connect.stripe.com/oauth/token',
+
+        	'URI_REDIRECT' => 'result',
+        	'URI_NOTIFY' => 'notify',
+
+	        // some params
+	        'PARAM_MODE' => 'bx_stripe_connect_mode',
+            'PARAM_API_ID_LIVE' => 'bx_stripe_connect_api_id_live',
+        	'PARAM_API_PUBLIC_LIVE' => 'bx_stripe_connect_api_public_live',
+        	'PARAM_API_SECRET_LIVE' => 'bx_stripe_connect_api_secret_live',
+        	'PARAM_API_ID_TEST' => 'bx_stripe_connect_api_id_test',
+        	'PARAM_API_PUBLIC_TEST' => 'bx_stripe_connect_api_public_test',
+        	'PARAM_API_SECRET_TEST' => 'bx_stripe_connect_api_secret_test',
+        	'PARAM_API_SCOPE' => 'bx_stripe_connect_api_scope',
+        	'PARAM_PMODE_SINGLE' => 'bx_stripe_connect_pmode_single',
+        	'PARAM_FEE_SINGLE' => 'bx_stripe_connect_fee_single',
+        	'PARAM_PMODE_RECURRING' => 'bx_stripe_connect_pmode_recurring',
+        	'PARAM_FEE_RECURRING' => 'bx_stripe_connect_fee_recurring',
+
+	        // objects
+        	'OBJECT_GRID_ACCOUNTS' => 'bx_stripe_connect_accounts',
+
+	        // Related Stripe payment provider name in Payments module 
+        	'STRIPE' => 'stripe',
+        );
+
+        $this->_aJsClasses = array(
+        	'main' => 'BxStripeConnectMain',
+        );
+
+        $this->_aJsObjects = array(
+        	'main' => 'oStripeConnectMain',
+        );
+
+        $this->_sLogFile = BX_DIRECTORY_PATH_LOGS . 'bx_stripe_connect.log';
+    }
+
+    public function init(&$oDb)
+    {
+    	$this->_oDb = &$oDb;
+        $sOptionPrefix = $this->getName();
+
+    	$this->_sMode = $this->_oDb->getParam($this->CNF['PARAM_MODE']);
+    	$this->_sApiId = $this->_oDb->getParam($this->CNF['PARAM_API_ID_' . ($this->_sMode == BX_STRIPE_CONNECT_MODE_LIVE ? 'LIVE' : 'TEST')]);
+    	$this->_sApiPublicKey = $this->_oDb->getParam($this->CNF['PARAM_API_PUBLIC_' . ($this->_sMode == BX_STRIPE_CONNECT_MODE_LIVE ? 'LIVE' : 'TEST')]);
+    	$this->_sApiSecretKey = $this->_oDb->getParam($this->CNF['PARAM_API_SECRET_' . ($this->_sMode == BX_STRIPE_CONNECT_MODE_LIVE ? 'LIVE' : 'TEST')]);
+    }
+
+    public function getMode()
+    {
+        return $this->_sMode;
+    }
+
+    public function getApiId()
+	{
+		return $this->_sApiId;
+	}
+
+    public function getApiPublicKey()
+	{
+		return $this->_sApiPublicKey;
+	}
+
+	public function getApiSecretKey()
+	{
+		return $this->_sApiSecretKey;
+	}
+
+    public function getPayMode($sType)
+    {
+        $sResult = '';
+
+        switch($sType) {
+            case BX_PAYMENT_TYPE_SINGLE:
+                $sResult = getParam($this->CNF['PARAM_PMODE_SINGLE']);
+                break;
+
+            case BX_PAYMENT_TYPE_RECURRING:
+                $sResult = getParam($this->CNF['PARAM_PMODE_RECURRING']);
+                break;
+        }
+
+        return $sResult;
+    }
+
+    public function getFee($sType, $fAmount = 0)
+    {
+        $iResult = 0;
+
+        switch($sType) {
+            case BX_PAYMENT_TYPE_SINGLE:
+                $mixedValue = getParam($this->CNF['PARAM_FEE_SINGLE']);
+                if(is_numeric($mixedValue))
+                    $iResult = (int)$mixedValue;
+                else if(strpos($mixedValue, '%') !== false)
+                    $iResult = (int)round($fAmount * (int)trim($mixedValue, '%') / 100);
+                break;
+
+            case BX_PAYMENT_TYPE_RECURRING:
+                $iResult = (int)trim(getParam($this->CNF['PARAM_FEE_RECURRING']), '%');
+                break;
+        }
+
+        return $iResult;
+    }
+
+    public function getLogFile()
+    {
+    	return $this->_sLogFile;
+    }
+}
+
+/** @} */

+ 81 - 0
modules/boonex/stripe_connect/classes/BxStripeConnectDb.php

@@ -0,0 +1,81 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    StripeConnect Stripe Connect
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxStripeConnectDb extends BxBaseModConnectDb
+{
+    function __construct(&$oConfig)
+    {
+        parent::__construct($oConfig);
+    }
+
+	public function getAccount($aParams = array())
+    {
+    	$CNF = &$this->_oConfig->CNF;
+    	$aMethod = array('name' => 'getAll', 'params' => array(0 => 'query'));
+
+    	$sJoinClause = $sWhereClause = "";
+        switch($aParams['type']) {
+            case 'id':
+            	$aMethod['name'] = 'getRow';
+            	$aMethod['params'][1] = array(
+                	'id' => $aParams['id']
+                );
+
+                $sWhereClause = " AND `te`.`id`=:id";
+                break;
+
+			case 'author':
+				$aMethod['name'] = 'getRow';
+				$aMethod['params'][1] = array(
+                	'author' => $aParams['author']
+                );
+
+				$sWhereClause = " AND `te`.`author`=:author";
+				break;
+        }
+
+        $aMethod['params'][0] = "SELECT
+        		`te`.*
+            FROM `" . $this->_oConfig->CNF['TABLE_ENTRIES'] . "` AS `te`" . $sJoinClause . "
+            WHERE 1" . $sWhereClause;
+
+        return call_user_func_array(array($this, $aMethod['name']), $aMethod['params']);
+    }
+
+	public function insertAccount($aSet)
+    {
+        $sQuery = "REPLACE INTO `" . $this->_oConfig->CNF['TABLE_ENTRIES'] . "` SET " . $this->arrayToSQL($aSet);
+        return (int)$this->query($sQuery) > 0;
+    }
+
+	public function updateAccount($aSet, $aWhere)
+    {
+        $sQuery = "UPDATE `" . $this->_oConfig->CNF['TABLE_ENTRIES'] . "` SET " . $this->arrayToSQL($aSet) . " WHERE " . (!empty($aWhere) ? $this->arrayToSQL($aWhere, ' AND ') : "1");
+        return (int)$this->query($sQuery) > 0;
+    }
+
+	public function deleteAccount($aWhere)
+    {
+    	if(empty($aWhere))
+    		return false;
+
+        return $this->query("DELETE FROM `" . $this->_oConfig->CNF['TABLE_ENTRIES'] . "` WHERE " . $this->arrayToSQL($aWhere, ' AND ')) !== false;
+    }
+
+    public function hasAccount($iAuthor)
+    {
+        return (int)$this->getOne("SELECT `id` FROM `" . $this->_oConfig->CNF['TABLE_ENTRIES'] . "` WHERE `author` = :author LIMIT 1", array(
+    		'author' => $iAuthor,
+    	)) > 0;
+    }
+}
+
+/** @} */

+ 46 - 0
modules/boonex/stripe_connect/classes/BxStripeConnectGridAccounts.php

@@ -0,0 +1,46 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    StripeConnect Stripe Connect
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxStripeConnectGridAccounts extends BxTemplGrid
+{
+	protected $_sModule;
+	protected $_oModule;
+	
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+    	$this->_sModule = 'bx_stripe_connect';
+    	$this->_oModule = BxDolModule::getInstance($this->_sModule);
+
+        parent::__construct ($aOptions, $oTemplate);
+    }
+
+	protected function _isVisibleGrid ($a)
+    {
+        return isAdmin();
+    }
+
+	protected function _getCellAuthor($mixedValue, $sKey, $aField, $aRow)
+    {
+    	return parent::_getCellDefault($this->_oModule->_oTemplate->displayProfileLink($mixedValue), $sKey, $aField, $aRow);
+    }
+
+	protected function _getCellAdded($mixedValue, $sKey, $aField, $aRow)
+    {
+    	return parent::_getCellDefault(bx_time_js($mixedValue), $sKey, $aField, $aRow);
+    }
+
+    protected function _delete($mixedId)
+    {
+    	return $this->_oModule->deleteAccount($mixedId);
+    }
+}
+
+/** @} */

+ 442 - 0
modules/boonex/stripe_connect/classes/BxStripeConnectModule.php

@@ -0,0 +1,442 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    StripeConnect Stripe Connect
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+require_once(BX_DIRECTORY_PATH_PLUGINS . 'stripe/init.php');
+
+define('BX_STRIPE_CONNECT_MODE_LIVE', 'live');
+define('BX_STRIPE_CONNECT_MODE_TEST', 'test');
+
+define('BX_STRIPE_CONNECT_PMODE_DIRECT', 'direct');
+define('BX_STRIPE_CONNECT_PMODE_PLATFORM', 'platform');
+
+class BxStripeConnectModule extends BxBaseModConnectModule
+{
+    function __construct(&$aModule)
+    {
+        parent::__construct($aModule);
+
+        $this->_oConfig->init($this->_oDb);
+    }
+
+    public function serviceGetOptionsMode()
+    {
+        return array(
+        	BX_STRIPE_CONNECT_MODE_LIVE => _t('_bx_stripe_connect_option_mode_live'),
+        	BX_STRIPE_CONNECT_MODE_TEST => _t('_bx_stripe_connect_option_mode_test'),
+        );
+    }
+
+    public function serviceGetOptionsApiScope()
+    {
+        return array(
+        	'read_only' => _t('_bx_stripe_connect_option_api_scope_read_only'),
+            'read_write' => _t('_bx_stripe_connect_option_api_scope_read_write'),
+        );
+    }
+
+    public function serviceGetOptionsPmodeSingle()
+    {
+        return array(
+        	BX_STRIPE_CONNECT_PMODE_DIRECT => _t('_bx_stripe_connect_option_pmode_direct'),
+            BX_STRIPE_CONNECT_PMODE_PLATFORM => _t('_bx_stripe_connect_option_pmode_platform'),
+        );
+    }
+
+    /**
+     * Note. Subscriptions do not currently support the Platform mode.
+     */
+    public function serviceGetOptionsPmodeRecurring()
+    {
+        return array(
+        	BX_STRIPE_CONNECT_PMODE_DIRECT => _t('_bx_stripe_connect_option_pmode_direct'),
+        );
+    }
+
+    public function serviceGetBlockConnect()
+    {
+    	return $this->_oTemplate->displayBlockConnect();
+    }
+
+    public function actionDelete()
+    {
+    	$sError = _t('_bx_stripe_connect_err_perform');
+
+    	$iId = (int)bx_get('id');
+    	if(empty($iId))
+    		return echoJson(array('code' => 1, 'message' => $sError));
+
+    	if(!$this->deleteAccount($iId))
+    		return echoJson(array('code' => 2, 'message' => $sError));
+
+    	echoJson(array('code' => 0, 'id' => $iId, 'reload' => 1));
+    }
+
+    public function actionResult()
+    {
+    	if(bx_get('error') !== false)
+    		$this->_oTemplate->displayErrorOccured(bx_process_input(bx_get('error_description')));
+
+		$mixedResult = $this->createAccount(bx_process_input(bx_get('code')));
+		if($mixedResult !== true)
+			$this->_oTemplate->displayErrorOccured($mixedResult);
+
+		$this->_oTemplate->displayMsg('_bx_stripe_connect_msg_connected', true);
+    }
+
+	public function actionNotify()
+    {
+		$iResult = $this->_processEvent();
+		http_response_code($iResult);
+    }
+
+    public function createAccount($sCode)
+    {
+    	$CNF = $this->_oConfig->CNF;
+
+		$oResult = $this->_request($CNF['URL_API_TOKEN'], array(
+			'client_secret' => $this->_oConfig->getApiSecretKey(),
+			'code' => $sCode,
+			'grant_type' => 'authorization_code'
+		));
+
+		if(!empty($oResult->error))
+			return bx_process_input($oResult->error_description);
+
+		$bResult = $this->_oDb->insertAccount(array(
+			'author' => bx_get_logged_profile_id(),
+			'added' => time(),
+			'user_id' => $oResult->stripe_user_id,
+			'public_key' => $oResult->stripe_publishable_key,
+			'access_token' => $oResult->access_token,
+			'refresh_token' => $oResult->refresh_token
+		));
+
+		return $bResult ? $bResult : _t('_bx_stripe_connect_err_perform');
+    }
+
+    public function deleteAccount($iId)
+    {
+    	$CNF = $this->_oConfig->CNF;
+
+		$aAccount = $this->_oDb->getAccount(array('type' => 'id', 'id' => $iId));
+		if(empty($aAccount) || !is_array($aAccount))
+			return false;
+
+		$oResult = $this->_request($CNF['URL_API_DEAUTHORIZE'], array(
+			'client_id' => $this->_oConfig->getApiId(),
+			'client_secret' => $this->_oConfig->getApiSecretKey(),
+			'stripe_user_id' => $aAccount['user_id'],
+		));
+
+		if(!empty($oResult->error))
+			return false;
+
+		return $this->_oDb->deleteAccount(array('id' => $iId));
+    }
+
+    public function processAlertStripeGetButton($iObject, $iSender, $aParams)
+    {
+        if(empty($aParams['type']))
+            return false;
+
+        $sType = $aParams['type'];
+        $sPayMode = $this->_oConfig->getPayMode($sType);
+
+        switch($sType) {
+            case BX_PAYMENT_TYPE_SINGLE:
+                if($sPayMode == BX_STRIPE_CONNECT_PMODE_PLATFORM)
+                    $aParams['public_key'] = $this->_oConfig->getApiPublicKey();
+                break;
+
+            case BX_PAYMENT_TYPE_RECURRING:
+                //TODO: Perform necessary actions here !WHEN! 'Platform' mode will be available for recurring payments.
+                break;
+        }
+
+        return !empty($aParams['public_key']);
+    }
+
+    public function processAlertStripeCreateCustomer($iObject, $iSender, $aParams)
+    {
+        if(empty($aParams['type']) || empty($aParams['customer_params']['card']))
+            return false;
+
+        $sPayMode = $this->_oConfig->getPayMode($aParams['type']);
+
+        try {
+            switch($sPayMode) {
+                case BX_STRIPE_CONNECT_PMODE_DIRECT:
+                    /*
+                     * Do nothing in this case because a Customer 
+                     * should be created in Connected Stripe account.
+                     */
+                    break;
+
+                case BX_STRIPE_CONNECT_PMODE_PLATFORM:
+                    \Stripe\Stripe::setApiKey($this->_oConfig->getApiSecretKey());
+
+                    $aParams['customer_object'] = \Stripe\Customer::create($aParams['customer_params']);
+                    break;
+            }
+		}
+		catch (Exception $oException) {
+		    $aParams['customer_object'] = null;
+
+		    return $this->_processException('Create Customer Error: ', $oException);
+		}
+
+		return !empty($aParams['customer_object']);
+    }
+
+    public function processAlertStripeRetrieveCustomer($iObject, $iSender, $aParams)
+    {
+        if(empty($aParams['type']) || empty($aParams['customer_id']))
+            return false;
+
+        $sPayMode = $this->_oConfig->getPayMode($aParams['type']);
+
+        try {
+            switch($sPayMode) {
+                case BX_STRIPE_CONNECT_PMODE_DIRECT:
+                    /*
+                     * Do nothing in this case because a Customer 
+                     * should be retreived from Connected Stripe account.
+                     */
+                    break;
+
+                case BX_STRIPE_CONNECT_PMODE_PLATFORM:
+                    \Stripe\Stripe::setApiKey($this->_oConfig->getApiSecretKey());
+
+                    $aParams['customer_object'] = \Stripe\Customer::retrieve($aParams['customer_id']);
+                    break;
+            }
+		}
+		catch (Exception $oException) {
+		    $aParams['customer_object'] = null;
+
+		    return $this->_processException('Retrieve Customer Error: ', $oException);
+		}
+
+		return !empty($aParams['customer_object']);
+    }
+
+    public function processAlertStripeCreateCharge($iObject, $iSender, $aParams)
+    {
+        if(empty($iObject) || empty($aParams['charge_params']['amount']))
+            return false;
+
+        $aAccount = $this->_getAccount($iObject, BX_PAYMENT_TYPE_SINGLE);
+        if($aAccount === false)
+            return false;
+
+        $sPayMode = $this->_oConfig->getPayMode(BX_PAYMENT_TYPE_SINGLE);
+        $aParams['charge_params']['application_fee'] = $this->_oConfig->getFee(BX_PAYMENT_TYPE_SINGLE, (float)$aParams['charge_params']['amount']);
+
+        \Stripe\Stripe::setApiKey($this->_oConfig->getApiSecretKey());
+
+        try {
+            switch($sPayMode) {
+                case BX_STRIPE_CONNECT_PMODE_DIRECT:
+                    $aParams['charge_object'] = \Stripe\Charge::create($aParams['charge_params'], array('stripe_account' => $aAccount['user_id']));
+                    break;
+
+                case BX_STRIPE_CONNECT_PMODE_PLATFORM:
+                    $aParams['charge_params']['destination'] = $aAccount['user_id'];
+                    $aParams['charge_object'] = \Stripe\Charge::create($aParams['charge_params']);
+                    break;
+            }
+		}
+		catch (Exception $oException) {
+		    $aParams['charge_object'] = null;
+
+			return $this->_processException('Create Charge Error: ', $oException);
+		}
+
+		return !empty($aParams['charge_object']);
+    }
+
+    public function processAlertStripeRetrieveCharge($iObject, $iSender, $aParams)
+    {
+        if(empty($aParams['charge_id']))
+            return false;
+
+        $sPayMode = $this->_oConfig->getPayMode(BX_PAYMENT_TYPE_SINGLE);
+
+        try {
+            switch($sPayMode) {
+                case BX_STRIPE_CONNECT_PMODE_DIRECT:
+                    /*
+                     * Do nothing in this case because a Charge 
+                     * should be stored on Connected Stripe account.
+                     */
+                    break;
+
+                case BX_STRIPE_CONNECT_PMODE_PLATFORM:
+                    \Stripe\Stripe::setApiKey($this->_oConfig->getApiSecretKey());
+
+                    $aParams['charge_object'] = \Stripe\Charge::retrieve($aParams['charge_id']);
+                    break;
+            }
+		}
+		catch (Exception $oException) {
+		    $aParams['charge_object'] = null;
+
+		    return $this->_processException('Retrieve Customer Error: ', $oException);
+		}
+
+		return !empty($aParams['charge_object']);
+    }
+    
+    public function processAlertStripeCreateSubscription($iObject, $iSender, $aParams)
+    {
+        if(empty($iObject) || empty($aParams['subscription_params']['plan']))
+            return false;
+
+        $aAccount = $this->_getAccount($iObject, BX_PAYMENT_TYPE_RECURRING);
+        if($aAccount === false)
+            return false;
+
+        $aParams['subscription_params']['application_fee_percent'] = $this->_oConfig->getFee(BX_PAYMENT_TYPE_RECURRING);
+
+        \Stripe\Stripe::setApiKey($this->_oConfig->getApiSecretKey());
+
+        try {
+             $aParams['subscription_object'] = $aParams['customer']->subscriptions->create($aParams['subscription_params'], array('stripe_account' => $aAccount['user_id']));
+		}
+		catch (Exception $oException) {
+		    $aParams['subscription_object'] = null;
+
+			return $this->_processException('Create Subscription Error: ', $oException);
+		}
+
+		return !empty($aParams['subscription_object']);
+    }
+
+	protected function _request($sUrl, $aParams = array())
+	{
+	    $sResult = '';
+	    if(!function_exists('curl_init'))
+			return false;
+
+        $rConnect = curl_init();
+
+		curl_setopt($rConnect, CURLOPT_URL, $sUrl);
+		curl_setopt($rConnect, CURLOPT_HEADER, 0);
+		curl_setopt($rConnect, CURLOPT_RETURNTRANSFER, 1);
+		curl_setopt($rConnect, CURLOPT_FOLLOWLOCATION, 1);
+		curl_setopt($rConnect, CURLOPT_POST, 1);
+		curl_setopt($rConnect, CURLOPT_POSTFIELDS, http_build_query($aParams));
+
+        if(bx_mb_strpos($sUrl, 'https') !== false) {
+	        curl_setopt($rConnect, CURLOPT_SSL_VERIFYPEER, 0);
+			curl_setopt($rConnect, CURLOPT_SSL_VERIFYHOST, 0);
+        }
+	
+		$sResult = curl_exec($rConnect);
+		curl_close($rConnect);
+
+	    return json_decode($sResult);
+	}
+
+	protected function _processEvent()
+	{
+    	$sInput = @file_get_contents("php://input");
+		$aEvent = json_decode($sInput, true);
+		if(empty($aEvent) || !is_array($aEvent)) 
+			return 404;
+
+		$sType = $aEvent['type'];
+		if(!in_array($sType, array('account.application.deauthorized')))
+			return 200;
+
+		$this->_log('Webhooks: ' . (!empty($sType) ? $sType : ''));
+		$this->_log($aEvent);
+
+		$sMethod = '_processEvent' . bx_gen_method_name($sType, array('.', '_', '-'));
+    	if(!method_exists($this, $sMethod))
+    		return 200;
+
+    	return $this->$sMethod($aEvent) ? 200 : 403;
+    }
+
+	protected function _processEventAccountApplicationDeauthorized(&$aEvent)
+	{
+		$CNF = $this->_oConfig->CNF;
+
+		$sApiId = bx_process_input($aEvent['data']['object']['id']);
+		if(strcmp($sApiId, $this->_oConfig->getApiId()) != 0)
+			return false;
+
+		$sUserId = bx_process_input($aEvent['user_id']);
+		if(empty($sUserId))
+			return false;
+
+		return $this->_oDb->deleteAccount(array('user_id' => $sUserId));
+	}
+
+    protected function _processException($sMessage, &$oException)
+	{
+		$aError = $oException->getJsonBody();
+
+		$sMessage = $aError['error']['message'];
+		if(empty($sMessage))
+			$sMessage = $oException->getMessage();
+
+		$this->_log($sMessage . $aError['error']['message']);
+		$this->_log($aError);
+
+		return false;
+	}
+
+    protected function _getAccount($iPending, $sType)
+    {
+        $aPending = BxDolPayments::getInstance()->getPendingOrdersInfo(array('id' => $iPending));
+        if(!empty($aPending) && is_array($aPending) && count($aPending) == 1)
+            $aPending = array_shift($aPending);
+
+        if(empty($aPending) || !is_array($aPending) || $aPending['type'] != $sType)
+            return false;
+
+        $iSeller = (int)$aPending['seller_id'];
+        $oSeller = BxDolProfile::getInstance($iSeller);
+        if(!$oSeller)
+            return false;
+
+        $aAccount = $this->_oDb->getAccount(array('type' => 'author', 'author' => $iSeller));
+        if(empty($aAccount) || !is_array($aAccount))
+            return false;
+
+        return $aAccount;
+    }
+
+	protected function _log($sContents)
+	{
+		try {
+			$sFile = $this->_oConfig->getLogFile();
+			if(empty($sFile))
+				$sFile = dirname(__FILE__) . "/bx_stripe_connect.log";
+	
+			file_put_contents($sFile, date('m-d H:i:s') . ": ", FILE_APPEND);
+	
+			if (is_array($sContents))
+				$sContents = var_export($sContents, true);	
+			else if (is_object($sContents))
+				$sContents = json_encode($sContents);
+	
+			file_put_contents($sFile, $sContents . "\n", FILE_APPEND);
+	  	} 
+	  	catch (Exception $oException) {
+			echo "Error: " . $oException->getMessage();
+	  	}
+	}
+}
+
+/** @} */

+ 20 - 0
modules/boonex/stripe_connect/classes/BxStripeConnectPage.php

@@ -0,0 +1,20 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    StripeConnect Stripe Connect
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxStripeConnectPage extends BxTemplPage
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 50 - 0
modules/boonex/stripe_connect/classes/BxStripeConnectStudioPage.php

@@ -0,0 +1,50 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    StripeConnect Stripe Connect
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+require_once('BxStripeConnectStudioSettings.php');
+
+define('BX_DOL_STUDIO_MOD_TYPE_ACCOUNTS', 'accounts');
+
+class BxStripeConnectStudioPage extends BxTemplStudioModule
+{
+	protected $_sModule;
+	protected $_oModule;
+
+    function __construct($sModule = "", $sPage = "")
+    {
+        parent::__construct($sModule, $sPage);
+
+        $this->_sModule = 'bx_stripe_connect';
+    	$this->_oModule = BxDolModule::getInstance($this->_sModule);
+
+        $this->aMenuItems[] = array('name' => BX_DOL_STUDIO_MOD_TYPE_ACCOUNTS, 'icon' => 'users', 'title' => '_bx_stripe_connect_menu_item_title_accounts');
+    }
+
+    protected function getSettings()
+    {
+        $oPage = new BxStripeConnectStudioSettings($this->sModule);
+
+        return BxDolStudioTemplate::getInstance()->parseHtmlByName('module.html', array(
+            'content' => $oPage->getPageCode(),
+        ));
+    }
+
+	protected function getAccounts()
+    {
+        $oGrid = BxDolGrid::getObjectInstance($this->_oModule->_oConfig->CNF['OBJECT_GRID_ACCOUNTS'], BxDolStudioTemplate::getInstance());
+        if(!$oGrid)
+            return '';
+
+        return $oGrid->getCode();
+    }
+}
+
+/** @} */

+ 32 - 0
modules/boonex/stripe_connect/classes/BxStripeConnectStudioSettings.php

@@ -0,0 +1,32 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    StripeConnect Stripe Connect
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxStripeConnectStudioSettings extends BxTemplStudioSettings
+{
+    protected $_sModule;
+	protected $_oModule;
+
+    function __construct($sType = '', $sCategory = '')
+    {
+        parent::__construct($sType, $sCategory);
+        
+        $this->_sModule = 'bx_stripe_connect';
+        $this->_oModule = BxDolModule::getInstance($this->_sModule);
+    }
+
+    public function getCustomValueRedirectUrl($aItem, $mixedValue)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        return BX_DOL_URL_ROOT . $this->_oModule->_oConfig->getBaseUri() . $CNF['URI_REDIRECT'];
+    }
+}
+/** @} */

+ 94 - 0
modules/boonex/stripe_connect/classes/BxStripeConnectTemplate.php

@@ -0,0 +1,94 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    StripeConnect Stripe Connect
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxStripeConnectTemplate extends BxBaseModConnectTemplate
+{
+    function __construct($oConfig, $oDb)
+    {
+    	$this->MODULE = 'bx_stripe_connect';
+
+        parent::__construct($oConfig, $oDb);
+    }
+
+    public function displayBlockConnect()
+    {
+    	$CNF = $this->_oConfig->CNF;
+
+    	$sApiId = $this->_oConfig->getApiId();
+    	if(empty($sApiId))
+    		return '';
+
+		$iVendor = bx_get_logged_profile_id();
+		$aVendorAccount = $this->_oDb->getAccount(array('type' => 'author', 'author' => $iVendor));
+		if(!empty($aVendorAccount) && is_array($aVendorAccount))
+			return $this->displayBlockAccount($aVendorAccount);
+
+		$aVendor = BxDolModule::getInstance($this->MODULE)->getProfileInfo($iVendor);
+    	$bVendorStripe = BxDolPayments::getInstance()->isPaymentProvider($iVendor, $CNF['STRIPE']);
+
+    	$aRequestParams = array(
+			'response_type' => 'code',
+			'client_id' => $sApiId,
+			'scope' => $this->_oDb->getParam($CNF['PARAM_API_SCOPE']),
+			'redirect_uri' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . $CNF['URI_REDIRECT'],
+			'stripe_landing' => $bVendorStripe ? 'login' : 'register'
+		);
+
+		if(!$bVendorStripe)
+			$aRequestParams = array_merge($aRequestParams, array(
+				'stripe_user[email]' => $aVendor['email'],
+				'stripe_user[url]' => urlencode($aVendor['link']),
+				'stripe_user[first_name]' => $aVendor['name']
+			));
+
+    	$this->addCss(array('main.css'));
+    	return $this->parseHtmlByName('block_connect.html', array(
+    		'link' => bx_append_url_params($CNF['URL_API_AUTHORIZE'], $aRequestParams)
+    	));
+    }
+    
+    public function displayBlockAccount($aAccount)
+    {
+    	$CNF = $this->_oConfig->CNF;
+
+    	$sApiId = $this->_oConfig->getApiId();
+    	if(empty($sApiId))
+    		return '';
+
+		$this->addCss(array('main.css'));
+		$this->addJs(array('main.js'));
+    	$this->addJsTranslation(array('_bx_stripe_connect_wrn_disconnect'));
+    	return $this->parseHtmlByName('block_account.html', array(
+    		'js_object' => $this->_oConfig->getJsObject('main'),
+    		'id' => $aAccount['id'],
+    		'user_id' => $aAccount['user_id'],
+    	    'public_key' => $aAccount['public_key'],
+    		'access_token' => $aAccount['access_token'],
+	    	'added' => bx_time_js($aAccount['added']),
+    	    'keys_usage' => _t('_bx_stripe_connect_txt_keys_usage', BxDolPayments::getInstance()->getDetailsUrl()),
+    		'js_code' => $this->getJsCode('main')
+    	));
+    }
+
+	public function displayProfileLink($mixedProfile)
+    {
+    	if(!is_array($mixedProfile))
+    		$mixedProfile = BxDolModule::getInstance($this->MODULE)->getProfileInfo((int)$mixedProfile);
+
+    	return $this->parseHtmlByName('link.html', array(
+            'href' => $mixedProfile['link'],
+            'title' => bx_html_attribute(!empty($mixedProfile['title']) ? $mixedProfile['title'] : $mixedProfile['name']),
+            'content' => $mixedProfile['name']
+        ));
+    }
+}
+
+/** @} */

+ 68 - 0
modules/boonex/stripe_connect/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    StripeConnect Stripe Connect
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_stripe_connect',
+    'title' => 'Stripe Connect',
+    'note' => 'Organize eCommerce platform using Stripe Connect.',
+    'version' => '9.0.0.DEV',
+    'vendor' => 'BoonEx',
+    'help_url' => 'http://feed.boonex.com/?section={module_name}',
+
+    'compatible_with' => array(
+        '9.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/stripe_connect/',
+    'home_uri' => 'stripe_connect',
+
+    'db_prefix' => 'bx_stripe_connect_',
+    'class_prefix' => 'BxStripeConnect',
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => 'Stripe Connect',
+
+    /**
+     * 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/stripe_connect/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    StripeConnect Stripe Connect
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxStripeConnectInstaller extends BxDolStudioInstaller
+{
+    function __construct($aConfig)
+    {
+        parent::__construct($aConfig);
+    }
+}
+
+/** @} */

+ 49 - 0
modules/boonex/stripe_connect/install/langs/en.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+	<string name="_bx_stripe_connect"><![CDATA[Stripe Connect]]></string>
+
+	<!-- OPTIONS -->
+	<string name="_bx_stripe_connect_option_mode"><![CDATA[Mode]]></string>
+	<string name="_bx_stripe_connect_option_mode_live"><![CDATA[Live]]></string>
+	<string name="_bx_stripe_connect_option_mode_test"><![CDATA[Test]]></string>
+    <string name="_bx_stripe_connect_option_api_id_live"><![CDATA[Client ID (live)]]></string>
+    <string name="_bx_stripe_connect_option_api_public_live"><![CDATA[Public Key (live)]]></string>
+    <string name="_bx_stripe_connect_option_api_secret_live"><![CDATA[Secret Key (live)]]></string>
+    <string name="_bx_stripe_connect_option_api_id_test"><![CDATA[Client ID (test)]]></string>
+    <string name="_bx_stripe_connect_option_api_public_test"><![CDATA[Public Key (test)]]></string>
+    <string name="_bx_stripe_connect_option_api_secret_test"><![CDATA[Secret Key (test)]]></string>
+    <string name="_bx_stripe_connect_option_api_scope"><![CDATA[Scope]]></string>
+    <string name="_bx_stripe_connect_option_api_scope_read_only"><![CDATA[Read Only]]></string>
+    <string name="_bx_stripe_connect_option_api_scope_read_write"><![CDATA[Read Write]]></string>
+    <string name="_bx_stripe_connect_option_pmode_single"><![CDATA[One-time payments processing mode]]></string>
+    <string name="_bx_stripe_connect_option_fee_single"><![CDATA[One-time fee (in cents, percent)]]></string>
+    <string name="_bx_stripe_connect_option_pmode_recurring"><![CDATA[Subscription payments processing mode]]></string>
+    <string name="_bx_stripe_connect_option_pmode_direct"><![CDATA[Direct]]></string>
+    <string name="_bx_stripe_connect_option_pmode_platform"><![CDATA[Platform]]></string>
+    <string name="_bx_stripe_connect_option_fee_recurring"><![CDATA[Subscription fee (percent only)]]></string>
+    <string name="_bx_stripe_connect_option_redirect_url"><![CDATA[Redirect URL]]></string>  
+
+	<!-- PAGES and BLOCKS -->
+	<string name="_bx_stripe_connect_page_title_sys_result"><![CDATA[Stripe Connect Results]]></string>
+	<string name="_bx_stripe_connect_page_title_result"><![CDATA[Stripe Connect Results]]></string>
+	<string name="_bx_stripe_connect_page_block_title_result"><![CDATA[Stripe Connect Results]]></string>
+	<string name="_bx_stripe_connect_page_block_title_connect"><![CDATA[Stripe Connect]]></string>
+
+	<!-- MENUS -->
+	<string name="_bx_stripe_connect_menu_item_title_accounts"><![CDATA[Accounts]]></string>
+
+	<!-- GRIDS -->
+	<string name="_bx_stripe_connect_grid_column_title_author"><![CDATA[Author]]></string>
+	<string name="_bx_stripe_connect_grid_column_title_user_id"><![CDATA[Stripe User ID]]></string>
+	<string name="_bx_stripe_connect_grid_column_title_public_key"><![CDATA[Public Key]]></string>
+	<string name="_bx_stripe_connect_grid_column_title_access_token"><![CDATA[Secret Key]]></string>
+	<string name="_bx_stripe_connect_grid_column_title_added"><![CDATA[Connected]]></string>
+	<string name="_bx_stripe_connect_action_title_delete"><![CDATA[Disconnect]]></string>
+	
+	<!-- OTHER -->
+	<string name="_bx_stripe_connect_btn_connect"><![CDATA[Connect]]></string>
+	<string name="_bx_stripe_connect_msg_connected"><![CDATA[You were successfully connected.]]></string>
+	<string name="_bx_stripe_connect_wrn_disconnect"><![CDATA[Are you sure you want to disconnect?]]></string>
+	<string name="_bx_stripe_connect_err_perform"><![CDATA[Cannot perform the action. Please report.]]></string>
+	<string name="_bx_stripe_connect_txt_keys_usage"><![CDATA[<b>Note</b>. You should use these <b>Public</b> and <b>Secret</b> keys in configuration settings of your Stripe account <a href="{0}">here</a>.]]></string>
+</resources>

+ 22 - 0
modules/boonex/stripe_connect/install/sql/disable.sql

@@ -0,0 +1,22 @@
+SET @sName = 'bx_stripe_connect';
+
+
+-- SETTINGS
+DELETE FROM `tot`, `toc`, `to` USING `sys_options_types` AS `tot` LEFT JOIN `sys_options_categories` AS `toc` ON `tot`.`id`=`toc`.`type_id` LEFT JOIN `sys_options` AS `to` ON `toc`.`id`=`to`.`category_id` WHERE `tot`.`name` = @sName;
+
+
+-- PAGES
+DELETE FROM `sys_objects_page` WHERE `module` = @sName;
+DELETE FROM `sys_pages_blocks` WHERE `module` = @sName;
+
+
+-- GRIDS
+DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_stripe_connect_accounts');
+DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_stripe_connect_accounts');
+DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_stripe_connect_accounts');
+
+
+-- ALERTS
+SET @iHandler := (SELECT `id` FROM `sys_alerts_handlers` WHERE `name` = @sName LIMIT 1);
+DELETE FROM `sys_alerts` WHERE `handler_id` = @iHandler;
+DELETE FROM `sys_alerts_handlers` WHERE `id` = @iHandler;

+ 74 - 0
modules/boonex/stripe_connect/install/sql/enable.sql

@@ -0,0 +1,74 @@
+SET @sName = 'bx_stripe_connect';
+
+
+-- SETTINGS
+SET @iTypeOrder = (SELECT MAX(`order`) FROM `sys_options_types` WHERE `group` = 'modules');
+INSERT INTO `sys_options_types` (`group`, `name`, `caption`, `icon`, `order`) VALUES 
+('modules', @sName, '_bx_stripe_connect', 'bx_stripe_connect@modules/boonex/stripe_connect/|std-icon.svg', IF(NOT ISNULL(@iTypeOrder), @iTypeOrder + 1, 1));
+SET @iTypeId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
+VALUES (@iTypeId, @sName, '_bx_stripe_connect', 1);
+SET @iCategId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_error`, `order`, `extra`) VALUES
+('bx_stripe_connect_mode', 'live', @iCategId, '_bx_stripe_connect_option_mode', 'select', '', '', 10, 'a:2:{s:6:"module";s:17:"bx_stripe_connect";s:6:"method";s:16:"get_options_mode";}'),
+('bx_stripe_connect_api_id_live', '', @iCategId, '_bx_stripe_connect_option_api_id_live', 'digit', '', '', 20, ''),
+('bx_stripe_connect_api_public_live', '', @iCategId, '_bx_stripe_connect_option_api_public_live', 'digit', '', '', 30, ''),
+('bx_stripe_connect_api_secret_live', '', @iCategId, '_bx_stripe_connect_option_api_secret_live', 'digit', '', '', 40, ''),
+('bx_stripe_connect_api_id_test', '', @iCategId, '_bx_stripe_connect_option_api_id_test', 'digit', '', '', 50, ''),
+('bx_stripe_connect_api_public_test', '', @iCategId, '_bx_stripe_connect_option_api_public_test', 'digit', '', '', 60, ''),
+('bx_stripe_connect_api_secret_test', '', @iCategId, '_bx_stripe_connect_option_api_secret_test', 'digit', '', '', 70, ''),
+('bx_stripe_connect_api_scope', 'read_write', @iCategId, '_bx_stripe_connect_option_api_scope', 'select', '', '', 80, 'a:2:{s:6:"module";s:17:"bx_stripe_connect";s:6:"method";s:21:"get_options_api_scope";}'),
+('bx_stripe_connect_pmode_single', 'direct', @iCategId, '_bx_stripe_connect_option_pmode_single', 'select', '', '', 90, 'a:2:{s:6:"module";s:17:"bx_stripe_connect";s:6:"method";s:24:"get_options_pmode_single";}'),
+('bx_stripe_connect_fee_single', '', @iCategId, '_bx_stripe_connect_option_fee_single', 'digit', '', '', 100, ''),
+('bx_stripe_connect_pmode_recurring', 'direct', @iCategId, '_bx_stripe_connect_option_pmode_recurring', 'select', '', '', 110, 'a:2:{s:6:"module";s:17:"bx_stripe_connect";s:6:"method";s:27:"get_options_pmode_recurring";}'),
+('bx_stripe_connect_fee_recurring', '', @iCategId, '_bx_stripe_connect_option_fee_recurring', 'digit', '', '', 120, ''),
+('bx_stripe_connect_redirect_url', '', @iCategId, '_bx_stripe_connect_option_redirect_url', 'value', '', '', 130, '');
+
+
+-- PAGE: result
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_stripe_connect_result', 'stripe-connect-result', '_bx_stripe_connect_page_title_sys_result', '_bx_stripe_connect_page_title_result', @sName, 5, 2147483647, 0, '', '', '', '', 0, 1, 0, 'BxStripeConnectPage', 'modules/boonex/stripe_connect/classes/BxStripeConnectPage.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_stripe_connect_result', 1, @sName, '_bx_stripe_connect_page_block_title_result', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:17:"bx_stripe_connect";s:6:"method";s:16:"get_block_result";}', 0, 0, 1, 1);
+
+
+-- PAGES: add page block on dashboard
+SET @iPBCellDashboard = 3;
+SET @iPBOrderDashboard = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_pages_blocks` WHERE `object` = 'sys_dashboard' AND `cell_id` = @iPBCellDashboard LIMIT 1);
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('sys_dashboard', @iPBCellDashboard, @sName, '_bx_stripe_connect_page_block_title_connect', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:17:"bx_stripe_connect";s:6:"method";s:17:"get_block_connect";}', 0, 1, @iPBOrderDashboard + 1);
+
+
+-- GRIDS: Manage
+INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_mode`, `sorting_fields`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
+('bx_stripe_connect_accounts', 'Sql', 'SELECT * FROM `bx_stripe_connect_accounts`', 'bx_stripe_connect_accounts', 'id', '', '', 10, NULL, 'start', '', 'user_id,public_key,access_token', 'auto', 'user_id,public_key,access_token', 128, 'BxStripeConnectGridAccounts', 'modules/boonex/stripe_connect/classes/BxStripeConnectGridAccounts.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('bx_stripe_connect_accounts', 'checkbox', 'Select', '2%', 0, '', '', 1),
+('bx_stripe_connect_accounts', 'author', '_bx_stripe_connect_grid_column_title_author', '16%', 0, '18', '', 2),
+('bx_stripe_connect_accounts', 'user_id', '_bx_stripe_connect_grid_column_title_user_id', '18%', 0, '18', '', 3),
+('bx_stripe_connect_accounts', 'public_key', '_bx_stripe_connect_grid_column_title_public_key', '18%', 0, '18', '', 4),
+('bx_stripe_connect_accounts', 'access_token', '_bx_stripe_connect_grid_column_title_access_token', '18%', 0, '18', '', 5),
+('bx_stripe_connect_accounts', 'added', '_bx_stripe_connect_grid_column_title_added', '10%', 0, '18', '', 6),
+('bx_stripe_connect_accounts', 'actions', '', '18%', 0, '', '', 7);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon_only`, `confirm`, `order`) VALUES
+('bx_stripe_connect_accounts', 'single', 'delete', '_bx_stripe_connect_action_title_delete', 'chain-broken', 1, 1, 1),
+('bx_stripe_connect_accounts', 'bulk', 'delete', '_bx_stripe_connect_action_title_delete', '', 0, 1, 1);
+
+
+-- ALERTS
+INSERT INTO `sys_alerts_handlers` (`name`, `class`, `file`, `service_call`) VALUES 
+(@sName, 'BxStripeConnectAlertsResponse', 'modules/boonex/stripe_connect/classes/BxStripeConnectAlertsResponse.php', '');
+SET @iHandler := LAST_INSERT_ID();
+
+INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
+('bx_payment', 'stripe_get_button', @iHandler),
+('bx_payment', 'stripe_create_customer', @iHandler),
+('bx_payment', 'stripe_retrieve_customer', @iHandler),
+('bx_payment', 'stripe_create_charge', @iHandler),
+('bx_payment', 'stripe_retrieve_charge', @iHandler),
+('bx_payment', 'stripe_create_subscription', @iHandler);

+ 29 - 0
modules/boonex/stripe_connect/install/sql/install.sql

@@ -0,0 +1,29 @@
+SET @sName = 'bx_stripe_connect';
+
+
+-- TABLES
+CREATE TABLE `bx_stripe_connect_accounts` (
+  `id` int(11) NOT NULL auto_increment,
+  `author` int(11) NOT NULL default '0',
+  `added` int(11) NOT NULL default '0',
+  `user_id` varchar(64) NOT NULL default '',
+  `public_key` varchar(128) NOT NULL default '',
+  `access_token` varchar(128) NOT NULL default '',
+  `refresh_token` varchar(128) NOT NULL default '',
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `author` (`author`),
+  UNIQUE KEY `user_id` (`user_id`)
+);
+
+
+-- Studio page and widget
+INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
+(3, @sName, '_bx_stripe_connect', '_bx_stripe_connect', 'bx_stripe_connect@modules/boonex/stripe_connect/|std-icon.svg');
+SET @iPageId = LAST_INSERT_ID();
+
+SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
+SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
+INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
+(@iPageId, @sName, '{url_studio}module.php?name=bx_stripe_connect', '', 'bx_stripe_connect@modules/boonex/stripe_connect/|std-icon.svg', '_bx_stripe_connect', '', '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));

+ 11 - 0
modules/boonex/stripe_connect/install/sql/uninstall.sql

@@ -0,0 +1,11 @@
+SET @sName = 'bx_stripe_connect';
+
+
+-- TABLES
+DROP TABLE IF EXISTS `bx_stripe_connect_accounts`;
+
+
+-- Studio page and widget
+DELETE FROM `tp`, `tw`, `tpw`
+USING `sys_std_pages` AS `tp`, `sys_std_widgets` AS `tw`, `sys_std_pages_widgets` AS `tpw`
+WHERE `tp`.`id` = `tw`.`page_id` AND `tw`.`id` = `tpw`.`widget_id` AND `tp`.`name` = @sName;

+ 79 - 0
modules/boonex/stripe_connect/js/main.js

@@ -0,0 +1,79 @@
+function BxStripeConnectMain(oOptions) {
+	this._sActionsUri = oOptions.sActionUri;
+    this._sActionsUrl = oOptions.sActionUrl;
+    this._sObjName = oOptions.sObjName == undefined ? 'oStripeConnectMain' : oOptions.sObjName;
+    this._sAnimationEffect = oOptions.sAnimationEffect == undefined ? 'slide' : oOptions.sAnimationEffect;
+    this._iAnimationSpeed = oOptions.iAnimationSpeed == undefined ? 'slow' : oOptions.iAnimationSpeed;
+    this._aHtmlIds = oOptions.aHtmlIds == undefined ? {} : oOptions.aHtmlIds;
+}
+
+BxStripeConnectMain.prototype.disconnect = function(iId, oLink) {
+	var $this = this;
+	var oDate = new Date();
+
+	if(!confirm(_t('_bx_stripe_connect_wrn_disconnect')))
+		return;
+
+    this.loadingInButton(oLink, true);
+
+    $.get(
+        this._sActionsUrl + 'delete/',
+        {
+        	id: iId,
+        	_t: oDate.getTime()
+        },
+        function(oData) {
+        	if(parseInt(oData.code) != 0)
+        		$this.loadingInButton(oLink, false);
+
+        	$this.processResult(oData);
+        },
+        'json'
+    );
+};
+
+BxStripeConnectMain.prototype.processResult = function(oData) {
+	var $this = this;
+
+	if(oData && oData.message != undefined && oData.message.length != 0)
+    	alert(oData.message);
+
+    if(oData && oData.reload != undefined && parseInt(oData.reload) == 1)
+    	document.location = document.location;
+
+    if(oData && oData.popup != undefined) {
+    	var oPopup = null;
+    	var oOptions = {
+            fog: {
+				color: '#fff',
+				opacity: .7
+            },
+            closeOnOuterClick: false
+        };
+
+    	if(typeof(oData.popup) == 'object') {
+    		oOptions = $.extend({}, oOptions, oData.popup.options);
+    		oPopup = $(oData.popup.html);
+    	}
+    	else 
+    		oPopup = $(oData.popup);
+
+    	$('#' + oPopup.attr('id')).remove();
+        oPopup.hide().prependTo('body').dolPopup(oOptions);
+    }
+
+    if (oData && oData.eval != undefined)
+        eval(oData.eval);
+};
+
+BxStripeConnectMain.prototype.loadingInButton = function(e, bShow) {
+	if($(e).length)
+		bx_loading_btn($(e), bShow);
+	else
+		bx_loading($('body'), bShow);	
+};
+
+BxStripeConnectMain.prototype.loadingInBlock = function(e, bShow) {
+	var oParent = $(e).length ? $(e).parents('.bx-db-container:first') : $('body'); 
+	bx_loading(oParent, bShow);
+};

+ 18 - 0
modules/boonex/stripe_connect/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    StripeConnect Stripe Connect
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
+
+check_logged();
+
+BxBaseModTextRequest::processAsAction($GLOBALS['aModule'], $GLOBALS['aRequest']);
+
+/** @} */

+ 11 - 0
modules/boonex/stripe_connect/template/block_account.html

@@ -0,0 +1,11 @@
+<div class="bx-strp-con-account">
+	<div><bx_text:_bx_stripe_connect_grid_column_title_user_id />: <span class="bx-def-font-grayed">__user_id__</span></div>
+	<div class="bx-def-margin-thd-top"><bx_text:_bx_stripe_connect_grid_column_title_public_key />: <span class="bx-def-font-grayed">__public_key__</span></div>
+	<div class="bx-def-margin-thd-top"><bx_text:_bx_stripe_connect_grid_column_title_access_token />: <span class="bx-def-font-grayed">__access_token__</span></div>
+	<div class="bx-def-margin-thd-top"><bx_text:_bx_stripe_connect_grid_column_title_added />: <span class="bx-def-font-grayed">__added__</span></div>
+	<div class="bx-def-margin-topbottom">__keys_usage__</div>
+	<div>
+		<a class="bx-btn" href="javascript:void(0)" onclick="javascript:__js_object__.disconnect(__id__, this);"><bx_text:_bx_stripe_connect_action_title_delete /></a>
+	</div>
+	__js_code__
+</div>

+ 3 - 0
modules/boonex/stripe_connect/template/block_connect.html

@@ -0,0 +1,3 @@
+<div class="bx-strp-con-connect bx-def-font-align-center">
+	<a class="bx-btn" href="__link__"><bx_text:_bx_stripe_connect_btn_connect /></a>
+</div>

+ 5 - 0
modules/boonex/stripe_connect/template/css/main.css

@@ -0,0 +1,5 @@
+/*-- Connect Block --*/
+.bx-strp-con-connect .bx-btn {
+	display: inline-block;
+	float: none;
+}

+ 36 - 0
modules/boonex/stripe_connect/template/images/icons/std-icon.svg

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="606px" height="606px" viewBox="0 0 606 606" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Generator: Sketch 40.2 (33826) - http://www.bohemiancoding.com/sketch -->
+    <title>stripe</title>
+    <desc>Created with Sketch.</desc>
+    <defs>
+        <linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
+            <stop stop-color="#FFFFFF" stop-opacity="0.2" offset="0%"></stop>
+            <stop stop-color="#000000" stop-opacity="0.2" offset="100%"></stop>
+        </linearGradient>
+        <path d="M552.268958,552.268958 C600,504.537813 600,431.458333 600,300 C600,168.541667 600,95.4621875 552.268958,47.7310417 C504.537813,0 431.458333,0 300,0 C168.541667,0 95.4621875,0 47.7310417,47.7310417 C0,95.4621875 0,168.541667 0,300 C0,431.458333 0,504.537813 47.7310417,552.268958 C95.4621875,600 168.541667,600 300,600 C431.458333,600 504.537813,600 552.268958,552.268958 Z" id="path-2"></path>
+    </defs>
+    <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="stripe" transform="translate(3.000000, 3.000000)">
+            <g id="Squircle2-Copy-6">
+                <g id="Shape">
+                    <use fill="#6772E5" xlink:href="#path-2"></use>
+                    <use stroke="#000000" stroke-width="4.04" fill="url(#linearGradient-1)" xlink:href="#path-2"></use>
+                </g>
+            </g>
+            <g id="Stripe-Logo-(white)" transform="translate(100.000000, 217.000000)" fill="#FFFFFF">
+                <g id="Layer_1">
+                    <g id="Stripe">
+                        <path d="M400,86 C400,57.5555556 386.222222,35.1111111 359.888889,35.1111111 C333.444444,35.1111111 317.444444,57.5555556 317.444444,85.7777778 C317.444444,119.222222 336.333333,136.111111 363.444444,136.111111 C376.666667,136.111111 386.666667,133.111111 394.222222,128.888889 L394.222222,106.666667 C386.666667,110.444444 378,112.777778 367,112.777778 C356.222222,112.777778 346.666667,109 345.444444,95.8888889 L399.777778,95.8888889 C399.777778,94.4444444 400,88.6666667 400,86 L400,86 Z M345.111111,75.4444444 C345.111111,62.8888889 352.777778,57.6666667 359.777778,57.6666667 C366.555556,57.6666667 373.777778,62.8888889 373.777778,75.4444444 L345.111111,75.4444444 L345.111111,75.4444444 Z" id="Shape"></path>
+                        <path d="M274.555556,35.1111111 C263.666667,35.1111111 256.666667,40.2222222 252.777778,43.7777778 L251.333333,36.8888889 L226.888889,36.8888889 L226.888889,166.444444 L254.666667,160.555556 L254.777778,129.111111 C258.777778,132 264.666667,136.111111 274.444444,136.111111 C294.333333,136.111111 312.444444,120.111111 312.444444,84.8888889 C312.333333,52.6666667 294,35.1111111 274.555556,35.1111111 L274.555556,35.1111111 Z M267.888889,111.666667 C261.333333,111.666667 257.444444,109.333333 254.777778,106.444444 L254.666667,65.2222222 C257.555556,62 261.555556,59.7777778 267.888889,59.7777778 C278,59.7777778 285,71.1111111 285,85.6666667 C285,100.555556 278.111111,111.666667 267.888889,111.666667 L267.888889,111.666667 Z" id="Shape"></path>
+                        <polygon id="Shape" points="188.666667 28.5555556 216.555556 22.5555556 216.555556 0 188.666667 5.88888889"></polygon>
+                        <rect id="Rectangle-path" x="188.666667" y="37" width="27.8888889" height="97.2222222"></rect>
+                        <path d="M158.777778,45.2222222 L157,37 L133,37 L133,134.222222 L160.777778,134.222222 L160.777778,68.3333333 C167.333333,59.7777778 178.444444,61.3333333 181.888889,62.5555556 L181.888889,37 C178.333333,35.6666667 165.333333,33.2222222 158.777778,45.2222222 L158.777778,45.2222222 Z" id="Shape"></path>
+                        <path d="M103.222222,12.8888889 L76.1111111,18.6666667 L76,107.666667 C76,124.111111 88.3333333,136.222222 104.777778,136.222222 C113.888889,136.222222 120.555556,134.555556 124.222222,132.555556 L124.222222,110 C120.666667,111.444444 103.111111,116.555556 103.111111,100.111111 L103.111111,60.6666667 L124.222222,60.6666667 L124.222222,37 L103.111111,37 L103.222222,12.8888889 L103.222222,12.8888889 Z" id="Shape"></path>
+                        <path d="M28.1111111,65.2222222 C28.1111111,60.8888889 31.6666667,59.2222222 37.5555556,59.2222222 C46,59.2222222 56.6666667,61.7777778 65.1111111,66.3333333 L65.1111111,40.2222222 C55.8888889,36.5555556 46.7777778,35.1111111 37.5555556,35.1111111 C15,35.1111111 0,46.8888889 0,66.5555556 C0,97.2222222 42.2222222,92.3333333 42.2222222,105.555556 C42.2222222,110.666667 37.7777778,112.333333 31.5555556,112.333333 C22.3333333,112.333333 10.5555556,108.555556 1.22222222,103.444444 L1.22222222,129.888889 C11.5555556,134.333333 22,136.222222 31.5555556,136.222222 C54.6666667,136.222222 70.5555556,124.777778 70.5555556,104.888889 C70.4444444,71.7777778 28.1111111,77.6666667 28.1111111,65.2222222 L28.1111111,65.2222222 Z" id="Shape"></path>
+                    </g>
+                </g>
+            </g>
+        </g>
+    </g>
+</svg>

+ 1 - 0
modules/boonex/stripe_connect/template/link.html

@@ -0,0 +1 @@
+<a href="__href__" title="__title__">__content__</a>

+ 18 - 0
studio/template/scripts/BxBaseStudioSettings.php

@@ -495,6 +495,10 @@ class BxBaseStudioSettings extends BxDolStudioSettings
     {
     {
     	$mixedValue = isset($aItems2Mixes[$aItem['name']]) ? $aItems2Mixes[$aItem['name']] : $aItem['value'];
     	$mixedValue = isset($aItems2Mixes[$aItem['name']]) ? $aItems2Mixes[$aItem['name']] : $aItem['value'];
 
 
+    	$sMethod = 'getCustomValue' . bx_gen_method_name(trim(str_replace($this->sType, '', $aItem['name']), '_'));
+    	if(method_exists($this, $sMethod))
+    	    $mixedValue = $this->$sMethod($aItem, $mixedValue);
+
     	$aAttributes = array();
     	$aAttributes = array();
     	if($this->isReadOnly())
     	if($this->isReadOnly())
 	    	$aAttributes = array_merge($aAttributes, array(
 	    	$aAttributes = array_merge($aAttributes, array(
@@ -503,6 +507,20 @@ class BxBaseStudioSettings extends BxDolStudioSettings
 
 
         $aField = array();
         $aField = array();
         switch($aItem['type']) {
         switch($aItem['type']) {
+            case 'value':
+                $aField = array(
+                    'type' => 'text',
+                    'name' => $aItem['name'],
+                    'caption' => _t($aItem['caption']),
+                    'value' => $mixedValue,
+                	'attrs' => array_merge($aAttributes, array(
+                    	'readonly' => 'readonly'
+                    )),
+                    'db' => array (
+                        'pass' => 'Xss',
+                    ),
+                );
+                break;
             case 'digit':
             case 'digit':
                 $aField = array(
                 $aField = array(
                     'type' => 'text',
                     'type' => 'text',

+ 10 - 16
template/css/common.css

@@ -380,32 +380,26 @@ body > .bx-popup-wrapper {
 }
 }
 
 
 .bx-loading-ajax-btn {
 .bx-loading-ajax-btn {
+	position: relative;
     display: inline-block;
     display: inline-block;
+
     vertical-align: top;
     vertical-align: top;
 
 
     margin-left: 5px;
     margin-left: 5px;
 }
 }
 
 
-.bx-btn .bx-loading-ajax-btn,
-.bx-btn .bx-loading-ajax-btn svg {
-	width: 30px;
-    height: 30px;
-}
-.bx-btn .bx-loading-ajax-btn {
-	margin-top: 5px;
-	margin-bottom: 5px;
+@-moz-document url-prefix() {
+	button.bx-btn .bx-loading-ajax-btn {
+		top: -1px;
+	}
 }
 }
 
 
-.bx-btn.bx-btn-small .bx-loading-ajax-btn,
-.bx-btn.bx-btn-small .bx-loading-ajax-btn svg {
-	width: 20px;
-    height: 20px;
-}
-.bx-btn.bx-btn-small .bx-loading-ajax-btn {
-    margin-top: 2px;
-    margin-bottom: 2px;
+button.bx-btn:focus,
+button.bx-btn:focus .bx-loading-ajax-btn {
+    outline: 0;	
 }
 }
 
 
+
 /* --------------- SVG loading indicator */
 /* --------------- SVG loading indicator */
 svg .outer, 
 svg .outer, 
 svg .inner{
 svg .inner{

+ 12 - 12
template/menu_account_popup.html

@@ -1,17 +1,17 @@
-
 <div id="bx-sliding-menu-account" class="bx-sliding-menu-main bx-sliding-menu-fullheight bx-def-z-index-nav bx-def-color-bg-block bx-def-border-bottom bx-def-box-sizing bx-search-site" style="display:none; opacity:1;">
 <div id="bx-sliding-menu-account" class="bx-sliding-menu-main bx-sliding-menu-fullheight bx-def-z-index-nav bx-def-color-bg-block bx-def-border-bottom bx-def-box-sizing bx-search-site" style="display:none; opacity:1;">
     <div class="bx-def-page-width bx-def-centered">
     <div class="bx-def-page-width bx-def-centered">
-        <a class="bx-sliding-menu-close bx-def-margin bx-def-font-h1" href="javascript:void(0);" onclick="bx_menu_slide('#bx-sliding-menu-account')"><i class="sys-icon times"></i></a>
+        <div class="bx-sliding-menu-main-cnt">
+	        <a class="bx-sliding-menu-close bx-def-margin bx-def-font-h1" href="javascript:void(0);" onclick="bx_menu_slide('#bx-sliding-menu-account')"><i class="sys-icon times"></i></a>
 
 
-        <div class="bx-menu-account-popup bx-menu-object-__object__ bx-def-padding">
-            <div class="bx-def-font-h1 bx-menu-account-popup-profile">__profile_display_name__</div>
-            <div class="bx-menu-account-popup-menu bx-def-margin-top bx-def-margin-bottom">__menu_account__</div>
-            <div>__menu_notifications__</div>     
+	        <div class="bx-menu-account-popup bx-menu-object-__object__ bx-def-padding">
+	            <div class="bx-def-font-h1 bx-menu-account-popup-profile">__profile_display_name__</div>
+	            <div class="bx-menu-account-popup-menu bx-def-margin-top bx-def-margin-bottom">__menu_account__</div>
+	            <div>__menu_notifications__</div>     
+	        </div>
+	        <div class="bx-menu-account-popup-profile-switcher bx-def-box-sizing bx-def-padding-leftright">__profile_switcher__</div>
+	        <bx_if:multiple_profiles_mode>
+	            <div class="bx-menu-account-popup-profile-switcher-link bx-def-padding"><a href="__url_switch_profile__"><bx_text:_sys_txt_my_profiles /></div>
+	        </bx_if:multiple_profiles_mode>
         </div>
         </div>
-        <div class="bx-menu-account-popup-profile-switcher bx-def-box-sizing bx-def-padding-leftright">__profile_switcher__</div>
-        <bx_if:multiple_profiles_mode>
-            <div class="bx-menu-account-popup-profile-switcher-link bx-def-padding"><a href="__url_switch_profile__"><bx_text:_sys_txt_my_profiles /></div>
-        </bx_if:multiple_profiles_mode>
     </div>
     </div>
-</div>
-
+</div>