Răsfoiți Sursa

Ticket #438 - Basic integration in modules. Related improvements. Integration in Market.

AntonLV 10 ani în urmă
părinte
comite
8d09e0f323

+ 45 - 18
modules/base/general/classes/BxBaseModGeneralModule.php

@@ -213,8 +213,16 @@ class BxBaseModGeneralModule extends BxDolModule
             return false;
 
         $CNF = &$this->_oConfig->CNF;
-
-        return $this->_entitySocialSharing ($iContentId, $iContentId, $aContentInfo[$CNF['FIELD_THUMB']], $aContentInfo[$CNF['FIELD_TITLE']], $CNF['OBJECT_STORAGE'], false, $CNF['OBJECT_VOTES'], $CNF['OBJECT_REPORTS'], $CNF['URI_VIEW_ENTRY']);
+        return $this->_entitySocialSharing ($iContentId, array(
+            'id_timeline' => $iContentId,
+        	'id_thumb' => $aContentInfo[$CNF['FIELD_THUMB']],
+        	'title' => $aContentInfo[$CNF['FIELD_TITLE']],
+        	'object_storage' => $CNF['OBJECT_STORAGE'],
+            'object_transcoder' => false,
+        	'object_vote' => $CNF['OBJECT_VOTES'],
+        	'object_report' => $CNF['OBJECT_REPORTS'],
+        	'uri_view_entry' => $CNF['URI_VIEW_ENTRY'],
+        ));
     }
 
 	/**
@@ -701,12 +709,15 @@ class BxBaseModGeneralModule extends BxDolModule
 		);
     }
 
-    protected function _entitySocialSharing ($iId, $iIdForTimeline, $iIdThumb, $sTitle, $sObjectStorage, $sObjectTranscoder, $sObjectVote, $sObjectReport, $sUriViewEntry, $sCommentsObject = '', $bEnableSocialSharing = true)
+    protected function _entitySocialSharing ($iId, $aParams = array())
     {
-        $sUrl = BxDolPermalinks::getInstance()->permalink('page.php?i=' . $sUriViewEntry . '&id=' . $iId);
+        $sUrl = !empty($aParams['uri_view_entry']) ? BxDolPermalinks::getInstance()->permalink('page.php?i=' . $aParams['uri_view_entry'] . '&id=' . $iId) : '';
+        $sTitle = !empty($aParams['title']) ? $aParams['title'] : '';
 
+        //--- Comments
         $sComments = '';
-        if ($sCommentsObject && ($oComments = BxTemplCmts::getObjectInstance($sCommentsObject, $iId))) {
+        $oComments = !empty($aParams['object_comments']) ? BxTemplCmts::getObjectInstance($aParams['object_comments'], $iId) : false;
+        if ($oComments) {
             $iNum = $oComments->getCommentsCountAll();
             $sComments = $this->_oTemplate->parseHtmlByName('comments-item.html', array (
                 'url' => $sUrl . '#' . $oComments->getListAnchor(),
@@ -720,40 +731,56 @@ class BxBaseModGeneralModule extends BxDolModule
         }
 
         $aCustomParams = false;
-        if ($iIdThumb && $bEnableSocialSharing) {
-            if ($sObjectTranscoder)
-                $o = BxDolTranscoder::getObjectInstance($sObjectTranscoder);
-            else
-                $o = BxDolStorage::getObjectInstance($sObjectStorage);
-
-            if ($sImgUrl = $o->getFileUrlById($iIdThumb)) {
+        $iIdThumb = isset($aParams['id_thumb']) ? (int)$aParams['id_thumb'] : 0;
+        $bSocialSharing = isset($aParams['social_sharing']) ? (bool)$aParams['social_sharing'] : true;
+        if ($iIdThumb && $bSocialSharing) {
+            if(!empty($aParams['object_transcoder']))
+                $o = BxDolTranscoder::getObjectInstance($aParams['object_transcoder']);
+            else if(!empty($aParams['object_storage']))
+                $o = BxDolStorage::getObjectInstance($aParams['object_storage']);
+
+            $sImgUrl = $o ? $o->getFileUrlById($iIdThumb) : '';
+            if($sImgUrl)
                 $aCustomParams = array (
                     'img_url' => $sImgUrl,
                     'img_url_encoded' => rawurlencode($sImgUrl),
                 );
-            }
         }
 
         //TODO: Rebuild using menus engine when it will be ready for such elements like Vote, Share, etc.
+        //--- Votes
         $sVotes = '';
-        $oVotes = BxDolVote::getObjectInstance($sObjectVote, $iId);
+        $oVotes = !empty($aParams['object_vote']) ? BxDolVote::getObjectInstance($aParams['object_vote'], $iId) : false;
         if ($oVotes)
             $sVotes = $oVotes->getElementBlock(array('show_do_vote_as_button' => true));
 
+        //--- Favorite
+        $sFavorites = '';
+        $oFavorites = !empty($aParams['object_favorite']) ? BxDolFavorite::getObjectInstance($aParams['object_favorite'], $iId) : false;
+        if ($oFavorites)
+            $sFavorites = $oFavorites->getElementBlock(array('show_do_favorite_as_button' => true));
+
+        //--- Timeline Repost (Internal Share)
         $sShare = '';
-        if ($iIdForTimeline && BxDolRequest::serviceExists('bx_timeline', 'get_share_element_block'))
-            $sShare = BxDolService::call('bx_timeline', 'get_share_element_block', array(bx_get_logged_profile_id(), $this->_aModule['name'], 'added', $iIdForTimeline, array('show_do_share_as_button' => true)));
+        $iIdTimeline = isset($aParams['id_timeline']) ? (int)$aParams['id_timeline'] : $iId;
+        if ($iIdTimeline && BxDolRequest::serviceExists('bx_timeline', 'get_share_element_block'))
+            $sShare = BxDolService::call('bx_timeline', 'get_share_element_block', array(bx_get_logged_profile_id(), $this->_aModule['name'], 'added', $iIdTimeline, array('show_do_share_as_button' => true)));
 
+        //--- Report
 		$sReport = '';
-        $oReport = BxDolReport::getObjectInstance($sObjectReport, $iId);
+        $oReport = !empty($aParams['object_report']) ? BxDolReport::getObjectInstance($aParams['object_report'], $iId) : false;
         if ($oReport)
             $sReport = $oReport->getElementBlock(array('show_do_report_as_button' => true));
 
-        $sSocial = $bEnableSocialSharing ? BxTemplSocialSharing::getInstance()->getCode($iId, $this->_aModule['name'], BX_DOL_URL_ROOT . $sUrl, $sTitle, $aCustomParams) : '';
+        $sSocial = $bSocialSharing ? BxTemplSocialSharing::getInstance()->getCode($iId, $this->_aModule['name'], BX_DOL_URL_ROOT . $sUrl, $sTitle, $aCustomParams) : '';
+
+        if(empty($sComments) && empty($sVotes) && empty($sFavorites) && empty($sShare) && empty($sReport) && empty($sSocial))
+            return '';
 
         return $this->_oTemplate->parseHtmlByName('entry-share.html', array(
             'comments' => $sComments,
             'vote' => $sVotes,
+            'favorite' => $sFavorites,
             'share' => $sShare,
         	'report' => $sReport,
             'social' => $sSocial,

+ 1 - 0
modules/base/general/template/css/main.css

@@ -5,6 +5,7 @@
 }
 
 .bx-base-general-entity-share .bx-vote,
+.bx-base-general-entity-share .bx-favorite,
 .bx-base-general-entity-share .bx-report,
 .bx-base-general-entity-share .bx-tl-share,
 .bx-base-general-entity-share .bx-social-sharing {

+ 1 - 1
modules/base/general/template/entry-share.html

@@ -1 +1 @@
-<div class="bx-base-general-entity-share bx-clearfix">__comments____vote____share____report____social__</div>
+<div class="bx-base-general-entity-share bx-clearfix">__comments____vote____favorite____share____report____social__</div>

+ 10 - 2
modules/base/groups/classes/BxBaseModGroupsModule.php

@@ -231,8 +231,16 @@ class BxBaseModGroupsModule extends BxBaseModProfileModule
             return false;
 
         $CNF = &$this->_oConfig->CNF;
-
-        return $this->_entitySocialSharing ($iContentId, $iContentId, 0, $oGroupProfile->getDisplayName(), false, false, $CNF['OBJECT_VOTES'], $CNF['OBJECT_REPORTS'], $CNF['URI_VIEW_ENTRY']);
+        return $this->_entitySocialSharing ($iContentId, array(
+            'id_timeline' => $iContentId,
+            'id_thumb' => 0,
+            'title' => $oGroupProfile->getDisplayName(),
+            'object_storage' => false,
+            'object_transcoder' => false,
+            'object_vote' => $CNF['OBJECT_VOTES'],
+        	'object_report' => $CNF['OBJECT_REPORTS'],
+            'uri_view_entry' => $CNF['URI_VIEW_ENTRY']
+        ));
     }
 
 	/**

+ 10 - 2
modules/base/text/classes/BxBaseModTextModule.php

@@ -100,8 +100,16 @@ class BxBaseModTextModule extends BxBaseModGeneralModule
             return false;
 
         $CNF = &$this->_oConfig->CNF;
-
-        return $this->_entitySocialSharing ($iContentId, $iContentId, $aContentInfo[$CNF['FIELD_THUMB']], $aContentInfo[$CNF['FIELD_TITLE']], $CNF['OBJECT_STORAGE'], false, $CNF['OBJECT_VOTES'], $CNF['OBJECT_REPORTS'], $CNF['URI_VIEW_ENTRY']);
+        return $this->_entitySocialSharing ($iContentId, array(
+            'id_timeline' => $iContentId,
+        	'id_thumb' => $aContentInfo[$CNF['FIELD_THUMB']],
+        	'title' => $aContentInfo[$CNF['FIELD_TITLE']],
+        	'object_storage' => $CNF['OBJECT_STORAGE'],
+            'object_transcoder' => false,
+        	'object_vote' => $CNF['OBJECT_VOTES'],
+        	'object_report' => $CNF['OBJECT_REPORTS'],
+        	'uri_view_entry' => $CNF['URI_VIEW_ENTRY']
+        ));
     }
 
     public function serviceEntityAllActions ($iContentId = 0)

+ 12 - 2
modules/boonex/albums/classes/BxAlbumsModule.php

@@ -92,8 +92,18 @@ class BxAlbumsModule extends BxBaseModTextModule
             return false;
 
         $CNF = &$this->_oConfig->CNF;
-
-        return $this->_entitySocialSharing ($iMediaId, 0, $aMediaInfo['file_id'], $aMediaInfo['title'], false, $CNF['OBJECT_IMAGES_TRANSCODER_BIG'], $CNF['OBJECT_VOTES_MEDIA'], '', $CNF['URI_VIEW_MEDIA'], $bEnableCommentsBtn ? $CNF['OBJECT_COMMENTS_MEDIA'] : '', $bEnableSocialSharing);
+        return $this->_entitySocialSharing ($iMediaId, array(
+            'id_timeline' => 0,
+        	'id_thumb' => $aMediaInfo['file_id'],
+        	'title' => $aMediaInfo['title'],
+        	'object_storage' => false,
+            'object_transcoder' => $CNF['OBJECT_IMAGES_TRANSCODER_BIG'],
+        	'object_vote' => $CNF['OBJECT_VOTES_MEDIA'],
+        	'object_report' => '',
+        	'object_comments' => $bEnableCommentsBtn ? $CNF['OBJECT_COMMENTS_MEDIA'] : '',
+        	'uri_view_entry' => $CNF['URI_VIEW_MEDIA'],
+            'social_sharing' => $bEnableSocialSharing
+        ));
     }
 
     public function serviceMediaView ($iMediaId = 0, $mixedContext = false)

+ 1 - 0
modules/boonex/market/classes/BxMarketConfig.php

@@ -102,6 +102,7 @@ class BxMarketConfig extends BxBaseModTextConfig
         	'OBJECT_REPORTS' => 'bx_market',
             'OBJECT_VIEWS' => 'bx_market',
             'OBJECT_VOTES' => 'bx_market',
+        	'OBJECT_FAVORITES' => 'bx_market',
             'OBJECT_METATAGS' => 'bx_market',
             'OBJECT_COMMENTS' => 'bx_market',
             'OBJECT_PRIVACY_VIEW' => 'bx_market_allow_view_to',

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

@@ -462,6 +462,16 @@ class BxMarketModule extends BxBaseModTextModule
 
 		return $aContentInfo;
     }
+
+    protected function _entitySocialSharing ($iId, $aParams = array())
+    {
+        $CNF = &$this->_oConfig->CNF;
+        return parent::_entitySocialSharing($iId, array_merge($aParams, array(
+        	'object_vote' => '',
+            'object_favorite' => $CNF['OBJECT_FAVORITES'],
+            'social_sharing' => false
+        )));
+    }
 }
 
 /** @} */

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

