AntonLV 8 лет назад
Родитель
Сommit
7694d5fb78

+ 7 - 2
modules/boonex/market/classes/BxMarketConfig.php

@@ -18,8 +18,11 @@ class BxMarketConfig extends BxBaseModTextConfig
         parent::__construct($aModule);
 
         $aMenuItems2Methods = array (
+        	'hide-product' => 'checkAllowedHide',
+            'unhide-product' => 'checkAllowedUnhide',
             'edit-product' => 'checkAllowedEdit',
             'delete-product' => 'checkAllowedDelete',
+            'product-more' => 'checkAllowedViewMoreMenu'
         );
 
         $this->CNF = array (
@@ -129,9 +132,10 @@ class BxMarketConfig extends BxBaseModTextConfig
             'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_market_entry_edit',
             'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_market_entry_delete',
             'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_market_view', // actions menu on view entry page
-            'OBJECT_MENU_ACTIONS_VIEW_ENTRY_POPUP' => 'bx_market_view_popup', // actions menu from view entry page but created for popup submenu
+            'OBJECT_MENU_ACTIONS_VIEW_ENTRY_MORE' => 'bx_market_view_more', 
             'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_market_my', // actions menu on my entries page
             'OBJECT_MENU_ACTIONS_SNIPPET' => 'bx_market_snippet', // actions menu for entry snippet
+            'OBJECT_MENU_ACTIONS_SNIPPET_MORE' => 'bx_market_snippet_more', // actions menu (short) from view entry page but created for snippet actions menu
             'OBJECT_MENU_SUBMENU' => 'bx_market_submenu', // main module submenu
             'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_market_view_submenu', // view entry submenu
             'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'products-home', // first item in view entry submenu from main module submenu
@@ -149,7 +153,8 @@ class BxMarketConfig extends BxBaseModTextConfig
                     'create-product' => 'checkAllowedAdd',
                 ),
                 'bx_market_view' => $aMenuItems2Methods,
-                'bx_market_view_popup' => $aMenuItems2Methods,
+                'bx_market_view_more' => $aMenuItems2Methods,
+                'bx_market_snippet_more' => $aMenuItems2Methods,
             ),
 
             // global settings

+ 19 - 0
modules/boonex/market/classes/BxMarketDb.php

@@ -199,6 +199,12 @@ class BxMarketDb extends BxBaseModTextDb
         return $this->getRow($sQuery);
     }
 
+    public function updateContentInfoBy ($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 getPhoto($aParams = array())
     {
     	return $this->_getAttachment($this->_oConfig->CNF['TABLE_PHOTOS2ENTRIES'], $aParams);
@@ -309,6 +315,19 @@ class BxMarketDb extends BxBaseModTextDb
 				$sWhereClause = " AND `type` = :type AND `added` < UNIX_TIMESTAMP() AND `expired` <> 0 AND `expired` < UNIX_TIMESTAMP()";
 				break;
 
+            case 'product_id':
+				$aMethod['params'][1] = array(
+                	'product_id' => $aParams['product_id']
+                );
+
+				$sWhereClause = " AND `tl`.`product_id`=:product_id";
+
+				if(!empty($aParams['profile_id'])) {
+					$aMethod['params'][1]['profile_id'] = $aParams['profile_id'];
+					$sWhereClause .= " AND `tl`.`profile_id`=:profile_id";
+				}
+				break;
+
 			case 'profile_id':
 				$aMethod['params'][1] = array(
                 	'profile_id' => $aParams['profile_id']

+ 1 - 1
modules/boonex/market/classes/BxMarketMenuSnippetActions.php

@@ -52,7 +52,7 @@ class BxMarketMenuSnippetActions extends BxBaseModTextMenu
     {
         $CNF = &$this->_oModule->_oConfig->CNF;
 
-        $oMenu = BxDolMenu::getObjectInstance($CNF['OBJECT_MENU_ACTIONS_VIEW_ENTRY_POPUP']);
+        $oMenu = BxDolMenu::getObjectInstance($CNF['OBJECT_MENU_ACTIONS_SNIPPET_MORE']);
         $oMenu->setContentId($this->_iContentId);
     	return $oMenu->isVisible();
     }

+ 4 - 0
modules/boonex/market/classes/BxMarketMenuView.php

@@ -18,6 +18,10 @@ class BxMarketMenuView extends BxBaseModTextMenuView
     {
         $this->MODULE = 'bx_market';
         parent::__construct($aObject, $oTemplate);
+
+        $this->addMarkers(array(
+        	'js_object' => $this->_oModule->_oConfig->getJsObject('entry')
+        ));
     }
 
     public function getCode ()

+ 93 - 0
modules/boonex/market/classes/BxMarketModule.php

@@ -37,6 +37,26 @@ class BxMarketModule extends BxBaseModTextModule
         ));
     }
 
