Parcourir la source

Ticket #967 - Files module.

AntonLV il y a 9 ans
Parent
commit
5056bdca69

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

@@ -43,6 +43,7 @@ class BxFilesConfig extends BxBaseModTextConfig
             'FIELD_TEXT_ID' => 'file-desc',
             'FIELD_TEXT_ID' => 'file-desc',
             'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
             'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
             'FIELD_PHOTO' => 'attachments',
             'FIELD_PHOTO' => 'attachments',
+        	'FIELD_VIEWS' => 'views',
             'FIELD_COMMENTS' => 'comments',
             'FIELD_COMMENTS' => 'comments',
 	        'FIELD_STATUS' => 'status',
 	        'FIELD_STATUS' => 'status',
         	'FIELD_STATUS_ADMIN' => 'status_admin',
         	'FIELD_STATUS_ADMIN' => 'status_admin',
@@ -81,6 +82,7 @@ class BxFilesConfig extends BxBaseModTextConfig
         	'OBJECT_FEATURED' => 'bx_files',
         	'OBJECT_FEATURED' => 'bx_files',
             'OBJECT_METATAGS' => 'bx_files',
             'OBJECT_METATAGS' => 'bx_files',
             'OBJECT_COMMENTS' => 'bx_files',
             'OBJECT_COMMENTS' => 'bx_files',
+            'OBJECT_CATEGORY' => 'bx_files_cats',
             'OBJECT_PRIVACY_VIEW' => 'bx_files_allow_view_to',
             'OBJECT_PRIVACY_VIEW' => 'bx_files_allow_view_to',
             'OBJECT_FORM_ENTRY' => 'bx_files',
             'OBJECT_FORM_ENTRY' => 'bx_files',
             'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_files_entry_view',
             'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_files_entry_view',
@@ -92,6 +94,7 @@ class BxFilesConfig extends BxBaseModTextConfig
             'OBJECT_MENU_SUBMENU' => 'bx_files_submenu', // main module submenu
             'OBJECT_MENU_SUBMENU' => 'bx_files_submenu', // main module submenu
             'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_files_view_submenu', // view entry submenu
             'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_files_view_submenu', // view entry submenu
             'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'files-home', // first item in view entry submenu from main module submenu
             'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'files-home', // first item in view entry submenu from main module submenu
+            'OBJECT_MENU_SNIPPET_META' => 'bx_files_snippet_meta', // menu for snippet meta info
             'OBJECT_MENU_MANAGE_TOOLS' => 'bx_files_menu_manage_tools', //manage menu in content administration tools
             'OBJECT_MENU_MANAGE_TOOLS' => 'bx_files_menu_manage_tools', //manage menu in content administration tools
             'OBJECT_GRID_ADMINISTRATION' => 'bx_files_administration',
             'OBJECT_GRID_ADMINISTRATION' => 'bx_files_administration',
         	'OBJECT_GRID_COMMON' => 'bx_files_common',
         	'OBJECT_GRID_COMMON' => 'bx_files_common',

+ 22 - 0
modules/boonex/files/classes/BxFilesMenuSnippetMeta.php

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

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

@@ -13,7 +13,7 @@ DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_files' OR `object` IN('bx_fi
 -- MENU
 -- MENU
 DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_files';
 DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_files';
 DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_files';
 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_submenu', 'bx_files_view_submenu', 'bx_files_my');
+DELETE FROM `sys_menu_items` WHERE `module` = 'bx_files' OR `set_name` IN('bx_files_view', 'bx_files_submenu', 'bx_files_view_submenu', 'bx_files_snippet_meta', 'bx_files_my');
 
 
 -- PRIVACY 
 -- PRIVACY 
 DELETE FROM `sys_objects_privacy` WHERE `object` = 'bx_files_allow_view_to';
 DELETE FROM `sys_objects_privacy` WHERE `object` = 'bx_files_allow_view_to';

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

@@ -236,6 +236,21 @@ INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `titl
 ('bx_files_view_submenu', 'bx_files', 'view-file', '_bx_files_menu_item_title_system_view_entry', '_bx_files_menu_item_title_view_entry_submenu_entry', 'page.php?i=view-file&id={content_id}', '', '', '', '', 2147483647, 0, 0, 1),
 ('bx_files_view_submenu', 'bx_files', 'view-file', '_bx_files_menu_item_title_system_view_entry', '_bx_files_menu_item_title_view_entry_submenu_entry', 'page.php?i=view-file&id={content_id}', '', '', '', '', 2147483647, 0, 0, 1),
 ('bx_files_view_submenu', 'bx_files', 'view-file-comments', '_bx_files_menu_item_title_system_view_entry_comments', '_bx_files_menu_item_title_view_entry_submenu_comments', 'page.php?i=view-file-comments&id={content_id}', '', '', '', '', 2147483647, 0, 0, 2);
 ('bx_files_view_submenu', 'bx_files', 'view-file-comments', '_bx_files_menu_item_title_system_view_entry_comments', '_bx_files_menu_item_title_view_entry_submenu_comments', 'page.php?i=view-file-comments&id={content_id}', '', '', '', '', 2147483647, 0, 0, 2);
 
 
+-- MENU: custom menu for snippet meta info
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_files_snippet_meta', '_sys_menu_title_snippet_meta', 'bx_files_snippet_meta', 'bx_files', 15, 0, 1, 'BxFilesMenuSnippetMeta', 'modules/boonex/files/classes/BxFilesMenuSnippetMeta.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_files_snippet_meta', 'bx_files', '_sys_menu_set_title_snippet_meta', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `editable`, `order`) VALUES 
+('bx_files_snippet_meta', 'bx_files', 'date', '_sys_menu_item_title_system_sm_date', '_sys_menu_item_title_sm_date', '', '', '', '', '', 2147483647, 1, 0, 1, 1),
+('bx_files_snippet_meta', 'bx_files', 'author', '_sys_menu_item_title_system_sm_author', '_sys_menu_item_title_sm_author', '', '', '', '', '', 2147483647, 1, 0, 1, 2),
+('bx_files_snippet_meta', 'bx_files', 'category', '_sys_menu_item_title_system_sm_category', '_sys_menu_item_title_sm_category', '', '', '', '', '', 2147483647, 0, 0, 1, 3),
+('bx_files_snippet_meta', 'bx_files', 'tags', '_sys_menu_item_title_system_sm_tags', '_sys_menu_item_title_sm_tags', '', '', '', '', '', 2147483647, 0, 0, 1, 4),
+('bx_files_snippet_meta', 'bx_files', 'views', '_sys_menu_item_title_system_sm_views', '_sys_menu_item_title_sm_views', '', '', '', '', '', 2147483647, 0, 0, 1, 5),
+('bx_files_snippet_meta', 'bx_files', 'comments', '_sys_menu_item_title_system_sm_comments', '_sys_menu_item_title_sm_comments', '', '', '', '', '', 2147483647, 0, 0, 1, 6);
+
 -- MENU: profile stats
 -- MENU: profile stats
 SET @iNotifMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name` = 'sys_profile_stats' AND `active` = 1 LIMIT 1);
 SET @iNotifMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name` = 'sys_profile_stats' AND `active` = 1 LIMIT 1);
 INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
 INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES

+ 2 - 2
modules/boonex/files/template/css/main.css

@@ -31,7 +31,7 @@
     font-size:3.2rem;
     font-size:3.2rem;
 }
 }
 
 
-.bx-files-text-unit .bx-base-text-unit-text div,
-.bx-files-text-unit .bx-base-text-unit-text h2 {
+.bx-files-text-unit .bx-base-text-unit-text h2,
+.bx-files-text-unit .bx-base-text-unit-text > div {
     margin-left:3.5rem;
     margin-left:3.5rem;
 }
 }

+ 1 - 5
modules/boonex/files/template/unit.html

@@ -7,11 +7,7 @@
 	<div class="bx-base-text-unit-text bx-def-padding bx-def-box-sizing">
 	<div class="bx-base-text-unit-text bx-def-padding bx-def-box-sizing">
         <i class="sys-icon __icon__ bx-def-padding"></i>
         <i class="sys-icon __icon__ bx-def-padding"></i>
 	    <h2><a href="__content_url__">__title__</a></h2>
 	    <h2><a href="__content_url__">__title__</a></h2>
-	    <div class="bx-base-text-unit-info bx-def-margin-sec-top bx-def-font-small">
-	        <span class="bx-def-font-grayed">__entry_posting_date__</span>
-	        <span class="bx-base-text-unit-info-div bx-def-font-grayed">&#183;</span>
-	        <a class="bx-base-text-unit-author" href="__author_url__">__author__</a>
-	    </div>
+	    <div class="bx-base-text-unit-info bx-def-margin-sec-top bx-def-font-small">__meta__</div>
 	    <div class="bx-base-text-unit-summary bx-def-margin-sec-top bx-clearfix">
 	    <div class="bx-base-text-unit-summary bx-def-margin-sec-top bx-clearfix">
 	        __summary__
 	        __summary__
 	    </div> 
 	    </div> 

+ 1 - 5
modules/boonex/files/template/unit_gallery.html

@@ -2,11 +2,7 @@
 	<div class="bx-base-text-unit-cnt bx-def-box bx-def-round-corners bx-def-color-bg-box bx-def-box-sizing">
 	<div class="bx-base-text-unit-cnt bx-def-box bx-def-round-corners bx-def-color-bg-box bx-def-box-sizing">
 		<div class="bx-base-text-unit-text bx-def-padding-leftright bx-def-padding-sec-topbottom bx-def-font-align-center bx-def-box-sizing">
 		<div class="bx-base-text-unit-text bx-def-padding-leftright bx-def-padding-sec-topbottom bx-def-font-align-center bx-def-box-sizing">
 			<h2><a href="__content_url__">__title__</a></h2>
 			<h2><a href="__content_url__">__title__</a></h2>
-		    <div class="bx-base-text-unit-info">
-		        <span class="bx-def-font-grayed">__entry_posting_date__</span>
-		        <span class="bx-base-text-unit-info-div bx-def-font-grayed">&#183;</span>
-		        <a class="bx-base-text-unit-author" href="__author_url__">__author__</a>
-		    </div>
+		    <div class="bx-base-text-unit-info">__meta__</div>
 		</div>
 		</div>
 	    <bx_if:thumb>
 	    <bx_if:thumb>
 	        <a href="__content_url__" title="__summary_attr__">
 	        <a href="__content_url__" title="__summary_attr__">