Przeglądaj źródła

Ticket #2252 - Usage in Files, Photos and Videos.

AntonLV 7 lat temu
rodzic
commit
b1a2ce567c

+ 1 - 0
modules/boonex/files/classes/BxFilesConfig.php

@@ -63,6 +63,7 @@ class BxFilesConfig extends BxBaseModTextConfig
 
             'URL_HOME' => 'page.php?i=files-home',
             'URL_POPULAR' => 'page.php?i=files-popular',
+            'URL_TOP' => 'page.php?i=files-top',
             'URL_UPDATED' => 'page.php?i=files-updated',
             'URL_MANAGE_COMMON' => 'page.php?i=files-manage',
             'URL_MANAGE_ADMINISTRATION' => 'page.php?i=files-administration',

+ 10 - 23
modules/boonex/files/classes/BxFilesSearchResult.php

@@ -25,9 +25,9 @@ class BxFilesSearchResult extends BxBaseModTextSearchResult
             'searchFields' => array(),
             'restriction' => array(
                 'author' => array('value' => '', 'field' => 'author', 'operator' => '='),
-        		'featured' => array('value' => '', 'field' => 'featured', 'operator' => '<>'),
-        		'status' => array('value' => 'active', 'field' => 'status', 'operator' => '='),
-        		'statusAdmin' => array('value' => 'active', 'field' => 'status_admin', 'operator' => '='),
+                'featured' => array('value' => '', 'field' => 'featured', 'operator' => '<>'),
+                'status' => array('value' => 'active', 'field' => 'status', 'operator' => '='),
+                'statusAdmin' => array('value' => 'active', 'field' => 'status_admin', 'operator' => '='),
             ),
             'paginate' => array('perPage' => getParam('bx_files_per_page_browse'), 'start' => 0),
             'sorting' => 'last',
@@ -96,6 +96,13 @@ class BxFilesSearchResult extends BxBaseModTextSearchResult
                 $this->aCurrent['sorting'] = 'popular';
                 break;
 
+            case 'top':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_TOP']);
+                $this->aCurrent['title'] = _t('_bx_files_page_title_browse_top');
+                $this->aCurrent['rss']['link'] = 'modules/?r=files/rss/' . $sMode;
+                $this->aCurrent['sorting'] = 'top';
+                break;
+
             case 'updated':
                 $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_UPDATED']);
                 $this->aCurrent['title'] = _t('_bx_files_page_title_browse_updated');
@@ -119,26 +126,6 @@ class BxFilesSearchResult extends BxBaseModTextSearchResult
         if ('group_author' != $sMode)
             $this->addConditionsForPrivateContent($CNF, $oProfileAuthor);
     }
-
-    function getAlterOrder()
-    {
-        $aSql = array();
-        switch ($this->aCurrent['sorting']) {
-            case 'last':
-                $aSql['order'] = ' ORDER BY `bx_files_main`.`added` DESC';
-                break;
-            case 'featured':
-                $aSql['order'] = ' ORDER BY `bx_files_main`.`featured` DESC';
-                break;
-            case 'updated':
-                $aSql['order'] = ' ORDER BY `bx_files_main`.`changed` DESC';
-                break;
-            case 'popular':
-                $aSql['order'] = ' ORDER BY `bx_files_main`.`views` DESC';
-                break;
-        }
-        return $aSql;
-    }
 }
 
 /** @} */

+ 6 - 0
modules/boonex/files/install/langs/en.xml

@@ -76,6 +76,7 @@
 	<string name="_bx_files_page_title_browse_featured"><![CDATA[Featured Files]]></string>
     <string name="_bx_files_page_title_browse_recent"><![CDATA[Latest Files]]></string>
     <string name="_bx_files_page_title_browse_popular"><![CDATA[Popular Files]]></string>
+    <string name="_bx_files_page_title_browse_top"><![CDATA[Top Files]]></string>
     <string name="_bx_files_page_title_browse_updated"><![CDATA[Updated Files]]></string>
     <string name="_bx_files_page_title_sys_home"><![CDATA[Files Home]]></string>
     <string name="_bx_files_page_title_home"><![CDATA[Files]]></string>
@@ -94,10 +95,13 @@
     <string name="_bx_files_page_block_title_entry_all_actions"><![CDATA[All Actions]]></string>
     <string name="_bx_files_page_title_sys_entries_popular"><![CDATA[Popular Files]]></string>
     <string name="_bx_files_page_title_entries_popular"><![CDATA[Popular Files]]></string>
+    <string name="_bx_files_page_title_sys_entries_top"><![CDATA[Top Files]]></string>
+    <string name="_bx_files_page_title_entries_top"><![CDATA[Top Files]]></string>
     <string name="_bx_files_page_title_sys_entries_updated"><![CDATA[Updated Files]]></string>
     <string name="_bx_files_page_title_entries_updated"><![CDATA[Updated Files]]></string>
     <string name="_bx_files_page_block_title_popular_entries"><![CDATA[Popular Files]]></string>
     <string name="_bx_files_page_block_title_popular_entries_view_extended"><![CDATA[Popular Files (Extended View)]]></string>
+    <string name="_bx_files_page_block_title_top_entries"><![CDATA[Top Files]]></string>
     <string name="_bx_files_page_block_title_updated_entries"><![CDATA[Updated Files]]></string>
     <string name="_bx_files_page_title_sys_view_entry_comments"><![CDATA[File Comments]]></string>
     <string name="_bx_files_page_title_view_entry_comments"><![CDATA[Comments to {title}]]></string>
@@ -159,6 +163,8 @@
     <string name="_bx_files_menu_item_title_entries_manage"><![CDATA[Manage]]></string>
     <string name="_bx_files_menu_item_title_system_entries_popular"><![CDATA[Popular]]></string>
     <string name="_bx_files_menu_item_title_entries_popular"><![CDATA[Popular]]></string>
+    <string name="_bx_files_menu_item_title_system_entries_top"><![CDATA[Top]]></string>
+    <string name="_bx_files_menu_item_title_entries_top"><![CDATA[Top]]></string>
     <string name="_bx_files_menu_title_view_entry_submenu"><![CDATA[View File Submenu]]></string>
     <string name="_bx_files_menu_set_title_view_entry_submenu"><![CDATA[View File Submenu]]></string>
     <string name="_bx_files_menu_item_title_view_entry_submenu_entry"><![CDATA[File]]></string>

+ 1 - 1
modules/boonex/files/install/sql/disable.sql

@@ -8,7 +8,7 @@ DELETE FROM `sys_options_types` WHERE `id` = @iTypeId;
 
 -- PAGES
 DELETE FROM `sys_objects_page` WHERE `module` = 'bx_files';
-DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_files' OR `object` IN('bx_files_create_entry', 'bx_files_edit_entry', 'bx_files_delete_entry', 'bx_files_view_entry', 'bx_files_view_entry_comments', 'bx_files_home', 'bx_files_popular', 'bx_files_context', 'bx_files_updated', 'bx_files_author', 'bx_files_group', 'bx_files_search', 'bx_files_manage');
+DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_files' OR `object` IN('bx_files_create_entry', 'bx_files_edit_entry', 'bx_files_delete_entry', 'bx_files_view_entry', 'bx_files_view_entry_comments', 'bx_files_home', 'bx_files_popular', 'bx_files_top', 'bx_files_context', 'bx_files_updated', 'bx_files_author', 'bx_files_group', 'bx_files_search', 'bx_files_manage');
 
 -- MENU
 DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_files';

+ 12 - 2
modules/boonex/files/install/sql/enable.sql

@@ -83,6 +83,15 @@ INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbo
 ('bx_files_popular', 1, 'bx_files', '_bx_files_page_block_title_popular_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_files";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: top entries
+
+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_files_top', '_bx_files_page_title_sys_entries_top', '_bx_files_page_title_entries_top', 'bx_files', 5, 2147483647, 1, 'files-top', 'page.php?i=files-top', '', '', '', 0, 1, 0, 'BxFilesPageBrowse', 'modules/boonex/files/classes/BxFilesPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_files_top', 1, 'bx_files', '_bx_files_page_block_title_top_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_files";s:6:"method";s:10:"browse_top";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: recently updated entries
 
 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 
@@ -261,8 +270,9 @@ INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
 ('bx_files_submenu', 'bx_files', 'files-home', '_bx_files_menu_item_title_system_entries_public', '_bx_files_menu_item_title_entries_public', 'page.php?i=files-home', '', '', '', '', 2147483647, 1, 1, 1),
 ('bx_files_submenu', 'bx_files', 'files-popular', '_bx_files_menu_item_title_system_entries_popular', '_bx_files_menu_item_title_entries_popular', 'page.php?i=files-popular', '', '', '', '', 2147483647, 1, 1, 2),
-('bx_files_submenu', 'bx_files', 'files-search', '_bx_files_menu_item_title_system_entries_search', '_bx_files_menu_item_title_entries_search', 'page.php?i=files-search', '', '', '', '', 2147483647, 1, 1, 3),
-('bx_files_submenu', 'bx_files', 'files-manage', '_bx_files_menu_item_title_system_entries_manage', '_bx_files_menu_item_title_entries_manage', 'page.php?i=files-manage', '', '', '', '', 2147483646, 1, 1, 4);
+('bx_files_submenu', 'bx_files', 'files-top', '_bx_files_menu_item_title_system_entries_top', '_bx_files_menu_item_title_entries_top', 'page.php?i=files-top', '', '', '', '', 2147483647, 1, 1, 3),
+('bx_files_submenu', 'bx_files', 'files-search', '_bx_files_menu_item_title_system_entries_search', '_bx_files_menu_item_title_entries_search', 'page.php?i=files-search', '', '', '', '', 2147483647, 1, 1, 4),
+('bx_files_submenu', 'bx_files', 'files-manage', '_bx_files_menu_item_title_system_entries_manage', '_bx_files_menu_item_title_entries_manage', 'page.php?i=files-manage', '', '', '', '', 2147483646, 1, 1, 5);
 
 -- MENU: sub-menu for view entry
 

+ 1 - 0
modules/boonex/photos/classes/BxPhotosConfig.php

@@ -65,6 +65,7 @@ class BxPhotosConfig extends BxBaseModTextConfig
 
             'URL_HOME' => 'page.php?i=photos-home',
             'URL_POPULAR' => 'page.php?i=photos-popular',
+            'URL_TOP' => 'page.php?i=photos-top',
             'URL_UPDATED' => 'page.php?i=photos-updated',
             'URL_MANAGE_COMMON' => 'page.php?i=photos-manage',
             'URL_MANAGE_ADMINISTRATION' => 'page.php?i=photos-administration',

+ 10 - 23
modules/boonex/photos/classes/BxPhotosSearchResult.php

@@ -28,9 +28,9 @@ class BxPhotosSearchResult extends BxBaseModTextSearchResult
             'searchFields' => array(),
             'restriction' => array(
                 'author' => array('value' => '', 'field' => 'author', 'operator' => '='),
-        		'featured' => array('value' => '', 'field' => 'featured', 'operator' => '<>'),
-        		'status' => array('value' => 'active', 'field' => 'status', 'operator' => '='),
-        		'statusAdmin' => array('value' => 'active', 'field' => 'status_admin', 'operator' => '='),
+                'featured' => array('value' => '', 'field' => 'featured', 'operator' => '<>'),
+                'status' => array('value' => 'active', 'field' => 'status', 'operator' => '='),
+                'statusAdmin' => array('value' => 'active', 'field' => 'status_admin', 'operator' => '='),
             ),
             'paginate' => array('perPage' => getParam('bx_photos_per_page_browse'), 'start' => 0),
             'sorting' => 'last',
@@ -104,6 +104,13 @@ class BxPhotosSearchResult extends BxBaseModTextSearchResult
                 $this->aCurrent['sorting'] = 'popular';
                 break;
 
+            case 'top':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_TOP']);
+                $this->aCurrent['title'] = _t('_bx_photos_page_title_browse_top');
+                $this->aCurrent['rss']['link'] = 'modules/?r=photos/rss/' . $sMode;
+                $this->aCurrent['sorting'] = 'top';
+                break;
+
             case 'updated':
                 $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_UPDATED']);
                 $this->aCurrent['title'] = _t('_bx_photos_page_title_browse_updated');
@@ -141,26 +148,6 @@ class BxPhotosSearchResult extends BxBaseModTextSearchResult
 
         return $aResult;
     }
