Просмотр исходного кода

Ticket #3583 - Timeline: Dynamic browsing: Browse by context.

AntonLV 4 лет назад
Родитель
Сommit
a5beffca86

+ 4 - 1
inc/classes/BxDolTemplate.php

@@ -2691,7 +2691,10 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
                 if(isset($aMatches[1]) && !empty($aMatches[1])) {
                     if(is_array($aValuesSrc[$i]))
                         foreach($aValuesSrc[$i] as $aValue)
-                            $sValue .= $this->parseHtmlByContent($aMatches[1], $aValue, $mixedKeyWrapperHtml);
+                            if(is_array($aValue))
+                                $sValue .= $this->parseHtmlByContent($aMatches[1], $aValue, $mixedKeyWrapperHtml);
+                            else if(is_string($aValue))
+                                $sValue .= $aValue;
                     else if(is_string($aValuesSrc[$i]))
                         $sValue = $aValuesSrc[$i];
                 }

+ 5 - 0
modules/boonex/russian/data/langs/bx_timeline/ru.xml

@@ -197,6 +197,11 @@
     <string name="_bx_timeline_menu_item_title_system_hot"><![CDATA[Популярное]]></string>
     <string name="_bx_timeline_menu_item_title_hot"><![CDATA[Популярное]]></string>
 
+    <string name="_bx_timeline_menu_title_feeds"><![CDATA[Хроники]]></string>
+    <string name="_bx_timeline_menu_set_title_feeds"><![CDATA[Хроники]]></string>
+    <string name="_bx_timeline_menu_template_title_feeds"><![CDATA[Хроники]]></string>
+    <string name="_bx_timeline_menu_item_title_system_divider"><![CDATA[Разделитель]]></string>
+
     <string name="_bx_timeline_menu_item_view_all"><![CDATA[Все сообщения]]></string>
     <string name="_bx_timeline_menu_item_view_owner"><![CDATA[Сообщения от {0}]]></string>
     <string name="_bx_timeline_menu_item_view_other"><![CDATA[Сообщения от других]]></string>

+ 3 - 0
modules/boonex/timeline/classes/BxTimelineDb.php

@@ -976,6 +976,8 @@ class BxTimelineDb extends BxBaseModNotificationsDb
                 $mixedJoinClause['p1'] .= " LEFT JOIN `" . $aJoin1['table'] . "` AS `" . $aJoin1['table_alias'] . "` ON " . $aJoin1['condition'];
 
                 $mixedWhereSubclause['p1'] = "NOT ISNULL(`" . $aJoin1['table_alias'] . "`.`content`)";
+                if(!empty($aParams['context']))
+                    $mixedWhereSubclause['p1'] .= $this->prepareAsString(" AND `" . $aJoin1['table_alias'] . "`.`content`=?", $aParams['context']);
 
                 //--- Exclude Own (Direct) posts on timelines of following members.
                 //--- Note. Disabled for now.
@@ -1056,6 +1058,7 @@ class BxTimelineDb extends BxBaseModNotificationsDb
             'link' => 'javascript:void(0)', 
             'onclick' => "javascript:{js_object_view}.changeFeed(this, '" . $sModule . "')", 
             'target' => '_self',
+            'collapsed' => 1,
             'order' => $iOrder
         ]));
     }

+ 78 - 6
modules/boonex/timeline/classes/BxTimelineMenuFeeds.php

