1
0
Эх сурвалжийг харах

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

RomanL 6 жил өмнө
parent
commit
884f49e7cc

+ 17 - 4
inc/classes/BxDolVoteReactions.php

@@ -34,7 +34,7 @@ class BxDolVoteReactions extends BxTemplVote
         $this->_sDataList = 'sys_vote_reactions';
         $this->_aDataList = array();
 
-        $this->_sDefault = '';
+        $this->_sDefault = 'default';
     }
 
     public function init($iId)
@@ -52,13 +52,14 @@ class BxDolVoteReactions extends BxTemplVote
                 'title' => $aReaction['LKey'],
                 'title_aux' => $aReaction['LKey2'],
                 'icon' => isset($aData['icon']) ? $aData['icon'] : '',
+                'color' => isset($aData['color']) ? $aData['color'] : '',
                 'weight' => isset($aData['weight']) ? $aData['weight'] : 1,
             );
         }
 
         if(!empty($this->_aDataList)) {
-            $aNames = array_keys($this->_aDataList);
-            $this->_sDefault = array_shift($aNames);
+            $this->_aDataList[$this->_sDefault] = reset($this->_aDataList);
+            $this->_aDataList[$this->_sDefault]['color'] = '';
         }
     }
     /**
@@ -69,6 +70,11 @@ class BxDolVoteReactions extends BxTemplVote
         return (int)$this->_aSystem['min_value'];
     }
 
+    public function getDefault()
+    {
+        return $this->_sDefault;
+    }
+
     public function getReaction($sName)
     {
         if(empty($this->_aDataList))
@@ -86,6 +92,13 @@ class BxDolVoteReactions extends BxTemplVote
     {
         return $this->_oQuery->getTrackBy($aParams);
     }
+    
+    public function getIcon($sReaction, $bWithColor = true)
+    {
+        $aReaction = isset($this->_aDataList[$sReaction]) ? $this->_aDataList[$sReaction] : $this->_aDataList[$this->_sDefault];
+
+    	return $aReaction['icon'] . ($bWithColor && !empty($aReaction['color']) ? ' ' . $aReaction['color'] : '');
+    }
 
     /**
      * Actions functions
@@ -200,7 +213,7 @@ class BxDolVoteReactions extends BxTemplVote
     {
         $sReaction = $bVoted ? $aTrack['reaction'] : $this->_sDefault;
 
-    	return $this->_aDataList[$sReaction]['icon'];
+    	return $this->getIcon($sReaction);
     }
 
     protected function _getTitleDoWithTrack($bVoted, $aTrack = array())

+ 4 - 2
inc/classes/BxDolWiki.php

@@ -116,11 +116,12 @@ class BxDolWiki extends BxDolFactory implements iBxDolFactoryObject
     {
         if (!$sLang)
             $sLang = bx_lang_name();
-        $s = $this->_oQuery->getBlockContent ($iBlockId, $sLang);
+        $a = $this->_oQuery->getBlockContent ($iBlockId, $sLang);
 
         require_once(BX_DIRECTORY_PATH_PLUGINS . "parsedown/Parsedown.php");
         $oParsedown = new Parsedown();
-        $s = $oParsedown->text($s);
+        $oParsedown->setSafeMode($a['unsafe'] ? false : true);
+        $s = $oParsedown->text($a['content']);
 
         $s = $this->addControls($iBlockId, $s);
 
@@ -152,6 +153,7 @@ class BxDolWiki extends BxDolFactory implements iBxDolFactoryObject
             'edit' => 'allow_edit_for_levels',
             'delete' => 'allow_delete_for_levels',
             'translate' => 'allow_translate_for_levels',
+            'unsafe' => 'allow_unsafe_for_levels',
         );
         if (!isset($aTypes[$sType]) || !isset($this->_aObject[$aTypes[$sType]]))
             return false;

+ 3 - 3
inc/classes/BxDolWikiQuery.php

@@ -52,15 +52,15 @@ class BxDolWikiQuery extends BxDolDb
         }
 
         // get latest revision for specific language
-        $aRow = $this->getRow("SELECT `content` FROM `sys_pages_wiki_blocks` WHERE `block_id` = :block AND `language` = :lang $sWhere ORDER BY `revision` DESC LIMIT 1", $aBind);
+        $aRow = $this->getRow("SELECT `content`, `unsafe` FROM `sys_pages_wiki_blocks` WHERE `block_id` = :block AND `language` = :lang $sWhere ORDER BY `revision` DESC LIMIT 1", $aBind);
 
         // if translation isn't found for specific language then get latest revision for main language 
         if (!$aRow) {
             unset($aBind['lang']);
-            $aRow = $this->getRow("SELECT `content` FROM `sys_pages_wiki_blocks` WHERE `block_id` = :block AND `main_language` = 1 $sWhere ORDER BY `revision` DESC LIMIT 1", $aBind);
+            $aRow = $this->getRow("SELECT `content`, `unsafe` FROM `sys_pages_wiki_blocks` WHERE `block_id` = :block AND `main_language` = 1 $sWhere ORDER BY `revision` DESC LIMIT 1", $aBind);
         }
 
-        return $aRow ? $aRow['content'] : false;
+        return $aRow ? $aRow : false;
     }
 }
 

+ 7 - 6
install/sql/system.sql

@@ -3668,12 +3668,12 @@ INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALU
 ('sys_report_types', 'other', 5, '_sys_pre_lists_report_types_other', '');
 
 INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`, `Data`) VALUES
-('sys_vote_reactions', 'like', 1, '_sys_pre_lists_vote_reactions_like', '', 'a:2:{s:4:"icon";s:9:"thumbs-up";s:6:"weight";s:1:"1";}'),
-('sys_vote_reactions', 'love', 2, '_sys_pre_lists_vote_reactions_love', '', 'a:2:{s:4:"icon";s:26:"heart sys-colored col-red1";s:6:"weight";s:1:"1";}'),
-('sys_vote_reactions', 'joy', 3, '_sys_pre_lists_vote_reactions_joy', '', 'a:2:{s:4:"icon";s:32:"grin-squint sys-colored col-red3";s:6:"weight";s:1:"1";}'),
-('sys_vote_reactions', 'surprise', 4, '_sys_pre_lists_vote_reactions_surprise', '', 'a:2:{s:4:"icon";s:29:"surprise sys-colored col-red3";s:6:"weight";s:1:"1";}'),
-('sys_vote_reactions', 'sadness', 5, '_sys_pre_lists_vote_reactions_sadness', '', 'a:2:{s:4:"icon";s:29:"sad-tear sys-colored col-red3";s:6:"weight";s:1:"1";}'),
-('sys_vote_reactions', 'anger', 6, '_sys_pre_lists_vote_reactions_anger', '', 'a:2:{s:4:"icon";s:26:"angry sys-colored col-red3";s:6:"weight";s:1:"1";}');
+('sys_vote_reactions', 'like', 1, '_sys_pre_lists_vote_reactions_like', '', 'a:3:{s:4:"icon";s:9:"thumbs-up";s:5:"color";s:20:"sys-colored col-gray";s:6:"weight";s:1:"1";}'),
+('sys_vote_reactions', 'love', 2, '_sys_pre_lists_vote_reactions_love', '', 'a:3:{s:4:"icon";s:5:"heart";s:5:"color";s:20:"sys-colored col-red1";s:6:"weight";s:1:"1";}'),
+('sys_vote_reactions', 'joy', 3, '_sys_pre_lists_vote_reactions_joy', '', 'a:3:{s:4:"icon";s:11:"grin-squint";s:5:"color";s:20:"sys-colored col-red3";s:6:"weight";s:1:"1";}'),
+('sys_vote_reactions', 'surprise', 4, '_sys_pre_lists_vote_reactions_surprise', '', 'a:3:{s:4:"icon";s:8:"surprise";s:5:"color";s:20:"sys-colored col-red3";s:6:"weight";s:1:"1";}'),
+('sys_vote_reactions', 'sadness', 5, '_sys_pre_lists_vote_reactions_sadness', '', 'a:3:{s:4:"icon";s:8:"sad-tear";s:5:"color";s:20:"sys-colored col-red3";s:6:"weight";s:1:"1";}'),
+('sys_vote_reactions', 'anger', 6, '_sys_pre_lists_vote_reactions_anger', '', 'a:3:{s:4:"icon";s:5:"angry";s:5:"color";s:20:"sys-colored col-red3";s:6:"weight";s:1:"1";}');
 
 INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`, `Data`) VALUES
 ('sys_relations', '1', 1, '_sys_pre_lists_relations_husband', '', 'a:1:{i:0;s:1:"2";}'),
@@ -4860,6 +4860,7 @@ CREATE TABLE IF NOT EXISTS `sys_pages_wiki_blocks` (
   `main_language` tinyint(4) NOT NULL DEFAULT '0',
   `profile_id` int(10) UNSIGNED NOT NULL,
   `content` mediumtext NOT NULL,
+  `unsafe` tinyint(4) NOT NULL DEFAULT '0',
   `comment` varchar(255) NOT NULL,
   `added` int(11) NOT NULL,
   `changed` int(11) NOT NULL,

+ 1 - 1
modules/base/general/classes/BxBaseModGeneralModule.php

@@ -1341,7 +1341,7 @@ class BxBaseModGeneralModule extends BxDolModule
             'entry_caption' => $sEntryCaption,
             'entry_author' => $aContentInfo[$CNF['FIELD_AUTHOR']],
             'entry_privacy' => '', //may be empty or not specified. In this case Public privacy will be used.
-            'lang_key' => '', //may be empty or not specified. In this case the default one from Notification module will be used.
+            'lang_key' => '', //may be empty or not specified, or a string, or an array('site' => '...', 'email' => '...', 'push' => '...'). In this case of empty/not specified the default one from Notification module will be used.
             /*
              * Custom settings for email and/or push notifications can be provided here. 
              * Only necessary parts of 'settings' array can be used.

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

@@ -361,7 +361,7 @@ INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `ch
 ('bx_albums', 'bx_albums', 'do_submit', '_bx_albums_form_entry_input_do_submit', '', 0, 'submit', '_bx_albums_form_entry_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('bx_albums', 'bx_albums', 'title', '', '', 0, 'text', '_bx_albums_form_entry_input_sys_title', '_bx_albums_form_entry_input_title', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_albums_form_entry_input_title_err', 'Xss', '', 1, 0),
 ('bx_albums', 'bx_albums', 'text', '', '', 0, 'textarea', '_bx_albums_form_entry_input_sys_text', '_bx_albums_form_entry_input_text', '', 0, 0, 2, '', '', '', '', '', '', 'XssHtml', '', 1, 0),
-('bx_albums', 'bx_albums', 'pictures', 'a:2:{i:0;s:15:"bx_albums_html5";i:1;s:14:"bx_albums_crop";}', 'a:3:{s:16:"bx_albums_simple";s:26:"_sys_uploader_simple_title";s:15:"bx_albums_html5";s:25:"_sys_uploader_html5_title";s:14:"bx_albums_crop";s:24:"_sys_uploader_crop_title";}', 0, 'files', '_bx_albums_form_entry_input_sys_pictures', '_bx_albums_form_entry_input_pictures', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_albums', 'bx_albums', 'pictures', 'a:1:{i:0;s:15:"bx_albums_html5";}', 'a:3:{s:16:"bx_albums_simple";s:26:"_sys_uploader_simple_title";s:15:"bx_albums_html5";s:25:"_sys_uploader_html5_title";s:14:"bx_albums_crop";s:24:"_sys_uploader_crop_title";}', 0, 'files', '_bx_albums_form_entry_input_sys_pictures', '_bx_albums_form_entry_input_pictures', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('bx_albums', 'bx_albums', 'allow_view_to', '', '', 0, 'custom', '_bx_albums_form_entry_input_sys_allow_view_to', '_bx_albums_form_entry_input_allow_view_to', '', 1, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('bx_albums', 'bx_albums', 'location', '', '', 0, 'location', '_sys_form_input_sys_location', '_sys_form_input_location', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('bx_albums', 'bx_albums', 'added', '', '', 0, 'datetime', '_bx_albums_form_entry_input_sys_date_added', '_bx_albums_form_entry_input_date_added', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),

+ 1 - 0
modules/boonex/credits/classes/BxCreditsGridHistoryAdministration.php

@@ -161,6 +161,7 @@ class BxCreditsGridHistoryAdministration extends BxTemplGrid
         ));
 
         $this->_oModule->_oTemplate->addCss(array(
+            'main.css',
             'withdraw.css'
         ));
 

+ 2 - 2
modules/boonex/credits/classes/BxCreditsTemplate.php

@@ -17,7 +17,7 @@ class BxCreditsTemplate extends BxBaseModGeneralTemplate
 
         parent::__construct($oConfig, $oDb);
 
-        $this->aMethodsToCallAddJsCss = array('getBlockBundles');
+        $this->aMethodsToCallAddJsCss = array('getBlockBundles', 'getBlockCheckout');
     }
 
     public function getJsCode($sType, $aParams = array(), $bWrap = true)
@@ -42,7 +42,7 @@ class BxCreditsTemplate extends BxBaseModGeneralTemplate
         if(($sCode = getParam($CNF['PARAM_CODE'])) != '')
             $sUnit = $sCode;
         else if(($sIcon = getParam($CNF['PARAM_ICON'])) != '')
-            $sUnit = $this->parseIcon($sIcon, array('class' => $this->_oConfig->getPrefix('style') . '-mti-balance bx-def-margin-thd-right'));
+            $sUnit = $this->parseIcon($sIcon, array('class' => $this->_oConfig->getPrefix('style') . '-prefix-icon bx-def-margin-thd-right'));
 
         return $sUnit;
     }

+ 0 - 4
modules/boonex/credits/install/sql/disable.sql

@@ -15,10 +15,6 @@ DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_credits';
 DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_credits';
 DELETE FROM `sys_menu_items` WHERE `module` = 'bx_credits' OR `set_name` IN ('bx_credits_submenu', 'bx_credits_orders_submenu');
 
--- ACL
-DELETE `sys_acl_actions`, `sys_acl_matrix` FROM `sys_acl_actions`, `sys_acl_matrix` WHERE `sys_acl_matrix`.`IDAction` = `sys_acl_actions`.`ID` AND `sys_acl_actions`.`Module` = 'bx_credits';
-DELETE FROM `sys_acl_actions` WHERE `Module` = 'bx_credits';
-
 -- GRIDS
 DELETE FROM `sys_objects_grid` WHERE `object` LIKE 'bx_credits_%';
 DELETE FROM `sys_grid_fields` WHERE `object` LIKE 'bx_credits_%';

+ 0 - 28
modules/boonex/credits/install/sql/enable.sql

@@ -119,34 +119,6 @@ INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `titl
 ('sys_account_dashboard_manage_tools', 'bx_credits', 'credits-history-administration', '_bx_credits_menu_item_title_system_admt_credits', '_bx_credits_menu_item_title_admt_credits', 'page.php?i=credits-history-administration', '', '_self', 'copyright col-green3', 'a:2:{s:6:"module";s:10:"bx_credits";s:6:"method";s:27:"get_menu_addon_manage_tools";}', '', 192, 1, 0, @iManageMenuOrder + 1);
 
 
--- ACL
-INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
-('bx_credits', 'view', NULL, '_bx_credits_acl_action_view_entry', '', 1, 0);
-SET @iIdActionView = LAST_INSERT_ID();
-
-SET @iUnauthenticated = 1;
-SET @iAccount = 2;
-SET @iStandard = 3;
-SET @iUnconfirmed = 4;
-SET @iPending = 5;
-SET @iSuspended = 6;
-SET @iModerator = 7;
-SET @iAdministrator = 8;
-SET @iPremium = 9;
-
-INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
-
--- entry view
-(@iUnauthenticated, @iIdActionView),
-(@iAccount, @iIdActionView),
-(@iStandard, @iIdActionView),
-(@iUnconfirmed, @iIdActionView),
-(@iPending, @iIdActionView),
-(@iModerator, @iIdActionView),
-(@iAdministrator, @iIdActionView),
-(@iPremium, @iIdActionView);
-
-
 -- GRIDS: bundles
 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_credits_bundles', 'Sql', 'SELECT * FROM `bx_credits_bundles` WHERE 1 ', 'bx_credits_bundles', 'id', 'order', 'active', '', 100, NULL, 'start', '', 'period,period_unit,price', '', 'like', '', '', 192, 'BxCreditsGridBundles', 'modules/boonex/credits/classes/BxCreditsGridBundles.php');

+ 4 - 0
modules/boonex/credits/template/css/main.css

@@ -1,5 +1,9 @@
 @import url(../../../general/template/css/main.css);
 
+.sys-icon.bx-credits-prefix-icon {
+    color: #334455;
+}
+
 /*--- Bundles ---*/
 .bx-credits-bundles,
 .bx-credits-bundles-cnt {

+ 25 - 6
modules/boonex/notifications/classes/BxNtfsTemplate.php

@@ -197,9 +197,22 @@ class BxNtfsTemplate extends BxBaseModNotificationsTemplate
 
     	$bEventParsed = false;
         bx_alert($this->_oConfig->getName(), 'get_notification', 0, 0, array('event' => &$aEvent, 'event_parsed' => &$bEventParsed, 'owner' => &$oOwner));
-        if (!$bEventParsed){
-    	    $aEvent['content_parsed'] = _t(!empty($aEvent['content']['lang_key']) ? $aEvent['content']['lang_key'] : $this->_getContentLangKey($aEvent));
-    	    $aEvent['content_parsed'] = $this->parseHtmlByContent($aEvent['content_parsed'], $aEvent['content'], array('{', '}'));
+        if(!$bEventParsed) {
+            $mLk = '';
+            if(!empty($aEvent['content']['lang_key'])) {
+                $mLk = $aEvent['content']['lang_key'];
+                if(!is_string($mLk) && !(is_array($mLk) && isset($mLk['site'], $mLk['email'], $mLk['push'])))
+                    $mLk = '';
+            }
+
+            if(empty($mLk))
+                $mLk = $this->_getContentLangKey($aEvent);
+
+            if(is_array($mLk))
+                foreach($mLk as $sDeliveryType => $sLangKey)
+                    $aEvent['content_parsed'][$sDeliveryType] = $this->_parseContentLangKey($sLangKey, $aEvent);
+            else
+                $aEvent['content_parsed'] = $this->_parseContentLangKey($mLk, $aEvent);
         }
 
         // returns parsed content for React Jot
@@ -214,7 +227,7 @@ class BxNtfsTemplate extends BxBaseModNotificationsTemplate
             'id' => $aEvent['id'],
             'author_unit' => $this->_isInContext($aEvent) && $oObjectOwner ? $oObjectOwner->getUnit(0, array('template' => 'unit_wo_info_links')) : $oOwner->getUnit(0, array('template' => 'unit_wo_info_links')),
             'link' => $this->_getContentLink($aEvent),
-            'content' => $aEvent['content_parsed'],
+            'content' => is_array($aEvent['content_parsed']) && isset($aEvent['content_parsed']['site']) ? $aEvent['content_parsed']['site'] : $aEvent['content_parsed'],
             'date' => bx_time_js($aEvent['date']),
         ));
     }
