RomanL 6 лет назад
Родитель
Сommit
32f6171b0b
28 измененных файлов с 169 добавлено и 77 удалено
  1. 9 0
      inc/classes/BxDolProfile.php
  2. 4 1
      inc/js/functions.js
  3. 40 27
      modules/base/general/classes/BxBaseModGeneralModule.php
  4. 1 1
      modules/base/general/classes/BxBaseModGeneralTemplate.php
  5. 15 8
      modules/base/general/template/css/main.css
  6. 2 6
      modules/base/profile/classes/BxBaseModProfileTemplate.php
  7. 6 1
      modules/base/profile/template/cover.html
  8. 10 1
      modules/base/profile/template/css/main.css
  9. 3 3
      modules/base/profile/template/unit_with_cover.html
  10. 0 3
      modules/base/profile/template/unit_wo_info.html
  11. 3 1
      modules/base/text/classes/BxBaseModTextTemplate.php
  12. 14 0
      modules/base/text/template/css/main.css
  13. 6 1
      modules/base/text/template/entry-text.html
  14. 5 1
      modules/base/text/template/unit.html
  15. 4 1
      modules/base/text/template/unit_gallery.html
  16. 5 2
      modules/boonex/lucid/data/template/bx_persons/unit_with_cover.html
  17. 4 1
      modules/boonex/lucid/data/template/bx_posts/unit.html
  18. 2 0
      modules/boonex/persons/classes/BxPersonsConfig.php
  19. 2 0
      modules/boonex/posts/classes/BxPostsConfig.php
  20. 1 0
      modules/boonex/posts/install/sql/enable.sql
  21. 0 1
      modules/boonex/posts/template/unit.html
  22. 7 0
      modules/boonex/timeline/classes/BxTimelineModule.php
  23. 2 2
      modules/boonex/timeline/classes/BxTimelineTemplate.php
  24. 5 0
      modules/boonex/timeline/template/css/view.css
  25. 6 7
      studio/template/css/badges.css
  26. 7 1
      studio/template/scripts/BxBaseStudioBadgesGrid.php
  27. 4 6
      template/scripts/BxBaseMenuSetBadges.php
  28. 2 2
      template/scripts/BxBaseServices.php

+ 9 - 0
inc/classes/BxDolProfile.php

@@ -261,6 +261,15 @@ class BxDolProfile extends BxDolFactory implements iBxDolProfile
         $aInfo = $this->getInfo($iProfileId);
         return BxDolService::call($aInfo['type'], 'profile_unit', array($aInfo['content_id'], $aParams));
     }
+    
+    /**
+     * Get badges
+     */
+    public function getBadges($iProfileId = 0)
+    {
+        $aInfo = $this->getInfo($iProfileId);
+        return BxDolService::call($aInfo['type'], 'get_badges', array($aInfo['content_id'], true, true));
+    }
 
 	/**
      * Check whether a profile has real image uploaded by user.

+ 4 - 1
inc/js/functions.js

@@ -678,7 +678,7 @@ function bx_set_acl_level (iProfileId, iAclLevel, mixedLoadingElement) {
  * @param iBadgeId - badge id to assign to a given content
  */
 function bx_set_badge (sModule, iContentId, iBadgeId, mixedLoadingElement) {
-    
+   
     var bLoading = typeof(mixedLoadingElement) != 'undefined';
     if(bLoading)
         bx_loading($(mixedLoadingElement), true);
@@ -699,6 +699,9 @@ function bx_set_badge (sModule, iContentId, iBadgeId, mixedLoadingElement) {
                 var oCard = $(oData.card[iField]);
                 $('#' + oCard.attr('id')).replaceWith(oCard);
             }
+		
+		$('.bx-base-bages-container').html(oData.html);
+		
     }, 'json');
 }
 

+ 40 - 27
modules/base/general/classes/BxBaseModGeneralModule.php

@@ -1757,7 +1757,33 @@ class BxBaseModGeneralModule extends BxDolModule
 
         return $iProfileId;
     }