-
-    function getAlterOrder()
-    {
-        $aSql = array();
-        switch ($this->aCurrent['sorting']) {
-            case 'last':
-                $aSql['order'] = ' ORDER BY `bx_photos_entries`.`added` DESC';
-                break;
-            case 'featured':
-                $aSql['order'] = ' ORDER BY `bx_photos_entries`.`featured` DESC';
-                break;
-            case 'updated':
-                $aSql['order'] = ' ORDER BY `bx_photos_entries`.`changed` DESC';
-                break;
-            case 'popular':
-                $aSql['order'] = ' ORDER BY `bx_photos_entries`.`views` DESC';
-                break;
-        }
-        return $aSql;
-    }
 }
 
 /** @} */

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

@@ -80,6 +80,7 @@
 	<string name="_bx_photos_page_title_browse_featured"><![CDATA[Featured Photos]]></string>
     <string name="_bx_photos_page_title_browse_recent"><![CDATA[Latest Photos]]></string>
     <string name="_bx_photos_page_title_browse_popular"><![CDATA[Popular Photos]]></string>
+    <string name="_bx_photos_page_title_browse_top"><![CDATA[Top Photos]]></string>
     <string name="_bx_photos_page_title_browse_updated"><![CDATA[Updated Photos]]></string>
     <string name="_bx_photos_page_title_sys_home"><![CDATA[Photos Home]]></string>
     <string name="_bx_photos_page_title_home"><![CDATA[Photos]]></string>
@@ -100,6 +101,8 @@
     <string name="_bx_photos_page_block_title_entry_rating"><![CDATA[Rating]]></string>
     <string name="_bx_photos_page_title_sys_entries_popular"><![CDATA[Popular Photos]]></string>
     <string name="_bx_photos_page_title_entries_popular"><![CDATA[Popular Photos]]></string>
+    <string name="_bx_photos_page_title_sys_entries_top"><![CDATA[Top Photos]]></string>
+    <string name="_bx_photos_page_title_entries_top"><![CDATA[Top Photos]]></string>
     <string name="_bx_photos_page_title_sys_entries_updated"><![CDATA[Updated Photos]]></string>
     <string name="_bx_photos_page_title_entries_updated"><![CDATA[Updated Photos]]></string>
     <string name="_bx_photos_page_title_sys_entries_search"><![CDATA[Search]]></string>
@@ -111,6 +114,7 @@
     <string name="_bx_photos_page_block_title_popular_entries"><![CDATA[Popular Photos]]></string>
     <string name="_bx_photos_page_block_title_popular_entries_view_extended"><![CDATA[Popular Photos (Extended View)]]></string>
     <string name="_bx_photos_page_block_title_popular_entries_view_full"><![CDATA[Popular Photos (Full View)]]></string>
+    <string name="_bx_photos_page_block_title_top_entries"><![CDATA[Top Photos]]></string>
     <string name="_bx_photos_page_block_title_updated_entries"><![CDATA[Updated Photos]]></string>
     <string name="_bx_photos_page_title_sys_view_entry_comments"><![CDATA[Photo Comments]]></string>
     <string name="_bx_photos_page_title_view_entry_comments"><![CDATA[Comments to {title}]]></string>