@@ -230,7 +243,7 @@ class BxNtfsTemplate extends BxBaseModNotificationsTemplate
             'content' => $this->parseHtmlByName('et_new_event.html', array(
                 'icon_url' => !empty($aContent['owner_icon']) ? $aContent['owner_icon'] : $this->getIconUrl('std-icon.svg'),
                 'content_url' => $this->_getContentLink($aEvent),
-                'content' => $aEvent['content_parsed'],
+                'content' => is_array($aEvent['content_parsed']) && isset($aEvent['content_parsed']['email']) ? $aEvent['content_parsed']['email'] : $aEvent['content_parsed'],
                 'date' => bx_process_output($aEvent['date'], BX_DATA_DATETIME_TS),
             )),
             'settings' => !empty($aContent['settings']['email']) ? $aContent['settings']['email'] : array()
@@ -243,7 +256,8 @@ class BxNtfsTemplate extends BxBaseModNotificationsTemplate
         if(empty($sEvent) || empty($aEvent['content_parsed']))
             return false;
 
-        $sMessage = preg_replace('/<\/?[a-zA-Z0-9=\'":;\(\)\s_-]+>/i', '"', $aEvent['content_parsed']);
+        $sMessage = is_array($aEvent['content_parsed']) && isset($aEvent['content_parsed']['push']) ? $aEvent['content_parsed']['push'] : $aEvent['content_parsed'];
+        $sMessage = preg_replace('/<\/?[a-zA-Z0-9=\'":;\(\)\s_-]+>/i', '"', $sMessage);
         if($sMessage)
             $sMessage = BxTemplFunctions::getInstance()->getStringWithLimitedLength(html_entity_decode($sMessage), $this->_oConfig->getPushMaxLen());
 