+    public function actionPerform()
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        $aContentInfo = $this->_getContentInfo();
+        if(empty($aContentInfo) || !is_array($aContentInfo))
+            return echoJson(array('code' => 1));
+
+        $sAction = bx_process_input(bx_get('action'));
+        if(empty($CNF['MENU_ITEM_TO_METHOD'][$CNF['OBJECT_MENU_ACTIONS_VIEW_ENTRY']][$sAction])) 
+            return echoJson(array('code' => 2));
+
+        $sMethodCheck = $CNF['MENU_ITEM_TO_METHOD'][$CNF['OBJECT_MENU_ACTIONS_VIEW_ENTRY']][$sAction];
+        $sMethodPerform = '_perform' . bx_gen_method_name($sAction, array('-', '_'));
+        if(!method_exists($this, $sMethodCheck) || $this->$sMethodCheck($aContentInfo) !== CHECK_ACTION_RESULT_ALLOWED || !method_exists($this, $sMethodPerform))
+            return echoJson(array('code' => 3, 'msg' => _t('_sys_txt_access_denied')));
+
+        return $this->$sMethodPerform($aContentInfo);
+    }
+
     public function actionCheckName()
     {
     	$CNF = &$this->_oConfig->CNF;
@@ -976,6 +996,19 @@ class BxMarketModule extends BxBaseModTextModule
 		return $aTmplVars;
     }
 
+    public function checkAllowedDelete (&$aDataEntry, $isPerformAction = false)
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        if($aDataEntry[$CNF['FIELD_AUTHOR']] == $this->_iProfileId) {
+            $aLicenses = $this->_oDb->getLicense(array('type' => 'product_id', 'product_id' => $aDataEntry[$CNF['FIELD_ID']]));
+            if(is_array($aLicenses) && count($aLicenses) > 0)
+                return _t('_sys_txt_access_denied');
+        }
+
+        return parent::checkAllowedDelete($aDataEntry, $isPerformAction);
+    }
+
     public function checkAllowedSetCover ()
     {
         $aCheck = checkActionModule($this->_iProfileId, 'set cover', $this->getName(), false);
@@ -1016,6 +1049,46 @@ class BxMarketModule extends BxBaseModTextModule
         return CHECK_ACTION_RESULT_ALLOWED;
     }
 
+    public function checkAllowedHide($aDataEntry, $isPerformAction = false)
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        if($aDataEntry[$CNF['FIELD_STATUS']] != 'active')
+            return CHECK_ACTION_RESULT_NOT_ALLOWED;
+
+        // moderator and owner always have access
+        if ($aDataEntry[$CNF['FIELD_AUTHOR']] == $this->_iProfileId || $this->_isModerator($isPerformAction))
+            return CHECK_ACTION_RESULT_ALLOWED;
+
+        return CHECK_ACTION_RESULT_NOT_ALLOWED;
+    }
+
+    public function checkAllowedUnhide($aDataEntry, $isPerformAction = false)
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        if($aDataEntry[$CNF['FIELD_STATUS']] == 'active')
+            return CHECK_ACTION_RESULT_NOT_ALLOWED;
+
+        // moderator and owner always have access
+        if ($aDataEntry[$CNF['FIELD_AUTHOR']] == $this->_iProfileId || $this->_isModerator($isPerformAction))
+            return CHECK_ACTION_RESULT_ALLOWED;
+
+        return CHECK_ACTION_RESULT_NOT_ALLOWED;
+    }
+
+    public function checkAllowedViewMoreMenu (&$aDataEntry, $isPerformAction = false)
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        $oMenu = BxTemplMenu::getObjectInstance($CNF['OBJECT_MENU_ACTIONS_VIEW_ENTRY_MORE']);
+        $oMenu->setContentId($aDataEntry[$CNF['FIELD_ID']]);
+        if(!$oMenu || !$oMenu->isVisible())
+            return CHECK_ACTION_RESULT_NOT_ALLOWED;
+
+        return CHECK_ACTION_RESULT_ALLOWED;
+    }
+
     protected function _getContentInfo($iContentId = 0)
     {
     	if(!$iContentId)
@@ -1031,6 +1104,26 @@ class BxMarketModule extends BxBaseModTextModule
 		return $aContentInfo;
     }
 
