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

Merge branch 'master' of https://github.com/boonex/dolphin

AntonLV 11 лет назад
Родитель
Сommit
7f34e201db

+ 16 - 0
inc/classes/BxDolTemplate.php

@@ -751,6 +751,19 @@ class BxDolTemplate extends BxDol implements iBxDolSingleton
     {
         $this->aPage['image'] = $sImageUrl;
     }
+    /**
+     * Set page rss link.
+     *
+     * @param $sTitle - rss feed title
+     * @param $sUrl - rss feed URL
+     */
+    function addPageRssLink($sTitle, $sUrl)
+    {
+        if (!isset($this->aPage['rss']))
+            $this->aPage['rss'] = array('title' => $sTitle, 'url' => $sUrl);
+        else
+            $this->aPage['rss'] = false;
+    }
     /**
      * Returns page meta info, like meta keyword, meta description, location, etc
      */
@@ -777,6 +790,9 @@ class BxDolTemplate extends BxDol implements iBxDolSingleton
             $sRet .= BxTemplFunctions::getInstance()->getMetaIcons();
         }
 
+        if (!empty($this->aPage['rss']) && !empty($this->aPage['rss']['url']))
+            $sRet .= '<link rel="alternate" type="application/rss+xml" title="' . bx_html_attribute($this->aPage['rss']['title'], BX_ESCAPE_STR_QUOTE) . '" href="' . $this->aPage['rss']['url'] . '" />';
+
         return $sRet;
     }
     /**

+ 2 - 2
modules/base/general/classes/BxBaseModGeneralFormsEntryHelper.php

@@ -174,8 +174,8 @@ class BxBaseModGeneralFormsEntryHelper extends BxDolProfileForms
         // redirect
         bx_import('BxDolPermalinks');
         $this->_redirectAndExit($CNF['URL_HOME'], true, array(
-            'account_id' => $oProfile->getAccountId(),
-            'profile_id' => $oProfile->id(),
+            'account_id' => method_exists($oProfile, 'getAccountId') ? $oProfile->getAccountId() : getLoggedId(),
+            'profile_id' => $oProfile->id() ? $oProfile->id() : bx_get_logged_profile_id(),
         ));
     }
 

+ 8 - 8
modules/base/text/classes/BxBaseModTextModule.php

@@ -50,34 +50,34 @@ class BxBaseModTextModule extends BxBaseModGeneralModule
 	}
 
     /**
-     * Display pablic entries
+     * Display public entries
      * @return HTML string
      */
