AntonLV 9 лет назад
Родитель
Сommit
5d93d3c16c

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

@@ -78,6 +78,7 @@ class BxFilesConfig extends BxBaseModTextConfig
             'OBJECT_VIEWS' => 'bx_files',
             'OBJECT_VOTES' => 'bx_files',
         	'OBJECT_FAVORITES' => 'bx_files',
+        	'OBJECT_FEATURED' => 'bx_files',
             'OBJECT_METATAGS' => 'bx_files',
             'OBJECT_COMMENTS' => 'bx_files',
             'OBJECT_PRIVACY_VIEW' => 'bx_files_allow_view_to',

+ 12 - 0
modules/boonex/files/classes/BxFilesSearchResult.php

@@ -25,6 +25,7 @@ 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' => '='),
             ),
             'paginate' => array('perPage' => getParam('bx_files_per_page_browse'), 'start' => 0),
@@ -75,6 +76,14 @@ class BxFilesSearchResult extends BxBaseModTextSearchResult
                 $this->aCurrent['rss']['link'] = 'modules/?r=files/rss/' . $sMode;
                 break;
 
+            case 'featured':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME']);
+                $this->aCurrent['title'] = _t('_bx_files_page_title_browse_featured');
+                $this->aCurrent['restriction']['featured']['value'] = '0';
+                $this->aCurrent['rss']['link'] = 'modules/?r=files/rss/' . $sMode;
+                $this->aCurrent['sorting'] = 'featured';
+                break;
+
             case 'popular':
                 $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_POPULAR']);
                 $this->aCurrent['title'] = _t('_bx_files_page_title_browse_popular');
@@ -114,6 +123,9 @@ class BxFilesSearchResult extends BxBaseModTextSearchResult
             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;

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

@@ -66,11 +66,13 @@
 	<string name="_bx_files_page_title_browse"><![CDATA[Files]]></string>
 	<string name="_bx_files_page_title_search_results"><![CDATA[Files matching "{0}"]]></string>
 	<string name="_bx_files_page_title_browse_by_author"><![CDATA[Files of {display_name}]]></string>
+	<string name="_bx_files_page_title_browse_featured"><![CDATA[Featured]]></string>
     <string name="_bx_files_page_title_browse_recent"><![CDATA[Latest]]></string>
     <string name="_bx_files_page_title_browse_popular"><![CDATA[Popular]]></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>
+    <string name="_bx_files_page_block_title_featured_entries_view_extended"><![CDATA[Featured]]></string>
     <string name="_bx_files_page_block_title_recent_entries"><![CDATA[Latest (Gallery View)]]></string>
     <string name="_bx_files_page_block_title_recent_entries_view_extended"><![CDATA[Latest]]></string>
     <string name="_bx_files_page_block_title_entry_social_sharing"><![CDATA[Share]]></string>

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

@@ -113,8 +113,9 @@ INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `t
 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 
 ('bx_files_home', 'files-home', '_bx_files_page_title_sys_home', '_bx_files_page_title_home', 'bx_files', 2, 2147483647, 1, 'page.php?i=files-home', '', '', '', 0, 1, 0, 'BxFilesPageBrowse', 'modules/boonex/files/classes/BxFilesPageBrowse.php');
 
-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_files_home', 1, 'bx_files', '', '_bx_files_page_block_title_recent_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_files";s:6:"method";s:13:"browse_public";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 1, 1, 0),
+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_files_home', 1, 'bx_files', '', '_bx_files_page_block_title_featured_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_files";s:6:"method";s:15:"browse_featured";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 1, 1, 0),
+('bx_files_home', 1, 'bx_files', '', '_bx_files_page_block_title_recent_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_files";s:6:"method";s:13:"browse_public";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 1, 1, 1),
 ('bx_files_home', 2, 'bx_files', '', '_bx_files_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_files\";i:1;s:8:\"bx_files\";}s:5:\"class\";s:20:\"TemplServiceMetatags\";}', 0, 1, 1, 0),
 ('bx_files_home', 2, 'bx_files', '', '_bx_files_page_block_title_cats', 11, 2147483647, 'service', 'a:4:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:15:\"categories_list\";s:6:\"params\";a:2:{i:0;s:13:\"bx_files_cats\";i:1;a:1:{s:10:\"show_empty\";b:1;}}s:5:\"class\";s:20:\"TemplServiceCategory\";}', 0, 1, 1, 1);
 

+ 6 - 0
modules/boonex/files/install/sql/install.sql

@@ -20,6 +20,7 @@ CREATE TABLE IF NOT EXISTS `bx_files_main` (
   `favorites` int(11) NOT NULL default '0',
   `comments` int(11) NOT NULL default '0',
   `reports` int(11) NOT NULL default '0',
+  `featured` int(11) NOT NULL default '0',
   `allow_view_to` varchar(16) NOT NULL DEFAULT '3',
   `status` enum('active','hidden') NOT NULL DEFAULT 'active',
   `status_admin` enum('active','hidden') NOT NULL DEFAULT 'active',
@@ -275,6 +276,11 @@ INSERT INTO `sys_objects_view` (`name`, `table_track`, `period`, `is_on`, `trigg
 INSERT INTO `sys_objects_favorite` (`name`, `table_track`, `is_on`, `is_undo`, `is_public`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
 ('bx_files', 'bx_files_favorites_track', '1', '1', '1', 'page.php?i=view-file&id={object_id}', 'bx_files_main', 'id', 'author', 'favorites', '', '');
 
+-- FEATURED
+
+INSERT INTO `sys_objects_feature` (`name`, `is_on`, `is_undo`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_flag`, `class_name`, `class_file`) VALUES 
+('bx_files', '1', '1', 'page.php?i=view-file&id={object_id}', 'bx_files_main', 'id', 'author', 'featured', '', '');
+
 -- STUDIO: page & widget
 
 INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES

+ 4 - 0
modules/boonex/files/install/sql/uninstall.sql

@@ -45,6 +45,10 @@ DELETE FROM `sys_objects_view` WHERE `name` = 'bx_files';
 
 DELETE FROM `sys_objects_favorite` WHERE `name` = 'bx_files';
 
+-- FEATURED
+
+DELETE FROM `sys_objects_feature` WHERE `name` = 'bx_files';
+
 -- STUDIO: page & widget
 
 DELETE FROM `tp`, `tw`, `tpw`

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

@@ -66,11 +66,13 @@
 	<string name="_bx_files_page_title_browse"><![CDATA[Файлы]]></string>
 	<string name="_bx_files_page_title_search_results"><![CDATA[Поиск по "{0}"]]></string>
 	<string name="_bx_files_page_title_browse_by_author"><![CDATA[{display_name} - файлы]]></string>
+	<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_updated"><![CDATA[Обновлённые]]></string>
     <string name="_bx_files_page_title_sys_home"><![CDATA[Главная страница]]></string>
     <string name="_bx_files_page_title_home"><![CDATA[Файлы]]></string>
+    <string name="_bx_files_page_block_title_featured_entries_view_extended"><![CDATA[Продвинутые]]></string>
     <string name="_bx_files_page_block_title_recent_entries"><![CDATA[Последние (галерея)]]></string>
     <string name="_bx_files_page_block_title_recent_entries_view_extended"><![CDATA[Последние]]></string>
     <string name="_bx_files_page_block_title_entry_social_sharing"><![CDATA[Поделиться]]></string>