瀏覽代碼

Ticket #3966 - Allow to overwrite layout icons/images

AntonLV 4 年之前
父節點
當前提交
fb8f050dbb

+ 106 - 1
inc/classes/BxDolTemplate.php

@@ -171,6 +171,10 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
     	'gray-dark' => array(87, 87, 87)
     );
 
+    protected static $_aImages;
+    protected static $_sImagesCacheKey;
+    protected static $_iImagesCacheTTL;
+
     /**
      * Main fields
      */
@@ -615,7 +619,7 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
         //--- Load page elements related static variables ---//
         $this->aPage = array(
             'name_index' => BX_PAGE_DEFAULT,
-        	'type' => BX_PAGE_TYPE_DEFAULT,
+            'type' => BX_PAGE_TYPE_DEFAULT,
             'url' => '',
             'header' => '',
             'header_text' => '',
@@ -657,6 +661,9 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
 
         $this->aPage['injections'] = $aInjections;
 
+        //--- Load images/icons cache ---//
+        $this->initImages();
+
         bx_import('BxTemplConfig'); // TODO: for some reason autoloader isn't working here....
         $this->_oTemplateConfig = BxTemplConfig::getInstance();
 
@@ -665,6 +672,30 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
 
         $this->addJsOption('sys_fixed_header');
     }