+	
+	public function serviceGetBadges($iContentId,  $bIsSingle = false, $bIsCompact  = false)
+    {
+        $oBadges = BxDolBadges::getInstance();
+        $aBadges = $oBadges->getData(
+            array(
+            'type' => ($bIsSingle ? 'by_module&object2_single' : 'by_module&object2'),
+            'module' => $this->_aModule['name'],
+            'object_id' => $iContentId
+            )
+        );
+        
+        if ($bIsSingle && count($aBadges) > 0)
+            return BxDolService::call('system', 'get_badge', array($aBadges[0], $bIsCompact), 'TemplServices');
+        
+        $aBadgesOutput = array();
+        foreach($aBadges as $aBadge) {
+            $aBadgesOutput[] =  array('badge' => BxDolService::call('system', 'get_badge', array($aBadge, $bIsCompact), 'TemplServices'));
+        }
 
+        return $this->_oTemplate->parseHtmlByName('badges.html', 
+			array(
+				'bx_repeat:items' => $aBadgesOutput,
+			)
+		);
+        
+    }
 
     // ====== PERMISSION METHODS
     public function serviceCheckAllowedViewForProfile ($aDataEntry, $isPerformAction = false, $iProfileId = false)
@@ -2093,6 +2119,20 @@ class BxBaseModGeneralModule extends BxDolModule
             $oProfile->getUnit(0, array('template' => 'unit_wo_info'))
         );
     }
+    
+    public function getUserInfoWithBadges($iUserId = 0)
+    {
+        $oProfile = BxDolProfile::getInstanceMagic($iUserId);
+
+        return array(
+            $oProfile->getDisplayName(),
+            $oProfile->getUrl(),
+            $oProfile->getThumb(),
+            $oProfile->getUnit(),
+            $oProfile->getUnit(0, array('template' => 'unit_wo_info')),
+            $oProfile->getBadges()
+        );
+    }
 
     public function isMenuItemVisible($sObject, &$aItem, &$aContentInfo)
     {
@@ -2148,33 +2188,6 @@ class BxBaseModGeneralModule extends BxDolModule
         return $AuditParams;
     }
     
-    public function _getBadges($iContentId,  $bIsSingle = false, $bIsSmall  = false)
-    {
-        $oBadges = BxDolBadges::getInstance();
-        $aBadges = $oBadges->getData(
-            array(
-            'type' => ($bIsSingle ? 'by_module&object2_single' : 'by_module&object2'),
-            'module' => $this->_aModule['name'],
-            'object_id' => $iContentId
-            )
-        );
-        
-        if ($bIsSingle && count($aBadges) > 0)
-            return BxDolService::call('system', 'get_badge', array($aBadges[0], $bIsSmall), 'TemplServices');
-        
-        $aBadgesOutput = array();
-        foreach($aBadges as $aBadge) {
-            $aBadgesOutput[] =  array('badge' => BxDolService::call('system', 'get_badge', array($aBadge, $bIsSmall), 'TemplServices'));
-        }
-
-        return $this->_oTemplate->parseHtmlByName('badges.html', 
-			array(
-				'bx_repeat:items' => $aBadgesOutput,
-			)
-		);
-        
-    }
-
     // ====== PROTECTED METHODS
 
     protected function _serviceEntityForm ($sFormMethod, $iContentId = 0, $sDisplay = false, $sCheckFunction = false, $bErrorMsg = true)

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

@@ -140,7 +140,7 @@ class BxBaseModGeneralTemplate extends BxDolModuleTemplate
         $aVars = $aData;
         $aVars['entry_title'] = $this->getTitle($aData);
         $aVars['entry_text'] = $this->getText($aData);