+    protected function _performHideProduct($aDataEntry) {
+        $CNF = &$this->_oConfig->CNF;
+
+        if(!$this->_oDb->updateContentInfoBy(array($CNF['FIELD_STATUS'] => 'hidden'), array($CNF['FIELD_ID'] => $aDataEntry[$CNF['FIELD_ID']]))) 
+            return echoJson(array());
+
+        $this->checkAllowedHide($aDataEntry, true);
+        return echoJson(array('reload' => 1));
+    }
+
+    protected function _performUnhideProduct($aDataEntry) {
+        $CNF = &$this->_oConfig->CNF;
+
+        if(!$this->_oDb->updateContentInfoBy(array($CNF['FIELD_STATUS'] => 'active'), array($CNF['FIELD_ID'] => $aDataEntry[$CNF['FIELD_ID']]))) 
+            return echoJson(array());
+
+        $this->checkAllowedHide($aDataEntry, true);
+        return echoJson(array('reload' => 1));
+    }
+
     protected function _entitySocialSharing ($iId, $aParams = array())
     {
         $CNF = &$this->_oConfig->CNF;

+ 14 - 0
modules/boonex/market/classes/BxMarketPageEntry.php

@@ -20,6 +20,20 @@ class BxMarketPageEntry extends BxBaseModTextPageEntry
         parent::__construct($aObject, $oTemplate);
     }
 