+    
+    protected function initImages()
+    {
+        if(self::$_iImagesCacheTTL)
+            return;
+
+        self::$_iImagesCacheTTL = 86400;
+        self::$_sImagesCacheKey = $this->_sCacheFilePrefix . $this->_sCode .  '_' . bx_site_hash('images') . '.php';
+        self::$_aImages = BxDolDb::getInstance()->getDbCacheObject()->getData(self::$_sImagesCacheKey);
+        if(!self::$_aImages)
+            self::$_aImages = [];
+
+        bx_alert('system', 'get_layout_images', 0, false, array(
+            'override_result' => &self::$_aImages
+        ));
+    }
+
+    protected function saveImages()
+    {
+        if(!self::$_iImagesCacheTTL)
+            $this->initImages();
+
+        BxDolDb::getInstance()->getDbCacheObject()->setData(self::$_sImagesCacheKey, self::$_aImages, self::$_iImagesCacheTTL);
+    }
 
     protected function getInjectionsData ()
     {
@@ -1358,6 +1389,76 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
     {
         return $this->_getAbsoluteLocation('path', $this->_sFolderIcons, $sName, $sCheckIn);
     }
+
+    /**
+     * Get image/icon by name automatically. Cache item description:
+     * [
+     *      'v' => value (name, url or source),
+     *      'c' => classes list divided with comma (,)
+     *      't' => parse type (ic - icon, im - image, sc - source)
+     * ]
+     * Cached images can be overwritten by listening 'system' - 'get_layout_images' alert.
+     * 
+     * @param string $sName unique name. The following format can be used: name|classes. 
+     * Where name and classes can consists of multiple parts (divided with comma (,) in HTML variant). For example, 
+     *     in PHP: $this->getImageAuto('far star|class1 class2');
+     *     in HTML: <bx_image_auto:far,star|class1,class2 />
+     * @param boolean $bWrapped wrap in HTML tag or not.
+     * @param string $sCheckIn where the content would be searched(base, template, both)
+     * @return string icon/image value (name, url or source) or final HTML code.
+     */
+    function getImageAuto($sName, $bWrapped = true, $sCheckIn = BX_DOL_TEMPLATE_CHECK_IN_BOTH)
+    {
+        $sDivParts = '|';
+        $sDivItems = ',';
+
+        $sKey = md5($sName);
+
+        $sClasses = '';
+        if(strpos($sName, $sDivParts) !== false)
+            list($sName, $sClasses) = explode($sDivParts, $sName);
+
+        if(strpos($sName, $sDivItems) !== false)
+            $sName = implode(' ', explode($sDivItems, $sName));
+
+        if(!isset(self::$_aImages[$sKey])) {
+            $aResult = [
+                'v' => $sName,
+                'c' => $sClasses,
+                't' => 'ic'
+            ];
+
+            $sUrl = '';
+            foreach(['Image', 'Icon'] as $sType) 
+                foreach(['png', 'jpg', 'gif'] as $sExt)
+                    if(($sUrl = $this->{'get' . $sType . 'Url'}($sName . '.' . $sExt, $sCheckIn)) != '') {
+                        $aResult = [
+                            'v' => $sUrl,
+                            'c' => $sClasses,
+                            't' => 'im'
+                        ];
+                        break 2;
+                    }
+
+            self::$_aImages[$sKey] = $aResult;
+
+            $this->saveImages();
+        }
+
+        if(!self::$_aImages[$sKey]['v'])
+            return '';
+
+        if(!$bWrapped || self::$_aImages[$sKey]['t'] == 'sc')
+            return self::$_aImages[$sKey]['v'];       
+
+        $aAttrs = [];
+        if(self::$_aImages[$sKey]['c'] != '')
+            $aAttrs['class'] = implode(' ', explode($sDivItems, self::$_aImages[$sKey]['c']));
+
+        $aType2Method = ['ic' => 'parseIcon', 'im' => 'parseImage'];
+        return $this->{$aType2Method[self::$_aImages[$sKey]['t']]}(self::$_aImages[$sKey]['v'], $aAttrs);
+    }
+
     /**
      * Get full URL for the image.
      *
@@ -2927,6 +3028,7 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
     	$oTemplate = &$this;
 
     	$aCallbackPatterns = array_merge($aCallbackPatterns, array(
+            "'<bx_image_auto:([^\s]+) \/>'s" => "get_image_auto",
             "'<bx_image_url:([^\s]+) \/>'s" => "get_image_url",
             "'<bx_icon_url:([^\s]+) \/>'s" => "get_icon_url",
             "'<bx_text:([_\{\}\w\d\s]+[^\s]{1}) \/>'s" => "get_text",
@@ -2940,6 +3042,9 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
             $sResult = '';
 
             switch($sAction) {
+                case 'get_image_auto':
+                    $sResult = $oTemplate->getImageAuto($aMatches[1]);
+                    break;
                 case 'get_image_url':
                     $sResult = $oTemplate->getImageUrl($aMatches[1]);
                     break;

+ 1 - 1
inc/classes/BxDolView.php

@@ -196,7 +196,7 @@ class BxDolView extends BxDolObject
         return $iObjectAuthorId != 0 && $iObjectAuthorId == $this->_getAuthorId() && $this->checkAction('view_view_viewers_own', $isPerformAction);
     }
 
-	/**
+    /**
      * Internal functions
      */
     protected function _getIconDo()

+ 1 - 1
inc/classes/BxDolVoteLikes.php

@@ -38,7 +38,7 @@ class BxDolVoteLikes extends BxTemplVote
 
     protected function _getIconDo($bVoted)
     {
-    	return $bVoted && $this->isUndo() ?  'thumbs-up' : 'thumbs-up';
+    	return $bVoted && $this->isUndo() ? 'thumbs-up' : 'thumbs-up';
     }
 
     protected function _getTitleDo($bVoted)

+ 1 - 1
modules/boonex/artificer/data/template/bx_forum/score_do_vote_label.html

@@ -1 +1 @@
-<span class="sys-action-do __style_prefix__-do bx-def-valign-center group text-gray-700 dark:text-gray-300 hover:text-gray-800 dark:hover:text-white"><bx_if:show_image><span class="sys-action-do-image __style_prefix__-do-image bx-def-align-center"><img src="__src__" /></span></bx_if:show_image><bx_if:show_icon><span class="sys-action-do-icon __style_prefix__-do-icon bx-def-align-center"><i class="sys-icon __name__"></i></span></bx_if:show_icon><bx_if:show_text><span class="sys-action-do-text __style_prefix__-do-text bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text></span>
+<span class="sys-action-do __style_prefix__-do bx-def-valign-center group text-gray-700 dark:text-gray-300 hover:text-gray-800 dark:hover:text-white"><bx_if:show_icon><span class="sys-action-do-icon __style_prefix__-do-icon bx-def-align-center">__icon__</span></bx_if:show_icon><bx_if:show_text><span class="sys-action-do-text __style_prefix__-do-text bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text></span>

+ 1 - 1
modules/boonex/artificer/data/template/system/view_counter_label.html

@@ -1,6 +1,6 @@
 <span class="__style_prefix__-counter-label flex items-center text-sm font-normal p-1">
     <bx_if:show_icon>
-        <span class="sys-action-counter-icon __style_prefix__-counter-icon relative flex items-center justify-center ring-1 h-6 w-6 ring-white dark:ring-gray-700 h-6 w-6 bg-gray-200 dark:bg-gray-700 rounded-full">__name__</span>
+        <span class="sys-action-counter-icon __style_prefix__-counter-icon relative flex items-center justify-center ring-1 h-6 w-6 ring-white dark:ring-gray-700 h-6 w-6 bg-gray-200 dark:bg-gray-700 rounded-full">__icon__</span>
     </bx_if:show_icon>
     <bx_if:show_text>
         <span class="sys-action-counter-text __style_prefix__-counter-text ml-1.5">__text__</span>

+ 1 - 3
modules/boonex/artificer/data/template/system/vote_counter_label_likes.html

@@ -1,8 +1,6 @@
 <span class="sys-action-counter-label __style_prefix__-counter-label flex items-center text-sm font-normal p-1">
     <bx_if:show_icon>
-        <span class="sys-action-counter-icon __style_prefix__-counter-icon relative flex items-center justify-center ring-1 h-6 w-6 ring-white dark:ring-gray-700 h-6 w-6 bg-gray-200 dark:bg-gray-700 rounded-full">
-            __name__
-        </span>
+        <span class="sys-action-counter-icon __style_prefix__-counter-icon relative flex items-center justify-center ring-1 h-6 w-6 ring-white dark:ring-gray-700 h-6 w-6 bg-gray-200 dark:bg-gray-700 rounded-full">__icon__</span>
     </bx_if:show_icon>
     <bx_if:show_text>
         <span class="sys-action-counter-text __style_prefix__-counter-text ml-1.5">__text__</span>

+ 3 - 3
modules/boonex/artificer/data/template/system/vote_do_vote_stars.html

@@ -1,6 +1,6 @@
 <div class="__style_prefix__-element relative inline-block">
     <div class="__style_prefix__-underlay">
-        <bx_repeat:stars><i class="__style_prefix__-star sys-icon far star text-yellow-500"></i></bx_repeat:stars>
+        <bx_repeat:stars><bx_image_auto:far,star|__style_prefix__-star,text-yellow-500 /></bx_repeat:stars>
     </div>
     <bx_if:show_legend>
         <div class="__style_prefix__-legend text-xs">
@@ -8,9 +8,9 @@
         </div>
     </bx_if:show_legend>
     <div class="__style_prefix__-slider absolute z-1 top-0 left-0 whitespace-nowrap overflow-hidden">
-        <bx_repeat:slider><i class="__style_prefix__-star sys-icon star text-yellow-500"></i></bx_repeat:slider>
+        <bx_repeat:slider><bx_image_auto:star|__style_prefix__-star,text-yellow-500 /></bx_repeat:slider>
     </div>
     <div class="__style_prefix__-buttons absolute z-2 top-0 left-0">
-        <bx_repeat:buttons><a class="__style_prefix__-button hover:no-underline" href="javascript:void(0);" onmouseover="__js_object__.over(this);" onmouseout="__js_object__.out(this);" onclick="__js_object__.vote(this, __value__)"><i class="__style_prefix__-star sys-icon star text-transparent hover:text-yellow-600"></i></a></bx_repeat:buttons>
+        <bx_repeat:buttons><a class="__style_prefix__-button hover:no-underline" href="javascript:void(0);" onmouseover="__js_object__.over(this);" onmouseout="__js_object__.out(this);" onclick="__js_object__.vote(this, __value__)"><bx_image_auto:star|__style_prefix__-star,text-transparent,hover:text-yellow-600 /></a></bx_repeat:buttons>
     </div>
 </div>

+ 1 - 1
template/_sub_header.html

@@ -32,7 +32,7 @@
                         <div class="bx-ti-search-button relative flex items-center mx-2 text-gray-500 dark:text-gray-300 hover:text-gray-800 dark:hover:text-gray-100 border border-transparent rounded-full bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 block">
                             <a href="javascript:void(0)" onclick="javascript:bx_site_search_show(this)">
                                 <span class="relative flex items-center justify-center h-8 w-8 md:h-10 md:w-10">
-                                    <i class="sys-icon search"></i>
+                                    <bx_image_auto:search />
                                 </span>
                             </a>
                         </div>

+ 1 - 1
template/comment_counter.html

@@ -2,7 +2,7 @@
     <a class="bx-def-valign-center" href="__href__"<bx_if:show_onclick> onclick="__onclick__"</bx_if:show_onclick>>
         <bx_repeat:profiles>__icon__</bx_repeat:profiles>
         <bx_if:show_icon>
-            <div class="sys-action-counter-icon __style_prefix__-counter-icon bx-def-icon-size bx-def-align-center"><i class="__style_prefix__-counter-icon sys-icon comment"></i></div>
+            <div class="sys-action-counter-icon __style_prefix__-counter-icon bx-def-icon-size bx-def-align-center">__icon__</div>
         </bx_if:show_icon>
         <div class="sys-action-counter-text __style_prefix__-counter-text bx-def-margin-sec-left-auto">__content__</div>
     </a>

+ 1 - 1
template/comment_do_comment_label.html

@@ -1 +1 @@
-<span class="sys-action-do __style_prefix__-do bx-def-valign-center"><bx_if:show_image><span class="sys-action-do-image __style_prefix__-do-image bx-def-align-center"><img src="__src__" /></span></bx_if:show_image><bx_if:show_icon><span class="sys-action-do-icon __style_prefix__-do-icon bx-def-align-center"><i class="sys-icon __name__"></i></span></bx_if:show_icon><bx_if:show_text><span class="sys-action-do-text __style_prefix__-do-text bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text></span>
+<span class="sys-action-do __style_prefix__-do bx-def-valign-center"><bx_if:show_icon><span class="sys-action-do-icon __style_prefix__-do-icon bx-def-align-center">__icon__</span></bx_if:show_icon><bx_if:show_text><span class="sys-action-do-text __style_prefix__-do-text bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text></span>

+ 1 - 1
template/favorite_do_favorite_label.html

@@ -1 +1 @@
-<span class="sys-action-do __style_prefix__-do bx-def-valign-center"><bx_if:show_icon><span class="sys-action-do-icon __style_prefix__-do-icon bx-def-align-center"><i class="sys-icon __name__"></i></span></bx_if:show_icon><bx_if:show_text><span class="sys-action-do-text __style_prefix__-do-text bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text></span>
+<span class="sys-action-do __style_prefix__-do bx-def-valign-center"><bx_if:show_icon><span class="sys-action-do-icon __style_prefix__-do-icon bx-def-align-center">__icon__</span></bx_if:show_icon><bx_if:show_text><span class="sys-action-do-text __style_prefix__-do-text bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text></span>

+ 1 - 1
template/feature_do_feature_label.html

@@ -1 +1 @@
-<span class="sys-action-do __style_prefix__-do bx-def-valign-center"><bx_if:show_icon><span class="sys-action-do-icon __style_prefix__-do-icon bx-def-align-center"><i class="sys-icon __name__"></i></span></bx_if:show_icon><bx_if:show_text><span class="sys-action-do-text __style_prefix__-do-text bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text></span>
+<span class="sys-action-do __style_prefix__-do bx-def-valign-center"><bx_if:show_icon><span class="sys-action-do-icon __style_prefix__-do-icon bx-def-align-center">__icon__</span></bx_if:show_icon><bx_if:show_text><span class="sys-action-do-text __style_prefix__-do-text bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text></span>

+ 1 - 1
template/score_counter_label.html

@@ -1 +1 @@
-<span class="sys-action-counter-label __style_prefix__-counter-label bx-def-align-center"><bx_if:show_icon><span class="sys-action-counter-icon __style_prefix__-counter-icon bx-def-align-center"><i class="sys-icon __name__"></i></span></bx_if:show_icon><bx_if:show_text><span class="sys-action-counter-text __style_prefix__-counter-text bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text></span>
+<span class="sys-action-counter-label __style_prefix__-counter-label bx-def-align-center"><bx_if:show_icon><span class="sys-action-counter-icon __style_prefix__-counter-icon bx-def-align-center">__icon__</span></bx_if:show_icon><bx_if:show_text><span class="sys-action-counter-text __style_prefix__-counter-text bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text></span>

+ 1 - 1
template/score_do_vote_label.html

@@ -1 +1 @@
-<span class="sys-action-do __style_prefix__-do bx-def-valign-center"><bx_if:show_image><span class="sys-action-do-image __style_prefix__-do-image bx-def-align-center"><img src="__src__" /></span></bx_if:show_image><bx_if:show_icon><span class="sys-action-do-icon __style_prefix__-do-icon bx-def-align-center"><i class="sys-icon __name__"></i></span></bx_if:show_icon><bx_if:show_text><span class="sys-action-do-text __style_prefix__-do-text bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text></span>
+<span class="sys-action-do __style_prefix__-do bx-def-valign-center"><bx_if:show_icon><span class="sys-action-do-icon __style_prefix__-do-icon bx-def-align-center">__icon__</span></bx_if:show_icon><bx_if:show_text><span class="sys-action-do-text __style_prefix__-do-text bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text></span>

+ 2 - 10
template/scripts/BxBaseCmts.php

@@ -53,7 +53,6 @@ class BxBaseCmts extends BxDolCmts
         $this->_aElementDefaults = array(
             'show_do_comment_as_button' => false,
             'show_do_comment_as_button_small' => false,
-            'show_do_comment_image' => false,
             'show_do_comment_icon' => true,
             'show_do_comment_label' => false,
             'show_counter' => true,
@@ -790,7 +789,7 @@ class BxBaseCmts extends BxDolCmts
                 'condition' => ($bShowEmpty || !empty($aTmplVarsProfiles)) && (!isset($aParams['show_icon']) || $aParams['show_icon']),
                 'content' => array(
                     'style_prefix' => $this->_sStylePrefix,
-                    'icon' => !empty($aParams['custom_icon']) ? $aParams['custom_icon'] : BxTemplFunctions::getInstanceWithTemplate($this->_oTemplate)->getFontIconAsHtml('comment', $this->_sStylePrefix . '-counter-icon sys-icon')
+                    'icon' => !empty($aParams['custom_icon']) ? $aParams['custom_icon'] : $this->_oTemplate->getImageAuto('comment|' . $this->_sStylePrefix . '-counter-icon')
                 )
             )
         ));
@@ -800,18 +799,11 @@ class BxBaseCmts extends BxDolCmts
     {
         return $this->_oTemplate->parseHtmlByContent($this->_getTmplLabelDo(), array(
             'style_prefix' => $this->_sStylePrefix,
-            'bx_if:show_image' => array(
-                'condition' => isset($aParams['show_do_comment_image']) && $aParams['show_do_comment_image'] == true,
-                'content' => array(
-                    'style_prefix' => $this->_sStylePrefix,
-                    'src' => $this->_getImageDo()
-                )
-            ),
             'bx_if:show_icon' => array(
                 'condition' => isset($aParams['show_do_comment_icon']) && $aParams['show_do_comment_icon'] == true,
                 'content' => array(
                     'style_prefix' => $this->_sStylePrefix,
-                    'name' => $this->_getIconDo()
+                    'icon' => $this->_oTemplate->getImageAuto($this->_getIconDo())
                 )
             ),
             'bx_if:show_text' => array(

+ 1 - 1
template/scripts/BxBaseFavorite.php

@@ -205,7 +205,7 @@ class BxBaseFavorite extends BxDolFavorite
                 'condition' => isset($aParams['show_do_favorite_icon']) && $aParams['show_do_favorite_icon'] == true,
                 'content' => array(
                     'style_prefix' => $this->_sStylePrefix,
-                    'name' => $this->_getIconDoFavorite($bFavorited)
+                    'icon' => $this->_oTemplate->getImageAuto($this->_getIconDoFavorite($bFavorited))
                 )
             ),
             'bx_if:show_text' => array(

+ 1 - 1
template/scripts/BxBaseFeature.php

@@ -153,7 +153,7 @@ class BxBaseFeature extends BxDolFeature
                 'condition' => isset($aParams['show_do_feature_icon']) && $aParams['show_do_feature_icon'] == true,
                 'content' => array(
                     'style_prefix' => $this->_sStylePrefix,
-                    'name' => $this->_getIconDoFeature($bFeatured)
+                    'icon' => $this->_oTemplate->getImageAuto($this->_getIconDoFeature($bFeatured))
                 )
             ),
             'bx_if:show_text' => array(

+ 2 - 10
template/scripts/BxBaseScore.php

@@ -42,7 +42,6 @@ class BxBaseScore extends BxDolScore
         $this->_aElementDefaults = array(
             'show_do_vote_as_button' => false,
             'show_do_vote_as_button_small' => false,
-            'show_do_vote_image' => false,
             'show_do_vote_icon' => true,
             'show_do_vote_label' => false,
             'show_counter' => true,
@@ -310,7 +309,7 @@ class BxBaseScore extends BxDolScore
                 'condition' => !isset($aParams['show_counter_label_icon']) || (bool)$aParams['show_counter_label_icon'] === true,
                 'content' => array(
                     'style_prefix' => $this->_sStylePrefix,
-                    'name' => $this->_getIconDo()
+                    'icon' => $this->_oTemplate->getImageAuto($this->_getIconDo())
                 )
             ),
             'bx_if:show_text' => array(
@@ -327,18 +326,11 @@ class BxBaseScore extends BxDolScore
     {
         return $this->_oTemplate->parseHtmlByContent($this->_getTmplContentDoActionLabel(), array(
             'style_prefix' => $this->_sStylePrefix,
-            'bx_if:show_image' => array(
-                'condition' => isset($aParams['show_do_vote_image']) && (bool)$aParams['show_do_vote_image'] === true,
-                'content' => array(
-                    'style_prefix' => $this->_sStylePrefix,
-                    'src' => $this->_getImageDo($sType)
-                )
-            ),
             'bx_if:show_icon' => array(
                 'condition' => isset($aParams['show_do_vote_icon']) && (bool)$aParams['show_do_vote_icon'] === true,
                 'content' => array(
                     'style_prefix' => $this->_sStylePrefix,
-                    'name' => $this->_getIconDo($sType)
+                    'icon' => $this->_oTemplate->getImageAuto($this->_getIconDo($sType))
                 )
             ),
             'bx_if:show_text' => array(

+ 2 - 2
template/scripts/BxBaseView.php

@@ -247,7 +247,7 @@ class BxBaseView extends BxDolView
                 'condition' => !isset($aParams['show_counter_label_icon']) || $aParams['show_counter_label_icon'] === true,
                 'content' => array(
                     'style_prefix' => $this->_sStylePrefix,
-                    'name' => isset($aParams['custom_icon']) && $aParams['custom_icon'] != '' ? $aParams['custom_icon'] : BxTemplFunctions::getInstanceWithTemplate($this->_oTemplate)->getFontIconAsHtml($this->_getIconDo())
+                    'icon' => isset($aParams['custom_icon']) && $aParams['custom_icon'] != '' ? $aParams['custom_icon'] : $this->_oTemplate->getImageAuto($this->_getIconDo())
                 )
             ),
             'bx_if:show_text' => array(
@@ -268,7 +268,7 @@ class BxBaseView extends BxDolView
                 'condition' => isset($aParams['show_do_view_icon']) && $aParams['show_do_view_icon'] == true,
                 'content' => array(
                     'style_prefix' => $this->_sStylePrefix,
-                    'name' => $this->_getIconDo()
+                    'icon' => $this->_oTemplate->getImageAuto($this->_getIconDo())
                 )
             ),
             'bx_if:show_text' => array(

+ 2 - 2
template/scripts/BxBaseVoteLikes.php

@@ -114,7 +114,7 @@ class BxBaseVoteLikes extends BxDolVoteLikes
                 'condition' => isset($aParams['show_do_vote_icon']) && (bool)$aParams['show_do_vote_icon'] === true,
                 'content' => array(
                     'style_prefix' => $this->_sStylePrefix,
-                    'name' => $this->_getIconDo($bVoted)
+                    'icon' => $this->_oTemplate->getImageAuto($this->_getIconDo($bVoted))
                 )
             ),
             'bx_if:show_text' => array(
@@ -136,7 +136,7 @@ class BxBaseVoteLikes extends BxDolVoteLikes
                 'condition' => !isset($aParams['show_counter_label_icon']) || (bool)$aParams['show_counter_label_icon'] === true,
                 'content' => array(
                     'style_prefix' => $this->_sStylePrefix,
-                    'name' => isset($aParams['custom_icon']) && $aParams['custom_icon'] != '' ? $aParams['custom_icon'] : BxTemplFunctions::getInstanceWithTemplate($this->_oTemplate)->getFontIconAsHtml($this->_getIconDo($bVoted))
+                    'icon' => isset($aParams['custom_icon']) && $aParams['custom_icon'] != '' ? $aParams['custom_icon'] : $this->_oTemplate->getImageAuto($this->_getIconDo($bVoted))
                 )
             ),
             'bx_if:show_text' => array(

+ 1 - 3
template/view_counter_label.html

@@ -1,8 +1,6 @@
 <span class="__style_prefix__-counter-label bx-def-valign-center">
     <bx_if:show_icon>
-        <span class="sys-action-counter-icon __style_prefix__-counter-icon bx-def-align-center">
-            __name__
-        </span>
+        <span class="sys-action-counter-icon __style_prefix__-counter-icon bx-def-align-center">__icon__</span>
     </bx_if:show_icon>
     <bx_if:show_text>
         <span class="sys-action-counter-text __style_prefix__-counter-text bx-def-margin-sec-left-auto">__text__</span>

+ 1 - 1
template/view_do_view_label.html

@@ -1 +1 @@
-<span class="sys-action-do __style_prefix__-do bx-def-valign-center"><bx_if:show_icon><span class="sys-action-do-icon __style_prefix__-do-icon bx-def-align-center"><i class="sys-icon __name__"></i></span></bx_if:show_icon><bx_if:show_text><span class="sys-action-do-text __style_prefix__-do-text bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text></span>
+<span class="sys-action-do __style_prefix__-do bx-def-valign-center"><bx_if:show_icon><span class="sys-action-do-icon __style_prefix__-do-icon bx-def-align-center">__icon__</span></bx_if:show_icon><bx_if:show_text><span class="sys-action-do-text __style_prefix__-do-text bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text></span>

+ 1 - 3
template/vote_counter_label_likes.html

@@ -1,8 +1,6 @@
 <span class="sys-action-counter-label __style_prefix__-counter-label bx-def-valign-center">
     <bx_if:show_icon>
-        <span class="sys-action-counter-icon __style_prefix__-counter-icon bx-def-align-center">
-            __name__
-        </span>
+        <span class="sys-action-counter-icon __style_prefix__-counter-icon bx-def-align-center">__icon__</span>
     </bx_if:show_icon>
     <bx_if:show_text>
         <span class="sys-action-counter-text __style_prefix__-counter-text bx-def-margin-sec-left-auto">__text__</span>

+ 1 - 1
template/vote_do_vote_label_likes.html

@@ -1 +1 @@
-<span class="sys-action-do __style_prefix__-do bx-def-valign-center"><bx_if:show_icon><span class="sys-action-do-icon __style_prefix__-do-icon bx-def-align-center"><i class="sys-icon __name__"></i></span></bx_if:show_icon><bx_if:show_text><span class="sys-action-do-text __style_prefix__-do-text bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text></span>
+<span class="sys-action-do __style_prefix__-do bx-def-valign-center"><bx_if:show_icon><span class="sys-action-do-icon __style_prefix__-do-icon bx-def-align-center">__icon__</span></bx_if:show_icon><bx_if:show_text><span class="sys-action-do-text __style_prefix__-do-text bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text></span>

+ 3 - 3
template/vote_do_vote_stars.html

@@ -1,6 +1,6 @@
 <div class="__style_prefix__-element">
     <div class="__style_prefix__-underlay">
-        <bx_repeat:stars><i class="__style_prefix__-star sys-icon far star"></i></bx_repeat:stars>
+        <bx_repeat:stars><bx_image_auto:far,star|__style_prefix__-star /></bx_repeat:stars>
     </div>
     <bx_if:show_legend>
         <div class="__style_prefix__-legend bx-def-font-small">
@@ -8,9 +8,9 @@
         </div>
     </bx_if:show_legend>
     <div class="__style_prefix__-slider">
-        <bx_repeat:slider><i class="__style_prefix__-star sys-icon star"></i></bx_repeat:slider>
+        <bx_repeat:slider><bx_image_auto:star|__style_prefix__-star /></bx_repeat:slider>
     </div>
     <div class="__style_prefix__-buttons">
-        <bx_repeat:buttons><a class="__style_prefix__-button" href="javascript:void(0);" onmouseover="__js_object__.over(this);" onmouseout="__js_object__.out(this);" onclick="__js_object__.vote(this, __value__)"><i class="__style_prefix__-star sys-icon star"></i></a></bx_repeat:buttons>
+        <bx_repeat:buttons><a class="__style_prefix__-button" href="javascript:void(0);" onmouseover="__js_object__.over(this);" onmouseout="__js_object__.out(this);" onclick="__js_object__.vote(this, __value__)"><bx_image_auto:star|__style_prefix__-star /></a></bx_repeat:buttons>
     </div>
 </div>