-
+		$aVars['badges'] = $this->getModule()->serviceGetBadges($aData[$CNF['FIELD_ID']]);
         if (!empty($CNF['OBJECT_METATAGS'])) {
             $oMetatags = BxDolMetatags::getObjectInstance($CNF['OBJECT_METATAGS']);
 

+ 15 - 8
modules/base/general/template/css/main.css

@@ -283,8 +283,8 @@ div.bx-badge {
 	vertical-align: middle;
 	height: 1.25rem;
 	line-height: 1.25rem;
-	padding: 0.25rem 0.5rem ;
-	border-radius: 1em;
+	padding: 0 0.5rem ;
+	border-radius: 2em;
 	white-space: nowrap; 
 	text-overflow: ellipsis; 
     overflow: hidden;
@@ -294,12 +294,12 @@ div.bx-badges-list div.bx-badge{
 }
 
 img.bx-badge-icon {
-    width: 20px;
-    height: 20px;
+    width: 14px;
+    height: 14px;
 }
 div.bx-badge img{
 
-	margin-right: 0.25rem;
+	margin-right: 0.5rem;
 }
 div.bx-badge span{
 	text-overflow: ellipsis; 
@@ -307,8 +307,7 @@ div.bx-badge span{
 }
 div.bx-badge .sys-icon{
 	color:#fff;
-	font-size: 1.25rem;
-	margin-right: 0.25rem;
+	margin-right: 0.5rem;
 }
 div.bx-badge.bx-badge-compact{
 	width: 1.25rem;
@@ -319,5 +318,13 @@ div.bx-badge.bx-badge-compact .sys-icon{
 }
 div.bx-badge.bx-badge-compact .sys-icon,
 div.bx-badge.bx-badge-compact img{
-	margin-right: 0;
+    margin:0px auto;
+}
+#bx-popup-ajax-wrapper-sys_set_badges li span{
+    display: flex;
+    margin-left: 0px;
+    align-items: baseline;
+}
+#bx-popup-ajax-wrapper-sys_set_badges li INPUT[type="checkbox"] {
+    margin-right: 0.5rem;
 }

+ 2 - 6
modules/base/profile/classes/BxBaseModProfileTemplate.php

@@ -95,10 +95,6 @@ class BxBaseModProfileTemplate extends BxBaseModGeneralTemplate
 
         $sThumbUrl = $bPublicThumb ? $this->_getUnitThumbUrl($sTemplateSize, $aData, false) : '';
         $bThumbUrl = !empty($sThumbUrl);
-
-		$bShowOneBadge = false;
-		if ('unit_wo_info.html' ==  $sTemplate)
-			$bShowOneBadge = true;
 		
         $aTmplVarsThumbnail = array(
             'bx_if:show_thumb_image' => array(
@@ -121,7 +117,7 @@ class BxBaseModProfileTemplate extends BxBaseModGeneralTemplate
                 'content' => array()
             ),
             'size' => $sTemplateSize,
-            'badges' => $oModule->_getBadges($iContentId, $bShowOneBadge, $bShowOneBadge),
+            'badges' => $oModule->serviceGetBadges($iContentId, false, true),
             'thumb_url' => $bThumbUrl ? $sThumbUrl : $this->getImageUrl('no-picture-thumb.png'),
         );
 
@@ -320,7 +316,7 @@ class BxBaseModProfileTemplate extends BxBaseModGeneralTemplate
             'cover_popup_id' => $sCoverPopupId,
             'cover_url' => $sUrlCover,
             'cover_href' => !$aData[$CNF['FIELD_COVER']] && CHECK_ACTION_RESULT_ALLOWED === $oModule->checkAllowedChangeCover($aData) ? $sUrlCoverChange : 'javascript:void(0);',
-            'badges' => $oModule->_getBadges($aData[$CNF['FIELD_ID']]),
+            'badges' => $oModule->serviceGetBadges($aData[$CNF['FIELD_ID']]),
         );
 
         BxDolCover::getInstance($this)->set($aVars, $sTemplateName);

+ 6 - 1
modules/base/profile/template/cover.html

@@ -25,7 +25,12 @@
                         </div>
                     </bx_if:show_avatar>
                     <div class="bx-base-pofile-cover-user bx-def-margin-sec-topbottom">
-                        <h1 class="bx-def-unit-info">__title__ </h1>__badges__
+                        <div class="bx-base-profile-cover-title-bages">
+							<h1 class="bx-def-unit-info">__title__ </h1>
+							<div class="bx-base-profile-cover-bages bx-base-bages-container">
+								__badges__
+							</div>
+						</div>
                         <div class="bx-base-pofile-cover-actions bx-def-margin-sec-leftright-neg" onclick="event.stopPropagation();">__action_menu__</div>
                     </div>
                 </div>

+ 10 - 1
modules/base/profile/template/css/main.css

@@ -124,6 +124,8 @@ p.bx-base-pofile-unit-thumb.bx-def-ava-size {
     white-space:nowrap;
     text-overflow:ellipsis;
     overflow:hidden;
+    display: flex; 
+    justify-content:center;
 }
 
 .bx-base-pofile-unit-info-members {
@@ -497,4 +499,11 @@ a.bx-base-pofile-cover-thumb p.bx-base-pofile-unit-thumb.bx-def-ava-big-size {
     position: absolute;
     right: -30%;
     top: 0px;
-}
+}
+.bx-base-profile-cover-title-bages{
+    display: flex; 
+    align-items: center;
+    justify-content: center; 
+    overflow: hidden;
+    align-items: center;
+}

+ 3 - 3
modules/base/profile/template/unit_with_cover.html

@@ -16,10 +16,10 @@
             </bx_if:show_thumbnail>
         </a>
         <div class="bx-base-pofile-unit-title bx-def-box-sizing bx-def-padding-sec">
-            <a href="__content_url__" onclick="__content_click__">__title__</a><br />
-            <span class="bx-def-font-small bx-def-font-grayed">__addon__</span>
+            <a href="__content_url__" onclick="__content_click__" >__title__</a>
+			__badges__
         </div>
-        __badges__
+		<span class="bx-def-font-small bx-def-font-grayed">__addon__</span>
         <div class="bx-base-pofile-unit-info">
             <bx_if:meta><div class="bx-base-general-unit-meta bx-def-box-sizing bx-def-padding-sec-rightbottomleft">__meta__</div></bx_if:meta>
         </div>

+ 0 - 3
modules/base/profile/template/unit_wo_info.html

@@ -13,7 +13,4 @@
         </bx_if:show_online>
 		
     </div>
-	<div class="bx-base-pofile-unit-bages">
-		__badges__
-	</div>
 </div>

+ 3 - 1
modules/base/text/classes/BxBaseModTextTemplate.php

@@ -596,7 +596,8 @@ class BxBaseModTextTemplate extends BxBaseModGeneralTemplate
 
     protected function getUnit ($aData, $aParams = array())
     {
-        $CNF = &BxDolModule::getInstance($this->MODULE)->_oConfig->CNF;
+        $oModule = BxDolModule::getInstance($this->MODULE);
+        $CNF = &$oModule->_oConfig->CNF;
 
         // get thumb url
         list($sPhotoThumb, $sPhotoGallery) = $this->getUnitThumbAndGallery($aData);
@@ -633,6 +634,7 @@ class BxBaseModTextTemplate extends BxBaseModGeneralTemplate
             'id' => $aData[$CNF['FIELD_ID']],
             'content_url' => $sUrl,
             'title' => $sTitle,
+            'badges' => $oModule->serviceGetBadges($aData[$CNF['FIELD_ID']], false, true),
             'title_attr' => bx_html_attribute($sTitle),
             'summary' => $sSummary,
             'text' => $sText,

+ 14 - 0
modules/base/text/template/css/main.css

@@ -42,6 +42,13 @@
 	text-align: left;
 }
 
+.bx-base-text-unit-title{
+    white-space: nowrap;
+    text-overflow: ellipsis;
+    overflow: hidden;
+    display: flex;
+}
+
 .bx-base-text-unit-cover img {
 	position: relative;
 	display: block;
@@ -220,6 +227,7 @@
 .bx-base-text-entity-content h2:first-child,
 .bx-base-text-entity-content h1:first-child {
     margin-top:0;
+	margin-bottom: 0;
 }
 
 .bx-base-text-entity-content p:last-child,
@@ -233,3 +241,9 @@
     display:inline-block;
     vertical-align:top;
 }
+
+.bx-base-text-title-bages{
+    display: flex;
+    overflow: hidden;
+    align-items: center;
+}

+ 6 - 1
modules/base/text/template/entry-text.html

@@ -6,7 +6,12 @@
         </div>
     </bx_if:show_image>
     <div class="bx-base-text-entity-content bx-def-constraint-list bx-def-constraint-pre bx-def-constraint-object bx-def-constraint-iframe bx-def-constraint-img">
-        <h1>__entry_title__</h1>
+		<div class="bx-base-text-title-bages">
+			<h1>__entry_title__</h1> 
+			<div class="bx-base-bages-container">
+				__badges__
+			</div>
+		</div>	
         __entry_text__
     </div>
 </div>

+ 5 - 1
modules/base/text/template/unit.html

@@ -5,7 +5,11 @@
 		</div>
 	</bx_if:thumb>
 	<div class="bx-base-text-unit-text bx-def-padding bx-def-box-sizing">
-	    <h2 class="bx-base-text-unit-title"><a href="__content_url__">__title__</a></h2>
+	    <div class="bx-base-text-unit-title">
+			<h2><a href="__content_url__">__title__ </a></h2>
+			 __badges__
+		</div>
+		
 	    <div class="bx-base-text-unit-info bx-def-margin-sec-top bx-def-font-small">
             <bx_if:meta><div class="bx-base-general-unit-meta">__meta__</div></bx_if:meta>
         </div>

+ 4 - 1
modules/base/text/template/unit_gallery.html

@@ -16,7 +16,10 @@
             </div>
         </bx_if:no_thumb>
         <div class="bx-base-text-unit-text bx-def-padding-leftright bx-def-padding-sec-topbottom bx-def-box-sizing">
-            <h2><a href="__content_url__">__title__</a></h2>
+            <div class="bx-base-text-unit-title">
+                <h2><a href="__content_url__">__title__</a></h2>
+                __badges__
+            </div>
             <div class="bx-base-text-unit-info">
                 <bx_if:meta><div class="bx-base-general-unit-meta">__meta__</div></bx_if:meta>
             </div>

+ 5 - 2
modules/boonex/lucid/data/template/bx_persons/unit_with_cover.html

@@ -13,8 +13,11 @@
                 </bx_if:show_online>
             </div>
         </a>
-        <div class="bx-base-pofile-unit-title bx-def-box-sizing bx-def-padding"><a href="__content_url__" onclick="__content_click__">__title__</a></div>
-		__badges__
+        <div class="bx-base-pofile-unit-title bx-def-box-sizing bx-def-padding">
+			<a href="__content_url__" onclick="__content_click__">__title__</a>
+			__badges__
+		</div>
+		
         <div class="bx-base-pofile-unit-info">
             <bx_if:meta><div class="bx-base-general-unit-meta bx-def-box-sizing bx-def-padding-rightbottomleft">__meta__</div></bx_if:meta>
         </div>

+ 4 - 1
modules/boonex/lucid/data/template/bx_posts/unit.html

@@ -5,7 +5,10 @@
 		</div>
 	</bx_if:thumb>
 	<div class="bx-base-text-unit-text bx-def-padding bx-def-box-sizing">
-	    <h2 class="bx-base-text-unit-title"><a href="__content_url__">__title__</a></h2>
+		 <div class="bx-base-text-unit-title">
+			<h2><a href="__content_url__">__title__ </a></h2>
+			 __badges__
+		</div>
 	    <div class="bx-base-text-unit-summary bx-def-margin-sec-top bx-clearfix">__summary__</div> 
 	    <div class="bx-base-text-unit-info bx-def-margin-sec-top bx-def-font-small">
             <bx_if:meta><div class="bx-base-general-unit-meta">__meta__</div></bx_if:meta>

+ 2 - 0
modules/boonex/persons/classes/BxPersonsConfig.php

@@ -130,6 +130,8 @@ class BxPersonsConfig extends BxBaseModProfileConfig
             'OBJECT_GRID_COMMON' => 'bx_persons_common',
             'OBJECT_UPLOADERS_COVER' => array('bx_persons_cover_crop'),
             'OBJECT_UPLOADERS_PICTURE' => array('bx_persons_picture_crop'),
+            
+            'BADGES_AVALIABLE' => true,
 
             'EMAIL_FRIEND_REQUEST' => 'bx_persons_friend_request',
 

+ 2 - 0
modules/boonex/posts/classes/BxPostsConfig.php

@@ -140,6 +140,8 @@ class BxPostsConfig extends BxBaseModTextConfig
             'OBJECT_UPLOADERS' => array('bx_posts_simple', 'bx_posts_html5'),
             'OBJECT_CONTENT_INFO' => 'bx_posts',
             'OBJECT_CMTS_CONTENT_INFO' => 'bx_posts_cmts',
+            
+            'BADGES_AVALIABLE' => true,
 
             // menu items which visibility depends on custom visibility checking
             'MENU_ITEM_TO_METHOD' => array (

+ 1 - 0
modules/boonex/posts/install/sql/enable.sql

@@ -243,6 +243,7 @@ INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `submenu_popup`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
 ('bx_posts_view_actions', 'bx_posts', 'edit-post', '_bx_posts_menu_item_title_system_edit_entry', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 10),
 ('bx_posts_view_actions', 'bx_posts', 'delete-post', '_bx_posts_menu_item_title_system_delete_entry', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 20),
+('bx_posts_view_actions', 'bx_posts', 'set-badges', '_sys_menu_item_title_system_set_badges', '_sys_menu_item_title_set_badges', 'javascript:void(0)', 'bx_menu_popup(''sys_set_badges'', window, {}, {module: ''bx_posts'', content_id: {content_id}});', '', 'check-circle', '', '', 0, 2147483647, 1, 0, 40),
 ('bx_posts_view_actions', 'bx_posts', 'comment', '_sys_menu_item_title_system_va_comment', '', '', '', '', '', '', '', 0, 2147483647, 0, 0, 200),
 ('bx_posts_view_actions', 'bx_posts', 'view', '_sys_menu_item_title_system_va_view', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 210),
 ('bx_posts_view_actions', 'bx_posts', 'vote', '_sys_menu_item_title_system_va_vote', '', '', '', '', '', '', '', 0, 2147483647, 0, 0, 220),

+ 0 - 1
modules/boonex/posts/template/unit.html

@@ -1,3 +1,2 @@
-
 <bx_include_base:../modules/base/text/template/unit.html />
 

+ 7 - 0
modules/boonex/timeline/classes/BxTimelineModule.php

@@ -3424,6 +3424,13 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
         $iUserId = (int)$iUserId;
         return parent::getUserInfo($iUserId);
     }
+    
+    public function getUserInfoWithBadges($iUserId = 0)
+    {
+        $iLoggedId = $this->getUserId();
+        $iUserId = (int)$iUserId;
+        return parent::getUserInfoWithBadges($iUserId);
+    }
 
     /**
      * Protected Methods 

+ 2 - 2
modules/boonex/timeline/classes/BxTimelineTemplate.php

@@ -1378,7 +1378,7 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         $bViewItem = isset($aBrowseParams['view']) && $aBrowseParams['view'] == BX_TIMELINE_VIEW_ITEM;
         $bViewOutline = isset($aBrowseParams['view']) && $aBrowseParams['view'] == BX_TIMELINE_VIEW_OUTLINE;
 
-        list($sAuthorName, $sAuthorUrl, $sAuthorIcon, $sAuthorUnit, $sAuthorUnitShort) = $oModule->getUserInfo($aEvent['object_owner_id']);
+        list($sAuthorName, $sAuthorUrl, $sAuthorIcon, $sAuthorUnit, $sAuthorUnitShort, $sAuthorBadges) = $oModule->getUserInfoWithBadges($aEvent['object_owner_id']);
         $bAuthorIcon = !empty($sAuthorIcon);
 
         if(($bViewItem || $this->_oConfig->isCountAllViews()) && !empty($aEvent['views']) && is_array($aEvent['views']) && isset($aEvent['views']['system']))
@@ -1455,7 +1455,7 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
             'item_icon' => !empty($aEvent['icon']) ? $aEvent['icon'] : $CNF['ICON'],
             'item_owner_url' => $sAuthorUrl,
             'item_owner_title' => bx_html_attribute($sAuthorName),
-            'item_owner_name' => $sAuthorName,
+            'item_owner_name' => $sAuthorName .' '. $sAuthorBadges,
             'item_owner_unit' => $sAuthorUnitShort,
             'item_owner_action' => _t($aEvent['sample_action'], _t($aEvent['sample'])),
             'bx_if:show_timeline_owner' => array(

+ 5 - 0
modules/boonex/timeline/template/css/view.css

@@ -268,6 +268,11 @@ div.bx-tl-item div.bx-tl-owner-name {
     text-overflow: ellipsis;
     overflow: hidden;
 }
+
+div.bx-tl-item div.bx-tl-owner-name .bx-badge-compact {
+    display:inline-block;
+}
+
 div.bx-tl-item div.bx-tl-owner-name > * {
     vertical-align: middle;
 }

+ 6 - 7
studio/template/css/badges.css

@@ -62,19 +62,19 @@ div.bx-badge {
 	vertical-align: middle;
 	height: 1.25rem;
 	line-height: 1.25rem;
-	padding: 0.25rem 0.5rem ;
+	padding: 0 0.5rem ;
 	border-radius: 1em;
 	white-space: nowrap; 
 	text-overflow: ellipsis; 
     overflow: hidden;
 }
 img.bx-badge-icon {
-    width: 20px;
-    height: 20px;
+    width: 14px;
+    height: 14px;
 }
 div.bx-badge img{
 
-	margin-right: 0.25rem;
+	margin-right: 0.5rem;
 }
 div.bx-badge span{
 	text-overflow: ellipsis; 
@@ -82,8 +82,7 @@ div.bx-badge span{
 }
 div.bx-badge .sys-icon{
 	color:#fff;
-	font-size: 1.25rem;
-	margin-right: 0.25rem;
+	margin-right: 0.5rem;
 }
 div.bx-badge.bx-badge-compact{
 	width: 1.25rem;
@@ -94,7 +93,7 @@ div.bx-badge.bx-badge-compact .sys-icon{
 }
 div.bx-badge.bx-badge-compact .sys-icon,
 div.bx-badge.bx-badge-compact img{
-	margin-right: 0;
+    margin:0px auto;
 }
 
 /*--- Pre Lists page -> Add/Edit Form block ---*/

+ 7 - 1
studio/template/scripts/BxBaseStudioBadgesGrid.php

@@ -266,7 +266,13 @@ class BxBaseStudioBadgesGrid extends BxDolStudioBadgesGrid
 			$oModule = BxDolModule::getInstance($sKey);
             if(!($oModule instanceof iBxDolContentInfoService)){
                 unset($aInputModules['values'][$sKey]);
-			}				
+			}	
+            else{
+                $CNF = $oModule->_oConfig->CNF;
+                if(!isset($CNF['BADGES_AVALIABLE']) || !(bool)$CNF['BADGES_AVALIABLE']){
+                    unset($aInputModules['values'][$sKey]);
+                }
+            }
 		}
 		$aInputModules['values'] = array_merge(array('' => _t('_adm_txt_select_module')), $aInputModules['values']);
 		$oForm = new BxTemplStudioFormView(array());

