Bläddra i källkod

#124 - Posts: "Full view" blocks

Alex Trofimov 11 år sedan
förälder
incheckning
7b2d0251ed

+ 1 - 1
modules/base/text/classes/BxBaseModTextSearchResult.php

@@ -13,7 +13,7 @@ bx_import('BxBaseModGeneralSearchResult');
 
 class BxBaseModTextSearchResult extends BxBaseModGeneralSearchResult
 {
-    protected $aUnitViews = array('extended' => 'unit.html', 'gallery' => 'unit_gallery.html');
+    protected $aUnitViews = array('extended' => 'unit.html', 'gallery' => 'unit_gallery.html', 'full' => 'unit_full.html');
     protected $sUnitViewDefault = 'gallery';
     protected $sUnitViewParamName = 'unit_view';
 

+ 11 - 0
modules/base/text/classes/BxBaseModTextTemplate.php

@@ -62,12 +62,23 @@ class BxBaseModTextTemplate extends BxBaseModGeneralTemplate
         $sSummary = strmaxtextlen($aData[$CNF['FIELD_TEXT']], (int)getParam($CNF['PARAM_CHARS_SUMMARY']), $sLinkMore);
         $sSummaryPlain = BxTemplFunctions::getInstance()->getStringWithLimitedLength(strip_tags($sSummary), (int)getParam($CNF['PARAM_CHARS_SUMMARY_PLAIN']));
 
+        $sText = $aData[$CNF['FIELD_TEXT']];
+        if (!empty($CNF['OBJECT_METATAGS'])) {
+            bx_import('BxDolMetatags');
+            $oMetatags = BxDolMetatags::getObjectInstance($CNF['OBJECT_METATAGS']);
+    
+            // keywords
+            if ($oMetatags->keywordsIsEnabled())
+                $sText = $oMetatags->keywordsParse($aData[$CNF['FIELD_ID']], $sText);
+        }
+
         // generate html
         $aVars = array (
             'id' => $aData[$CNF['FIELD_ID']],
             'content_url' => $sUrl,
             'title' => bx_process_output($aData[$CNF['FIELD_TITLE']]),
             'summary' => $sSummary,
+            'text' => $sText,
             'author' => $oProfile->getDisplayName(),
             'author_url' => $oProfile->getUrl(),
             'entry_posting_date' => bx_time_js($aData[$CNF['FIELD_ADDED']], BX_FORMAT_DATE),

+ 2 - 0
modules/boonex/posts/install/langs/en.xml

@@ -58,6 +58,7 @@
     <string name="_bx_posts_page_title_home"><![CDATA[Posts]]></string>
     <string name="_bx_posts_page_block_title_recent_entries"><![CDATA[Recent Posts]]></string>
     <string name="_bx_posts_page_block_title_recent_entries_view_extended"><![CDATA[Recent Posts (Extended View)]]></string>
+    <string name="_bx_posts_page_block_title_recent_entries_view_full"><![CDATA[Recent Posts (Full View)]]></string>
     <string name="_bx_posts_page_block_title_entry_social_sharing"><![CDATA[Share]]></string>
     <string name="_bx_posts_page_block_title_entry_author"><![CDATA[Author]]></string>
     <string name="_bx_posts_page_block_title_entry_actions"><![CDATA[Actions]]></string>
@@ -67,6 +68,7 @@
     <string name="_bx_posts_page_title_entries_popular"><![CDATA[Popular Posts]]></string>
     <string name="_bx_posts_page_block_title_popular_entries"><![CDATA[Popular Posts]]></string>
     <string name="_bx_posts_page_block_title_popular_entries_view_extended"><![CDATA[Popular Posts (Extended View)]]></string>
+    <string name="_bx_posts_page_block_title_popular_entries_view_full"><![CDATA[Popular Posts (Full View)]]></string>
     <string name="_bx_posts_page_title_sys_view_entry_comments"><![CDATA[Post Comments]]></string>
     <string name="_bx_posts_page_title_view_entry_comments"><![CDATA[Post Comments]]></string>
     <string name="_bx_posts_page_title_sys_entries_of_author"><![CDATA[Posts of author]]></string>

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

@@ -125,7 +125,9 @@ INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbo
 SET @iBlockOrder = (SELECT `order` FROM `sys_pages_blocks` WHERE `object` = '' AND `cell_id` = 0 ORDER BY `order` DESC LIMIT 1);
 INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
 ('', 0, 'bx_posts', '_bx_posts_page_block_title_recent_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_posts";s:6:"method";s:13:"browse_public";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 1, IFNULL(@iBlockOrder, 0) + 1),
-('', 0, 'bx_posts', '_bx_posts_page_block_title_popular_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_posts";s:6:"method";s:14:"browse_popular";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 1, IFNULL(@iBlockOrder, 0) + 2);
+('', 0, 'bx_posts', '_bx_posts_page_block_title_recent_entries_view_full', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_posts";s:6:"method";s:13:"browse_public";s:6:"params";a:1:{i:0;s:4:"full";}}', 0, 1, IFNULL(@iBlockOrder, 0) + 2),
+('', 0, 'bx_posts', '_bx_posts_page_block_title_popular_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_posts";s:6:"method";s:14:"browse_popular";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 1, IFNULL(@iBlockOrder, 0) + 3),
+('', 0, 'bx_posts', '_bx_posts_page_block_title_popular_entries_view_full', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_posts";s:6:"method";s:14:"browse_popular";s:6:"params";a:1:{i:0;s:4:"full";}}', 0, 1, IFNULL(@iBlockOrder, 0) + 4);
 
 -- MENU: add to site menu