Parcourir la source

#2844 add block to post's page

RomanL il y a 6 ans
Parent
commit
3c52459cfc

+ 6 - 2
modules/base/general/classes/BxBaseModGeneralTemplate.php

@@ -133,8 +133,11 @@ class BxBaseModGeneralTemplate extends BxDolModuleTemplate
     
     function getContextAddon ($aData, $oProfile)
     {
-        $CNF = &$this->getModule()->_oConfig->CNF;
+        $CNF = &$this->getModule()->_oConfig->CNF; 
         $sUrl = 'page.php?i=' . $CNF['URI_ENTRIES_BY_CONTEXT'] . '&profile_id=' . $oProfile->id();
+        $bActAsProfile = BxDolService::call($oProfile->getModule(), 'act_as_profile');
+        if ($bActAsProfile)
+            $sUrl = 'page.php?i=' . $CNF['URI_AUTHOR_ENTRIES'] . '&profile_id=' . $oProfile->id();
         $sUrl = BxDolPermalinks::getInstance()->permalink($sUrl);
         return _t($CNF['T']['txt_all_entries_in'], $sUrl, $oProfile->getDisplayName(), $this->getModule()->_oDb->getEntriesNumByContext($oProfile->id()));
     }
@@ -300,7 +303,7 @@ class BxBaseModGeneralTemplate extends BxDolModuleTemplate
 
         $sName = $oProfile->getDisplayName();
         $sAddon = $sFuncContextAddon ? $this->$sFuncContextAddon($aData, $oProfile) : '';
-        
+        echo $sFuncContextAddon;
         $aVars = array (
             'author_url' => $oProfile->getUrl(),
             'author_thumb_url' => $oProfile->getThumb(),
@@ -315,6 +318,7 @@ class BxBaseModGeneralTemplate extends BxDolModuleTemplate
                 ),
             ),
         );
+        print_r($aVars);
         return $this->parseHtmlByName($sTemplateName, $aVars);
     }
 

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

@@ -111,8 +111,8 @@ INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module
 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_posts_author', 1, 'bx_posts', '', '_bx_posts_page_block_title_entries_actions', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:18:\"my_entries_actions\";}', 0, 0, 1, 1),
 ('bx_posts_author', 1, 'bx_posts', '_bx_posts_page_block_title_sys_favorites_of_author', '_bx_posts_page_block_title_favorites_of_author', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:15:\"browse_favorite\";s:6:"params";a:1:{i:0;s:12:"{profile_id}";}}', 0, 1, 1, 2),
-('bx_posts_author', 1, 'bx_posts', '_bx_posts_page_block_title_sys_entries_of_author', '_bx_posts_page_block_title_entries_of_author', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:13:\"browse_author\";}', 0, 0, 1, 3);
-
+('bx_posts_author', 1, 'bx_posts', '_bx_posts_page_block_title_sys_entries_of_author', '_bx_posts_page_block_title_entries_of_author', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:13:\"browse_author\";}', 0, 0, 1, 3),
+('bx_posts_author', 1, 'bx_posts', '_bx_posts_page_block_title_sys_entries_in_context', '_bx_posts_page_block_title_entries_in_context', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:14:\"browse_context\";}', 0, 0, 1, 4);
 -- PAGE: entries in context
 
 INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES