Przeglądaj źródła

Merge branch 'master' of https://github.com/unaio/una

AntonLV 6 lat temu
rodzic
commit
023e9772ce
33 zmienionych plików z 280 dodań i 60 usunięć
  1. 55 0
      modules/base/general/classes/BxBaseModGeneralPageListEntry.php
  2. 23 0
      modules/base/text/classes/BxBaseModTextPageListEntry.php
  3. 2 1
      modules/boonex/accounts/classes/BxAccntGridAdministration.php
  4. 5 0
      modules/boonex/files/classes/BxFilesConfig.php
  5. 24 0
      modules/boonex/files/classes/BxFilesPageListEntry.php
  6. 6 0
      modules/boonex/files/install/langs/en.xml
  7. 1 1
      modules/boonex/files/install/sql/disable.sql
  8. 15 2
      modules/boonex/files/install/sql/enable.sql
  9. 13 3
      modules/boonex/files/install/sql/install.sql
  10. 1 1
      modules/boonex/files/install/sql/uninstall.sql
  11. 1 0
      modules/boonex/files/template/favorite-list-info.html
  12. 1 0
      modules/boonex/files/template/favorite-lists.html
  13. 5 0
      modules/boonex/photos/classes/BxPhotosConfig.php
  14. 24 0
      modules/boonex/photos/classes/BxPhotosPageListEntry.php
  15. 6 0
      modules/boonex/photos/install/langs/en.xml
  16. 1 1
      modules/boonex/photos/install/sql/disable.sql
  17. 14 3
      modules/boonex/photos/install/sql/enable.sql
  18. 14 3
      modules/boonex/photos/install/sql/install.sql
  19. 1 1
      modules/boonex/photos/install/sql/uninstall.sql
  20. 1 0
      modules/boonex/photos/template/favorite-list-info.html
  21. 1 0
      modules/boonex/photos/template/favorite-lists.html
  22. 3 0
      modules/boonex/posts/classes/BxPostsConfig.php
  23. 24 0
      modules/boonex/posts/classes/BxPostsPageListEntry.php
  24. 6 0
      modules/boonex/posts/install/langs/en.xml
  25. 1 1
      modules/boonex/posts/install/sql/disable.sql
  26. 13 2
      modules/boonex/posts/install/sql/enable.sql
  27. 13 3
      modules/boonex/posts/install/sql/install.sql
  28. 1 1
      modules/boonex/posts/install/sql/uninstall.sql
  29. 1 0
      modules/boonex/posts/template/favorite-list-info.html
  30. 1 0
      modules/boonex/posts/template/favorite-lists.html
  31. 1 35
      modules/boonex/videos/classes/BxVideosPageListEntry.php
  32. 1 1
      modules/boonex/videos/install/langs/en.xml
  33. 1 1
      modules/boonex/videos/install/sql/enable.sql

+ 55 - 0
modules/base/general/classes/BxBaseModGeneralPageListEntry.php

@@ -0,0 +1,55 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    BaseGeneral Base classes for modules
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * * List entry page
+ */
+class BxBaseModGeneralPageListEntry extends BxBaseModGeneralPageBrowse
+{    
+    protected $_iListId;
+    
+    public function __construct($aObject, $oTemplate = false)
+    {
+        
+        parent::__construct($aObject, $oTemplate);
+        
+        $CNF = &$this->_oModule->_oConfig->CNF;
+        $this->_iListId = null;
+        if(bx_get('list_id') === false)
+            return false; 
+        $this->_iListId = (int)bx_get('list_id');
+        
+        $oFavorite = BxDolFavorite::getObjectInstance($CNF['OBJECT_FAVORITES'], 0, true);
+        $aList = $oFavorite->getQueryObject()->getList(array('type' => 'id', 'list_id' => $this->_iListId));   
+        if($this->_iListId == 0){
+            $aList['title'] = _t('_sys_txt_default_favorite_list');
+        }
+        $this->addMarkers(array(
+            'title' => $aList['title']
+        ));
+        $this->_aObject['title'] = $aList['title'];
+    }
+    
+    public function getCode ()
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        $oPrivacy = BxDolPrivacy::getObjectInstance($CNF['OBJECT_PRIVACY_LIST_VIEW']);
+        
+        if ($this->_iListId > 0){
+            if (!$oPrivacy->check($this->_iListId)){
+                $this->_oTemplate->displayAccessDenied('');
+                exit;
+            }
+        }
+        return parent::getCode ();
+    }
+}

+ 23 - 0
modules/base/text/classes/BxBaseModTextPageListEntry.php

@@ -0,0 +1,23 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    BaseText Base classes for text modules
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * List entry page
+ */
+class BxBaseModTextPageListEntry extends BxBaseModGeneralPageListEntry
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 2 - 1
modules/boonex/accounts/classes/BxAccntGridAdministration.php

@@ -287,7 +287,8 @@ class BxAccntGridAdministration extends BxBaseModProfileGridAdministration
             return echoJson(array());
 
         $aRes = array();