@@ -9,35 +9,107 @@
  * @{
  */
 
-class BxTimelineMenuFeeds extends BxTemplMenuCustom
+class BxTimelineMenuFeeds extends BxTemplMenu
 {
     protected $_sModule;
     protected $_oModule;
 
+    protected $_sJsObject;
+    protected $_sStylePrefix;
+
     public function __construct($aObject, $oTemplate = false)
     {
         $this->_sModule = 'bx_timeline';
         $this->_oModule = BxDolModule::getInstance($this->_sModule);
 
         parent::__construct($aObject, $this->_oModule->_oTemplate);
+
+        $this->_bMultilevel = true;
+        $this->_bDisplayAddons = true;
     }
 
     public function setBrowseParams($aParams = [])
     {
+        $this->_sJsObject = $this->_oModule->_oConfig->getJsObjectView($aParams);
+        $this->_sStylePrefix = $this->_oModule->_oConfig->getPrefix('style');
+
         $aMarkers = array();
         foreach($aParams as $sKey => $mixedValue)
             if(!is_array($mixedValue))
                 $aMarkers[$sKey] = $mixedValue;
+        $aMarkers['js_object_view'] = $this->_sJsObject;
 
         $this->addMarkers($aMarkers);
-        $this->addMarkers(array(
-            'js_object_view' => $this->_oModule->_oConfig->getJsObjectView($aParams)
-        ));
     }
 
-    protected function _getMenuItemItemDivider($aItem)
+    protected function getMenuItemsRaw()
+    {
+        $aMenuItems = parent::getMenuItemsRaw();
+        if(empty($aMenuItems) || !is_array($aMenuItems))
+            return $aMenuItems;
+
+        $iProfile = bx_get_logged_profile_id();
+        $oConnection = BxDolConnection::getObjectInstance('sys_profiles_subscriptions');
+        $sOnClickMask = "return " . $this->_sJsObject. ".changeFeed(this, '%s', {context: %d})";
+
+        foreach($aMenuItems as $iIndex => $aItem) {
+            $aIds = $oConnection->getConnectedContentByType($iProfile, array($aItem['module']));
+
+            if(empty($aItem['onclick']))
+                $aMenuItems[$iIndex]['onclick'] = $this->_sJsObject . '.toggleMenuItemFeeds(this)';
+
+            $aSubmenu = array();
+            foreach($aIds as $iId) {
+                $oContext = BxDolProfile::getInstance($iId);
+                if(!$oContext)
+                    continue;
+
+                $aSubmenu[] = array(
+                    'id' => 'context-' . $iId, 
+                    'name' => 'context-' . $iId, 
+                    'class' => '', 
+                    'link' => $oContext->getUrl(), 
+                    'onclick' => sprintf($sOnClickMask, $aItem['module'], $iId), 
+                    'target' => '_self', 
+                    'title' => $oContext->getDisplayName(), 
+                    'icon' => $oContext->getIcon(),
+                    'active' => 1
+                );
+            }
+
+            if(!empty($aSubmenu))
+                $aMenuItems[$iIndex]['subitems'] = $aSubmenu;
+        }
+
+        return $aMenuItems;
+    }
+    
+    protected function _getTemplateVars ()
     {
-        return $this->_oModule->_oTemplate->parseHtmlByName('menu_item_divider.html', []);
+        $aResult = parent::_getTemplateVars();
+        $aResult['style_prefix'] = $this->_sStylePrefix;
+        return $aResult;
+    }
+    
+    protected function _getMenuItem ($a)
+    {
+        if($a['name'] == 'divider')
+            return $this->_oModule->_oTemplate->parseHtmlByName('menu_item_divider.html', []);
+
+        $aResult = parent::_getMenuItem($a);
+        $aResult = array_merge($aResult, [
+            'js_object' => $this->_sJsObject,
+            'style_prefix' => $this->_sStylePrefix,
+            'bx_if:show_toggle' => [
+                'condition' => $this->_bMultilevel && !empty($a['subitems']),
+                'content' => [
+                    'js_object' => $this->_sJsObject,
+                    'style_prefix' => $this->_sStylePrefix,
+                ]
+            ]
+        ]);
+
+        return $aResult;
     }
 }
 

+ 10 - 30
modules/boonex/timeline/classes/BxTimelineModule.php

@@ -1374,36 +1374,6 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
             'form_display' => $this->_oConfig->getPostFormDisplay($sType)
         ));
     }
