Kaynağa Gözat

Ticket #5336 - Studio Forms: Select Module doesn't work in Categoeries builder.

AntonLV 9 ay önce
ebeveyn
işleme
a734dd4c38

+ 5 - 0
modules/boonex/russian/data/langs/bx_videos/ru.xml

@@ -147,6 +147,8 @@
     <string name="_bx_videos_page_block_title_system_manage"><![CDATA[Управление собственными видео]]></string>
     <string name="_bx_videos_page_block_title_system_manage_administration"><![CDATA[Управление всеми видео]]></string>
     <string name="_bx_videos_page_block_title_manage"><![CDATA[Управление]]></string>    
+    <string name="_bx_videos_page_block_title_sys_multicats"><![CDATA[Видео категории(Мульти)]]></string>
+    <string name="_bx_videos_page_block_title_multicats"><![CDATA[Видео категории]]></string>
     <string name="_bx_videos_page_block_title_popular_keywords"><![CDATA[Популярные хэштеги]]></string>
     <string name="_bx_videos_page_block_title_cats"><![CDATA[Видео категории]]></string>
     <string name="_bx_videos_page_block_title_entry_info"><![CDATA[Инфо]]></string>
@@ -158,12 +160,15 @@
     <string name="_bx_videos_page_block_title_popular_entries_view_showcase"><![CDATA[Популярные Видео]]></string>
     <string name="_bx_videos_page_block_title_sys_featured_entries_view_showcase"><![CDATA[Продвинутые Видео (Витринный просмотр)]]></string>
     <string name="_bx_videos_page_block_title_featured_entries_view_showcase"><![CDATA[Продвинутые Видео]]></string>
+    <string name="_bx_videos_page_block_title_sys_by_categoriers_entries_view_showcase"><![CDATA[Видео по категориям (Мульти, Витринный просмотр)]]></string>
+    <string name="_bx_videos_page_block_title_by_categoriers_entries_view_showcase"><![CDATA[Видео по категориям]]></string>
     <string name="_bx_videos_page_block_title_sys_entry_context"><![CDATA[Опубликовано в]]></string>
     <string name="_bx_videos_page_block_title_entry_context"><![CDATA[Опубликовано в]]></string>
     <string name="_bx_videos_page_block_title_sys_favorites_entries"><![CDATA[Избранное]]></string>
     <string name="_bx_videos_page_block_title_favorites_entries"><![CDATA[Список "{title}"]]></string>
     <string name="_bx_videos_page_block_title_favorites_entries_info"><![CDATA[Информация]]></string>
     <string name="_bx_videos_page_block_title_favorites_entries_actions"><![CDATA[Действия]]></string>
+    <string name="_bx_videos_page_block_title_favorites_entries_social_sharing"><![CDATA[Социальные действия]]></string>
 
     <string name="_bx_videos_menu_set_title_view_entry"><![CDATA[Видео - Действия]]></string>
     <string name="_bx_videos_menu_title_view_entry"><![CDATA[Видео - Действия]]></string>

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

@@ -169,7 +169,7 @@
     <string name="_bx_videos_page_block_title_popular_entries_view_showcase"><![CDATA[Popular Videos]]></string>
     <string name="_bx_videos_page_block_title_sys_featured_entries_view_showcase"><![CDATA[Featured Videos (Showcase View)]]></string>
     <string name="_bx_videos_page_block_title_featured_entries_view_showcase"><![CDATA[Featured Videos]]></string>
-    <string name="_bx_videos_page_block_title_sys_by_categoriers_entries_view_showcase"><![CDATA[Videos by categories (Showcase View)]]></string>
+    <string name="_bx_videos_page_block_title_sys_by_categoriers_entries_view_showcase"><![CDATA[Videos by categories (Multi, Showcase View)]]></string>
     <string name="_bx_videos_page_block_title_by_categoriers_entries_view_showcase"><![CDATA[Videos by categories]]></string>
     <string name="_bx_videos_page_block_title_sys_entry_context"><![CDATA[Posted in]]></string>
     <string name="_bx_videos_page_block_title_entry_context"><![CDATA[Posted in]]></string>