@@ -347,6 +361,11 @@ class BxNtfsTemplate extends BxBaseModNotificationsTemplate
     	return $sKey;
     }
 
+    protected function _parseContentLangKey($sLangKey, &$aEvent)
+    {
+        return $this->parseHtmlByContent(_t($sLangKey), $aEvent['content'], array('{', '}'));
+    }
+
     protected function _getContentLink(&$aEvent)
     {
         return !empty($aEvent['subobject_id']) && !empty($aEvent['content']['subentry_url']) ? $aEvent['content']['subentry_url'] : $aEvent['content']['entry_url'];

+ 3 - 0
modules/boonex/wiki/install/langs/en.xml

@@ -2,4 +2,7 @@
 <resources name="en" flag="gb" title="English">
     <string name="_sys_module_wiki"><![CDATA[Wiki]]></string>
     <string name="_bx_wiki"><![CDATA[Wiki]]></string>
+    <string name="_bx_wiki_page_home"><![CDATA[Wiki Home]]></string>
+    <string name="_bx_wiki_block_home"><![CDATA[Wiki Home]]></string>
+    <string name="_bx_wiki_menu_item_title_system_home"><![CDATA[Wiki]]></string>
 </resources>

+ 6 - 0
modules/boonex/wiki/install/sql/disable.sql

@@ -11,3 +11,9 @@ DELETE FROM `sys_permalinks` WHERE `standard` = 'r.php?_q=wiki/' AND `permalink`
 
 DELETE FROM `sys_rewrite_rules` WHERE `preg` = '^wiki/(.*)$';
 
+-- Menu
+
+DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_wiki';
+DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_wiki';
+DELETE FROM `sys_menu_items` WHERE `module` = 'bx_wiki' OR `set_name` LIKE 'bx_wiki%';
+

+ 11 - 0
modules/boonex/wiki/install/sql/enable.sql

@@ -14,3 +14,14 @@ INSERT INTO `sys_permalinks` (`standard`, `permalink`, `check`, `compare_by_pref
 INSERT INTO `sys_rewrite_rules` (`preg`, `service`, `active`) VALUES
 ('^wiki/(.*)$', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:9:"wiki_page";s:6:"params";a:2:{i:0;s:4:"wiki";i:1;s:3:"{1}";}s:5:"class";s:16:"TemplServiceWiki";}', 1);
 
+-- MENU: add to site menu
+
+SET @iSiteMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_site' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('sys_site', 'bx_wiki', 'wiki-home', '', '_bx_wiki_menu_item_title_system_home', 'r.php?_q=wiki/wiki-home', '', '', 'fab wikipedia-w', '', 2147483647, 1, 1, IFNULL(@iSiteMenuOrder, 0) + 1);
+
+-- MENU: add to homepage menu
+
+SET @iHomepageMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_homepage' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('sys_homepage', 'bx_wiki', 'wiki-home', '', '_bx_wiki_menu_item_title_system_home', 'r.php?_q=wiki/wiki-home', '', '', 'far wikipedia-w', '', 2147483647, 1, 1, IFNULL(@iHomepageMenuOrder, 0) + 1);

+ 12 - 0
modules/boonex/wiki/install/sql/install.sql

@@ -1,4 +1,16 @@
 
+-- Wiki home page
+
+INSERT INTO `sys_objects_page` (`object`, `uri`, `title_system`, `title`, `module`, `cover`, `cover_image`, `type_id`, `layout_id`, `submenu`, `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_wiki_home', 'wiki-home', '', '_bx_wiki_page_home', 'bx_wiki', 0, 0, 1, 5, '', 2147483647, 1, 'r.php?_q=wiki/home', '', '', '', 0, 1, 0, '', '');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `hidden_on`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES
+('bx_wiki_home', 1, 'bx_wiki', '', '_bx_wiki_block_home', 0, 2147483647, '0', 'wiki', '', 0, 1, 1, 1);
+SET @iBlockId = LAST_INSERT_ID();
+INSERT INTO `sys_pages_wiki_blocks` (`block_id`, `revision`, `language`, `main_language`, `profile_id`, `content`, `comment`, `added`, `changed`) VALUES
+(@iBlockId, 1, 'en', 1, 0, '# Wiki Home\r\n\r\nInsert **your content** here', 'Initial version', UNIX_TIMESTAMP(), UNIX_TIMESTAMP());
+
+
 -- Studio page and widget
 
 INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES

+ 8 - 0
modules/boonex/wiki/install/sql/uninstall.sql

@@ -1,5 +1,13 @@
 
+-- Delete WIKI content
 
+DELETE FROM `wb`, `wc`, `wp`
+USING `sys_pages_blocks` AS `wb`, `sys_pages_wiki_blocks` AS `wc`, `sys_objects_page` AS `wp`
+WHERE `wb`.`id` = `wc`.`block_id` AND `wp`.`object` = `wb`.`object` AND `wp`.`module` = 'bx_wiki';
+
+DELETE FROM `wb`, `wc`
+USING `sys_pages_blocks` AS `wb`, `sys_pages_wiki_blocks` AS `wc`
+WHERE `wb`.`id` = `wc`.`block_id` AND `wb`.`module` = 'bx_wiki';
 
 -- Studio page and widget
 

+ 3 - 3
template/scripts/BxBaseVoteReactions.php

@@ -329,7 +329,7 @@ class BxBaseVoteReactions extends BxDolVoteReactions
                 'condition' => !isset($aParams['show_counter_label_icon']) || (bool)$aParams['show_counter_label_icon'] === true,
                 'content' => array(
                     'style_prefix' => $this->_sStylePrefix,
-                    'name' => $this->_aDataList[$sReaction]['icon']
+                    'name' => $this->getIcon($sReaction)
                 )
             ),
             'bx_if:show_text' => array(
@@ -367,7 +367,7 @@ class BxBaseVoteReactions extends BxDolVoteReactions
                     'condition' => $bSummary,
                     'content' => array(
                         'style_prefix' => $this->_sStylePrefix,
-                        'icon' => $bSummary ? $this->_aDataList[$mValue['reaction']]['icon'] : ''
+                        'icon' => $bSummary ? $this->getIcon($mValue['reaction']) : ''
                     )
                 )
             );