@@ -164,6 +168,8 @@
     <string name="_bx_photos_menu_item_title_entries_manage"><![CDATA[Manage]]></string>
     <string name="_bx_photos_menu_item_title_system_entries_popular"><![CDATA[Popular]]></string>
     <string name="_bx_photos_menu_item_title_entries_popular"><![CDATA[Popular]]></string>
+    <string name="_bx_photos_menu_item_title_system_entries_top"><![CDATA[Top]]></string>
+    <string name="_bx_photos_menu_item_title_entries_top"><![CDATA[Top]]></string>
     <string name="_bx_photos_menu_item_title_system_entries_search"><![CDATA[Search]]></string>
     <string name="_bx_photos_menu_item_title_entries_search"><![CDATA[Search]]></string>
     <string name="_bx_photos_menu_title_view_entry_submenu"><![CDATA[View Photo Submenu]]></string>

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

@@ -9,7 +9,7 @@ DELETE FROM `sys_options_types` WHERE `id` = @iTypeId;
 
 -- PAGES
 DELETE FROM `sys_objects_page` WHERE `module` = 'bx_photos';
-DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_photos' OR `object` IN('bx_photos_create_entry', 'bx_photos_edit_entry', 'bx_photos_delete_entry', 'bx_photos_view_entry', 'bx_photos_view_entry_brief', 'bx_photos_view_entry_comments', 'bx_photos_home', 'bx_photos_popular', 'bx_photos_updated', 'bx_photos_author', 'bx_photos_context', 'bx_photos_search', 'bx_photos_manage');
+DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_photos' OR `object` IN('bx_photos_create_entry', 'bx_photos_edit_entry', 'bx_photos_delete_entry', 'bx_photos_view_entry', 'bx_photos_view_entry_brief', 'bx_photos_view_entry_comments', 'bx_photos_home', 'bx_photos_popular', 'bx_photos_top', 'bx_photos_updated', 'bx_photos_author', 'bx_photos_context', 'bx_photos_search', 'bx_photos_manage');
 
 
 -- MENU

+ 10 - 2
modules/boonex/photos/install/sql/enable.sql