+ 14 - 0
studio/js/forms_categories.js

@@ -17,6 +17,20 @@ function BxDolStudioFormsCategories(oOptions) {
     this.sTextSearchInput = oOptions.sTextSearchInput == undefined ? '' : oOptions.sTextSearchInput;
 }
 
+BxDolStudioFormsCategories.prototype.onChangeFilter = function() {
+    var $this = this;
+    var sValueModule = $('#bx-grid-module-' + this.sObjNameGrid).val();
+
+    var sValueSearch = $('#bx-grid-search-' + this.sObjNameGrid).val();
+    if(sValueSearch == this.sTextSearchInput)
+        sValueSearch = '';
+
+    clearTimeout($this._iSearchTimeoutId);
+    $this._iSearchTimeoutId = setTimeout(function () {
+    	glGrids[$this.sObjNameGrid].setFilter(sValueModule + $this.sParamsDivider + sValueSearch, true);
+    }, 500);
+};
+
 BxDolStudioFormsCategories.prototype.onChangeModule = function () {
     this.reloadGrid($('#bx-grid-module-' + this.sObjNameGrid).val());
 };

+ 10 - 30
studio/template/scripts/BxBaseStudioFormsCategories.php

@@ -318,43 +318,23 @@ class BxBaseStudioFormsCategories extends BxDolStudioFormsCategories
         parent::_getFilterControls();
 
         $aInputModules = $this->getModulesSelectOneArray('getCategories', false, false);
-		foreach($aInputModules['values'] as $sKey => $sValue){
-			$bEnable = false;
-			$oModule = BxDolModule::getInstance($sKey);
-			if (isset($oModule->_oConfig) && isset($oModule->_oConfig->CNF)){
-				$CNF = $oModule->_oConfig->CNF;
-				if (isset($CNF['PARAM_MULTICAT_ENABLED']) && $CNF['PARAM_MULTICAT_ENABLED'] == true){
-					$bEnable = true;
-				}
-			}
-			if (!$bEnable)
-				unset($aInputModules['values'][$sKey]);
-		}
-		$aInputModules['values'] = array_merge(array('' => _t('_adm_txt_select_module')), $aInputModules['values']);
-		$oForm = new BxTemplStudioFormView(array());
-        $sContent = $oForm->genRow($aInputModules);
-        $oForm = new BxTemplStudioFormView(array());
 
-        $aInputSearch = array(
-            'type' => 'text',
-            'name' => 'keyword',
-            'attrs' => array(
-                'id' => 'bx-grid-search-' . $this->_sObject,
-            ),
-            'tr_attrs' => array(
-                'style' => 'display:none;'
-            )
-        );
-        $sContent .= $oForm->genRow($aInputSearch);
+        $aValues = [['key' => '', 'value' => _t('_adm_txt_select_module')]];
+        foreach($aInputModules['values'] as $sName => $sTitle)
+            if(($sKey = 'PARAM_MULTICAT_ENABLED') && ($oModule = BxDolModule::getInstance($sName)) && ($CNF = $oModule->_oConfig->CNF ?? false) && isset($CNF[$sKey]) && $CNF[$sKey])
+                $aValues[] = ['key' => $sName, 'value' => $sTitle];
+
+        $aInputModules['values'] = $aValues;
 
-        return  $sContent;
+        $oForm = new BxTemplStudioFormView([]);
+        return $oForm->genRow($aInputModules) . parent::_getSearchInput();
     }
-    
+
     function getJsObject()
     {
         return 'oBxDolStudioFormsCategories';
     }
-    
+
     function getCode($isDisplayHeader = true)
     {
         return $this->_oTemplate->parseHtmlByName('forms_categories.html', array(