+    public function isActive()
+    {
+        if(parent::isActive())
+            return true;
+
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        $iProfile = bx_get_logged_profile_id();
+        if($this->_oModule->_oDb->hasLicense($iProfile, $this->_aContentInfo[$CNF['FIELD_ID']]))
+            return true;
+
+        return false;
+    }
+
     public function getCode ()
     {
     	$sResult = parent::getCode();

+ 14 - 5
modules/boonex/market/install/langs/en.xml

@@ -211,22 +211,29 @@
     <string name="_bx_market_page_block_title_featured_entries_view_showcase"><![CDATA[Featured Products]]></string>
 
     <string name="_bx_market_menu_set_title_view_entry"><![CDATA[Product Actions]]></string>
-    <string name="_bx_market_menu_title_view_entry"><![CDATA[Product Actions]]></string>    
-    <string name="_bx_market_menu_title_view_entry_popup"><![CDATA[Product Actions (in popup)]]></string>
+    <string name="_bx_market_menu_title_view_entry"><![CDATA[Product Actions]]></string>
+    <string name="_bx_market_menu_set_title_view_entry_more"><![CDATA[Product More Actions]]></string>
+    <string name="_bx_market_menu_title_view_entry_more"><![CDATA[Product More Actions]]></string>
     <string name="_bx_market_menu_title_submenu"><![CDATA[Market Submenu]]></string>
     <string name="_bx_market_menu_set_title_submenu"><![CDATA[Market Submenu]]></string>
     <string name="_bx_market_menu_item_title_system_create_entry"><![CDATA[New Product]]></string>
     <string name="_bx_market_menu_item_title_create_entry"><![CDATA[New Product]]></string>
     <string name="_bx_market_menu_item_title_system_edit_entry"><![CDATA[Edit Product]]></string>
-    <string name="_bx_market_menu_item_title_edit_entry"><![CDATA[Edit Product]]></string>
+    <string name="_bx_market_menu_item_title_edit_entry"><![CDATA[Edit]]></string>
     <string name="_bx_market_menu_item_title_system_delete_entry"><![CDATA[Delete Product]]></string>
-    <string name="_bx_market_menu_item_title_delete_entry"><![CDATA[Delete Product]]></string>
+    <string name="_bx_market_menu_item_title_delete_entry"><![CDATA[Delete]]></string>
     <string name="_bx_market_menu_item_title_system_add_to_cart"><![CDATA[Add to Cart]]></string>
     <string name="_bx_market_menu_item_title_add_to_cart"><![CDATA[Buy for {0}{1}]]></string>
     <string name="_bx_market_menu_item_title_system_subscribe"><![CDATA[Rent]]></string>
     <string name="_bx_market_menu_item_title_subscribe"><![CDATA[Rent for {0}{1}/{2}]]></string>
-    <string name="_bx_market_menu_item_title_system_download"><![CDATA[Download]]></string>
+    <string name="_bx_market_menu_item_title_system_download"><![CDATA[Download Product]]></string>
     <string name="_bx_market_menu_item_title_download"><![CDATA[Download]]></string>
+    <string name="_bx_market_menu_item_title_system_product_more"><![CDATA[More Actions]]></string>
+    <string name="_bx_market_menu_item_title_product_more"><![CDATA[]]></string>
+    <string name="_bx_market_menu_item_title_system_unhide_entry"><![CDATA[Unhide Product]]></string>
+    <string name="_bx_market_menu_item_title_unhide_entry"><![CDATA[Publish]]></string>
+    <string name="_bx_market_menu_item_title_system_hide_entry"><![CDATA[Hide Product]]></string>
+    <string name="_bx_market_menu_item_title_hide_entry"><![CDATA[Hide]]></string>
     <string name="_bx_market_menu_item_title_system_entries_home"><![CDATA[Market]]></string>
     <string name="_bx_market_menu_item_title_entries_home"><![CDATA[Market]]></string>
     <string name="_bx_market_menu_item_title_system_entries_categories"><![CDATA[Categories]]></string>
@@ -273,6 +280,8 @@
     <string name="_bx_market_menu_set_title_snippet"><![CDATA[Snippet Actions]]></string>
     <string name="_bx_market_menu_item_title_system_snippet_more"><![CDATA[More Actions]]></string>
     <string name="_bx_market_menu_item_title_snippet_more"><![CDATA[More Actions]]></string>
+    <string name="_bx_market_menu_title_snippet_more"><![CDATA[Snippet More Actions]]></string>
+    <string name="_bx_market_menu_set_title_snippet_more"><![CDATA[Snippet More Actions]]></string>
     <string name="_bx_market_menu_item_title_downloads_more"><![CDATA[Show More]]></string>
 
 	<string name="_bx_market_grid_filter_item_title_adm_select_one_filter1"><![CDATA[All Statuses]]></string>

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

@@ -13,7 +13,7 @@ DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_market' OR `object` IN('bx_m
 -- MENU
 DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_market';
 DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_market';
-DELETE FROM `sys_menu_items` WHERE `module` = 'bx_market' OR `set_name` IN('bx_market_view', 'bx_market_submenu', 'bx_market_view_submenu', 'bx_market_my', 'bx_market_snippet', 'bx_market_snippet_meta', 'bx_market_menu_manage_tools');
+DELETE FROM `sys_menu_items` WHERE `module` = 'bx_market' OR `set_name` IN('bx_market_view', 'bx_market_view_more', 'bx_market_submenu', 'bx_market_view_submenu', 'bx_market_my', 'bx_market_snippet', 'bx_market_snippet_more', 'bx_market_snippet_meta', 'bx_market_menu_manage_tools');
 
 -- PRIVACY 
 DELETE FROM `sys_objects_privacy` WHERE `object` IN ('bx_market_allow_view_to', 'bx_market_allow_purchase_to', 'bx_market_allow_comment_to', 'bx_market_allow_vote_to');

+ 31 - 9
modules/boonex/market/install/sql/enable.sql

@@ -227,19 +227,29 @@ INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `tit
 
 -- MENU: actions menu for view entry 
 INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
-('bx_market_view', '_bx_market_menu_title_view_entry', 'bx_market_view', 'bx_market', 9, 0, 1, 'BxMarketMenuView', 'modules/boonex/market/classes/BxMarketMenuView.php'),
-('bx_market_view_popup', '_bx_market_menu_title_view_entry_popup', 'bx_market_view', 'bx_market', 4, 0, 1, 'BxMarketMenuView', 'modules/boonex/market/classes/BxMarketMenuView.php');
+('bx_market_view', '_bx_market_menu_title_view_entry', 'bx_market_view', 'bx_market', 9, 0, 1, 'BxMarketMenuView', 'modules/boonex/market/classes/BxMarketMenuView.php');
 
 INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
 ('bx_market_view', 'bx_market', '_bx_market_menu_set_title_view_entry', 0);
 
-INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
-('bx_market_view', 'bx_market', 'edit-product', '_bx_market_menu_item_title_system_edit_entry', '_bx_market_menu_item_title_edit_entry', 'page.php?i=edit-product&id={content_id}', '', '', 'pencil', '', 2147483647, 1, 0, 1),
-('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', '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}', '', 'credit-card', '', 2147483647, 1, 0, 5);
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `submenu_popup`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
+('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', '', 0, 2147483647, 1, 0, 10),
+('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', '', 0, 2147483647, 1, 0, 20),
+('bx_market_view', 'bx_market', 'subscribe', '_bx_market_menu_item_title_system_subscribe', '{subscribe_title}', 'javascript:void(0);', 'javascript:{subscribe_onclick}', '', 'credit-card', '', 0, 2147483647, 1, 0, 30),
+('bx_market_view', 'bx_market', 'unhide-product', '_bx_market_menu_item_title_system_unhide_entry', '_bx_market_menu_item_title_unhide_entry', 'javascript:void(0);', 'javascript:{js_object}.perform(this, ''unhide-product'', {content_id});', '', 'eye', '', 0, 2147483647, 1, 0, 40),
+('bx_market_view', 'bx_market', 'product-more', '_bx_market_menu_item_title_system_product_more', '_bx_market_menu_item_title_product_more', 'javascript:void(0)', 'bx_menu_popup(''bx_market_view_more'', this, {}, {id:{content_id}});', '', 'cog', 'bx_market_view_more', 1, 2147483647, 1, 0, 9999);
 
+-- MENU: actions more menu for view entry
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_market_view_more', '_bx_market_menu_title_view_entry_more', 'bx_market_view_more', 'bx_market', 6, 0, 1, 'BxMarketMenuView', 'modules/boonex/market/classes/BxMarketMenuView.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_market_view_more', 'bx_market', '_bx_market_menu_set_title_view_entry_more', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('bx_market_view_more', 'bx_market', 'hide-product', '_bx_market_menu_item_title_system_hide_entry', '_bx_market_menu_item_title_hide_entry', 'javascript:void(0);', 'javascript:{js_object}.perform(this, ''hide-product'', {content_id});', '', 'eye-slash', '', 2147483647, 1, 0, 10),
+('bx_market_view_more', 'bx_market', 'edit-product', '_bx_market_menu_item_title_system_edit_entry', '_bx_market_menu_item_title_edit_entry', 'page.php?i=edit-product&id={content_id}', '', '', 'pencil', '', 2147483647, 1, 0, 20),
+('bx_market_view_more', '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, 30);
 
 -- MENU: actions menu for my entries
 INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
@@ -259,7 +269,19 @@ INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
 ('bx_market_snippet', 'bx_market', '_bx_market_menu_set_title_snippet', 0);
 
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `submenu_popup`, `visible_for_levels`, `active`, `copyable`, `editable`, `order`) VALUES 
-('bx_market_snippet', 'bx_market', 'snippet-more', '_bx_market_menu_item_title_system_snippet_more', '_bx_market_menu_item_title_snippet_more', 'javascript:void(0)', 'bx_menu_popup(''bx_market_view_popup'', this, {''id'':''bx_market_snippet_{content_id}''}, {id:{content_id}});', '', 'ellipsis-v', '', 'bx_market_view_popup', 1, 2147483647, 1, 0, 0, 1);
+('bx_market_snippet', 'bx_market', 'snippet-more', '_bx_market_menu_item_title_system_snippet_more', '_bx_market_menu_item_title_snippet_more', 'javascript:void(0)', 'bx_menu_popup(''bx_market_snippet_more'', this, {''id'':''bx_market_snippet_{content_id}''}, {id:{content_id}});', '', 'ellipsis-v', '', 'bx_market_snippet_more', 1, 2147483647, 1, 0, 0, 1);
+
+-- MENU: actions more menu for snippet actions menu
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
+('bx_market_snippet_more', '_bx_market_menu_title_snippet_more', 'bx_market_snippet_more', 'bx_market', 4, 0, 1, 'BxMarketMenuView', 'modules/boonex/market/classes/BxMarketMenuView.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
+('bx_market_snippet_more', 'bx_market', '_bx_market_menu_set_title_snippet_more', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `submenu_popup`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
+('bx_market_snippet_more', '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', '', 0, 2147483647, 1, 0, 10),
+('bx_market_snippet_more', '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', '', 0, 2147483647, 1, 0, 20),
+('bx_market_snippet_more', 'bx_market', 'subscribe', '_bx_market_menu_item_title_system_subscribe', '{subscribe_title}', 'javascript:void(0);', 'javascript:{subscribe_onclick}', '', 'credit-card', '', 0, 2147483647, 1, 0, 30);
 
 -- MENU: custom menu for snippet meta info
 INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 

+ 20 - 0
modules/boonex/market/js/entry.js

@@ -24,6 +24,26 @@ function BxMarketEntry(oOptions) {
     });
 }
 
+BxMarketEntry.prototype.perform = function(oLink, sAction, iId) {
+	var oDate = new Date();
+    var oData = {
+    	action: sAction,
+    	id: iId,
+		_t:oDate.getTime()
+    };
+
+    $(oLink).parents('.bx-popup-applied:first:visible').dolPopupHide({});
+
+    $.post(
+        this._sActionsUrl + 'perform/',
+        oData,
+        function(oData) {
+        	processJsonData(oData);
+        },
+        'json'
+    );
+};
+
 BxMarketEntry.prototype.checkName = function(sTitleId, sNameId) {
 	var oDate = new Date();
 

+ 12 - 3
modules/boonex/russian/data/langs/bx_market/ru.xml

@@ -212,7 +212,8 @@
 
     <string name="_bx_market_menu_set_title_view_entry"><![CDATA[Продукт - Действия]]></string>
     <string name="_bx_market_menu_title_view_entry"><![CDATA[Продукт - Действия]]></string>
-    <string name="_bx_market_menu_title_view_entry_popup"><![CDATA[Продукт - Действия (всплывающее окно)]]></string>
+    <string name="_bx_market_menu_set_title_view_entry_more"><![CDATA[Продукт - Дополнительные действия]]></string>
+    <string name="_bx_market_menu_title_view_entry_more"><![CDATA[Продукт - Дополнительные действия]]></string>
     <string name="_bx_market_menu_title_submenu"><![CDATA[Рынок - Подменю]]></string>
     <string name="_bx_market_menu_set_title_submenu"><![CDATA[Рынок - Подменю]]></string>
     <string name="_bx_market_menu_item_title_system_create_entry"><![CDATA[Новый продукт]]></string>
@@ -227,6 +228,12 @@
     <string name="_bx_market_menu_item_title_subscribe"><![CDATA[Арендовать за {0}{1}/{2}]]></string>
     <string name="_bx_market_menu_item_title_system_download"><![CDATA[Скачать]]></string>
     <string name="_bx_market_menu_item_title_download"><![CDATA[Скачать]]></string>
+    <string name="_bx_market_menu_item_title_system_product_more"><![CDATA[Ещё действия]]></string>
+    <string name="_bx_market_menu_item_title_product_more"><![CDATA[Ещё действия]]></string>
+    <string name="_bx_market_menu_item_title_system_unhide_entry"><![CDATA[Показать продукт]]></string>
+    <string name="_bx_market_menu_item_title_unhide_entry"><![CDATA[Публиковать]]></string>
+    <string name="_bx_market_menu_item_title_system_hide_entry"><![CDATA[Скрыть продукт]]></string>
+    <string name="_bx_market_menu_item_title_hide_entry"><![CDATA[Скрыть]]></string>
     <string name="_bx_market_menu_item_title_system_entries_home"><![CDATA[Рынок]]></string>
     <string name="_bx_market_menu_item_title_entries_home"><![CDATA[Рынок]]></string>
 	<string name="_bx_market_menu_item_title_system_entries_categories"><![CDATA[Категории]]></string>
@@ -269,10 +276,12 @@
 	<string name="_bx_market_menu_item_title_manage_all"><![CDATA[Все продукты]]></string>
 	<string name="_bx_market_menu_item_title_system_licenses"><![CDATA[Лицензии]]></string>
 	<string name="_bx_market_menu_item_title_licenses"><![CDATA[Лицензии]]></string>
-    <string name="_bx_market_menu_title_snippet"><![CDATA[Действия с отрывоком]]></string>
-    <string name="_bx_market_menu_set_title_snippet"><![CDATA[Действия с отрывоком]]></string>
+    <string name="_bx_market_menu_title_snippet"><![CDATA[Отрывок - Действия]]></string>
+    <string name="_bx_market_menu_set_title_snippet"><![CDATA[Отрывок - Действия]]></string>
     <string name="_bx_market_menu_item_title_system_snippet_more"><![CDATA[Ещё действия]]></string>
     <string name="_bx_market_menu_item_title_snippet_more"><![CDATA[Ещё действия]]></string>
+    <string name="_bx_market_menu_title_snippet_more"><![CDATA[Отрывок - Дополнительные действия]]></string>
+    <string name="_bx_market_menu_set_title_snippet_more"><![CDATA[Отрывок - Дополнительные действия]]></string>
     <string name="_bx_market_menu_item_title_downloads_more"><![CDATA[Показать ещё]]></string>
 
 	<string name="_bx_market_grid_filter_item_title_adm_select_one_filter1"><![CDATA[Все статусы]]></string>