@@ -59,15 +59,15 @@ INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `t
 ('bx_market_view_entry', 2, 'bx_market', '', '_bx_market_page_block_title_entry_text', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:17:\"entity_text_block\";}', 0, 0, 1, 0),
 ('bx_market_view_entry', 2, 'bx_market', '', '_bx_market_page_block_title_entry_all_actions', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:18:\"entity_all_actions\";}', 0, 0, 0, 1),
 ('bx_market_view_entry', 2, 'bx_market', '', '_bx_market_page_block_title_entry_actions', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:14:\"entity_actions\";}', 0, 0, 0, 2),
-('bx_market_view_entry', 2, 'bx_market', '', '_bx_market_page_block_title_entry_social_sharing', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:21:\"entity_social_sharing\";}', 0, 0, 0, 3),
-('bx_market_view_entry', 2, 'bx_market', '', '_bx_market_page_block_title_entry_comments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 1, 4),
-('bx_market_view_entry', 2, 'bx_market', '', '_bx_market_page_block_title_entry_author_entries', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:22:\"entity_author_entities\";}', 0, 0, 1, 5),
-('bx_market_view_entry', 3, 'bx_market', '', '_bx_market_page_block_title_entry_info', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:11:\"entity_info\";}', 0, 0, 1, 0),
-('bx_market_view_entry', 3, 'bx_market', '', '_bx_market_page_block_title_entry_rating', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:13:\"entity_rating\";}', 0, 0, 1, 1),
-('bx_market_view_entry', 3, 'bx_market', '', '_bx_market_page_block_title_entry_author', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:13:\"entity_author\";}', 0, 0, 1, 2),
-('bx_market_view_entry', 3, 'bx_market', '', '_bx_market_page_block_title_entry_location', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:15:\"entity_location\";}', 0, 0, 0, 4),
-('bx_market_view_entry', 3, 'bx_market', '', '_bx_market_page_block_title_entry_location', 3, 2147483647, 'service', 'a:4:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:13:\"locations_map\";s:6:\"params\";a:2:{i:0;s:9:\"bx_market\";i:1;s:4:\"{id}\";}s:5:\"class\";s:20:\"TemplServiceMetatags\";}', 0, 0, 1, 5),
-('bx_market_view_entry', 3, 'bx_market', '', '_bx_market_page_block_title_entry_attachments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:18:\"entity_attachments\";}', 0, 0, 0, 6);
+('bx_market_view_entry', 2, 'bx_market', '', '_bx_market_page_block_title_entry_comments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 1, 3),
+('bx_market_view_entry', 2, 'bx_market', '', '_bx_market_page_block_title_entry_author_entries', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:22:\"entity_author_entities\";}', 0, 0, 1, 4),
+('bx_market_view_entry', 3, 'bx_market', '', '_bx_market_page_block_title_entry_social_sharing', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:21:\"entity_social_sharing\";}', 0, 0, 1, 0),
+('bx_market_view_entry', 3, 'bx_market', '', '_bx_market_page_block_title_entry_info', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:11:\"entity_info\";}', 0, 0, 1, 2),
+('bx_market_view_entry', 3, 'bx_market', '', '_bx_market_page_block_title_entry_rating', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:13:\"entity_rating\";}', 0, 0, 1, 3),
+('bx_market_view_entry', 3, 'bx_market', '', '_bx_market_page_block_title_entry_author', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:13:\"entity_author\";}', 0, 0, 1, 4),
+('bx_market_view_entry', 3, 'bx_market', '', '_bx_market_page_block_title_entry_location', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:15:\"entity_location\";}', 0, 0, 0, 5),
+('bx_market_view_entry', 3, 'bx_market', '', '_bx_market_page_block_title_entry_location', 3, 2147483647, 'service', 'a:4:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:13:\"locations_map\";s:6:\"params\";a:2:{i:0;s:9:\"bx_market\";i:1;s:4:\"{id}\";}s:5:\"class\";s:20:\"TemplServiceMetatags\";}', 0, 0, 1, 6),
+('bx_market_view_entry', 3, 'bx_market', '', '_bx_market_page_block_title_entry_attachments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:18:\"entity_attachments\";}', 0, 0, 0, 7);
 
 
 

+ 23 - 3
modules/boonex/market/install/sql/install.sql

@@ -19,6 +19,7 @@ CREATE TABLE IF NOT EXISTS `bx_market_products` (
   `views` int(11) NOT NULL default '0',
   `rate` float NOT NULL default '0',
   `votes` int(11) NOT NULL default '0',
+  `favorites` int(11) NOT NULL default '0',
   `comments` int(11) NOT NULL default '0',
   `reports` int(11) NOT NULL default '0',
   `allow_view_to` varchar(32) NOT NULL DEFAULT '3',
@@ -235,6 +236,21 @@ CREATE TABLE IF NOT EXISTS `bx_market_reports_track` (
   KEY `report` (`object_id`, `author_nip`)
 ) ENGINE=MYISAM DEFAULT CHARSET=utf8;
 
+-- TABLE: favorites
+CREATE TABLE IF NOT EXISTS `bx_market_favorites` (
+  `object_id` int(11) NOT NULL default '0',
+  `count` int(11) NOT NULL default '0',
+  UNIQUE KEY `object_id` (`object_id`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE `bx_market_favorites_track` (
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `author_nip` int(11) unsigned NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  KEY `id` (`object_id`,`author_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
 
 -- STORAGES & TRANSCODERS
 INSERT INTO `sys_objects_storage` (`object`, `engine`, `params`, `token_life`, `cache_control`, `levels`, `table_files`, `ext_mode`, `ext_allow`, `ext_deny`, `quota_size`, `current_size`, `quota_number`, `current_number`, `max_file_size`, `ts`) VALUES