-    public function serviceBrowsePublic ()
-    {
-        return $this->_serviceBrowse ('public', false, BX_DB_PADDING_DEF, true);
+    public function serviceBrowsePublic ($sUnitView = false, $bEmptyMessage = true, $bAjaxPaginate = true)
+    {   
+        return $this->_serviceBrowse ('public', $sUnitView ? array('unit_view' => $sUnitView) : false, BX_DB_PADDING_DEF, $bEmptyMessage, $bAjaxPaginate);
     }
 
     /**
      * Display featured entries
      * @return HTML string
      */
-    public function serviceBrowsePopular ()
+    public function serviceBrowsePopular ($sUnitView = false, $bEmptyMessage = true, $bAjaxPaginate = true)
     {
-        return $this->_serviceBrowse ('popular', false, BX_DB_PADDING_DEF, true);
+        return $this->_serviceBrowse ('popular', $sUnitView ? array('unit_view' => $sUnitView) : false, BX_DB_PADDING_DEF, $bEmptyMessage, $bAjaxPaginate);
     }
 
     /**
      * Display entries of the author
      * @return HTML string
      */
-    public function serviceBrowseAuthor ($iProfileId = 0)
+    public function serviceBrowseAuthor ($iProfileId = 0, $sUnitView = false)
     {
         if (!$iProfileId)
             $iProfileId = bx_process_input(bx_get('profile_id'), BX_DATA_INT);
         if (!$iProfileId)
             return '';
-        return $this->_serviceBrowse ('author', array('author' => $iProfileId), BX_DB_PADDING_DEF, true);
+        return $this->_serviceBrowse ('author', array('author' => $iProfileId, 'unit_view' => $sUnitView ? $sUnitView : ''), BX_DB_PADDING_DEF, true);
     }
 
     /**

+ 3 - 25
modules/base/text/classes/BxBaseModTextSearchResult.php

@@ -21,6 +21,9 @@ class BxBaseModTextSearchResult extends BxBaseModGeneralSearchResult
     {
         parent::__construct($sMode, $aParams);
 
+        if (!empty($aParams['unit_view']))
+            $this->sUnitViewDefault = $aParams['unit_view'];
+
         $this->aGetParams = array($this->sUnitViewParamName);
         $this->sUnitTemplate = $this->aUnitViews[$this->sUnitViewDefault];
         if (isset($this->aUnitViews[bx_get($this->sUnitViewParamName)]))
@@ -30,31 +33,6 @@ class BxBaseModTextSearchResult extends BxBaseModGeneralSearchResult
             $this->addContainerClass (array('bx-def-margin-sec-neg', 'bx-base-text-unit-gallery-wrapper'));
     }
 
-    function getDesignBoxMenu ()
-    {
-        $aMenu = parent::getDesignBoxMenu ();
-        if (!$aMenu)
-            return false;
-
-        return array_merge(
-            array(
-                array(
-                    'name' => 'gallery', 
-                    'title' => _t('_sys_menu_title_gallery'), 
-                    'link' => $this->getCurrentUrl(array($this->sUnitViewParamName => 'gallery')), 
-                    'onclick' => $this->getCurrentOnclick(array($this->sUnitViewParamName => 'gallery')), 
-                    'icon' => 'th'),
-                array(
-                    'name' => 'extended', 
-                    'title' => _t('_sys_menu_title_extended'), 
-                    'link' => $this->getCurrentUrl(array($this->sUnitViewParamName => 'extended')), 
-                    'onclick' => $this->getCurrentOnclick(array($this->sUnitViewParamName => 'extended')), 
-                    'icon' => 'list'),
-            ),
-            $aMenu
-        );
-    }
-
     protected function getCurrentOnclick($aAdditionalParams = array(), $bReplacePagesParams = true) 
     {
         // always add UnitView as additional param

+ 7 - 4
modules/boonex/albums/classes/BxAlbumsSearchResult.php

@@ -16,7 +16,10 @@ class BxAlbumsSearchResult extends BxBaseModTextSearchResult
     function __construct($sMode = '', $aParams = array())
     {
         $this->aUnitViews = array('extended' => 'unit.html');
-        $this->sUnitViewDefault = 'extended';
+    
+        if (empty($aParams['unit_view']))
+            $aParams['unit_view'] = 'extended';
+
         parent::__construct($sMode, $aParams);
 
         $this->aCurrent = array(
@@ -101,9 +104,9 @@ class BxAlbumsSearchResult extends BxBaseModTextSearchResult
 
         // add replaceable markers and replace them
         if ($oProfileAuthor) {
-            $this->addMarkers($oProfileAuthor->getInfo()); // profile info is replacable
-            $this->addMarkers(array('profile_id' => $oProfileAuthor->id())); // profile id is replacable
-            $this->addMarkers(array('display_name' => $oProfileAuthor->getDisplayName())); // profile display name is replacable
+            $this->addMarkers($oProfileAuthor->getInfo()); // profile info is replaceable
+            $this->addMarkers(array('profile_id' => $oProfileAuthor->id())); // profile id is replaceable
+            $this->addMarkers(array('display_name' => $oProfileAuthor->getDisplayName())); // profile display name is replaceable
         }
 
         $this->sBrowseUrl = $this->_replaceMarkers($this->sBrowseUrl);

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

@@ -72,7 +72,7 @@ INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `lay
 ('bx_albums_popular', '_bx_albums_page_title_sys_entries_popular', '_bx_albums_page_title_entries_popular', 'bx_albums', 5, 2147483647, 1, 'albums-popular', 'page.php?i=albums-popular', '', '', '', 0, 1, 0, 'BxAlbumsPageBrowse', 'modules/boonex/albums/classes/BxAlbumsPageBrowse.php');
 
 INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
-('bx_albums_popular', 1, 'bx_albums', '_bx_albums_page_block_title_popular_entries', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_albums\";s:6:\"method\";s:14:\"browse_popular\";}', 0, 1, 1);
+('bx_albums_popular', 1, 'bx_albums', '_bx_albums_page_block_title_popular_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_albums";s:6:"method";s:14:"browse_popular";s:6:"params";a:3:{s:9:"unit_view";s:8:"extended";s:13:"empty_message";b:1;s:13:"ajax_paginate";b:0;}}', 0, 1, 1);
 
 
 -- PAGE: entries of author
@@ -90,7 +90,7 @@ INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `lay
 ('bx_albums_home', '_bx_albums_page_title_sys_home', '_bx_albums_page_title_home', 'bx_albums', 5, 2147483647, 1, 'albums-home', 'page.php?i=albums-home', '', '', '', 0, 1, 0, 'BxAlbumsPageBrowse', 'modules/boonex/albums/classes/BxAlbumsPageBrowse.php');
 
 INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
-('bx_albums_home', 1, 'bx_albums', '_bx_albums_page_block_title_recent_entries', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_albums\";s:6:\"method\";s:13:\"browse_public\";}', 0, 1, 0);
+('bx_albums_home', 1, 'bx_albums', '_bx_albums_page_block_title_recent_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_albums";s:6:"method";s:13:"browse_public";s:6:"params";a:3:{s:9:"unit_view";s:8:"extended";s:13:"empty_message";b:1;s:13:"ajax_paginate";b:0;}}', 0, 1, 0);
 
 -- PAGE: module manage
 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 

+ 0 - 2
modules/boonex/english/data/langs/system.xml

@@ -1832,8 +1832,6 @@ If it is not enabled then please consider implement this optimization, since it
 	<string name="_sys_menu_title_add_profile"><![CDATA[Add Profile Menu]]></string>
 	<string name="_sys_menu_title_cmts_item_actions"><![CDATA[Comment Actions]]></string>
 	<string name="_sys_menu_title_cmts_item_manage"><![CDATA[Manage Comment]]></string>
-	<string name="_sys_menu_title_extended"><![CDATA[Extended view]]></string>
-	<string name="_sys_menu_title_gallery"><![CDATA[Gallery view]]></string>
 	<string name="_sys_menu_title_footer"><![CDATA[Footer Links]]></string>
 	<string name="_sys_menu_title_main"><![CDATA[Site Navigation]]></string>
 	<string name="_sys_menu_title_profiles_create"><![CDATA[Create Profiles]]></string>

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

@@ -57,6 +57,7 @@
     <string name="_bx_posts_page_title_sys_home"><![CDATA[Posts Home]]></string>
     <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_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>
@@ -65,6 +66,7 @@
     <string name="_bx_posts_page_title_sys_entries_popular"><![CDATA[Popular Posts]]></string>
     <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_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>

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

@@ -72,7 +72,7 @@ INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `lay
 ('bx_posts_popular', '_bx_posts_page_title_sys_entries_popular', '_bx_posts_page_title_entries_popular', 'bx_posts', 5, 2147483647, 1, 'posts-popular', 'page.php?i=posts-popular', '', '', '', 0, 1, 0, 'BxPostsPageBrowse', 'modules/boonex/posts/classes/BxPostsPageBrowse.php');
 
 INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
-('bx_posts_popular', 1, 'bx_posts', '_bx_posts_page_block_title_popular_entries', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:14:\"browse_popular\";}', 0, 1, 1);
+('bx_posts_popular', 1, 'bx_posts', '_bx_posts_page_block_title_popular_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_posts";s:6:"method";s:14:"browse_popular";s:6:"params";a:3:{s:9:"unit_view";s:7:"gallery";s:13:"empty_message";b:1;s:13:"ajax_paginate";b:0;}}', 0, 1, 1);
 
 
 -- PAGE: entries of author
@@ -90,7 +90,7 @@ INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module
 ('bx_posts_home', 'posts-home', '_bx_posts_page_title_sys_home', '_bx_posts_page_title_home', 'bx_posts', 2, 2147483647, 1, 'page.php?i=posts-home', '', '', '', 0, 1, 0, 'BxPostsPageBrowse', 'modules/boonex/posts/classes/BxPostsPageBrowse.php');
 
 INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
-('bx_posts_home', 1, 'bx_posts', '_bx_posts_page_block_title_recent_entries', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:13:\"browse_public\";}', 0, 1, 1, 0),
+('bx_posts_home', 1, 'bx_posts', '_bx_posts_page_block_title_recent_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_posts";s:6:"method";s:13:"browse_public";s:6:"params";a:3:{s:9:"unit_view";s:7:"gallery";s:13:"empty_message";b:1;s:13:"ajax_paginate";b:0;}}', 0, 1, 1, 0),
 ('bx_posts_home', 2, 'bx_posts', '_bx_posts_page_block_title_popular_keywords', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:14:"keywords_cloud";s:6:"params";a:2:{i:0;s:8:"bx_posts";i:1;s:8:"bx_posts";}s:5:"class";s:20:"TemplServiceMetatags";}', 0, 1, 1, 0);
 
 -- PAGE: module manage
@@ -120,6 +120,12 @@ SET @iBlockOrder = (SELECT `order` FROM `sys_pages_blocks` WHERE `object` = 'sys
 INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
 ('sys_home', 1, 'bx_posts', '_bx_posts_page_block_title_recent_entries', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:13:\"browse_public\";}', 1, 0, IFNULL(@iBlockOrder, 0) + 1);
 
+-- PAGE: service blocks
+
+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);
 
 -- MENU: add to site menu
 

+ 13 - 4
template/scripts/BxBaseSearchResult.php

@@ -83,6 +83,8 @@ class BxBaseSearchResult extends BxDolSearchResult
             return '<div class="bx-page-block-container bx-search-results bx-def-padding-topbottom bx-clearfix" id="bx-page-block-' . $this->id . '">' . $sCode . '</div>';
         }
 
+        $this->addPageRssLink ();
+
         return array(        	
         	'content' => $sContent,
         	'menu' => $sMenu,
@@ -96,13 +98,20 @@ class BxBaseSearchResult extends BxDolSearchResult
     }
 
     function getDesignBoxMenu ()
+    {
+        return array();
+    }
+
+    protected function addPageRssLink ()
     {
         if (false === ($sLink = $this->getRssPageUrl ()))
-            return false;
+            return;
 
-        return array(
-            array('name' => 'rss', 'title' => _t('_sys_menu_title_rss'), 'link' => $sLink, 'icon' => 'rss')
-        );
+        bx_import('BxDolTemplate');
+        if (!($oTemplate = BxDolTemplate::getInstance()))
+            return;
+
+        $oTemplate->addPageRssLink($this->aCurrent['title'], $sLink);
     }
 
     function getRssPageUrl ()