Răsfoiți Sursa

#103 link to the main entry in block title from comments page (Albums, Posts)

Alex Trofimov 11 ani în urmă
părinte
comite
af8e5abff6

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

@@ -33,8 +33,19 @@ class BxBaseModTextPageEntry extends BxBaseModGeneralPageEntry
             $this->addMarkers(array(
                 'title' => isset($this->_aContentInfo[$CNF['FIELD_TITLE']]) ? $this->_aContentInfo[$CNF['FIELD_TITLE']] : strmaxtextlen($this->_aContentInfo[$CNF['FIELD_TEXT']], 20, '...'),
             ));
+            $this->addMarkers(array('entry_link' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $this->_aContentInfo[$CNF['FIELD_ID']]))); // entry link
         }
     }
+
+    protected function _getBlockService ($aBlock)
+    {
+        $a = parent::_getBlockService ($aBlock);
+        $sTest = '_view_entry_comments';
+        if (false !== strpos($aBlock['content'], 'entity_comments') && substr_compare($this->_sObject, $sTest, strlen($this->_sObject) - strlen($sTest), strlen($sTest)) === 0)
+            unset($a['title']);            
+        return $a;
+    }    
+
 }
 
 /** @} */

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

@@ -72,6 +72,7 @@
     <string name="_bx_albums_page_block_title_entry_author"><![CDATA[Author]]></string>
     <string name="_bx_albums_page_block_title_entry_actions"><![CDATA[Actions]]></string>
     <string name="_bx_albums_page_block_title_entry_comments"><![CDATA[Comments]]></string>
+    <string name="_bx_albums_page_block_title_entry_comments_link"><![CDATA[Comments to <a href="{entry_link}">{title}</a>]]></string>
     <string name="_bx_albums_page_block_title_entry_location"><![CDATA[Location]]></string>
     <string name="_bx_albums_page_title_sys_entries_popular"><![CDATA[Popular Albums]]></string>
     <string name="_bx_albums_page_title_entries_popular"><![CDATA[Popular Albums]]></string>

+ 2 - 2
modules/boonex/albums/install/sql/enable.sql

@@ -73,8 +73,8 @@ INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbo
 INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
 ('bx_albums_view_entry_comments', '_bx_albums_page_title_sys_view_entry_comments', '_bx_albums_page_title_view_entry_comments', 'bx_albums', 5, 2147483647, 1, 'view-album-comments', '', '', '', '', 0, 1, 0, 'BxAlbumsPageEntry', 'modules/boonex/albums/classes/BxAlbumsPageEntry.php');
 
-INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
-('bx_albums_view_entry_comments', 1, 'bx_albums', '_bx_albums_page_block_title_entry_comments', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_albums\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 1);
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_albums_view_entry_comments', 1, 'bx_albums', '_bx_albums_page_block_title_entry_comments', '_bx_albums_page_block_title_entry_comments_link', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_albums\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 1);
 
 
 -- PAGE: popular albums

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

@@ -44,6 +44,7 @@ class BxPostsConfig extends BxBaseModTextConfig
 
             'URL_HOME' => 'page.php?i=posts-home',
             'URL_POPULAR' => 'page.php?i=posts-popular',
+            'URL_UPDATED' => 'page.php?i=posts-updated',
         	'URL_MANAGE_COMMON' => 'page.php?i=posts-manage',
         	'URL_MANAGE_ADMINISTRATION' => 'page.php?i=posts-administration',
 

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

@@ -66,6 +66,7 @@
     <string name="_bx_posts_page_block_title_entry_author"><![CDATA[Author]]></string>
     <string name="_bx_posts_page_block_title_entry_actions"><![CDATA[Actions]]></string>
     <string name="_bx_posts_page_block_title_entry_comments"><![CDATA[Comments]]></string>
+    <string name="_bx_posts_page_block_title_entry_comments_link"><![CDATA[Comments to <a href="{entry_link}">{title}</a>]]></string>
     <string name="_bx_posts_page_block_title_entry_location"><![CDATA[Location]]></string>
     <string name="_bx_posts_page_block_title_entry_attachments"><![CDATA[Attachments]]></string>
     <string name="_bx_posts_page_block_title_entry_all_actions"><![CDATA[All Actions]]></string>

+ 2 - 2
modules/boonex/posts/install/sql/enable.sql

@@ -65,8 +65,8 @@ INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `t
 INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
 ('bx_posts_view_entry_comments', '_bx_posts_page_title_sys_view_entry_comments', '_bx_posts_page_title_view_entry_comments', 'bx_posts', 5, 2147483647, 1, 'view-post-comments', '', '', '', '', 0, 1, 0, 'BxPostsPageEntry', 'modules/boonex/posts/classes/BxPostsPageEntry.php');
 
-INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
-('bx_posts_view_entry_comments', 1, 'bx_posts', '_bx_posts_page_block_title_entry_comments', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 1);
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_posts_view_entry_comments', 1, 'bx_posts', '_bx_posts_page_block_title_entry_comments', '_bx_posts_page_block_title_entry_comments_link', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 1);
 
 
 -- PAGE: popular entries

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

@@ -72,6 +72,7 @@
     <string name="_bx_albums_page_block_title_entry_author"><![CDATA[Автор]]></string>
     <string name="_bx_albums_page_block_title_entry_actions"><![CDATA[Действия]]></string>
     <string name="_bx_albums_page_block_title_entry_comments"><![CDATA[Комментарии]]></string>
+    <string name="_bx_albums_page_block_title_entry_comments_link"><![CDATA[Комментарии к <a href="{entry_link}">{title}</a>]]></string>
     <string name="_bx_albums_page_block_title_entry_location"><![CDATA[Расположение]]></string>
     <string name="_bx_albums_page_title_sys_entries_popular"><![CDATA[Популярные альбомы]]></string>
     <string name="_bx_albums_page_title_entries_popular"><![CDATA[Популярные альбомы]]></string>

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

@@ -66,6 +66,7 @@
     <string name="_bx_posts_page_block_title_entry_author"><![CDATA[Автор]]></string>
     <string name="_bx_posts_page_block_title_entry_actions"><![CDATA[Действия]]></string>
     <string name="_bx_posts_page_block_title_entry_comments"><![CDATA[Комментарии]]></string>
+    <string name="_bx_posts_page_block_title_entry_comments_link"><![CDATA[Комментарии к <a href="{entry_link}">{title}</a>]]></string>
     <string name="_bx_posts_page_block_title_entry_location"><![CDATA[Расположение]]></string>
     <string name="_bx_posts_page_block_title_entry_attachments"><![CDATA[Прикрепления]]></string>
     <string name="_bx_posts_page_block_title_entry_all_actions"><![CDATA[Все Действия]]></string>