@@ -289,9 +305,9 @@ INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `ch
 ('bx_market', 'bx_market', 'header_beg_single', '', '', 0, 'block_header', '_bx_market_form_entry_input_sys_header_beg_single', '_bx_market_form_entry_input_header_beg_single', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('bx_market', 'bx_market', 'header_beg_recurring', '', '', 0, 'block_header', '_bx_market_form_entry_input_sys_header_beg_recurring', '_bx_market_form_entry_input_header_beg_recurring', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('bx_market', 'bx_market', 'header_beg_privacy', '', '', 0, 'block_header', '_bx_market_form_entry_input_sys_header_beg_privacy', '_bx_market_form_entry_input_header_beg_privacy', '', 0, 1, 0, '', '', '', '', '', '', '', '', 1, 0),
-('bx_market', 'bx_market', 'header_end_single', '', '', 0, 'block_end', '_bx_market_form_entry_input_sys_header_end_single', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
-('bx_market', 'bx_market', 'header_end_recurring', '', '', 0, 'block_end', '_bx_market_form_entry_input_sys_header_end_recurring', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
-('bx_market', 'bx_market', 'header_end_privacy', '', '', 0, 'block_end', '_bx_market_form_entry_input_sys_header_end_privacy', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_market', 'bx_market', 'header_end_single', '', '', 0, 'block_end', '_bx_market_form_entry_input_sys_header_end_single', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_market', 'bx_market', 'header_end_recurring', '', '', 0, 'block_end', '_bx_market_form_entry_input_sys_header_end_recurring', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_market', 'bx_market', 'header_end_privacy', '', '', 0, 'block_end', '_bx_market_form_entry_input_sys_header_end_privacy', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
 ('bx_market', 'bx_market', 'warning_single', '_bx_market_err_not_accept_payments_single', '', 0, 'value', '_bx_market_form_entry_input_sys_warning_single', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('bx_market', 'bx_market', 'warning_recurring', '_bx_market_err_not_accept_payments_recurring', '', 0, 'value', '_bx_market_form_entry_input_sys_warning_recurring', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0);
 
@@ -484,6 +500,10 @@ INSERT INTO `sys_objects_report` (`name`, `table_main`, `table_track`, `is_on`,
 INSERT INTO `sys_objects_view` (`name`, `table_track`, `period`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
 ('bx_market', 'bx_market_views_track', '86400', '1', 'bx_market_products', 'id', 'views', '', '');
 
+-- FAFORITES
+INSERT INTO `sys_objects_favorite` (`name`, `table_main`, `table_track`, `is_on`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_market', 'bx_market_favorites', 'bx_market_favorites_track', '1', 'page.php?i=view-product&id={object_id}', 'bx_market_products', 'id', 'author', 'favorites', '', '');
+
 -- STUDIO: page & widget
 INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
 (3, 'bx_market', '_bx_market', '_bx_market', 'bx_market@modules/boonex/market/|std-pi.png');

+ 4 - 1
modules/boonex/market/install/sql/uninstall.sql

@@ -1,6 +1,6 @@
 
 -- TABLES
-DROP TABLE IF EXISTS `bx_market_products`, `bx_market_licenses`, `bx_market_licenses_deleted`, `bx_market_files`, `bx_market_files2products`, `bx_market_downloads_track`, `bx_market_photos`, `bx_market_photos2products`, `bx_market_photos_resized`, `bx_market_cmts`, `bx_market_votes`, `bx_market_votes_track`, `bx_market_views_track`, `bx_market_meta_keywords`, `bx_market_meta_locations`, `bx_market_reports`, `bx_market_reports_track`;
+DROP TABLE IF EXISTS `bx_market_products`, `bx_market_licenses`, `bx_market_licenses_deleted`, `bx_market_files`, `bx_market_files2products`, `bx_market_downloads_track`, `bx_market_photos`, `bx_market_photos2products`, `bx_market_photos_resized`, `bx_market_cmts`, `bx_market_votes`, `bx_market_votes_track`, `bx_market_views_track`, `bx_market_meta_keywords`, `bx_market_meta_locations`, `bx_market_reports`, `bx_market_reports_track`, `bx_market_favorites`, `bx_market_favorites_track`;
 
 -- STORAGES & TRANSCODERS
 DELETE FROM `sys_objects_storage` WHERE `object` IN('bx_market_files', 'bx_market_photos', 'bx_market_photos_resized');
@@ -33,6 +33,9 @@ DELETE FROM `sys_objects_report` WHERE `Name` = 'bx_market';
 -- VIEWS
 DELETE FROM `sys_objects_view` WHERE `Name` = 'bx_market';
 
+-- FAFORITES
+DELETE FROM `sys_objects_favorite` WHERE `Name` = 'bx_market';
+
 -- STUDIO: page & widget
 DELETE FROM `tp`, `tw`, `tpw`
 USING `sys_std_pages` AS `tp`, `sys_std_widgets` AS `tw`, `sys_std_pages_widgets` AS `tpw`

+ 1 - 1
modules/boonex/market/template/entry-share.html

@@ -1 +1 @@
-<div class="bx-base-text-entity-share bx-clearfix">__comments____share____report____social__</div>
+<bx_include_base:../modules/base/general/template/entry-share.html />