@@ -396,7 +396,7 @@ class BxBaseVoteReactions extends BxDolVoteReactions
             $bSummary = $sReaction == 'summary';
 
             $sName = $this->_sStylePrefix . '-' . $sReaction;
-            $sTitle = !$bSummary ? $this->_oTemplate->parseIcon($this->_aDataList[$sReaction]['icon']) : $sTxtSummary;
+            $sTitle = !$bSummary ? $this->_oTemplate->parseIcon($this->getIcon($sReaction)) : $sTxtSummary;
             $sTitleAttr = !$bSummary ? _t('_vote_do_by_x_reaction', _t($this->_aDataList[$sReaction]['title'])) : $sTxtSummary;
 
             $aMenuItems[] = array('id' => $sName, 'name' => $sName, 'class' => '', 'link' => 'javascript:void(0)', 'onclick' => 'javascript:' . $sJsObject . '.changeVotedBy(this, \'' . $sReaction . '\')', 'target' => '_self', 'title' => $sTitle, 'title_attr' => $sTitleAttr, 'active' => 1);

+ 5 - 1
template/scripts/BxBaseVoteReactionsMenuDo.php

@@ -35,9 +35,13 @@ class BxBaseVoteReactionsMenuDo extends BxTemplMenu
     {
         $sJsObject = $this->_oObject->getJsObjectName();
         $aReactions = $this->_oObject->getReactions(true);
+        $sDefault = $this->_oObject->getDefault();
 
         $aMenuItems = array();        
         foreach($aReactions as $sName => $aReaction) {
+            if($sName == $sDefault)
+                continue;
+
             $aMenuItems[] = array(
                 'id' => $sName, 
                 'name' => $sName, 
@@ -46,7 +50,7 @@ class BxBaseVoteReactionsMenuDo extends BxTemplMenu
                 'onclick' => 'javascript:' . $this->_oObject->getJsClickDo($sName, $this->_iValue), 
                 'target' => '_self', 
                 'title' => _t($aReaction['title']), 
-                'icon' => $aReaction['icon'], 
+                'icon' => $this->_oObject->getIcon($sName), 
                 'active' => 1
             );
         }