-    
-    /**
-     * @page service Service Calls
-     * @section bx_timeline Timeline
-     * @subsection bx_timeline-page_blocks Page Blocks
-     * @subsubsection bx_timeline-get_block_post_custom get_block_post_custom
-     * 
-     * @code bx_srv('bx_timeline', 'get_block_post_custom', [...]); @endcode
-     * 
-     * Get Post block for the Custom timeline.
-     *
-     * @return an array describing a block to display on the site. All necessary CSS and JS files are automatically added to the HEAD section of the site HTML.
-     * 
-     * @see BxTimelineModule::serviceGetBlockPostCustom
-     */
-    /** 
-     * @ref bx_timeline-get_block_post_custom "get_block_post_custom"
-     */
-    public function serviceGetBlockPostCustom($aParams)
-    {
-        if(!isLogged())
-            return '';
-
-        $iProfileId = $this->getProfileId();
-
-        if (!isset($aParams['form_display']))
-            $aParams['form_display'] = $this->_oConfig->getPostFormDisplay($aParams['type']);
-        
-        return $this->_getBlockPost($iProfileId, $aParams);
-    }
 
     /**
      * @page service Service Calls
@@ -1856,6 +1826,10 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
             $aParams['type'] = $sType;
 
         $sMenu = $this->_oConfig->getObject('menu_feeds');
+        if(isset($aParams['menu_feeds'])) {
+            $sMenu = $aParams['menu_feeds'];
+            unset($aParams['menu_feeds']);
+        }
         $oMenu = BxDolMenu::getObjectInstance($sMenu);
         if(!$oMenu)
             return '';
@@ -4817,6 +4791,9 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
         if(empty($aParams['modules']) || !is_array($aParams['modules']))
             $aParams['modules'] = array();
 
+        if(empty($aParams['context']))
+            $aParams['context'] = 0;
+
         if(empty($aParams['blink']) || !is_array($aParams['blink']))
             $aParams['blink'] = array();
 
@@ -4860,6 +4837,9 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
         $aParams['modules'] = bx_get('modules');
         $aParams['modules'] = $aParams['modules'] !== false ? bx_process_input($aParams['modules'], BX_DATA_TEXT) : array();
 
+        $aParams['context'] = bx_get('context');
+        $aParams['context'] = $aParams['context'] !== false ? bx_process_input($aParams['context'], BX_DATA_INT) : 0;
+
         $aParams['blink'] = bx_get('blink');
         $aParams['blink'] = $aParams['blink'] !== false ? explode(',', bx_process_input($aParams['blink'], BX_DATA_TEXT)) : array();
 

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

@@ -210,6 +210,7 @@
 
     <string name="_bx_timeline_menu_title_feeds"><![CDATA[Feeds]]></string>
     <string name="_bx_timeline_menu_set_title_feeds"><![CDATA[Feeds]]></string>
+    <string name="_bx_timeline_menu_template_title_feeds"><![CDATA[Feeds]]></string>
     <string name="_bx_timeline_menu_item_title_system_divider"><![CDATA[Divider]]></string>
 
     <string name="_bx_timeline_menu_item_view_all"><![CDATA[All posts]]></string>

+ 1 - 0
modules/boonex/timeline/install/sql/disable.sql

@@ -12,6 +12,7 @@ DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_timeline' OR `object` IN('bx
 DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_timeline';
 DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_timeline';
 DELETE FROM `sys_menu_items` WHERE `module` = 'bx_timeline' OR `set_name` IN('bx_timeline_menu_view', 'bx_timeline_menu_feeds', 'bx_timeline_menu_item_share', 'bx_timeline_menu_item_manage', 'bx_timeline_menu_item_actions', 'bx_timeline_menu_item_actions', 'bx_timeline_menu_item_counters', 'bx_timeline_menu_item_meta', 'bx_timeline_menu_post_attachments');
+DELETE FROM `sys_menu_templates` WHERE `template`='menu_feeds.html' AND `title`='_bx_timeline_menu_template_title_feeds';
 
 
 -- SETTINGS

+ 5 - 1
modules/boonex/timeline/install/sql/enable.sql

@@ -112,8 +112,12 @@ INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `titl
 ('bx_timeline_menu_view', 'bx_timeline', 'hot', '_bx_timeline_menu_item_title_system_hot', '_bx_timeline_menu_item_title_hot', 'javascript:void(0)', 'javascript:{js_object_view}.changeView(this, ''hot'')', '_self', '', '', 2147483647, 1, 0, 4);
 
 -- MENU: Feeds
+INSERT INTO `sys_menu_templates` (`id`, `template`, `title`, `visible`) VALUES
+(ROUND(RAND()*(9999 - 1000) + 1000), 'menu_feeds.html', '_bx_timeline_menu_template_title_feeds', 1);
+SET @iTemplId = (SELECT `id` FROM `sys_menu_templates` WHERE `template`='menu_feeds.html' AND `title`='_bx_timeline_menu_template_title_feeds' LIMIT 1);
+
 INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
-('bx_timeline_menu_feeds', '_bx_timeline_menu_title_feeds', 'bx_timeline_menu_feeds', 'bx_timeline', 20, 0, 1, 'BxTimelineMenuFeeds', 'modules/boonex/timeline/classes/BxTimelineMenuFeeds.php');
+('bx_timeline_menu_feeds', '_bx_timeline_menu_title_feeds', 'bx_timeline_menu_feeds', 'bx_timeline', @iTemplId, 0, 1, 'BxTimelineMenuFeeds', 'modules/boonex/timeline/classes/BxTimelineMenuFeeds.php');
 
 INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
 ('bx_timeline_menu_feeds', 'bx_timeline', '_bx_timeline_menu_set_title_feeds', 0);

+ 10 - 2
modules/boonex/timeline/js/view.js

@@ -374,8 +374,9 @@ BxTimelineView.prototype.changeFeed = function(oLink, sType, oRequestParams)
 
     var oTab = $(oLink);
     var sTabActive = 'bx-menu-tab-active';
-    oTab.parents('ul:first').find('li.' + sTabActive).removeClass(sTabActive);
-    oTab.parents('li:first').addClass(sTabActive);
+    var sTabActiveBg = 'bx-def-color-bg-active';
+    oTab.parents('ul.' + this.sSP + '-menu-feeds').find('li.' + sTabActive).removeClass(sTabActive + ' ' + sTabActiveBg);
+    oTab.parents('li:first').addClass(sTabActive + ' ' + sTabActiveBg);
 
     this.loadingIn(oLink, true);
 
@@ -395,6 +396,8 @@ BxTimelineView.prototype.changeFeed = function(oLink, sType, oRequestParams)
         },
         'json'
     );
+
+    return false;
 };
 
 BxTimelineView.prototype.changeFeedFilters = function(oLink, oRequestParams)
@@ -440,6 +443,11 @@ BxTimelineView.prototype.changeFeedFilters = function(oLink, oRequestParams)
     );
 };
 
+BxTimelineView.prototype.toggleMenuItemFeeds = function(oSource)
+{
+    $(oSource).parents('li:first').toggleClass('bx-menu-item-collapsed');
+};
+
 BxTimelineView.prototype.onFilterByModuleChange = function(oSource)
 {
     var oModules = $(oSource).parents('.bx-form-element-wrapper:first').siblings('.modules');

+ 56 - 8
modules/boonex/timeline/template/css/view.css

@@ -1,17 +1,65 @@
 /*--- General section ---*/
 
 /*--- Dynamic Browsing: Menu ---*/
