RomanL %!s(int64=6) %!d(string=hai) anos
pai
achega
a0ff8ab190

+ 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 />