+ 4 - 6
template/scripts/BxBaseMenuSetBadges.php

@@ -59,11 +59,11 @@ class BxBaseMenuSetBadges extends BxTemplMenu
                 'id' => $aBadge['id'],
                 'name' => $aBadge['id'],
                 'class' => '',
-                'title' => BxDolService::call('system', 'get_badge', array($aBadge), 'TemplServices'),
-                'icon' => '',//$aBadge['icon'],
+                'title' => '<input onclick=bx_set_badge("' . $sModule . '",' . $iContentId . ',' . $aBadge['id'] . ') type="checkbox" ' . ($aBadge['badge_id'] != '' ? 'checked' : '') . '>' . BxDolService::call('system', 'get_badge', array($aBadge), 'TemplServices'),
+                'addon' => '',
                 'selected' => true,
                 'link' => 'javascript:void(0);',
-                'onclick' => "bx_set_badge('" . $sModule . "', " . $iContentId . ", {$aBadge['id']}, " . bx_js_string("$(this).parents('.bx-popup-applied:first')") . ");"
+                'onclick' => 'javascript:void(0);'
             );
             if ($aBadge['badge_id'] != ''){
                 array_push($this->_aSelectedIds, $aBadge['id']);
@@ -89,15 +89,13 @@ class BxBaseMenuSetBadges extends BxTemplMenu
         
         checkActionModule($iPerformerId, 'set badge', 'system', true); // perform action
         
-        $aResult = array('code' => 0);
+        $aResult = array('code' => 0, 'html' => BxDolService::call($sModule, 'get_badges', array($iContentId)));
         
         return $aResult;
     }
     
     protected function _isSelected ($a)
     {
-        if (isset($a['name']) &&  in_array($a['name'], $this->_aSelectedIds))
-            return true;
         return false;
     }
 }

+ 2 - 2
template/scripts/BxBaseServices.php

@@ -409,10 +409,10 @@ class BxBaseServices extends BxDol implements iBxDolProfileService
         return $aResults;
     }
     
-    public function serviceGetBadge($aBadge, $isCompact = false)
+    public function serviceGetBadge($aBadge, $bIsCompact = false)
     {
         $sClass = '';
-        if ($isCompact){
+        if ($bIsCompact){
             $aBadge['is_icon_only'] = 1;
         }
         if ($aBadge['is_icon_only'] == 1){