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

#1643 Photos: no image displayed when photo description is entered and cache in on

Alex Trofimov 8 лет назад
Родитель
Сommit
de8953e692

+ 5 - 1
modules/boonex/photos/classes/BxPhotosTemplate.php

@@ -25,7 +25,8 @@ class BxPhotosTemplate extends BxBaseModTextTemplate
 
     public function entryText ($aData, $sTemplateName = 'entry-text.html')
     {
-        return $this->entryPhoto($aData);
+        $aTmplVars = BxBaseModGeneralTemplate::getTmplVarsText($aData);
+        return $this->parseHtmlByName($sTemplateName, $aTmplVars);
     }
 
     public function entryPhoto ($aContentInfo, $bAsArray = false)
@@ -164,6 +165,9 @@ class BxPhotosTemplate extends BxBaseModTextTemplate
             unset($aParams['context']);
         }
 
+        if (empty($aData['title']))
+            $aData['title'] = _t('_bx_photos_txt_no_title');
+
         $aResult = parent::getUnit($aData, $aParams);
         $aResult['bx_if:thumb']['content']['content_onclick'] = !empty($sMode) ? $this->_oConfig->getJsObject('main') . ".viewEntry(" . $aData[$CNF['FIELD_ID']] . ", '" . $sMode . "', " . bx_html_attribute(json_encode($aParams)) . "); return false;" : "";
 

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

@@ -224,4 +224,5 @@
     <string name="_bx_photos_txt_n_views"><![CDATA[{0} views]]></string>
     <string name="_bx_photos_txt_previous"><![CDATA[Previous]]></string>
     <string name="_bx_photos_txt_next"><![CDATA[Next]]></string>
+    <string name="_bx_photos_txt_no_title"><![CDATA[No title]]></string>
 </resources>

+ 1 - 1
modules/boonex/photos/install/sql/enable.sql

@@ -45,7 +45,7 @@ INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `lay
 ('bx_photos_view_entry', '_bx_photos_page_title_sys_view_entry', '_bx_photos_page_title_view_entry', 'bx_photos', 12, 2147483647, 1, 'view-photo', '', '', '', '', 0, 1, 0, 'BxPhotosPageEntry', 'modules/boonex/photos/classes/BxPhotosPageEntry.php');
 
 INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES
-('bx_photos_view_entry', 1, 'bx_photos', '', '_bx_photos_page_block_title_entry_photo', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_photos";s:6:"method";s:18:"entity_photo_block";}', 0, 0, 0, 0),
+('bx_photos_view_entry', 1, 'bx_photos', '', '_bx_photos_page_block_title_entry_photo', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_photos";s:6:"method";s:18:"entity_photo_block";}', 0, 0, 1, 0),
 ('bx_photos_view_entry', 2, 'bx_photos', '', '_bx_photos_page_block_title_entry_text', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_photos";s:6:"method";s:17:"entity_text_block";}', 0, 0, 1, 1),
 ('bx_photos_view_entry', 2, 'bx_photos', '', '_bx_photos_page_block_title_entry_author', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_photos";s:6:"method";s:13:"entity_author";}', 0, 0, 1, 3),
 ('bx_photos_view_entry', 2, 'bx_photos', '', '_bx_photos_page_block_title_entry_rating', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_photos";s:6:"method";s:13:"entity_rating";}', 0, 0, 0, 0),

+ 6 - 1
modules/boonex/photos/template/entry-photo.html

@@ -1 +1,6 @@
-<bx_include_base:entry-text.html />
+<div class="bx-photos-entity-photo bx-def-font-align-center">
+    <img class="bx-def-border-radius-block" src="__entry_photo__" title="__entry_title_attr__" />
+</div>
+<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 bx-def-margin-top">
+    <h1>__entry_title__</h1>
+</div>

+ 1 - 7
modules/boonex/photos/template/entry-text.html

@@ -1,7 +1 @@
-<div class="bx-photos-entity-photo bx-def-font-align-center">
-    <img class="bx-def-border-radius-block" src="__entry_photo__" title="__entry_title_attr__" />
-</div>
-<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 bx-def-margin-top">
-    <h1>__entry_title__</h1>
-    __entry_text__
-</div>
+__entry_text__

+ 1 - 0
modules/boonex/russian/data/langs/bx_photos/ru.xml

@@ -226,4 +226,5 @@
     <string name="_bx_photos_txt_n_views"><![CDATA[{0} просмотров]]></string>
     <string name="_bx_photos_txt_previous"><![CDATA[Предыдущее фото]]></string>
     <string name="_bx_photos_txt_next"><![CDATA[Следующее фото]]></string>
+    <string name="_bx_photos_txt_no_title"><![CDATA[Без заголовка]]></string>
 </resources>