-.bx-menu-object-bx_timeline_menu_feeds .bx-menu-item > span {
-    display: block;
-    padding: 0;
+.bx-tl-menu-feeds.bx-menu-ver li.bx-menu-tab-active {
+    background-color: rgba(235, 240, 245, 0.8);
 }
-.bx-menu-object-bx_timeline_menu_feeds .bx-menu-item > span > a {
-    display: block;
-    padding: 0.25rem 0.5rem;
+.bx-tl-menu-feeds.bx-menu-ver li .bx-menu-item-link {
+    position: relative;
+    display: -webkit-flex;
+    display: flex;
+    -webkit-flex-flow: row nowrap;
+    flex-flow: row nowrap;
+    -webkit-align-items: center;
+    align-items: center;
+    -webkit-justify-content: space-between;
+    justify-content: space-between;
 }
-.bx-menu-object-bx_timeline_menu_feeds .bx-menu-tab-active {
-    background-color: rgba(235, 240, 245, 0.8);
+.bx-tl-menu-feeds.bx-menu-ver li a {
+    -webkit-flex-grow: 3;
+    flex-grow: 3;
+
+    position: relative;
+    display: -webkit-flex;
+    display: flex;
+    -webkit-flex-flow: row nowrap;
+    flex-flow: row nowrap;
+    -webkit-align-items: center;
+    align-items: center;
+    -webkit-justify-content: flex-start;
+    justify-content: flex-start;
+
+    line-height: 1.5rem;
+}
+.bx-tl-menu-feeds.bx-menu-ver li img, 
+.bx-tl-menu-feeds.bx-menu-ver li .sys-icon {
+    display: inline-block;
+    vertical-align: top;
+    width: 1.5rem;
+    height: 1.5rem;
+    line-height: 1.5rem;
+    font-size: 1.0rem;
+}
+.bx-tl-menu-feeds.bx-menu-ver li .bx-menu-item-title {
+    overflow: hidden;
+    text-overflow: ellipsis;
+}
+.bx-tl-menu-feeds.bx-menu-ver li .bx-menu-show {
+    display: none;
+}
+.bx-tl-menu-feeds.bx-menu-ver li .bx-menu-hide {
+    display: inline;
+}
+.bx-tl-menu-feeds.bx-menu-ver li.bx-menu-item-collapsed .bx-menu-show {
+    display: inline;
 }
+.bx-tl-menu-feeds.bx-menu-ver li.bx-menu-item-collapsed .bx-menu-hide {
+    display: none;
+}
+.bx-tl-menu-feeds.bx-menu-ver li.bx-menu-item-collapsed .bx-menu-item-subitems {
+    display: none;
+}
+
 
 /*--- Views Block Style ---*/
 .bx-tl-views {

+ 25 - 0
modules/boonex/timeline/template/menu_feeds.html

@@ -0,0 +1,25 @@
+<ul class="__style_prefix__-menu-feeds bx-menu-ver bx-menu-object-__object__ bx-def-font-middle bx-clearfix">
+    <bx_repeat:menu_items>
+        <li class="bx-menu-item bx-menu-item-__name__ bx-def-round-corners __class_add__">
+            <div class="bx-menu-item-cnt">
+                <div class="bx-menu-item-link bx-def-padding-thd-topbottom bx-def-padding-sec-leftright bx-def-color-bg-hl-hover">
+                    <a href="__link__" onclick="__onclick__"__attrs__>
+                        <bx_include_auto:menu_icon.html />
+                        <span class="bx-menu-item-title bx-def-margin-sec-left-auto">__title__</span>
+                    </a>
+                    <bx_if:show_toggle>
+                        <span class="bx-menu-collapse bx-def-padding-sec-left">
+                            <a href="javascript:void(0)" onclick="__js_object__.toggleMenuItemFeeds(this)">
+                                <i class="sys-icon chevron-up bx-menu-hide"></i>
+                                <i class="sys-icon chevron-down bx-menu-show"></i>
+                            </a>
+                        </span>
+                    </bx_if:show_toggle>
+                </div>
+                <bx_if:show_subitems>
+                    <div class="bx-menu-item-subitems">__subitems__</div>
+                </bx_if:show_subitems>
+            </div>
+        </li>
+    </bx_repeat:menu_items>
+</ul>

+ 17 - 0
modules/boonex/timeline/template/menu_feeds_subitems.html

@@ -0,0 +1,17 @@
+<ul class="bx-menu-item-subitems bx-menu-pf-subitems bx-menu-ver bx-def-font-middle bx-clearfix">
+    <bx_repeat:menu_items>
+        <li class="bx-menu-subitem bx-menu-subitem-__name__ bx-def-round-corners bx-def-color-bg-hl-hover __class_add__">
+            <div class="bx-menu-item-cnt bx-def-padding-thd-topbottom bx-def-padding-left bx-def-padding-sec-right">
+                <a href="__link__" onclick="__onclick__"__attrs__>
+                    <bx_include_auto:menu_icon.html />
+                    <span class="bx-menu-item-title bx-def-margin-sec-left-auto">__title__</span>
+                </a>
+                <bx_if:addon>
+                    <div class="bx-menu-addon bx-def-padding-sec-left">
+                        <div class="bx-menu-addon-cnt bx-def-label menu">__addon__</div>
+                    </div>
+                </bx_if:addon>
+            </div>
+        </li>
+    </bx_repeat:menu_items>
+</ul>

+ 49 - 37
template/scripts/BxBaseFunctions.php

@@ -160,15 +160,15 @@ class BxBaseFunctions extends BxDolFactory implements iBxDolSingleton
             'content' => $sContent
         ));
     }
-    
+
     function getIcon($sCode, $aAttrs = array())
     {
         $sIconFont = false;
         $sIconA = false;
         $sIconUrl = false;
-		$sIconHtml = false;
+        $sIconHtml = false;
         $sIconFontWithHtml = false;
-        
+
         $sClass = '';
         if(!empty($aAttrs['class'])) {
             $sClass = ' ' . $aAttrs['class'] .' ';
@@ -178,30 +178,30 @@ class BxBaseFunctions extends BxDolFactory implements iBxDolSingleton
         $sAttrs = '';
         foreach($aAttrs as $sKey => $sValue)
             $sAttrs .= ' ' . $sKey . '="' . bx_html_attribute($sValue) . '"';
-		
+
         if (!empty($sCode)) {
-            if ((int)$sCode > 0 ) {
+            if ((int)$sCode > 0) {
                 $oStorage = BxDolStorage::getObjectInstance(BX_DOL_STORAGE_OBJ_IMAGES);
                 $sIconUrl = $oStorage ? $oStorage->getFileUrlById((int)$sCode) : false;
-            } else {
-				//svg
-                if (strpos($sCode, '&lt;svg') !== false || strpos($sCode, '<svg') !== false){
-                    if (strpos($sCode, '&lt;svg') !== false)
+            } 
+            else {
+                //--- Process Inline SVG
+                if (strpos($sCode, '&lt;svg') !== false || strpos($sCode, '<svg') !== false) {
+                    if(strpos($sCode, '&lt;svg') !== false)
                         $sIconHtml = htmlspecialchars_decode($sCode);
                     else
                         $sIconHtml = $sCode;    
-					$sClass .= 'sys-icon sys-icon-svg ';
-					if ($sClass != '' && strpos($sIconHtml, 'class="') !== false)
-						$sIconHtml = str_replace('class="', 'class="' . $sClass, $sIconHtml);
-					else
-						$sIconHtml = str_replace('<svg', '<svg class="' . $sClass . '" ', $sIconHtml);
-                    
+
+                    $sClass .= 'sys-icon sys-icon-svg ';
+                    if ($sClass != '' && strpos($sIconHtml, 'class="') !== false)
+                        $sIconHtml = str_replace('class="', 'class="' . $sClass, $sIconHtml);
+                    else
+                        $sIconHtml = str_replace('<svg', '<svg class="' . $sClass . '" ', $sIconHtml);
+
                     if ($sAttrs != '')
-				        $sIconHtml = str_replace('<svg', '<svg ' . $sAttrs . ' ', $sIconHtml);
-				}
-				else{
-					//emoji
-                
+                        $sIconHtml = str_replace('<svg', '<svg ' . $sAttrs . ' ', $sIconHtml);
+                }
+                else {
                     $sEmojIsRegex =
                         '/[\x{0080}-\x{02AF}'
                         .'\x{0300}-\x{03FF}'
@@ -229,33 +229,45 @@ class BxBaseFunctions extends BxDolFactory implements iBxDolSingleton
                         .'\x{1F680}-\x{1F6FF}'
                         .'\x{1F910}-\x{1F96B}'
                         .'\x{1F980}-\x{1F9E0}]/u';
-                    if(preg_match($sEmojIsRegex, $sCode, $aTmp)){
-						$sIconHtml = $this->_oTemplate->parseHtmlByName('icon_emoji.html', array('icon' => $sCode, 'class' => $sClass, 'attrs' => $sAttrs));
-					}
-                    else{
-						if (false === strpos($sCode, '.')) { 
-							if (0 === strncmp($sCode, 'a:', 2)){
-								$sIconA = substr($sCode, 2); // animated icon
-                            }
-							else{
-								$sIconFont = $sCode; // font icons
+
+                    //--- Process Emoji
+                    if(preg_match($sEmojIsRegex, $sCode, $aTmp))
+                        $sIconHtml = $this->_oTemplate->parseHtmlByName('icon_emoji.html', array(
+                            'icon' => $sCode, 
+                            'class' => $sClass, 
+                            'attrs' => $sAttrs
+                        ));
+                    else {
+                        if (strpos($sCode, '.') === false) {
+                            //--- Process animated icon
+                            if (strncmp($sCode, 'a:', 2) === 0)
+                                $sIconA = substr($sCode, 2);
+                            //--- Process font icons
+                            else {
+                                $sIconFont = $sCode;
                                 $sIconFontWithHtml = $this->getFontIconAsHtml($sIconFont, $sClass, $sAttrs);
                             }
-						} else {
-							$sIconUrl = $this->_oTemplate->getIconUrl($sCode);
-						}
-					}
-				}
+                        } 
+                        else {
+                            //--- Process common image
+                            if((!preg_match('/^https?:\/\//', $sCode)))
+                                $sIconUrl = $this->_oTemplate->getIconUrl($sCode);
+                            else
+                                $sIconUrl = $sCode;
+                        }
+                    }
+                }
             }
         }
+
         return array ($sIconFont, $sIconUrl, $sIconA, $sIconHtml, $sIconFontWithHtml);
     }
-      
+
     function getFontIconAsHtml($sIconFont, $sClass = '', $sAttrs = '')
     {
         return  '<i class="sys-icon ' . $sIconFont .' ' . $sClass . '"' . $sAttrs . '></i>';
     }
-    
+
     function getIconAsHtml($sCode, $aAttrs = array())
     {
         $aIcons = $this->getIcon($sCode, $aAttrs);

+ 1 - 1
template/scripts/BxBaseMenu.php

@@ -255,7 +255,7 @@ class BxBaseMenu extends BxDolMenu
                     $aSubitems[] = $aSubitem;
             }
 
-            $aTmplVarsSubitems['subitems'] = $this->_oTemplate->parseHtmlByName(str_replace('.html', '_subitems.html', $this->_aObject['template']), array(
+            $aTmplVarsSubitems['subitems'] = $this->_oTemplate->parseHtmlByName(str_replace('.html', '_subitems.html', $this->getTemplateName()), array(
                 'bx_repeat:menu_items' => $aSubitems,
             ));
         }

+ 0 - 10
template/scripts/BxBaseMenuProfileFollowings.php

@@ -64,16 +64,6 @@ class BxBaseMenuProfileFollowings extends BxTemplMenu
         return $aMenuItems;
     }
 
-    protected function _getMenuIcon ($a)
-    {
-        list($sIcon, $sIconUrl, $sIconA, $sIconHtml) = parent::_getMenuIcon($a);
-
-        if(!$sIcon && !$sIconUrl && !$sIconA && !$sIconHtml && !empty($a['icon']) && strpos($a['icon'], '.') !== false)
-            $sIconUrl = $a['icon'];
-
-        return array($sIcon, $sIconUrl, $sIconA, $sIconHtml);
-    }
-
     protected function _getTmplVarsAddon($mixedAddon, $aMenuItem)
     {
         $aAddon = parent::_getTmplVarsAddon($mixedAddon, $aMenuItem);