فهرست منبع

Ticket #623 - Fixed integration between Files and Timeline modules.

AntonLV 9 سال پیش
والد
کامیت
b1fe2fcd9c
2فایلهای تغییر یافته به همراه13 افزوده شده و 12 حذف شده
  1. 12 11
      modules/boonex/files/classes/BxFilesModule.php
  2. 1 1
      modules/boonex/files/template/timeline_post.html

+ 12 - 11
modules/boonex/files/classes/BxFilesModule.php

@@ -179,26 +179,27 @@ class BxFilesModule extends BxBaseModTextModule
         }
     }
 
-    public function serviceGetTimelinePost($aEvent)
+    protected function _getContentForTimelinePost($aEvent, $aContentInfo)
     {
-        $a = parent::serviceGetTimelinePost($aEvent);
+        $aResult = parent::_getContentForTimelinePost($aEvent, $aContentInfo);
 
-        $aContentInfo = $this->_oDb->getContentInfoById($aEvent['object_id']);
         $aFile = $this->getContentFile($aContentInfo);
         if (!$aFile['is_image']) {
             $oStorage = BxDolStorage::getObjectInstance($this->_oConfig->CNF['OBJECT_STORAGE']);
             $sIcon = $oStorage ? $oStorage->getFontIconNameByFileName($aFile['file_name']) : 'file-o';
-            $a['content'] = $this->_oTemplate->parseHtmlByName('timeline_post.html', array(
-                'title' => $a['content']['title'],
-                'title_attr' => bx_html_attribute($a['content']['title']),
-                'url' => $a['content']['url'],
-                'icon' => '<i class="sys-icon ' . $sIcon . '"></i>',
+
+            $aResult['raw'] = $this->_oTemplate->parseHtmlByName('timeline_post.html', array(
+                'title' => $aResult['title'],
+                'title_attr' => bx_html_attribute($aResult['title']),
+                'url' => $aResult['url'],
+                'icon' => $sIcon,
             ));
+            $aResult['title'] = '';
         }
-        
-        return $a;
+
+        return $aResult;
     }
-    
+
     protected function _getImagesForTimelinePost($aEvent, $aContentInfo, $sUrl)
     {
         $aFile = $this->getContentFile($aContentInfo);

+ 1 - 1
modules/boonex/files/template/timeline_post.html

@@ -1,5 +1,5 @@
 <div class="bx-tl-item-text">
     <div class="bx-tl-title bx-def-margin-sec-bottom bx-def-font-h3">
-        <a href="__url__" title="__title_attr__" class="bx-tl-title">__icon__ __title__</a>
+        <a href="__url__" title="__title_attr__" class="bx-tl-title"><i class="sys-icon __icon__"></i> __title__</a>
     </div>
 </div>