@@ -83,6 +83,13 @@ INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `lay
 INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
 ('bx_photos_popular', 1, 'bx_photos', '_bx_photos_page_block_title_popular_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_photos";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: top entries
+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_photos_top', '_bx_photos_page_title_sys_entries_top', '_bx_photos_page_title_entries_top', 'bx_photos', 5, 2147483647, 1, 'photos-top', 'page.php?i=photos-top', '', '', '', 0, 1, 0, 'BxPhotosPageBrowse', 'modules/boonex/photos/classes/BxPhotosPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_photos_top', 1, 'bx_photos', '_bx_photos_page_block_title_top_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_photos";s:6:"method";s:10:"browse_top";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: recently updated entries
 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_photos_updated', '_bx_photos_page_title_sys_entries_updated', '_bx_photos_page_title_entries_updated', 'bx_photos', 5, 2147483647, 1, 'photos-updated', 'page.php?i=photos-updated', '', '', '', 0, 1, 0, 'BxPhotosPageBrowse', 'modules/boonex/photos/classes/BxPhotosPageBrowse.php');
@@ -235,8 +242,9 @@ INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
 ('bx_photos_submenu', 'bx_photos', 'photos-home', '_bx_photos_menu_item_title_system_entries_public', '_bx_photos_menu_item_title_entries_public', 'page.php?i=photos-home', '', '', '', '', 2147483647, 1, 1, 1),
 ('bx_photos_submenu', 'bx_photos', 'photos-popular', '_bx_photos_menu_item_title_system_entries_popular', '_bx_photos_menu_item_title_entries_popular', 'page.php?i=photos-popular', '', '', '', '', 2147483647, 1, 1, 2),
-('bx_photos_submenu', 'bx_photos', 'photos-search', '_bx_photos_menu_item_title_system_entries_search', '_bx_photos_menu_item_title_entries_search', 'page.php?i=photos-search', '', '', '', '', 2147483647, 1, 1, 3),
-('bx_photos_submenu', 'bx_photos', 'photos-manage', '_bx_photos_menu_item_title_system_entries_manage', '_bx_photos_menu_item_title_entries_manage', 'page.php?i=photos-manage', '', '', '', '', 2147483646, 1, 1, 4);
+('bx_photos_submenu', 'bx_photos', 'photos-top', '_bx_photos_menu_item_title_system_entries_top', '_bx_photos_menu_item_title_entries_top', 'page.php?i=photos-top', '', '', '', '', 2147483647, 1, 1, 3),
+('bx_photos_submenu', 'bx_photos', 'photos-search', '_bx_photos_menu_item_title_system_entries_search', '_bx_photos_menu_item_title_entries_search', 'page.php?i=photos-search', '', '', '', '', 2147483647, 1, 1, 4),
+('bx_photos_submenu', 'bx_photos', 'photos-manage', '_bx_photos_menu_item_title_system_entries_manage', '_bx_photos_menu_item_title_entries_manage', 'page.php?i=photos-manage', '', '', '', '', 2147483646, 1, 1, 5);
 
 -- MENU: sub-menu for view entry
 INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 

+ 6 - 0
modules/boonex/russian/data/langs/bx_files/ru.xml

@@ -75,6 +75,7 @@
 	<string name="_bx_files_page_title_browse_featured"><![CDATA[Продвинутые файлы]]></string>
     <string name="_bx_files_page_title_browse_recent"><![CDATA[Последние файлы]]></string>
     <string name="_bx_files_page_title_browse_popular"><![CDATA[Популярные файлы]]></string>
+    <string name="_bx_files_page_title_browse_top"><![CDATA[Топ файлов]]></string>
     <string name="_bx_files_page_title_browse_updated"><![CDATA[Обновлённые файлы]]></string>
     <string name="_bx_files_page_title_sys_home"><![CDATA[Главная страница]]></string>
     <string name="_bx_files_page_title_home"><![CDATA[Файлы]]></string>
@@ -93,10 +94,13 @@
     <string name="_bx_files_page_block_title_entry_all_actions"><![CDATA[Все действия]]></string>
     <string name="_bx_files_page_title_sys_entries_popular"><![CDATA[Популярные файлы]]></string>
     <string name="_bx_files_page_title_entries_popular"><![CDATA[Популярные файлы]]></string>
+    <string name="_bx_files_page_title_sys_entries_top"><![CDATA[Топ файлов]]></string>
+    <string name="_bx_files_page_title_entries_top"><![CDATA[Топ файлов]]></string>
     <string name="_bx_files_page_title_sys_entries_updated"><![CDATA[Обновлённые файлы]]></string>
     <string name="_bx_files_page_title_entries_updated"><![CDATA[Обновлённые файлы]]></string>
     <string name="_bx_files_page_block_title_popular_entries"><![CDATA[Популярные файлы]]></string>
     <string name="_bx_files_page_block_title_popular_entries_view_extended"><![CDATA[Популярные файлы (расширенный вид)]]></string>
+    <string name="_bx_files_page_block_title_top_entries"><![CDATA[Топ файлов]]></string>
     <string name="_bx_files_page_block_title_updated_entries"><![CDATA[Обновлённые файлы]]></string>
     <string name="_bx_files_page_title_sys_view_entry_comments"><![CDATA[Комментарии к файлу]]></string>
     <string name="_bx_files_page_title_view_entry_comments"><![CDATA[Комментарии к {title}]]></string>
@@ -158,6 +162,8 @@
     <string name="_bx_files_menu_item_title_entries_manage"><![CDATA[Управление]]></string>
     <string name="_bx_files_menu_item_title_system_entries_popular"><![CDATA[Популярные]]></string>
     <string name="_bx_files_menu_item_title_entries_popular"><![CDATA[Популярные]]></string>
+    <string name="_bx_files_menu_item_title_system_entries_top"><![CDATA[Топ]]></string>
+    <string name="_bx_files_menu_item_title_entries_top"><![CDATA[Топ]]></string>
     <string name="_bx_files_menu_title_view_entry_submenu"><![CDATA[Подменю просмотра файла]]></string>
     <string name="_bx_files_menu_set_title_view_entry_submenu"><![CDATA[Подменю просмотра файла]]></string>
     <string name="_bx_files_menu_item_title_view_entry_submenu_entry"><![CDATA[Файл]]></string>

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

@@ -81,6 +81,7 @@
 	<string name="_bx_photos_page_title_browse_featured"><![CDATA[Продвинутые фото]]></string>
     <string name="_bx_photos_page_title_browse_recent"><![CDATA[Недавние фото]]></string>
     <string name="_bx_photos_page_title_browse_popular"><![CDATA[Популярные фото]]></string>
+    <string name="_bx_photos_page_title_browse_top"><![CDATA[Топ фото]]></string>
     <string name="_bx_photos_page_title_browse_updated"><![CDATA[Обновлённые фото]]></string>
     <string name="_bx_photos_page_title_sys_home"><![CDATA[Фото - Домой]]></string>
     <string name="_bx_photos_page_title_home"><![CDATA[Фото]]></string>
@@ -101,6 +102,8 @@
     <string name="_bx_photos_page_block_title_entry_rating"><![CDATA[Рейтинг]]></string>
     <string name="_bx_photos_page_title_sys_entries_popular"><![CDATA[Популярные фото]]></string>
     <string name="_bx_photos_page_title_entries_popular"><![CDATA[Популярные фото]]></string>
+    <string name="_bx_photos_page_title_sys_entries_top"><![CDATA[Топ фото]]></string>
+    <string name="_bx_photos_page_title_entries_top"><![CDATA[Топ фото]]></string>
     <string name="_bx_photos_page_title_sys_entries_updated"><![CDATA[Обновленные фото]]></string>
     <string name="_bx_photos_page_title_entries_updated"><![CDATA[Обновленные фото]]></string>
     <string name="_bx_photos_page_title_sys_entries_search"><![CDATA[Поиск]]></string>
@@ -112,6 +115,7 @@
     <string name="_bx_photos_page_block_title_popular_entries"><![CDATA[Популярные фото]]></string>
     <string name="_bx_photos_page_block_title_popular_entries_view_extended"><![CDATA[Популярные фото (Расширенный просмотр)]]></string>
     <string name="_bx_photos_page_block_title_popular_entries_view_full"><![CDATA[Популярные фото (Полный просмотр)]]></string>
+    <string name="_bx_photos_page_block_title_top_entries"><![CDATA[Топ фото]]></string>
     <string name="_bx_photos_page_block_title_updated_entries"><![CDATA[Обновленные фото]]></string>
     <string name="_bx_photos_page_title_sys_view_entry_comments"><![CDATA[Комментарии к фото]]></string>
     <string name="_bx_photos_page_title_view_entry_comments"><![CDATA[Комментарии к {title}]]></string>
@@ -166,6 +170,8 @@
     <string name="_bx_photos_menu_item_title_entries_manage"><![CDATA[Управление]]></string>
     <string name="_bx_photos_menu_item_title_system_entries_popular"><![CDATA[Популярные]]></string>
     <string name="_bx_photos_menu_item_title_entries_popular"><![CDATA[Популярные]]></string>
+    <string name="_bx_photos_menu_item_title_system_entries_top"><![CDATA[Топ]]></string>
+    <string name="_bx_photos_menu_item_title_entries_top"><![CDATA[Топ]]></string>
     <string name="_bx_photos_menu_item_title_system_entries_search"><![CDATA[Поиск]]></string>
     <string name="_bx_photos_menu_item_title_entries_search"><![CDATA[Поиск]]></string>
     <string name="_bx_photos_menu_title_view_entry_submenu"><![CDATA[Просмотреть фото - Подменю]]></string>

+ 6 - 0
modules/boonex/russian/data/langs/bx_videos/ru.xml

@@ -77,6 +77,7 @@
 	<string name="_bx_videos_page_title_browse_featured"><![CDATA[Продвинутые видео]]></string>
     <string name="_bx_videos_page_title_browse_recent"><![CDATA[Недавние видео]]></string>
     <string name="_bx_videos_page_title_browse_popular"><![CDATA[Популярные видео]]></string>
+    <string name="_bx_videos_page_title_browse_top"><![CDATA[Топ видео]]></string>
     <string name="_bx_videos_page_title_browse_updated"><![CDATA[Обновлённые видео]]></string>
     <string name="_bx_videos_page_title_sys_home"><![CDATA[Видео - Домой]]></string>
     <string name="_bx_videos_page_title_home"><![CDATA[Видео]]></string>
@@ -97,6 +98,8 @@
     <string name="_bx_videos_page_block_title_entry_rating"><![CDATA[Рейтинг]]></string>
     <string name="_bx_videos_page_title_sys_entries_popular"><![CDATA[Популярные видео]]></string>
     <string name="_bx_videos_page_title_entries_popular"><![CDATA[Популярные видео]]></string>
+    <string name="_bx_videos_page_title_sys_entries_top"><![CDATA[Топ видео]]></string>
+    <string name="_bx_videos_page_title_entries_top"><![CDATA[Топ видео]]></string>
     <string name="_bx_videos_page_title_sys_entries_updated"><![CDATA[Обновленные видео]]></string>
     <string name="_bx_videos_page_title_entries_updated"><![CDATA[Обновленные видео]]></string>
     <string name="_bx_videos_page_title_sys_entries_search"><![CDATA[Поиск]]></string>
@@ -108,6 +111,7 @@
     <string name="_bx_videos_page_block_title_popular_entries"><![CDATA[Популярные видео]]></string>
     <string name="_bx_videos_page_block_title_popular_entries_view_extended"><![CDATA[Популярные видео (Расширенный просмотр)]]></string>
     <string name="_bx_videos_page_block_title_popular_entries_view_full"><![CDATA[Популярные видео (Полный просмотр)]]></string>
+    <string name="_bx_videos_page_block_title_top_entries"><![CDATA[Топ видео]]></string>
     <string name="_bx_videos_page_block_title_updated_entries"><![CDATA[Обновленные видео]]></string>
     <string name="_bx_videos_page_title_sys_view_entry_comments"><![CDATA[Комментарии к видео]]></string>
     <string name="_bx_videos_page_title_view_entry_comments"><![CDATA[Комментарии к {title}]]></string>
@@ -161,6 +165,8 @@
     <string name="_bx_videos_menu_item_title_entries_manage"><![CDATA[Управление]]></string>
     <string name="_bx_videos_menu_item_title_system_entries_popular"><![CDATA[Популярные]]></string>
     <string name="_bx_videos_menu_item_title_entries_popular"><![CDATA[Популярные]]></string>
+    <string name="_bx_videos_menu_item_title_system_entries_top"><![CDATA[Топ]]></string>
+    <string name="_bx_videos_menu_item_title_entries_top"><![CDATA[Топ]]></string>
     <string name="_bx_videos_menu_item_title_system_entries_search"><![CDATA[Поиск]]></string>
     <string name="_bx_videos_menu_item_title_entries_search"><![CDATA[Поиск]]></string>
     <string name="_bx_videos_menu_title_view_entry_submenu"><![CDATA[Просмотреть видео - Подменю]]></string>

+ 1 - 0
modules/boonex/videos/classes/BxVideosConfig.php

@@ -68,6 +68,7 @@ class BxVideosConfig extends BxBaseModTextConfig
 
             'URL_HOME' => 'page.php?i=videos-home',
             'URL_POPULAR' => 'page.php?i=videos-popular',
+            'URL_TOP' => 'page.php?i=videos-top',
             'URL_UPDATED' => 'page.php?i=videos-updated',
             'URL_MANAGE_COMMON' => 'page.php?i=videos-manage',
             'URL_MANAGE_ADMINISTRATION' => 'page.php?i=videos-administration',

+ 10 - 23
modules/boonex/videos/classes/BxVideosSearchResult.php

@@ -25,9 +25,9 @@ class BxVideosSearchResult extends BxBaseModTextSearchResult
             'searchFields' => array(),
             'restriction' => array(
                 'author' => array('value' => '', 'field' => 'author', 'operator' => '='),
-        		'featured' => array('value' => '', 'field' => 'featured', 'operator' => '<>'),
-        		'status' => array('value' => 'active', 'field' => 'status', 'operator' => '='),
-        		'statusAdmin' => array('value' => 'active', 'field' => 'status_admin', 'operator' => '='),
+                'featured' => array('value' => '', 'field' => 'featured', 'operator' => '<>'),
+                'status' => array('value' => 'active', 'field' => 'status', 'operator' => '='),
+                'statusAdmin' => array('value' => 'active', 'field' => 'status_admin', 'operator' => '='),
             ),
             'paginate' => array('perPage' => getParam('bx_videos_per_page_browse'), 'start' => 0),
             'sorting' => 'last',
@@ -95,6 +95,13 @@ class BxVideosSearchResult extends BxBaseModTextSearchResult
                 $this->aCurrent['sorting'] = 'popular';
                 break;
 
+            case 'top':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_TOP']);
+                $this->aCurrent['title'] = _t('_bx_videos_page_title_browse_top');
+                $this->aCurrent['rss']['link'] = 'modules/?r=videos/rss/' . $sMode;
+                $this->aCurrent['sorting'] = 'top';
+                break;
+
             case 'updated':
                 $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_UPDATED']);
                 $this->aCurrent['title'] = _t('_bx_videos_page_title_browse_updated');
@@ -117,26 +124,6 @@ class BxVideosSearchResult extends BxBaseModTextSearchResult
 
         $this->addConditionsForPrivateContent($CNF, $oProfileAuthor);
     }
-
-    function getAlterOrder()
-    {
-        $aSql = array();
-        switch ($this->aCurrent['sorting']) {
-            case 'last':
-                $aSql['order'] = ' ORDER BY `bx_videos_entries`.`added` DESC';
-                break;
-            case 'featured':
-                $aSql['order'] = ' ORDER BY `bx_videos_entries`.`featured` DESC';
-                break;
-            case 'updated':
-                $aSql['order'] = ' ORDER BY `bx_videos_entries`.`changed` DESC';
-                break;
-            case 'popular':
-                $aSql['order'] = ' ORDER BY `bx_videos_entries`.`views` DESC';
-                break;
-        }
-        return $aSql;
-    }
 }
 
 /** @} */

+ 6 - 0
modules/boonex/videos/install/langs/en.xml

@@ -77,6 +77,7 @@
 	<string name="_bx_videos_page_title_browse_featured"><![CDATA[Featured Videos]]></string>
     <string name="_bx_videos_page_title_browse_recent"><![CDATA[Latest Videos]]></string>
     <string name="_bx_videos_page_title_browse_popular"><![CDATA[Popular Videos]]></string>
+    <string name="_bx_videos_page_title_browse_top"><![CDATA[Top Videos]]></string>
     <string name="_bx_videos_page_title_browse_updated"><![CDATA[Updated Videos]]></string>
     <string name="_bx_videos_page_title_sys_home"><![CDATA[Videos Home]]></string>
     <string name="_bx_videos_page_title_home"><![CDATA[Videos]]></string>
@@ -97,6 +98,8 @@
     <string name="_bx_videos_page_block_title_entry_rating"><![CDATA[Rating]]></string>
     <string name="_bx_videos_page_title_sys_entries_popular"><![CDATA[Popular Videos]]></string>
     <string name="_bx_videos_page_title_entries_popular"><![CDATA[Popular Videos]]></string>
+    <string name="_bx_videos_page_title_sys_entries_top"><![CDATA[Top Videos]]></string>
+    <string name="_bx_videos_page_title_entries_top"><![CDATA[Top Videos]]></string>
     <string name="_bx_videos_page_title_sys_entries_updated"><![CDATA[Updated Videos]]></string>
     <string name="_bx_videos_page_title_entries_updated"><![CDATA[Updated Videos]]></string>
     <string name="_bx_videos_page_title_sys_entries_search"><![CDATA[Search]]></string>
@@ -108,6 +111,7 @@
     <string name="_bx_videos_page_block_title_popular_entries"><![CDATA[Popular Videos]]></string>
     <string name="_bx_videos_page_block_title_popular_entries_view_extended"><![CDATA[Popular Videos (Extended View)]]></string>
     <string name="_bx_videos_page_block_title_popular_entries_view_full"><![CDATA[Popular Videos (Full View)]]></string>
+    <string name="_bx_videos_page_block_title_top_entries"><![CDATA[Top Videos]]></string>
     <string name="_bx_videos_page_block_title_updated_entries"><![CDATA[Updated Videos]]></string>
     <string name="_bx_videos_page_title_sys_view_entry_comments"><![CDATA[Video Comments]]></string>
     <string name="_bx_videos_page_title_view_entry_comments"><![CDATA[Comments to {title}]]></string>
@@ -161,6 +165,8 @@
     <string name="_bx_videos_menu_item_title_entries_manage"><![CDATA[Manage]]></string>
     <string name="_bx_videos_menu_item_title_system_entries_popular"><![CDATA[Popular]]></string>
     <string name="_bx_videos_menu_item_title_entries_popular"><![CDATA[Popular]]></string>
+    <string name="_bx_videos_menu_item_title_system_entries_top"><![CDATA[Top]]></string>
+    <string name="_bx_videos_menu_item_title_entries_top"><![CDATA[Top]]></string>
     <string name="_bx_videos_menu_item_title_system_entries_search"><![CDATA[Search]]></string>
     <string name="_bx_videos_menu_item_title_entries_search"><![CDATA[Search]]></string>
     <string name="_bx_videos_menu_title_view_entry_submenu"><![CDATA[View Video Submenu]]></string>

+ 1 - 1
modules/boonex/videos/install/sql/disable.sql

@@ -9,7 +9,7 @@ DELETE FROM `sys_options_types` WHERE `id` = @iTypeId;
 
 -- PAGES
 DELETE FROM `sys_objects_page` WHERE `module` = 'bx_videos';
-DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_videos' OR `object` IN('bx_videos_create_entry', 'bx_videos_edit_entry', 'bx_videos_delete_entry', 'bx_videos_view_entry', 'bx_videos_view_entry_comments', 'bx_videos_home', 'bx_videos_popular', 'bx_videos_updated', 'bx_videos_author', 'bx_videos_context', 'bx_videos_search', 'bx_videos_manage');
+DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_videos' OR `object` IN('bx_videos_create_entry', 'bx_videos_edit_entry', 'bx_videos_delete_entry', 'bx_videos_view_entry', 'bx_videos_view_entry_comments', 'bx_videos_home', 'bx_videos_popular', 'bx_videos_top', 'bx_videos_updated', 'bx_videos_author', 'bx_videos_context', 'bx_videos_search', 'bx_videos_manage');
 
 
 -- MENU

+ 10 - 2
modules/boonex/videos/install/sql/enable.sql

@@ -73,6 +73,13 @@ INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `lay
 INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
 ('bx_videos_popular', 1, 'bx_videos', '_bx_videos_page_block_title_popular_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_videos";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: top entries
+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_videos_top', '_bx_videos_page_title_sys_entries_top', '_bx_videos_page_title_entries_top', 'bx_videos', 5, 2147483647, 1, 'videos-top', 'page.php?i=videos-top', '', '', '', 0, 1, 0, 'BxVideosPageBrowse', 'modules/boonex/videos/classes/BxVideosPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_videos_top', 1, 'bx_videos', '_bx_videos_page_block_title_top_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_videos";s:6:"method";s:10:"browse_top";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: recently updated entries
 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_videos_updated', '_bx_videos_page_title_sys_entries_updated', '_bx_videos_page_title_entries_updated', 'bx_videos', 5, 2147483647, 1, 'videos-updated', 'page.php?i=videos-updated', '', '', '', 0, 1, 0, 'BxVideosPageBrowse', 'modules/boonex/videos/classes/BxVideosPageBrowse.php');
@@ -225,8 +232,9 @@ INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
 ('bx_videos_submenu', 'bx_videos', 'videos-home', '_bx_videos_menu_item_title_system_entries_public', '_bx_videos_menu_item_title_entries_public', 'page.php?i=videos-home', '', '', '', '', 2147483647, 1, 1, 1),
 ('bx_videos_submenu', 'bx_videos', 'videos-popular', '_bx_videos_menu_item_title_system_entries_popular', '_bx_videos_menu_item_title_entries_popular', 'page.php?i=videos-popular', '', '', '', '', 2147483647, 1, 1, 2),
-('bx_videos_submenu', 'bx_videos', 'videos-search', '_bx_videos_menu_item_title_system_entries_search', '_bx_videos_menu_item_title_entries_search', 'page.php?i=videos-search', '', '', '', '', 2147483647, 1, 1, 3),
-('bx_videos_submenu', 'bx_videos', 'videos-manage', '_bx_videos_menu_item_title_system_entries_manage', '_bx_videos_menu_item_title_entries_manage', 'page.php?i=videos-manage', '', '', '', '', 2147483646, 1, 1, 4);
+('bx_videos_submenu', 'bx_videos', 'videos-top', '_bx_videos_menu_item_title_system_entries_top', '_bx_videos_menu_item_title_entries_top', 'page.php?i=videos-top', '', '', '', '', 2147483647, 1, 1, 3),
+('bx_videos_submenu', 'bx_videos', 'videos-search', '_bx_videos_menu_item_title_system_entries_search', '_bx_videos_menu_item_title_entries_search', 'page.php?i=videos-search', '', '', '', '', 2147483647, 1, 1, 4),
+('bx_videos_submenu', 'bx_videos', 'videos-manage', '_bx_videos_menu_item_title_system_entries_manage', '_bx_videos_menu_item_title_entries_manage', 'page.php?i=videos-manage', '', '', '', '', 2147483646, 1, 1, 5);
 
 -- MENU: sub-menu for view entry
 INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES