RomanL 6 лет назад
Родитель
Сommit
5f22a3e8e6

+ 7 - 2
modules/boonex/videos/classes/BxVideosConfig.php

@@ -41,6 +41,7 @@ class BxVideosConfig extends BxBaseModTextConfig
             'FIELD_TEXT' => 'text',
             'FIELD_TEXT_ID' => 'video-text',
             'FIELD_CATEGORY' => 'cat',
+            'FIELD_MULTICAT' => 'multicat',
             'FIELD_DURATION' => 'duration',
             'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
             'FIELD_PHOTO' => 'pictures',
@@ -78,6 +79,8 @@ class BxVideosConfig extends BxBaseModTextConfig
             'PARAM_CHARS_SUMMARY_PLAIN' => 'bx_videos_plain_summary_chars',
             'PARAM_NUM_RSS' => 'bx_videos_rss_num',
             'PARAM_SEARCHABLE_FIELDS' => 'bx_videos_searchable_fields',
+            'PARAM_MULTICAT_ENABLED' => true,
+            'PARAM_MULTICAT_AUTO_ACTIVATION_FOR_CATEGORIES' => 'bx_videos_auto_activation_for_categories',
 
             // objects
             'OBJECT_STORAGE' => 'bx_videos_photos',
@@ -169,11 +172,13 @@ class BxVideosConfig extends BxBaseModTextConfig
         );
 
         $this->_aJsClasses = array(
-        	'manage_tools' => 'BxVideosManageTools'
+        	'manage_tools' => 'BxVideosManageTools',
+            'categories' => 'BxVideosCategories'
         );
 
         $this->_aJsObjects = array(
-        	'manage_tools' => 'oBxVideosManageTools'
+        	'manage_tools' => 'oBxVideosManageTools',
+            'categories' => 'oBxVideosCategories'
         );
 
         $this->_aGridObjects = array(

+ 8 - 2
modules/boonex/videos/install/langs/en.xml

@@ -11,6 +11,7 @@
 	<string name="_bx_videos_option_per_page_profile"><![CDATA[Number of items on profile/group page]]></string>
 	<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_form_entry"><![CDATA[Videos]]></string>
 	<string name="_bx_videos_form_entry_display_add"><![CDATA[Add Video]]></string>
@@ -27,7 +28,10 @@
 	<string name="_bx_videos_form_entry_input_title_err"><![CDATA[Title is essential. Please, fill in this field]]></string>
 	<string name="_bx_videos_form_entry_input_sys_cat"><![CDATA[Category]]></string>
 	<string name="_bx_videos_form_entry_input_cat"><![CDATA[Category]]></string>
-    <string name="_bx_videos_form_entry_input_cat_err"><![CDATA[Please select category]]></string>
+  <string name="_bx_videos_form_entry_input_cat_err"><![CDATA[Please select category]]></string>
+  <string name="_bx_videos_form_entry_input_sys_multicat"><![CDATA[Categories]]></string>
+  <string name="_bx_videos_form_entry_input_multicat"><![CDATA[Categories]]></string>
+  <string name="_bx_videos_form_entry_input_multicat_err"><![CDATA[Please select category]]></string>
 	<string name="_bx_videos_form_entry_input_sys_text"><![CDATA[Text]]></string>
 	<string name="_bx_videos_form_entry_input_text"><![CDATA[Text]]></string>
 	<string name="_bx_videos_form_entry_input_sys_duration"><![CDATA[Duration]]></string>
@@ -132,7 +136,9 @@
 	<string name="_bx_videos_page_title_manage"><![CDATA[Manage]]></string>
 	<string name="_bx_videos_page_block_title_system_manage"><![CDATA[Manage Own]]></string>
 	<string name="_bx_videos_page_block_title_system_manage_administration"><![CDATA[Manage All]]></string>
-	<string name="_bx_videos_page_block_title_manage"><![CDATA[Manage]]></string>    
+	<string name="_bx_videos_page_block_title_manage"><![CDATA[Manage]]></string>
+  <string name="_bx_videos_page_block_title_sys_multicats"><![CDATA[Discussions Categories(Multi)]]></string>
+  <string name="_bx_videos_page_block_title_multicats"><![CDATA[Discussions Categories]]></string>
 	<string name="_bx_videos_page_block_title_popular_keywords"><![CDATA[Popular Hashtags]]></string>
 	<string name="_bx_videos_page_block_title_cats"><![CDATA[Videos Categories]]></string>
 	<string name="_bx_videos_page_block_title_entry_info"><![CDATA[Info]]></string>

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

@@ -16,7 +16,8 @@ INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `c
 ('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_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_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);
 
 -- PAGE: create entry
 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 
@@ -112,8 +113,10 @@ INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `t
 ('bx_videos_home', 1, 'bx_videos', '', '_bx_videos_page_block_title_featured_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_videos";s:6:"method";s:15:"browse_featured";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 1, 1, 0),
 ('bx_videos_home', 1, 'bx_videos', '', '_bx_videos_page_block_title_recent_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_videos";s:6:"method";s:13:"browse_public";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 1, 1, 1),
 ('bx_videos_home', 2, 'bx_videos', '', '_bx_videos_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:9:"bx_videos";i:1;s:9:"bx_videos";}s:5:"class";s:20:"TemplServiceMetatags";}', 0, 1, 1, 0),
-('bx_videos_home', 2, 'bx_videos', '', '_bx_videos_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:14:"bx_videos_cats";i:1;a:1:{s:10:"show_empty";b:1;}}s:5:"class";s:20:"TemplServiceCategory";}', 0, 1, 1, 1);
+('bx_videos_home', 2, 'bx_videos', '', '_bx_videos_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:14:"bx_videos_cats";i:1;a:1:{s:10:"show_empty";b:1;}}s:5:"class";s:20:"TemplServiceCategory";}', 0, 1, 1, 1),
+('bx_videos_home', 2, 'bx_videos', '_bx_videos_page_block_title_sys_multicats', '_bx_videos_page_block_title_multicats', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_videos";s:6:"method";s:21:"categories_multi_list";}', 0, 0, 0, 2);
 
+-- PAGE: active profiles
 -- PAGE: search for 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_search', '_bx_videos_page_title_sys_entries_search', '_bx_videos_page_title_entries_search', 'bx_videos', 5, 2147483647, 1, 'videos-search', 'page.php?i=videos-search', '', '', '', 0, 1, 0, 'BxVideosPageBrowse', 'modules/boonex/videos/classes/BxVideosPageBrowse.php');

+ 2 - 0
modules/boonex/videos/install/sql/install.sql

@@ -9,6 +9,7 @@ CREATE TABLE IF NOT EXISTS `bx_videos_entries` (
   `video` int(11) NOT NULL default '0',
   `title` varchar(255) NOT NULL,
   `cat` int(11) NOT NULL,
+  `multicat` text NOT NULL,
   `text` text NOT NULL,
   `duration` int(11) NOT NULL,
   `labels` text NOT NULL,
@@ -299,6 +300,7 @@ INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `ch
 ('bx_videos', 'bx_videos', 'text', '', '', 0, 'textarea', '_bx_videos_form_entry_input_sys_text', '_bx_videos_form_entry_input_text', '', 0, 0, 3, '', '', '', '', '', '', 'XssHtml', '', 1, 0),
 ('bx_videos', 'bx_videos', 'title', '', '', 0, 'text', '_bx_videos_form_entry_input_sys_title', '_bx_videos_form_entry_input_title', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_videos_form_entry_input_title_err', 'Xss', '', 1, 0),
 ('bx_videos', 'bx_videos', 'cat', '', '#!bx_videos_cats', 0, 'select', '_bx_videos_form_entry_input_sys_cat', '_bx_videos_form_entry_input_cat', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_videos_form_entry_input_cat_err', 'Xss', '', 1, 0),
+('bx_videos', 'bx_videos', 'multicat', '', '', 0, 'custom', '_bx_videos_form_entry_input_sys_multicat', '_bx_videos_form_entry_input_multicat', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_videos_form_entry_input_multicat_err', 'Xss', '', 1, 0),
 ('bx_videos', 'bx_videos', 'duration', '', '', 0, 'text', '_bx_videos_form_entry_input_sys_duration', '_bx_videos_form_entry_input_duration', '', 1, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
 ('bx_videos', 'bx_videos', 'added', '', '', 0, 'datetime', '_bx_videos_form_entry_input_sys_date_added', '_bx_videos_form_entry_input_date_added', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('bx_videos', 'bx_videos', 'changed', '', '', 0, 'datetime', '_bx_videos_form_entry_input_sys_date_changed', '_bx_videos_form_entry_input_date_changed', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),

+ 48 - 0
modules/boonex/videos/js/categories.js

@@ -0,0 +1,48 @@
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Videos Videos
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+function BxVideosCategories(oOptions) {
+    this._sActionsUrl = oOptions.sActionUrl;
+    this._sObjName = oOptions.sObjName == undefined ? 'oBxVideosCategories' : oOptions.sObjName;
+
+    this._sAnimationEffect = oOptions.sAnimationEffect == undefined ? 'slide' : oOptions.sAnimationEffect;
+    this._iAnimationSpeed = oOptions.iAnimationSpeed == undefined ? 'slow' : oOptions.iAnimationSpeed;
+
+    this._aHtmlIds = oOptions.aHtmlIds == undefined ? {} : oOptions.aHtmlIds;
+    this._oRequestParams = oOptions.oRequestParams == undefined ? {} : oOptions.oRequestParams;
+}
+
+BxVideosCategories.prototype.categoryAdd = function (oButton, sName) {
+    var oButton = $(oButton);
+
+    var oCategory = oButton.parents('#bx-form-element-' + sName).find('.bx-form-input-category:first').clone();
+    oCategory.find("input[type = 'text']").val('');
+    oCategory.find("input[type = 'hidden']").remove();
+
+    oButton.parents('.bx-form-input-category-add:first').before(oCategory);
+};
+
+BxVideosCategories.prototype.categoryAddNew = function (oButton, sName) {
+    var oButton = $(oButton);
+
+    var oCategory = oButton.parents('#bx-form-element-' + sName).find('.bx-form-input-category-new:first').clone();
+    oCategory.find("input[type = 'text']").val('');
+    oCategory.find("input[type = 'hidden']").remove();
+
+    $('.bx-form-input-categories .bx-form-input-category-add:first').before(oCategory);
+};
+
+BxVideosCategories.prototype.categoryDelete = function (oButton) {
+    $(oButton).parents('.bx-form-input-category:first').remove();
+};
+
+BxVideosCategories.prototype.categoryDeleteNew = function (oButton) {
+    $(oButton).parents('.bx-form-input-category-new:first').remove();
+};

+ 1 - 0
modules/boonex/videos/template/category_list_inline.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/category_list_inline.html />

+ 1 - 0
modules/boonex/videos/template/css/categories.css

@@ -0,0 +1 @@
+@import url(../../../../base/text/template/css/categories.css);

+ 1 - 0
modules/boonex/videos/template/form_categories.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/form_categories.html />