-        if (BxDolAccount::getInstance()->updatePassword(genRndPwd(), $iId)){
+        $sPwd = genRndPwd();
+        if (BxDolAccount::getInstance()->updatePassword($sPwd, $iId)){
             $sPopupId = $this->_oModule->_oConfig->getHtmlIds('password_popup');
             $sPopupTitle = _t('_bx_accounts_form_display_account_settings_password_popup');
             $sPopupContent = $this->_oModule->_oTemplate->parseHtmlByName('reset_password.html', array(

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

@@ -53,6 +53,9 @@ class BxFilesConfig extends BxBaseModTextConfig
             'FIELD_LABELS' => 'labels',
             'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
 			
+            // some params
+            'PARAM_PER_PAGE_FOR_FAVORITES_LISTS' => 'bx_files_per_page_for_favorites_lists',
+            
             // page URIs
             'URI_VIEW_ENTRY' => 'view-file',
             'URI_AUTHOR_ENTRIES' => 'files-author',
@@ -60,6 +63,7 @@ class BxFilesConfig extends BxBaseModTextConfig
             'URI_ADD_ENTRY' => 'create-file',
             'URI_EDIT_ENTRY' => 'edit-file',
             'URI_MANAGE_COMMON' => 'files-manage',
+            'URI_FAVORITES_LIST' => 'files-favorites',
 
             'URL_HOME' => 'page.php?i=files-home',
             'URL_POPULAR' => 'page.php?i=files-popular',
@@ -90,6 +94,7 @@ class BxFilesConfig extends BxBaseModTextConfig
             'OBJECT_COMMENTS' => 'bx_files',
             'OBJECT_CATEGORY' => 'bx_files_cats',
             'OBJECT_PRIVACY_VIEW' => 'bx_files_allow_view_to',
+            'OBJECT_PRIVACY_LIST_VIEW' => 'bx_files_allow_view_favorite_list',
             'OBJECT_FORM_ENTRY' => 'bx_files',
             'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_files_entry_view',
             'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_files_entry_edit',

+ 24 - 0
modules/boonex/files/classes/BxFilesPageListEntry.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Photos Photos
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * List entry page
+ */
+class BxFilesPageListEntry extends BxBaseModTextPageListEntry
+{    
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_files';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

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

@@ -10,6 +10,7 @@
     <string name="_bx_files_option_per_page_profile"><![CDATA[Number of items on profile/group page]]></string>
 	<string name="_bx_files_option_rss_num"><![CDATA[Number of items in RSS feed]]></string>
 	<string name="_bx_files_option_searchable_fields"><![CDATA[Searchable fields for keyword search]]></string>
+  <string name="_bx_files_option_per_page_for_favorites_lists"><![CDATA[Number of favorite lists per page]]></string>
 
 	<string name="_bx_files_form_upload"><![CDATA[Files Upload]]></string>
 	<string name="_bx_files_form_entry"><![CDATA[Files]]></string>
@@ -45,6 +46,7 @@
         <string name="_bx_files_form_entry_input_attachments_err"><![CDATA[File is essential. Please, upload some file(s).]]></string>    
     <string name="_bx_files_form_entry_input_sys_allow_view_to"><![CDATA[Visibility]]></string>
     <string name="_bx_files_form_entry_input_allow_view_to"><![CDATA[Visibility]]></string>
+    <string name="_bx_files_form_entry_input_allow_view_favorite_list"><![CDATA[Visibility]]></string>
     <string name="_bx_files_form_entry_input_picture_use_as_thumb"><![CDATA[Cover Image]]></string>
     <string name="_bx_files_form_entry_input_sys_date_added"><![CDATA[Created]]></string>
     <string name="_bx_files_form_entry_input_date_added"><![CDATA[Created]]></string>
@@ -104,6 +106,8 @@
     <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_block_title_favorites_entries"><![CDATA["{title}" List]]></string>
+    <string name="_bx_files_page_block_title_favorites_entries_info"><![CDATA[Info]]></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>
     <string name="_bx_files_page_title_sys_entries_of_author"><![CDATA[Files of author]]></string>
@@ -132,6 +136,8 @@
 	<string name="_bx_files_page_block_title_group_entries"><![CDATA[Files]]></string>
 	<string name="_bx_files_page_title_sys_entries_search"><![CDATA[Search]]></string>
     <string name="_bx_files_page_title_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_files_page_title_sys_entries_favorites"><![CDATA[Favorives Files]]></string>
+    <string name="_bx_files_page_title_entries_favorites"><![CDATA[Favorives Files]]></string>
     <string name="_bx_files_page_block_title_search_form"><![CDATA[Search Form]]></string>
     <string name="_bx_files_page_block_title_search_results"><![CDATA[Search Results]]></string>
     <string name="_bx_files_page_block_title_search_form_cmts"><![CDATA[Comments Search Form]]></string>

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

@@ -16,7 +16,7 @@ DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_files';
 DELETE FROM `sys_menu_items` WHERE `module` = 'bx_files' OR `set_name` IN('bx_files_view', 'bx_files_view_actions', 'bx_files_submenu', 'bx_files_view_submenu', 'bx_files_snippet_meta', 'bx_files_my', 'bx_files_menu_manage_tools');
 
 -- PRIVACY 
-DELETE FROM `sys_objects_privacy` WHERE `object` = 'bx_files_allow_view_to';
+DELETE FROM `sys_objects_privacy` WHERE `object` IN ('bx_files_allow_view_to', 'bx_files_allow_view_favorite_list');
 
 -- ACL
 DELETE `sys_acl_actions`, `sys_acl_matrix` FROM `sys_acl_actions`, `sys_acl_matrix` WHERE `sys_acl_matrix`.`IDAction` = `sys_acl_actions`.`ID` AND `sys_acl_actions`.`Module` = 'bx_files';

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

@@ -15,6 +15,7 @@ INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `c
 ('bx_files_per_page_browse', '12', @iCategId, '_bx_files_option_per_page_browse', 'digit', '', '', '', 10),
 ('bx_files_per_page_profile', '6', @iCategId, '_bx_files_option_per_page_profile', 'digit', '', '', '', 12),
 ('bx_files_per_page_browse_showcase', '32', @iCategId, '_sys_option_per_page_browse_showcase', 'digit', '', '', '', 15),
+('bx_files_per_page_for_favorites_lists', '5', @iCategId, '_bx_files_option_per_page_for_favorites_lists', 'digit', '', '', '', 17),
 ('bx_files_rss_num', '10', @iCategId, '_bx_files_option_rss_num', 'digit', '', '', '', 20),
 ('bx_files_searchable_fields', 'title,desc,data', @iCategId, '_bx_files_option_searchable_fields', 'list', '', '', 'a:2:{s:6:"module";s:8:"bx_files";s:6:"method";s:21:"get_searchable_fields";}', 30);
 
@@ -108,11 +109,22 @@ 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_files_author', 1, 'bx_files', '', '_bx_files_page_block_title_entries_actions', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:18:\"my_entries_actions\";}', 0, 0, 1, 1),
-('bx_files_author', 1, 'bx_files', '_bx_files_page_block_title_sys_favorites_of_author', '_bx_files_page_block_title_favorites_of_author', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:15:\"browse_favorite\";s:6:"params";a:1:{i:0;s:12:"{profile_id}";}}', 0, 1, 1, 2),
+('bx_files_author', 1, 'bx_files', '_bx_files_page_block_title_sys_favorites_of_author', '_bx_files_page_block_title_favorites_of_author', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_files";s:6:"method";s:21:"browse_favorite_lists";s:6:"params";a:2:{s:10:"profile_id";s:12:"{profile_id}";s:6:"params";a:3:{s:9:"unit_view";s:8:"showcase";s:13:"empty_message";b:0;s:13:"ajax_paginate";b:0;}}}', 0, 1, 1, 2),
 ('bx_files_author', 1, 'bx_files', '_bx_files_page_block_title_sys_entries_of_author', '_bx_files_page_block_title_entries_of_author', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:13:\"browse_author\";}', 0, 0, 1, 3),
 ('bx_files_author', 1, 'bx_files', '_bx_files_page_block_title_sys_entries_in_context', '_bx_files_page_block_title_entries_in_context', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_files";s:6:"method";s:14:"browse_context";s:6:"params";a:2:{s:10:"profile_id";s:12:"{profile_id}";i:0;a:1:{s:13:"empty_message";b:0;}}}', 0, 0, 1, 4);
  
 
+-- PAGE: favorites by list
+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_favorites', '_bx_files_page_title_sys_entries_favorites', '_bx_files_page_title_entries_favorites', 'bx_files', 12, 2147483647, 1, 'files-favorites', 'page.php?i=files-favorites', '', '', '', 0, 1, 0, 'BxFilesPageListEntry', 'modules/boonex/files/classes/BxFilesPageListEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_files_favorites', 2, 'bx_files', '_bx_files_page_block_title_favorites_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_files";s:6:"method";s:15:"browse_favorite";s:6:"params";a:2:{s:10:"profile_id";s:12:"{profile_id}";s:6:"params";a:3:{s:9:"unit_view";s:7:"gallery";s:13:"empty_message";b:0;s:13:"ajax_paginate";b:0;}}}', 0, 1, 1),
+('bx_files_favorites', 3, 'bx_files', '_bx_files_page_block_title_favorites_entries_info', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_files";s:6:"method";s:19:"favorites_list_info";}', 0, 0, 0),
+('bx_files_favorites', 3, 'bx_files', '_bx_files_page_block_title_favorites_entries_actions', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_files";s:6:"method";s:22:"favorites_list_actions";}', 0, 0, 1);
+
+
+
 -- PAGE: entries of group
 
 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 
@@ -332,7 +344,8 @@ INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `titl
 -- PRIVACY 
 
 INSERT INTO `sys_objects_privacy` (`object`, `module`, `action`, `title`, `default_group`, `table`, `table_field_id`, `table_field_author`, `override_class_name`, `override_class_file`) VALUES
-('bx_files_allow_view_to', 'bx_files', 'view', '_bx_files_form_entry_input_allow_view_to', '3', 'bx_files_main', 'id', 'author', 'BxFilesPrivacy', 'modules/boonex/files/classes/BxFilesPrivacy.php');
+('bx_files_allow_view_to', 'bx_files', 'view', '_bx_files_form_entry_input_allow_view_to', '3', 'bx_files_main', 'id', 'author', 'BxFilesPrivacy', 'modules/boonex/files/classes/BxFilesPrivacy.php'),
+('bx_files_allow_view_favorite_list', 'bx_files', 'view_favorite_list', '_bx_files_form_entry_input_allow_view_favorite_list', '3', 'bx_files_favorites_lists', 'id', 'author_id', 'BxFilesPrivacy', 'modules/boonex/files/classes/BxFilesPrivacy.php');
 
 
 -- ACL

+ 13 - 3
modules/boonex/files/install/sql/install.sql

@@ -172,10 +172,20 @@ CREATE TABLE IF NOT EXISTS `bx_files_reports_track` (
 CREATE TABLE `bx_files_favorites_track` (
   `object_id` int(11) NOT NULL default '0',
   `author_id` int(11) NOT NULL default '0',
+  `list_id` int(11) NOT NULL default '0',
   `date` int(11) NOT NULL default '0',
   KEY `id` (`object_id`,`author_id`)
 );
 
+CREATE TABLE `bx_files_favorites_lists` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `title` varchar(255) NOT NULL,
+  `author_id` int(11) NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  `allow_view_favorite_list_to` varchar(16) NOT NULL DEFAULT '3',
+   PRIMARY KEY (`id`)
+);
+
 -- TABLE: scores
 CREATE TABLE IF NOT EXISTS `bx_files_scores` (
   `object_id` int(11) NOT NULL default '0',
@@ -314,9 +324,9 @@ INSERT INTO `sys_objects_report` (`name`, `table_main`, `table_track`, `is_on`,
 INSERT INTO `sys_objects_view` (`name`, `table_track`, `period`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
 ('bx_files', 'bx_files_views_track', '86400', '1', 'bx_files_main', 'id', 'author', 'views', '', '');
 
--- FAFORITES
-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', '', '');
+-- FAVORITES
+INSERT INTO `sys_objects_favorite` (`name`, `table_track`, `table_lists`, `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', 'bx_files_favorites_lists', '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 

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

@@ -1,6 +1,6 @@
 
 -- TABLES
-DROP TABLE IF EXISTS `bx_files_main`, `bx_files_files`, `bx_files_photos_resized`, `bx_files_cmts`, `bx_files_votes`, `bx_files_votes_track`, `bx_files_reactions`, `bx_files_reactions_track`, `bx_files_views_track`, `bx_files_meta_keywords`, `bx_files_meta_mentions`, `bx_files_reports`, `bx_files_reports_track`, `bx_files_favorites_track`, `bx_files_scores`, `bx_files_scores_track`;
+DROP TABLE IF EXISTS `bx_files_main`, `bx_files_files`, `bx_files_photos_resized`, `bx_files_cmts`, `bx_files_votes`, `bx_files_votes_track`, `bx_files_reactions`, `bx_files_reactions_track`, `bx_files_views_track`, `bx_files_meta_keywords`, `bx_files_meta_mentions`, `bx_files_reports`, `bx_files_reports_track`, `bx_files_favorites_track`, `bx_files_favorites_lists`, `bx_files_scores`, `bx_files_scores_track`;
 
 -- STORAGES & TRANSCODERS
 DELETE FROM `sys_objects_storage` WHERE `object` = 'bx_files_files' OR `object` = 'bx_files_photos_resized';

+ 1 - 0
modules/boonex/files/template/favorite-list-info.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/general/template/favorite-list-info.html />

+ 1 - 0
modules/boonex/files/template/favorite-lists.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/general/template/favorite-lists.html />

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

@@ -56,6 +56,9 @@ class BxPhotosConfig extends BxBaseModTextConfig
             'FIELD_LOCATION_PREFIX' => 'location',
             'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
 			
+            // some params
+            'PARAM_PER_PAGE_FOR_FAVORITES_LISTS' => 'bx_photos_per_page_for_favorites_lists',
+            
             // page URIs
             'URI_VIEW_ENTRY' => 'view-photo',
             'URI_AUTHOR_ENTRIES' => 'photos-author',
@@ -63,6 +66,7 @@ class BxPhotosConfig extends BxBaseModTextConfig
             'URI_ADD_ENTRY' => 'create-photo',
             'URI_EDIT_ENTRY' => 'edit-photo',
             'URI_MANAGE_COMMON' => 'photos-manage',
+            'URI_FAVORITES_LIST' => 'photos-favorites',
 
             'URL_HOME' => 'page.php?i=photos-home',
             'URL_POPULAR' => 'page.php?i=photos-popular',
@@ -95,6 +99,7 @@ class BxPhotosConfig extends BxBaseModTextConfig
             'OBJECT_COMMENTS' => 'bx_photos',
             'OBJECT_CATEGORY' => 'bx_photos_cats',
             'OBJECT_PRIVACY_VIEW' => 'bx_photos_allow_view_to',
+            'OBJECT_PRIVACY_LIST_VIEW' => 'bx_photos_allow_view_favorite_list',
             'OBJECT_FORM_ENTRY' => 'bx_photos',
             'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_photos_entry_view',
             'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_photos_entry_edit',

+ 24 - 0
modules/boonex/photos/classes/BxPhotosPageListEntry.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Photos Photos
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * List entry page
+ */
+class BxPhotosPageListEntry extends BxBaseModTextPageListEntry
+{    
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_photos';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

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

@@ -11,6 +11,7 @@
     <string name="_bx_photos_option_per_page_profile"><![CDATA[Number of items on profile/group page]]></string>
     <string name="_bx_photos_option_rss_num"><![CDATA[Number of items in RSS feed]]></string>
     <string name="_bx_photos_option_searchable_fields"><![CDATA[Searchable fields for keyword search]]></string>
+    <string name="_bx_photos_option_per_page_for_favorites_lists"><![CDATA[Number of favorite lists per page]]></string>
 
     <string name="_bx_photos_form_entry"><![CDATA[Photos]]></string>
     <string name="_bx_photos_form_entry_display_add"><![CDATA[Add Photo]]></string>
@@ -44,6 +45,7 @@
     <string name="_bx_photos_form_entry_input_picture_err"><![CDATA[Photo is essential. Please, upload a photo.]]></string>
     <string name="_bx_photos_form_entry_input_sys_allow_view_to"><![CDATA[Visibility]]></string>
     <string name="_bx_photos_form_entry_input_allow_view_to"><![CDATA[Visibility]]></string>
+    <string name="_bx_photos_form_entry_input_allow_view_favorite_list"><![CDATA[Visibility]]></string>
     <string name="_bx_photos_form_entry_input_picture_use_as_thumb"><![CDATA[Cover Image]]></string>
     <string name="_bx_photos_form_entry_input_sys_date_added"><![CDATA[Created]]></string>
     <string name="_bx_photos_form_entry_input_date_added"><![CDATA[Created]]></string>
@@ -107,6 +109,8 @@
     <string name="_bx_photos_page_title_entries_updated"><![CDATA[Updated Photos]]></string>
     <string name="_bx_photos_page_title_sys_entries_search"><![CDATA[Search]]></string>
     <string name="_bx_photos_page_title_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_photos_page_title_sys_entries_favorites"><![CDATA[Favorives Photos]]></string>
+    <string name="_bx_photos_page_title_entries_favorites"><![CDATA[Favorives Photos]]></string>
     <string name="_bx_photos_page_block_title_search_form"><![CDATA[Search Form]]></string>
     <string name="_bx_photos_page_block_title_search_results"><![CDATA[Search Results]]></string>
     <string name="_bx_photos_page_block_title_search_form_cmts"><![CDATA[Comments Search Form]]></string>
@@ -116,6 +120,8 @@
     <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_block_title_favorites_entries"><![CDATA["{title}" List]]></string>
+    <string name="_bx_photos_page_block_title_favorites_entries_info"><![CDATA[Info]]></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>
     <string name="_bx_photos_page_title_sys_entries_of_author"><![CDATA[Photos of author]]></string>

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

@@ -19,7 +19,7 @@ DELETE FROM `sys_menu_items` WHERE `module` = 'bx_photos' OR `set_name` IN('bx_p
 
 
 -- PRIVACY 
-DELETE FROM `sys_objects_privacy` WHERE `object` = 'bx_photos_allow_view_to';
+DELETE FROM `sys_objects_privacy` WHERE `object` IN ('bx_photos_allow_view_to', 'bx_photos_allow_view_favorite_list');
 
 
 -- ACL

+ 14 - 3
modules/boonex/photos/install/sql/enable.sql

@@ -15,6 +15,7 @@ INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `c
 ('bx_photos_per_page_browse', '12', @iCategId, '_bx_photos_option_per_page_browse', 'digit', '', '', '', 10),
 ('bx_photos_per_page_profile', '6', @iCategId, '_bx_photos_option_per_page_profile', 'digit', '', '', '', 12),
 ('bx_photos_per_page_browse_showcase', '32', @iCategId, '_sys_option_per_page_browse_showcase', 'digit', '', '', '', 15),
+('bx_photos_per_page_for_favorites_lists', '5', @iCategId, '_bx_photos_option_per_page_for_favorites_lists', 'digit', '', '', '', 17),
 ('bx_photos_rss_num', '10', @iCategId, '_bx_photos_option_rss_num', 'digit', '', '', '', 20),
 ('bx_photos_searchable_fields', 'title,text', @iCategId, '_bx_photos_option_searchable_fields', 'list', '', '', 'a:2:{s:6:"module";s:9:"bx_photos";s:6:"method";s:21:"get_searchable_fields";}', 30);
 
@@ -104,11 +105,21 @@ 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_photos_author', 1, 'bx_photos', '', '_bx_photos_page_block_title_entries_actions', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_photos";s:6:"method";s:18:"my_entries_actions";}', 0, 0, 1, 1),
-('bx_photos_author', 1, 'bx_photos', '_bx_photos_page_block_title_sys_favorites_of_author', '_bx_photos_page_block_title_favorites_of_author', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_photos";s:6:"method";s:15:"browse_favorite";s:6:"params";a:1:{i:0;s:12:"{profile_id}";}}', 0, 1, 1, 2),
+('bx_photos_author', 1, 'bx_photos', '_bx_photos_page_block_title_sys_favorites_of_author', '_bx_photos_page_block_title_favorites_of_author', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_photos";s:6:"method";s:21:"browse_favorite_lists";s:6:"params";a:2:{s:10:"profile_id";s:12:"{profile_id}";s:6:"params";a:3:{s:9:"unit_view";s:8:"showcase";s:13:"empty_message";b:0;s:13:"ajax_paginate";b:0;}}}', 0, 1, 1, 2),
 ('bx_photos_author', 1, 'bx_photos', '_bx_photos_page_block_title_sys_entries_of_author', '_bx_photos_page_block_title_entries_of_author', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_photos";s:6:"method";s:13:"browse_author";}', 0, 0, 1, 3),
 ('bx_photos_author', 1, 'bx_photos', '_bx_photos_page_block_title_sys_entries_in_context', '_bx_photos_page_block_title_entries_in_context', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_photos";s:6:"method";s:14:"browse_context";s:6:"params";a:2:{s:10:"profile_id";s:12:"{profile_id}";i:0;a:1:{s:13:"empty_message";b:0;}}}', 0, 0, 1, 4);
 
 
+-- PAGE: favorites by list
+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_favorites', '_bx_photos_page_title_sys_entries_favorites', '_bx_photos_page_title_entries_favorites', 'bx_photos', 12, 2147483647, 1, 'photos-favorites', 'page.php?i=photos-favorites', '', '', '', 0, 1, 0, 'BxPhotosPageListEntry', 'modules/boonex/photos/classes/BxPhotosPageListEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_photos_favorites', 2, 'bx_photos', '_bx_photos_page_block_title_favorites_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_photos";s:6:"method";s:15:"browse_favorite";s:6:"params";a:2:{s:10:"profile_id";s:12:"{profile_id}";s:6:"params";a:3:{s:9:"unit_view";s:7:"gallery";s:13:"empty_message";b:0;s:13:"ajax_paginate";b:0;}}}', 0, 1, 1),
+('bx_photos_favorites', 3, 'bx_photos', '_bx_photos_page_block_title_favorites_entries_info', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_photos";s:6:"method";s:19:"favorites_list_info";}', 0, 0, 0),
+('bx_photos_favorites', 3, 'bx_photos', '_bx_photos_page_block_title_favorites_entries_actions', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_photos";s:6:"method";s:22:"favorites_list_actions";}', 0, 0, 1);
+
+
 -- 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 
@@ -303,8 +314,8 @@ INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `titl
 
 -- PRIVACY 
 INSERT INTO `sys_objects_privacy` (`object`, `module`, `action`, `title`, `default_group`, `table`, `table_field_id`, `table_field_author`, `override_class_name`, `override_class_file`) VALUES
-('bx_photos_allow_view_to', 'bx_photos', 'view', '_bx_photos_form_entry_input_allow_view_to', '3', 'bx_photos_entries', 'id', 'author', 'BxPhotosPrivacy', 'modules/boonex/photos/classes/BxPhotosPrivacy.php');
-
+('bx_photos_allow_view_to', 'bx_photos', 'view', '_bx_photos_form_entry_input_allow_view_to', '3', 'bx_photos_entries', 'id', 'author', 'BxPhotosPrivacy', 'modules/boonex/photos/classes/BxPhotosPrivacy.php'),
+('bx_photos_allow_view_favorite_list', 'bx_photos', 'view_favorite_list', '_bx_photos_form_entry_input_allow_view_favorite_list', '3', 'bx_photos_favorites_lists', 'id', 'author_id', 'BxPhotosPrivacy', 'modules/boonex/photos/classes/BxPhotosPrivacy.php');
 -- ACL
 INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
 ('bx_photos', 'create entry', NULL, '_bx_photos_acl_action_create_entry', '', 1, 3);

+ 14 - 3
modules/boonex/photos/install/sql/install.sql

@@ -212,10 +212,21 @@ CREATE TABLE IF NOT EXISTS `bx_photos_reports_track` (
 CREATE TABLE `bx_photos_favorites_track` (
   `object_id` int(11) NOT NULL default '0',
   `author_id` int(11) NOT NULL default '0',
+  `list_id` int(11) NOT NULL default '0',
   `date` int(11) NOT NULL default '0',
   KEY `id` (`object_id`,`author_id`)
 );
 
+CREATE TABLE `bx_photos_favorites_lists` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `title` varchar(255) NOT NULL,
+  `author_id` int(11) NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  `allow_view_favorite_list_to` varchar(16) NOT NULL DEFAULT '3',
+   PRIMARY KEY (`id`)
+);
+
+
 -- TABLE: scores
 CREATE TABLE IF NOT EXISTS `bx_photos_scores` (
   `object_id` int(11) NOT NULL default '0',
@@ -349,9 +360,9 @@ INSERT INTO `sys_objects_view` (`name`, `table_track`, `period`, `is_on`, `trigg
 ('bx_photos', 'bx_photos_views_track', '86400', '1', 'bx_photos_entries', 'id', 'author', 'views', '', '');
 
 
--- FAFORITES
-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_photos', 'bx_photos_favorites_track', '1', '1', '1', 'page.php?i=view-photo&id={object_id}', 'bx_photos_entries', 'id', 'author', 'favorites', '', '');
+-- FAVORITES
+INSERT INTO `sys_objects_favorite` (`name`, `table_track`, `table_lists`, `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_photos', 'bx_photos_favorites_track', 'bx_photos_favorites_lists', '1', '1', '1', 'page.php?i=view-photo&id={object_id}', 'bx_photos_entries', 'id', 'author', 'favorites', '', '');
 
 
 -- FEATURED

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

@@ -1,6 +1,6 @@
 
 -- TABLES
-DROP TABLE IF EXISTS `bx_photos_entries`, `bx_photos_photos`, `bx_photos_media_resized`, `bx_photos_cmts`, `bx_photos_votes`, `bx_photos_votes_track`, `bx_photos_svotes`, `bx_photos_svotes_track`, `bx_photos_reactions`, `bx_photos_reactions_track`, `bx_photos_views_track`, `bx_photos_meta_keywords_camera`, `bx_photos_meta_keywords`, `bx_photos_meta_locations`, `bx_photos_meta_mentions`, `bx_photos_reports`, `bx_photos_reports_track`, `bx_photos_favorites_track`, `bx_photos_scores`, `bx_photos_scores_track`;
+DROP TABLE IF EXISTS `bx_photos_entries`, `bx_photos_photos`, `bx_photos_media_resized`, `bx_photos_cmts`, `bx_photos_votes`, `bx_photos_votes_track`, `bx_photos_svotes`, `bx_photos_svotes_track`, `bx_photos_reactions`, `bx_photos_reactions_track`, `bx_photos_views_track`, `bx_photos_meta_keywords_camera`, `bx_photos_meta_keywords`, `bx_photos_meta_locations`, `bx_photos_meta_mentions`, `bx_photos_reports`, `bx_photos_reports_track`, `bx_photos_favorites_track`, bx_photos_favorites_lists, `bx_photos_scores`, `bx_photos_scores_track`;
 
 
 -- STORAGES & TRANSCODERS

+ 1 - 0
modules/boonex/photos/template/favorite-list-info.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/general/template/favorite-list-info.html />

+ 1 - 0
modules/boonex/photos/template/favorite-lists.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/general/template/favorite-lists.html />

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

@@ -65,6 +65,7 @@ class BxPostsConfig extends BxBaseModTextConfig
              // some params
             'PARAM_MULTICAT_ENABLED' => true,
             'PARAM_MULTICAT_AUTO_ACTIVATION_FOR_CATEGORIES' => 'bx_posts_auto_activation_for_categories',
+            'PARAM_PER_PAGE_FOR_FAVORITES_LISTS' => 'bx_posts_per_page_for_favorites_lists',
             
             // page URIs
             'URI_VIEW_ENTRY' => 'view-post',
@@ -73,6 +74,7 @@ class BxPostsConfig extends BxBaseModTextConfig
             'URI_ADD_ENTRY' => 'create-post',
             'URI_EDIT_ENTRY' => 'edit-post',
             'URI_MANAGE_COMMON' => 'posts-manage',
+            'URI_FAVORITES_LIST' => 'posts-favorites',
 
             'URL_HOME' => 'page.php?i=posts-home',
             'URL_POPULAR' => 'page.php?i=posts-popular',
@@ -119,6 +121,7 @@ class BxPostsConfig extends BxBaseModTextConfig
             'OBJECT_NOTES' => 'bx_posts_notes',
             'OBJECT_CATEGORY' => 'bx_posts_cats',
             'OBJECT_PRIVACY_VIEW' => 'bx_posts_allow_view_to',
+            'OBJECT_PRIVACY_LIST_VIEW' => 'bx_posts_allow_view_favorite_list',
             'OBJECT_FORM_ENTRY' => 'bx_posts',
             'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_posts_entry_view',
             'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_posts_entry_add',

+ 24 - 0
modules/boonex/posts/classes/BxPostsPageListEntry.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Posts Posts
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * List entry page
+ */
+class BxPostsPageListEntry extends BxBaseModTextPageListEntry
+{    
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_posts';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

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

@@ -12,6 +12,7 @@
     <string name="_bx_posts_option_rss_num"><![CDATA[Number of items in RSS feed]]></string>
     <string name="_bx_posts_option_searchable_fields"><![CDATA[Searchable fields for keyword search]]></string>
     <string name="_bx_posts_option_auto_activation_for_categories"><![CDATA[Auto-Activation For Categories]]></string>
+    <string name="_bx_posts_option_per_page_for_favorites_lists"><![CDATA[Number of favorite lists per page]]></string>
   
     <string name="_bx_posts_form_entry"><![CDATA[Posts]]></string>
     <string name="_bx_posts_form_entry_display_add"><![CDATA[Add Post]]></string>
@@ -52,6 +53,7 @@
     <string name="_bx_posts_form_entry_input_sys_polls"><![CDATA[Polls]]></string>
     <string name="_bx_posts_form_entry_input_sys_allow_view_to"><![CDATA[Visibility]]></string>
     <string name="_bx_posts_form_entry_input_allow_view_to"><![CDATA[Visibility]]></string>
+    <string name="_bx_posts_form_entry_input_allow_view_favorite_list"><![CDATA[Visibility]]></string>
     <string name="_bx_posts_form_entry_input_sys_date_added"><![CDATA[Created]]></string>
     <string name="_bx_posts_form_entry_input_date_added"><![CDATA[Created]]></string>
     <string name="_bx_posts_form_entry_input_sys_date_changed"><![CDATA[Updated]]></string>
@@ -133,6 +135,8 @@
     <string name="_bx_posts_page_title_sys_entries_updated"><![CDATA[Updated Posts]]></string>
     <string name="_bx_posts_page_title_entries_updated"><![CDATA[Updated Posts]]></string>
     <string name="_bx_posts_page_title_sys_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_posts_page_title_sys_entries_favorites"><![CDATA[Favorives Posts]]></string>
+    <string name="_bx_posts_page_title_entries_favorites"><![CDATA[Favorives Posts]]></string>
     <string name="_bx_posts_page_title_entries_search"><![CDATA[Search]]></string>
     <string name="_bx_posts_page_block_title_search_form"><![CDATA[Search Form]]></string>
     <string name="_bx_posts_page_block_title_search_results"><![CDATA[Search Results]]></string>
@@ -143,6 +147,8 @@
     <string name="_bx_posts_page_block_title_popular_entries_view_full"><![CDATA[Popular Posts (Full View)]]></string>
     <string name="_bx_posts_page_block_title_top_entries"><![CDATA[Top Posts]]></string>
     <string name="_bx_posts_page_block_title_updated_entries"><![CDATA[Updated Posts]]></string>
+    <string name="_bx_posts_page_block_title_favorites_entries"><![CDATA["{title}" List]]></string>
+    <string name="_bx_posts_page_block_title_favorites_entries_info"><![CDATA[Info]]></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[Comments to {title}]]></string>
     <string name="_bx_posts_page_title_sys_entries_of_author"><![CDATA[Posts of author]]></string>

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

@@ -16,7 +16,7 @@ DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_posts';
 DELETE FROM `sys_menu_items` WHERE `module` = 'bx_posts' OR `set_name` IN('bx_posts_create_post_attachments', 'bx_posts_view', 'bx_posts_view_actions', 'bx_posts_submenu', 'bx_posts_view_submenu', 'bx_posts_snippet_meta', 'bx_posts_my', 'bx_posts_menu_manage_tools');
 
 -- PRIVACY 
-DELETE FROM `sys_objects_privacy` WHERE `object` = 'bx_posts_allow_view_to';
+DELETE FROM `sys_objects_privacy` WHERE `object` IN ('bx_posts_allow_view_to', 'bx_posts_allow_view_favorite_list');
 
 -- ACL
 DELETE `sys_acl_actions`, `sys_acl_matrix` FROM `sys_acl_actions`, `sys_acl_matrix` WHERE `sys_acl_matrix`.`IDAction` = `sys_acl_actions`.`ID` AND `sys_acl_actions`.`Module` = 'bx_posts';

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

@@ -16,6 +16,7 @@ INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `c
 ('bx_posts_per_page_browse', '12', @iCategId, '_bx_posts_option_per_page_browse', 'digit', '', '', '', 10),
 ('bx_posts_per_page_profile', '6', @iCategId, '_bx_posts_option_per_page_profile', 'digit', '', '', '', 12),
 ('bx_posts_per_page_browse_showcase', '32', @iCategId, '_sys_option_per_page_browse_showcase', 'digit', '', '', '', 15),
+('bx_posts_per_page_for_favorites_lists', '5', @iCategId, '_bx_posts_option_per_page_for_favorites_lists', 'digit', '', '', '', 17),
 ('bx_posts_rss_num', '10', @iCategId, '_bx_posts_option_rss_num', 'digit', '', '', '', 20),
 ('bx_posts_searchable_fields', 'title,text', @iCategId, '_bx_posts_option_searchable_fields', 'list', '', '', 'a:2:{s:6:"module";s:8:"bx_posts";s:6:"method";s:21:"get_searchable_fields";}', 30),
 ('bx_posts_auto_activation_for_categories', 'on', @iCategId, '_bx_posts_option_auto_activation_for_categories', 'checkbox', '', '', '', 35);
@@ -110,11 +111,20 @@ 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_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:21:"browse_favorite_lists";s:6:"params";a:2:{s:10:"profile_id";s:12:"{profile_id}";s:6:"params";a:3:{s:9:"unit_view";s:8:"showcase";s:13:"empty_message";b:0;s:13:"ajax_paginate";b:0;}}}', 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_in_context', '_bx_posts_page_block_title_entries_in_context', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_posts";s:6:"method";s:14:"browse_context";s:6:"params";a:2:{s:10:"profile_id";s:12:"{profile_id}";i:0;a:1:{s:13:"empty_message";b:0;}}}', 0, 0, 1, 4);
 
 
+-- PAGE: favorites by list
+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_favorites', '_bx_posts_page_title_sys_entries_favorites', '_bx_posts_page_title_entries_favorites', 'bx_posts', 12, 2147483647, 1, 'posts-favorites', 'page.php?i=posts-favorites', '', '', '', 0, 1, 0, 'BxPostsPageListEntry', 'modules/boonex/posts/classes/BxPostsPageListEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_posts_favorites', 2, 'bx_posts', '_bx_posts_page_block_title_favorites_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_posts";s:6:"method";s:15:"browse_favorite";s:6:"params";a:2:{s:10:"profile_id";s:12:"{profile_id}";s:6:"params";a:3:{s:9:"unit_view";s:7:"gallery";s:13:"empty_message";b:0;s:13:"ajax_paginate";b:0;}}}', 0, 1, 1),
+('bx_posts_favorites', 3, 'bx_posts', '_bx_posts_page_block_title_favorites_entries_info', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_posts";s:6:"method";s:19:"favorites_list_info";}', 0, 0, 0),
+('bx_posts_favorites', 3, 'bx_posts', '_bx_posts_page_block_title_favorites_entries_actions', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_posts";s:6:"method";s:22:"favorites_list_actions";}', 0, 0, 1);
+
 -- 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 
@@ -345,7 +355,8 @@ INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `titl
 -- PRIVACY 
 
 INSERT INTO `sys_objects_privacy` (`object`, `module`, `action`, `title`, `default_group`, `table`, `table_field_id`, `table_field_author`, `override_class_name`, `override_class_file`) VALUES
-('bx_posts_allow_view_to', 'bx_posts', 'view', '_bx_posts_form_entry_input_allow_view_to', '3', 'bx_posts_posts', 'id', 'author', '', '');
+('bx_posts_allow_view_to', 'bx_posts', 'view', '_bx_posts_form_entry_input_allow_view_to', '3', 'bx_posts_posts', 'id', 'author', '', ''),
+('bx_posts_allow_view_favorite_list', 'bx_posts', 'view_favorite_list', '_bx_posts_form_entry_input_allow_view_favorite_list', '3', 'bx_posts_favorites_lists', 'id', 'author_id', '', '');
 
 
 -- ACL

+ 13 - 3
modules/boonex/posts/install/sql/install.sql

@@ -266,10 +266,20 @@ CREATE TABLE IF NOT EXISTS `bx_posts_reports_track` (
 CREATE TABLE `bx_posts_favorites_track` (
   `object_id` int(11) NOT NULL default '0',
   `author_id` int(11) NOT NULL default '0',
+  `list_id` int(11) NOT NULL default '0',
   `date` int(11) NOT NULL default '0',
   KEY `id` (`object_id`,`author_id`)
 );
 
+CREATE TABLE `bx_posts_favorites_lists` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `title` varchar(255) NOT NULL,
+  `author_id` int(11) NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  `allow_view_favorite_list_to` varchar(16) NOT NULL DEFAULT '3',
+   PRIMARY KEY (`id`)
+);
+
 -- TABLE: scores
 CREATE TABLE IF NOT EXISTS `bx_posts_scores` (
   `object_id` int(11) NOT NULL default '0',
@@ -538,9 +548,9 @@ INSERT INTO `sys_objects_report` (`name`, `table_main`, `table_track`, `is_on`,
 INSERT INTO `sys_objects_view` (`name`, `table_track`, `period`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
 ('bx_posts', 'bx_posts_views_track', '86400', '1', 'bx_posts_posts', 'id', 'author', 'views', '', '');
 
--- FAFORITES
-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_posts', 'bx_posts_favorites_track', '1', '1', '1', 'page.php?i=view-post&id={object_id}', 'bx_posts_posts', 'id', 'author', 'favorites', '', '');
+-- FAVORITES
+INSERT INTO `sys_objects_favorite` (`name`, `table_track`, `table_lists`, `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_posts', 'bx_posts_favorites_track', 'bx_posts_favorites_lists', '1', '1', '1', 'page.php?i=view-post&id={object_id}', 'bx_posts_posts', '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 

+ 1 - 1
modules/boonex/posts/install/sql/uninstall.sql

@@ -1,6 +1,6 @@
 
 -- TABLES
-DROP TABLE IF EXISTS `bx_posts_posts`, `bx_posts_covers`, `bx_posts_files`, `bx_posts_photos`, `bx_posts_photos_resized`, `bx_posts_videos`, `bx_posts_videos_resized`, `bx_posts_cmts`, `bx_posts_cmts_notes`, `bx_posts_votes`, `bx_posts_votes_track`, `bx_posts_reactions`, `bx_posts_reactions_track`, `bx_posts_views_track`, `bx_posts_meta_keywords`, `bx_posts_meta_locations`, `bx_posts_meta_mentions`, `bx_posts_reports`, `bx_posts_reports_track`, `bx_posts_favorites_track`, `bx_posts_scores`, `bx_posts_scores_track`, `bx_posts_polls`, `bx_posts_polls_answers`, `bx_posts_polls_answers_votes`, `bx_posts_polls_answers_votes_track`;
+DROP TABLE IF EXISTS `bx_posts_posts`, `bx_posts_covers`, `bx_posts_files`, `bx_posts_photos`, `bx_posts_photos_resized`, `bx_posts_videos`, `bx_posts_videos_resized`, `bx_posts_cmts`, `bx_posts_cmts_notes`, `bx_posts_votes`, `bx_posts_votes_track`, `bx_posts_reactions`, `bx_posts_reactions_track`, `bx_posts_views_track`, `bx_posts_meta_keywords`, `bx_posts_meta_locations`, `bx_posts_meta_mentions`, `bx_posts_reports`, `bx_posts_reports_track`, `bx_posts_favorites_track`, `bx_posts_favorites_lists`, `bx_posts_scores`, `bx_posts_scores_track`, `bx_posts_polls`, `bx_posts_polls_answers`, `bx_posts_polls_answers_votes`, `bx_posts_polls_answers_votes_track`;
 
 -- STORAGES & TRANSCODERS
 DELETE FROM `sys_objects_storage` WHERE `object` LIKE 'bx_posts_%';

+ 1 - 0
modules/boonex/posts/template/favorite-list-info.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/general/template/favorite-list-info.html />

+ 1 - 0
modules/boonex/posts/template/favorite-lists.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/general/template/favorite-lists.html />

+ 1 - 35
modules/boonex/videos/classes/BxVideosPageListEntry.php

@@ -12,46 +12,12 @@
 /**
  * List entry page
  */
-class BxVideosPageListEntry extends BxBaseModTextPageBrowse
+class BxVideosPageListEntry extends BxBaseModTextPageListEntry
 {
-    
-    protected $_iListId;
-    
     public function __construct($aObject, $oTemplate = false)
     {
         $this->MODULE = 'bx_videos';
         parent::__construct($aObject, $oTemplate);
-       
-        $CNF = &$this->_oModule->_oConfig->CNF;
-        $this->_iListId = null;
-        if(bx_get('list_id') === false)
-            return false; 
-        $this->_iListId = (int)bx_get('list_id');
-       
-        $oFavorite = BxDolFavorite::getObjectInstance($CNF['OBJECT_FAVORITES'], 0, true);
-        $aList = $oFavorite->getQueryObject()->getList(array('type' => 'id', 'list_id' => $this->_iListId));   
-        if($this->_iListId == 0){
-            $aList['title'] = _t('_sys_txt_default_favorite_list');
-        }
-        $this->addMarkers(array(
-            'title' => $aList['title']
-        ));
-        $this->_aObject['title'] = $aList['title'];
-    }
-    
-    public function getCode ()
-    {
-        $CNF = &$this->_oModule->_oConfig->CNF;
-
-        $oPrivacy = BxDolPrivacy::getObjectInstance($CNF['OBJECT_PRIVACY_LIST_VIEW']);
-        
-        if ($this->_iListId > 0){
-            if (!$oPrivacy->check($this->_iListId)){
-                $this->_oTemplate->displayAccessDenied('');
-                exit;
-            }
-        }
-        return parent::getCode ();
     }
 }
 

+ 1 - 1
modules/boonex/videos/install/langs/en.xml

@@ -12,7 +12,7 @@
 	<string name="_bx_videos_option_rss_num"><![CDATA[Number of items in RSS feed]]></string>
 	<string name="_bx_videos_option_searchable_fields"><![CDATA[Searchable fields for keyword search]]></string>
   <string name="_bx_videos_option_auto_activation_for_categories"><![CDATA[Auto-Activation For Categories]]></string>
-  <string name="_bx_videos_option_bx_videos_per_page_for_favorites_lists"><![CDATA[Number of favorite lists per page]]></string>
+  <string name="_bx_videos_option_per_page_for_favorites_lists"><![CDATA[Number of favorite lists per page]]></string>
 
   <string name="_bx_videos_form_entry"><![CDATA[Videos]]></string>
 	<string name="_bx_videos_form_entry_display_add"><![CDATA[Add Video]]></string>

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

@@ -14,7 +14,7 @@ INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `c
 ('bx_videos_per_page_browse', '12', @iCategId, '_bx_videos_option_per_page_browse', 'digit', '', '', '', 10),
 ('bx_videos_per_page_profile', '6', @iCategId, '_bx_videos_option_per_page_profile', 'digit', '', '', '', 12),
 ('bx_videos_per_page_browse_showcase', '32', @iCategId, '_sys_option_per_page_browse_showcase', 'digit', '', '', '', 15),
-('bx_videos_per_page_for_favorites_lists', '5', @iCategId, '_bx_videos_option_bx_videos_per_page_for_favorites_lists', 'digit', '', '', '', 17),
+('bx_videos_per_page_for_favorites_lists', '5', @iCategId, '_bx_videos_option_per_page_for_favorites_lists', 'digit', '', '', '', 17),
 ('bx_videos_rss_num', '10', @iCategId, '_bx_videos_option_rss_num', 'digit', '', '', '', 20),
 ('bx_videos_searchable_fields', 'title,text', @iCategId, '_bx_videos_option_searchable_fields', 'list', '', '', 'a:2:{s:6:"module";s:9:"bx_videos";s:6:"method";s:21:"get_searchable_fields";}', 30),
 ('bx_videos_auto_activation_for_categories', 'on', @iCategId, '_bx_videos_option_auto_activation_for_categories', 'checkbox', '', '', '', 35);