1
0
Эх сурвалжийг харах

Ticket #367 - Allow access to category by membership.

AntonLV 10 жил өмнө
parent
commit
e268e1f1bb

+ 1 - 1
inc/classes/BxDolGrid.php

@@ -509,7 +509,7 @@ class BxDolGrid extends BxDol implements iBxDolFactoryObject, iBxDolReplaceable
 
         }
 
-        return $bFieldsOnly ? $sOrderClause : " ORDER BY " . $sOrderClause;
+        return $bFieldsOnly || empty($sOrderClause) ? $sOrderClause : " ORDER BY " . $sOrderClause;
     }
 
     protected function _getCellData($sKey, $aField, $aRow)

+ 7 - 3
modules/boonex/forum/classes/BxForumConfig.php

@@ -55,7 +55,8 @@ class BxForumConfig extends BxBaseModTextConfig
 
             // page URIs
             'URI_VIEW_ENTRY' => 'view-discussion',
-            'URI_AUTHOR_ENTRIES' => 'discussions',
+            'URI_AUTHOR_ENTRIES' => 'discussions-author',
+        	'URI_CATEGORY_ENTRIES' => 'discussions-category',
             'URI_ADD_ENTRY' => 'create-discussion',
         	'URI_EDIT_ENTRY' => 'edit-discussion',
         	'URI_MANAGE_COMMON' => 'discussions-manage',
@@ -77,6 +78,7 @@ class BxForumConfig extends BxBaseModTextConfig
             'OBJECT_GRID' => 'bx_forum',
         	'OBJECT_GRID_ADMINISTRATION' => 'bx_forum_administration',
         	'OBJECT_GRID_COMMON' => 'bx_forum_common',
+        	'OBJECT_GRID_CATEGORIES' => 'bx_forum_categories',
             'OBJECT_STORAGE' => 'bx_forum_files',
         	'OBJECT_STORAGE_CMTS' => 'bx_forum_files_cmts',
             'OBJECT_IMAGES_TRANSCODER_PREVIEW' => 'bx_forum_preview',
@@ -124,13 +126,15 @@ class BxForumConfig extends BxBaseModTextConfig
         $this->_aJsClasses = array(
         	'main' => 'BxForumMain',
         	'entry' => 'BxForumEntry',
-        	'manage_tools' => 'BxForumManageTools'
+        	'manage_tools' => 'BxForumManageTools',
+        	'studio' => 'BxForumStudio'
         );
 
         $this->_aJsObjects = array(
         	'main' => 'oBxForumMain',
         	'entry' => 'oBxForumEntry',
-        	'manage_tools' => 'oBxForumManageTools'
+        	'manage_tools' => 'oBxForumManageTools',
+        	'studio' => 'oBxForumStudio'
         );
 
         $this->_aGridObjects = array(

+ 38 - 0
modules/boonex/forum/classes/BxForumDb.php

@@ -88,6 +88,44 @@ class BxForumDb extends BxBaseModTextDb
 
 		return $this->updateEntries($aActions[$sAction], array($CNF['FIELD_ID'] => $aContentInfo[$CNF['FIELD_ID']]));
 	}
+
+	public function insertCategory($aSet)
+    {
+        $sQuery = "INSERT INTO `" . $this->getPrefix() . "categories` SET " . $this->arrayToSQL($aSet);
+        return (int)$this->query($sQuery) > 0;
+    }
+
+	public function getCategories($aParams)
+    {
+        $aMethod = array('name' => 'getAll', 'params' => array(0 => 'query'));
+        $sSelectClause = $sJoinClause = $sWhereClause = $sGroupClause = $sOrderClause = $sLimitClause = "";
+
+        if(!isset($aParams['order']) || empty($aParams['order']))
+           $sOrderClause = "ORDER BY `tc`.`category` ASC";
+
+        switch($aParams['type']) {
+            case 'by_category':
+                $aMethod['name'] = 'getRow';
+                $aMethod['params'][1] = array(
+                	'category' => $aParams['category']
+                );
+
+                $sWhereClause = " AND `tc`.`category`=:category ";
+                break;
+
+            case 'all_pairs':
+            	$aMethod['name'] = 'getPairs';
+                $aMethod['params'][1] = 'category';
+                $aMethod['params'][2] = 'visible_for_levels';
+            	break;
+        }
+
+        $aMethod['params'][0] = "SELECT 
+                `tc`.*" . $sSelectClause . " 
+            FROM `" . $this->getPrefix() . "categories` AS `tc` " . $sJoinClause . "
+            WHERE 1 " . $sWhereClause . " " . $sGroupClause . " " . $sOrderClause . " " . $sLimitClause;
+        return call_user_func_array(array($this, $aMethod['name']), $aMethod['params']);
+    }
 }
 
 /** @} */

+ 34 - 26
modules/boonex/forum/classes/BxForumGrid.php

@@ -14,6 +14,7 @@ require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
 class BxForumGrid extends BxTemplGrid
 {
     protected $_oModule;
+    protected $_aParams;
 
     public function __construct ($aOptions, $oTemplate = false)
     {
@@ -23,33 +24,36 @@ class BxForumGrid extends BxTemplGrid
         $this->_sDefaultSortingOrder = 'DESC';
     }
 
-    public function setBrowseType($sType)
+    public function setBrowseParams($aParams)
     {
-    	$sField = '';
-    	$sDir = 'DESC';
-    	switch($sType) {
-    		case 'new':
-                $sField = 'added';
-                break;
-
-			case 'updated':
-				$sField = 'changed';
-                break;
-
-			case 'latest':
-				$sField = 'lr_timestamp';
-                break;
-
-			case 'top':
-				$sField = 'comments';
-                break;
-
-            case 'popular':
-            	$sField = 'views';
-                break;
-    	}
-
-    	$this->_aOptions['field_order'] = $sField;
+    	$this->_aParams = $aParams;
+
+    	$sField = 'added';
+    	if(!empty($this->_aParams['type']))
+	    	switch($this->_aParams['type']) {
+	    		case 'new':
+	    		case 'category':
+	                $sField = 'added';
+	                break;
+	
+				case 'updated':
+					$sField = 'changed';
+	                break;
+	
+				case 'latest':
+					$sField = 'lr_timestamp';
+	                break;
+	
+				case 'top':
+					$sField = 'comments';
+	                break;
+	
+	            case 'popular':
+	            	$sField = 'views';
+	                break;
+	    	}
+
+		$this->_aOptions['field_order'] = $sField;
     }
 
     protected function _getActionAdd ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
@@ -115,6 +119,10 @@ class BxForumGrid extends BxTemplGrid
 		if(isset($aCondition['where']))
 			$sWhereClause .= $aCondition['where'];
 
+		//--- Check browse params
+		if(!empty($this->_aParams['where']) && is_array($this->_aParams['where']))
+			$sWhereClause .= " AND " . $this->_oModule->_oDb->arrayToSQL($this->_aParams['where'], " AND ");
+
 		$this->_aOptions['source'] = sprintf($this->_aOptions['source'], $sJoinClause, $sWhereClause);
 		return parent::_getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage);
     }

+ 211 - 0
modules/boonex/forum/classes/BxForumGridCategories.php

@@ -0,0 +1,211 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Forum Forum
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
+
+class BxForumGridCategories extends BxTemplStudioGrid
+{
+    protected $_oModule;
+    protected $_iVisibleForDefault;
+
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+        parent::__construct ($aOptions, $oTemplate);
+
+        $this->_oModule = BxDolModule::getInstance('bx_forum');
+        $this->_iVisibleForDefault = 2147483647;
+    }
+
+    public function getCode($isDisplayHeader = true)
+    {
+    	return $this->_oModule->_oTemplate->getJsCode('studio') . parent::getCode($isDisplayHeader);
+    }
+
+	public function performActionShowTo()
+    {
+        $sAction = 'show_to';
+
+        $aCategories = bx_get('ids');
+        if(!$aCategories || !is_array($aCategories)) {
+            $iCategory = (int)bx_get('category');
+            if(!$iCategory) {
+                echoJson(array());
+                exit;
+            }
+
+            $aCategories = array($iCategory);
+        }
+
+        $iCategory = $aCategories[0];
+
+        $aItem = $this->_oModule->_oDb->getCategories(array('type' => 'by_category', 'category' => $iCategory));
+        if(!is_array($aItem) || empty($aItem)) {
+        	$aItem = array('category' => $iCategory, 'visible_for_levels' => $this->_iVisibleForDefault);
+
+        	$this->_oModule->_oDb->insertCategory($aItem);            
+        } 
+
+		bx_import('BxDolStudioUtils');
+        $aForm = array(
+            'form_attrs' => array(
+                'id' => 'bx-forum-visible-for',
+                'action' => BX_DOL_URL_ROOT . 'grid.php?o=' . $this->_sObject . '&a=' . $sAction,
+                'method' => 'post'
+            ),
+            'params' => array (
+                'db' => array(
+                    'table' => 'bx_forum_categories',
+                    'key' => 'category',
+                    'uri' => '',
+                    'uri_title' => '',
+                    'submit_name' => 'do_submit'
+                ),
+            ),
+            'inputs' => array (
+                'category' => array(
+                    'type' => 'hidden',
+                    'name' => 'category',
+                    'value' => $aItem['category'],
+                    'db' => array (
+                        'pass' => 'Int',
+                    ),
+                ),
+                'visible_for' => array(
+                    'type' => 'select',
+                    'name' => 'visible_for',
+                    'caption' => _t('_bx_forum_grid_txt_visible_for'),
+                    'info' => '',
+                    'value' => $aItem['visible_for_levels'] == BX_DOL_INT_MAX ? BX_DOL_STUDIO_VISIBLE_ALL : BX_DOL_STUDIO_VISIBLE_SELECTED,
+                    'values' => array(
+                        array('key' => BX_DOL_STUDIO_VISIBLE_ALL, 'value' => _t('_bx_forum_grid_txt_visible_for_all')),
+                        array('key' => BX_DOL_STUDIO_VISIBLE_SELECTED, 'value' => _t('_bx_forum_grid_txt_visible_for_selected')),
+                    ),
+                    'required' => '0',
+                    'attrs' => array(
+                        'onchange' => $this->_oModule->_oConfig->getJsObject('studio') . '.onChangeVisibleFor(this)'
+                    ),
+                    'db' => array (
+                        'pass' => 'Xss',
+                    )
+                ),
+                'visible_for_levels' => array(
+                    'type' => 'checkbox_set',
+                    'name' => 'visible_for_levels',
+                    'caption' => _t('_bx_forum_grid_txt_visible_for_levels'),
+                    'info' => _t('_bx_forum_grid_inf_visible_for_levels'),
+                    'value' => '',
+                    'values' => array(),
+                    'tr_attrs' => array(
+                        'style' => $aItem['visible_for_levels'] == BX_DOL_INT_MAX ? 'display:none' : ''
+                    ),
+                    'db' => array (
+                        'pass' => 'Int',
+                    ),
+                ),
+                'controls' => array(
+                    'name' => 'controls',
+                    'type' => 'input_set',
+                    array(
+                        'type' => 'submit',
+                        'name' => 'do_submit',
+                        'value' => _t('_bx_forum_grid_btn_save'),
+                    ),
+                    array (
+                        'type' => 'reset',
+                        'name' => 'close',
+                        'value' => _t('_bx_forum_grid_btn_cancel'),
+                        'attrs' => array(
+                            'onclick' => "$('.bx-popup-applied:visible').dolPopupHide()",
+                            'class' => 'bx-def-margin-sec-left',
+                        ),
+                    )
+                )
+            )
+        );
+
+        BxDolStudioUtils::getVisibilityValues($aItem['visible_for_levels'], $aForm['inputs']['visible_for_levels']['values'], $aForm['inputs']['visible_for_levels']['value']);
+
+        $oForm = new BxTemplStudioFormView($aForm);
+        $oForm->initChecker();
+
+        if($oForm->isSubmittedAndValid()) {
+            if($oForm->updateWithVisibility($aItem['category']) !== false)
+                $aRes = array('grid' => $this->getCode(false), 'blink' => $aItem['category']);
+            else
+                $aRes = array('msg' => _t('_bx_forum_grid_err_show_to'));
+
+            echoJson($aRes);
+        }
+        else {
+            $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-forum-visible-for-popup', _t('_bx_forum_grid_show_to_popup'), $this->_oModule->_oTemplate->parseHtmlByName('category_visible_for.html', array(
+                'form_id' => $aForm['form_attrs']['id'],
+                'form' => $oForm->getCode(true),
+                'object' => $this->_sObject,
+                'action' => $sAction
+            )));
+
+            echoJson(array('popup' => $sContent));
+        }
+    }
+
+	protected function _getCellVisibleForLevels($mixedValue, $sKey, $aField, $aRow)
+    {
+        $mixedValue = $this->_oTemplate->parseHtmlByName('bx_a.html', array(
+            'href' => 'javascript:void(0)',
+            'title' => _t('_bx_forum_grid_txt_manage_visibility'),
+            'bx_repeat:attrs' => array(
+                array('key' => 'bx_grid_action_single', 'value' => 'show_to'),
+                array('key' => 'bx_grid_action_data', 'value' => $aRow['category'])
+            ),
+            'content' => BxDolStudioUtils::getVisibilityTitle($aRow['visible_for_levels'])
+        ));
+
+        return parent::_getCellDefault ($mixedValue, $sKey, $aField, $aRow);
+    }
+
+	protected function _getActionShowTo ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
+    {
+        return '';
+    }
+
+    protected function _addJsCss()
+    {
+        parent::_addJsCss();
+        $this->_oModule->_oTemplate->addStudioJs(array('jquery.form.min.js', 'studio.js'));
+
+        $oForm = new BxTemplStudioFormView(array());
+        $oForm->addCssJs();
+    }
+
+	protected function _getDataArray($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage)
+    {
+    	$this->_aOptions['source'] = array();
+
+    	$aCategoriesDb = $this->_oModule->_oDb->getCategories(array('type' => 'all_pairs'));
+    	$aCategoriesAll = BxDolForm::getDataItems($this->_oModule->_oConfig->CNF['OBJECT_CATEGORY']);
+        if(!empty($aCategoriesAll) && is_array($aCategoriesAll)) {
+        	foreach($aCategoriesAll as $sValue => $sTitle) {
+        		if(empty($sValue))
+        			continue;
+
+        		$this->_aOptions['source'][] = array(
+        			'category' => $sValue,
+        			'title' => $sTitle,
+        			'visible_for_levels' => array_key_exists($sValue, $aCategoriesDb) ? $aCategoriesDb[$sValue] : $this->_iVisibleForDefault
+        		);
+        	}
+        }
+
+        return parent::_getDataArray($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage);
+    }
+}
+
+/** @} */

+ 25 - 8
modules/boonex/forum/classes/BxForumModule.php

@@ -73,7 +73,7 @@ class BxForumModule extends BxBaseModTextModule
     	if($sUnitView != 'table')   
         	return $this->_serviceBrowse($sType, $sUnitView ? array('unit_view' => $sUnitView) : false, BX_DB_PADDING_DEF, $bEmptyMessage, $bAjaxPaginate);
 
-        return $this->_serviceBrowseTable($sType);
+        return $this->_serviceBrowseTable(array('type' => $sType));
     }
 
 	public function serviceBrowseLatest($sUnitView = false, $bEmptyMessage = true, $bAjaxPaginate = true)
@@ -83,7 +83,7 @@ class BxForumModule extends BxBaseModTextModule
     	if($sUnitView != 'table')
         	return $this->_serviceBrowse($sType, $sUnitView ? array('unit_view' => $sUnitView) : false, BX_DB_PADDING_DEF, $bEmptyMessage, $bAjaxPaginate);
 
-		return $this->_serviceBrowseTable($sType);
+		return $this->_serviceBrowseTable(array('type' => $sType));
     }
 
 	public function serviceBrowseTop($sUnitView = false, $bEmptyMessage = true, $bAjaxPaginate = true)
@@ -93,7 +93,27 @@ class BxForumModule extends BxBaseModTextModule
     	if($sUnitView != 'table')   
         	return $this->_serviceBrowse($sType, $sUnitView ? array('unit_view' => $sUnitView) : false, BX_DB_PADDING_DEF, $bEmptyMessage, $bAjaxPaginate);
 
-		return $this->_serviceBrowseTable($sType);
+		return $this->_serviceBrowseTable(array('type' => $sType));
+    }
+
+    public function serviceBrowseCategories($bEmptyMessage = true)
+    {
+    	return $this->_oTemplate->getCategories($bEmptyMessage);
+    }
+
+    public function serviceBrowseCategory($sUnitView = false, $bEmptyMessage = true, $bAjaxPaginate = true)
+    {
+    	$sType = 'category';
+    	$iCategory = bx_process_input(bx_get('category'), BX_DATA_INT);
+
+    	$aCategory = $this->_oDb->getCategories(array('type' => 'by_category', 'category' => $iCategory));
+    	if(!empty($aCategory['visible_for_levels']) && !BxDolAcl::getInstance()->isMemberLevelInSet($aCategory['visible_for_levels']))
+    		return $bEmptyMessage ? MsgBox(_t('_sys_txt_access_denied')) : '';
+
+    	if($sUnitView != 'table')   
+        	return $this->_serviceBrowse($sType, $sUnitView ? array('unit_view' => $sUnitView) : false, BX_DB_PADDING_DEF, $bEmptyMessage, $bAjaxPaginate);
+
+		return $this->_serviceBrowseTable(array('type' => $sType, 'where' => array('cat' => $iCategory)));
     }  
 
     /**
@@ -264,16 +284,13 @@ class BxForumModule extends BxBaseModTextModule
         return _t('_sys_txt_access_denied');
     }
 
-	protected function _serviceBrowseTable($sType)
+	protected function _serviceBrowseTable($aParams)
     {
         $oGrid = BxDolGrid::getObjectInstance($this->_oConfig->CNF['OBJECT_GRID']);
         if(!$oGrid)
 			return false;
 
-		$oGrid->setBrowseType($sType);
-        $oGrid->addMarkers(array(
-            'profile_id' => bx_get_logged_profile_id(),
-        ));
+		$oGrid->setBrowseParams($aParams);
 
         return $oGrid->getCode();
     }

+ 7 - 0
modules/boonex/forum/classes/BxForumPageBrowse.php

@@ -20,6 +20,13 @@ class BxForumPageBrowse extends BxBaseModTextPageBrowse
         parent::__construct($aObject, $oTemplate);
 
         $this->_oModule->_oTemplate->addJs(array('main.js'));
+
+        $iCategory = bx_process_input(bx_get('category'), BX_DATA_INT);
+        if(!empty($iCategory))
+	        $this->addMarkers(array(
+	        	'category_id' => $iCategory,
+	        	'category_name' => BxDolCategory::getObjectInstance($this->_oModule->_oConfig->CNF['OBJECT_CATEGORY'])->getCategoryTitle($iCategory),
+	        ));
     }
 
 	public function getCode()

+ 15 - 0
modules/boonex/forum/classes/BxForumSearchResult.php

@@ -25,6 +25,7 @@ class BxForumSearchResult extends BxBaseModTextSearchResult
             'searchFields' => array('title', 'text'),
             'restriction' => array(
                 'author' => array('value' => '', 'field' => 'author', 'operator' => '='),
+        		'category' => array('value' => '', 'field' => 'cat', 'operator' => '='),
         		'status' => array('value' => 'active', 'field' => 'status', 'operator' => '='),
             ),
             'paginate' => array('perPage' => getParam('bx_forum_per_page_browse'), 'start' => 0),
@@ -65,6 +66,20 @@ class BxForumSearchResult extends BxBaseModTextSearchResult
                 $this->sBrowseUrl = 'page.php?i=' . $CNF['URI_AUTHOR_ENTRIES'] . '&profile_id={profile_id}';
                 $this->aCurrent['title'] = _t('_bx_forum_page_title_browse_by_author');
                 $this->aCurrent['rss']['link'] = 'modules/?r=forum/rss/' . $sMode . '/' . $oProfileAuthor->id();
+                break;
+
+			case 'category':
+				$iCategory = (int)$aParams['category'];
+				$this->addMarkers(array(
+					'category_id' => $iCategory,
+					'category_name' => BxDolCategory::getObjectInstance($CNF['OBJECT_CATEGORY'])->getCategoryTitle($iCategory),
+				));
+
+                $this->aCurrent['restriction']['category']['value'] = $iCategory;
+
+                $this->sBrowseUrl = 'page.php?i=' . $CNF['URI_CATEGORY_ENTRIES'] . '&category={category_id}';
+                $this->aCurrent['title'] = _t('_bx_forum_page_title_browse_by_category');
+                $this->aCurrent['rss']['link'] = 'modules/?r=forum/rss/' . $sMode . '/' . $iCategory;
                 break;
 
 			case 'new':

+ 39 - 0
modules/boonex/forum/classes/BxForumStudioPage.php

@@ -0,0 +1,39 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Forum Forum
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+define('BX_DOL_STUDIO_MOD_TYPE_CATEGORIES', 'categories');
+
+class BxForumStudioPage extends BxTemplStudioModule
+{
+	protected $_sModule;
+	protected $_oModule;
+
+    function __construct($sModule = "", $sPage = "")
+    {
+    	$this->_sModule = 'bx_forum';
+    	$this->_oModule = BxDolModule::getInstance($this->_sModule);
+
+        parent::__construct($sModule, $sPage);
+
+        $this->aMenuItems[] = array('name' => BX_DOL_STUDIO_MOD_TYPE_CATEGORIES, 'icon' => 'bars', 'title' => '_bx_forum_lmi_cpt_categories');
+    }
+
+	protected function getCategories()
+    {
+        $oGrid = BxDolGrid::getObjectInstance($this->_oModule->_oConfig->CNF['OBJECT_GRID_CATEGORIES']);
+        if(!$oGrid)
+            return '';
+
+        return $oGrid->getCode();
+    }
+}
+
+/** @} */

+ 31 - 1
modules/boonex/forum/classes/BxForumTemplate.php

@@ -31,7 +31,9 @@ class BxForumTemplate extends BxBaseModTextTemplate
         $oCategory = BxDolCategory::getObjectInstance($CNF['OBJECT_CATEGORY']);
 
         $aTmplVarsItems = array(array(
-        	'url' => $oCategory->getCategoryUrl($aContentInfo[$CNF['FIELD_CATEGORY']]),
+        	'url' => bx_append_url_params($oPermalink->permalink('page.php?i=' . $CNF['URI_CATEGORY_ENTRIES']), array(
+        		'category' => $aContentInfo[$CNF['FIELD_CATEGORY']]
+        	)),
         	'title' => $oCategory->getCategoryTitle($aContentInfo[$CNF['FIELD_CATEGORY']])
         ), array(
         	'url' => $oPermalink->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]),
@@ -134,6 +136,34 @@ class BxForumTemplate extends BxBaseModTextTemplate
         return $this->parseHtmlByName('participants.html', $aVars);
     }
 
+    function getCategories($bEmptyMessage = true)
+    {
+    	$CNF = BxDolModule::getInstance($this->MODULE)->_oConfig->CNF;
+
+    	$aCategories = BxDolForm::getDataItems($CNF['OBJECT_CATEGORY']);
+    	if(empty($aCategories) ||  !is_array($aCategories))
+    		return $bEmptyMessage ? MsgBox(_t('Empty')) : '';
+
+		$oPermalink = BxDolPermalinks::getInstance();
+		$oCategories = BxDolCategory::getObjectInstance($CNF['OBJECT_CATEGORY']);
+
+		$aTmplVarsCategories = array();
+		foreach($aCategories as $iValue => $sTitle) {
+			if(empty($iValue))
+				continue;
+
+			$aTmplVarsCategories[] = array(
+				'title' => $sTitle,
+				'link' => BX_DOL_URL_ROOT . $oPermalink->permalink('page.php?i=' . $CNF['URI_CATEGORY_ENTRIES'] . '&category=' . $iValue),
+				'count' => $oCategories->getItemsNum($iValue)
+			);
+        }
+
+        return $this->parseHtmlByName('categories.html', array(
+        	'bx_repeat:categories' => $aTmplVarsCategories
+        ));
+    }
+
 	function getEntryAuthor($aRow)
     {
     	$oProfileAuthor = BxDolProfile::getInstance($aRow['author']);

+ 23 - 2
modules/boonex/forum/install/langs/en.xml

@@ -66,6 +66,7 @@
     <string name="_bx_forum_page_title_browse"><![CDATA[Forum]]></string>
 	<string name="_bx_forum_page_title_search_results"><![CDATA[Discussions matching "{0}"]]></string>
 	<string name="_bx_forum_page_title_browse_by_author"><![CDATA[Discussions of {display_name}]]></string>
+	<string name="_bx_forum_page_title_browse_by_category"><![CDATA[Discussions by {category_name}]]></string>
 	<string name="_bx_forum_page_title_browse_new"><![CDATA[New]]></string>
     <string name="_bx_forum_page_title_browse_latest"><![CDATA[Latest]]></string>
     <string name="_bx_forum_page_title_browse_top"><![CDATA[Top]]></string>
@@ -97,8 +98,10 @@
     <string name="_bx_forum_page_title_sys_entries_categories"><![CDATA[Categories]]></string>
     <string name="_bx_forum_page_title_entries_categories"><![CDATA[Categories]]></string>
     <string name="_bx_forum_page_block_title_entries_categories"><![CDATA[Categories]]></string>
-    <string name="_bx_forum_page_block_title_entries_by_category"><![CDATA[Discussions by <a href="{link}">{title}</a>]]></string>
+    <string name="_bx_forum_page_title_sys_entries_by_category"><![CDATA[Discussions by category]]></string>
+    <string name="_bx_forum_page_title_entries_by_category"><![CDATA[Discussions by {category_name}]]></string>
     <string name="_bx_forum_page_block_title_sys_entries_by_category"><![CDATA[Discussions by category]]></string>
+    <string name="_bx_forum_page_block_title_entries_by_category"><![CDATA[Discussions by {category_name}]]></string>
     <string name="_bx_forum_page_title_sys_entries_of_author"><![CDATA[Discussions of author]]></string>
     <string name="_bx_forum_page_title_entries_of_author"><![CDATA[Discussions by {display_name}]]></string>
     <string name="_bx_forum_page_block_title_entries_of_author"><![CDATA[Discussions by <a href="{profile_link}">{display_name}</a>]]></string>
@@ -165,6 +168,7 @@
     <string name="_bx_forum_menu_item_title_forum"><![CDATA[Forum]]></string>
     <string name="_bx_forum_menu_item_title_system_unreplied_discussions"><![CDATA[Unreplied discussions number]]></string>
     <string name="_bx_forum_menu_item_title_unreplied_discussions"><![CDATA[{addon} unreplied discussions]]></string>
+    <string name="_bx_forum_lmi_cpt_categories"><![CDATA[Categories]]></string>
 
 	<string name="_bx_forum_grid_filter_item_title_adm_select_one_filter1"><![CDATA[All Statuses]]></string>
 	<string name="_bx_forum_grid_filter_item_title_adm_active"><![CDATA[Active]]></string>
@@ -173,12 +177,29 @@
     <string name="_bx_forum_grid_column_title_adm_title"><![CDATA[Title]]></string>
     <string name="_bx_forum_grid_column_title_adm_added"><![CDATA[Added]]></string>
     <string name="_bx_forum_grid_column_title_adm_author"><![CDATA[Author]]></string>
+    <string name="_bx_forum_grid_column_title_title"><![CDATA[Category]]></string>
+    <string name="_bx_forum_grid_column_title_visible_for_levels"><![CDATA[Visible For]]></string>
     <string name="_bx_forum_grid_action_title_adm_edit"><![CDATA[Edit]]></string>
     <string name="_bx_forum_grid_action_title_adm_delete"><![CDATA[Delete]]></string>
     <string name="_bx_forum_grid_action_title_adm_more_actions"><![CDATA[More Actions]]></string>
+    <string name="_bx_forum_grid_action_title_add"><![CDATA[New discussion]]></string>
+    <string name="_bx_forum_grid_action_title_show_to"><![CDATA[Show To]]></string>
     <string name="_bx_forum_grid_action_err_delete"><![CDATA[Cannot delete the selected discussion(s).]]></string>
     <string name="_bx_forum_grid_txt_account_manager"><![CDATA[Redirect to manage account.]]></string>
-    <string name="_bx_forum_grid_action_title_add"><![CDATA[New discussion]]></string>
+    <string name="_bx_forum_grid_txt_manage_visibility"><![CDATA[Manage visibility settings.]]></string>
+    <string name="_bx_forum_grid_show_to_popup"><![CDATA[Show category to:]]></string>
+    <string name="_bx_forum_grid_txt_visible_for"><![CDATA[Visible For]]></string>
+    <string name="_bx_forum_grid_txt_visible_for_all"><![CDATA[Anyone]]></string>
+	<string name="_bx_forum_grid_txt_visible_for_levels"><![CDATA[Select Levels]]></string>
+	<string name="_bx_forum_grid_txt_visible_for_selected"><![CDATA[Selected levels]]></string>
+	<string name="_bx_forum_grid_inf_visible_for_levels"><![CDATA[Select user levels that can view this category]]></string>
+	<string name="_bx_forum_grid_err_show_to"><![CDATA[Cannot update category.]]></string>
+	<string name="_bx_forum_grid_btn_save"><![CDATA[Save]]></string>
+	<string name="_bx_forum_grid_btn_cancel"><![CDATA[Cancel]]></string>
+	
+    <string name="_bx_forum_grid_txt_"><![CDATA[]]></string>
+    <string name="_bx_forum_grid_txt_"><![CDATA[]]></string>
+    <string name="_bx_forum_grid_txt_"><![CDATA[]]></string>
 
 	<string name="_bx_forum_pre_lists_cats"><![CDATA[Forum categories]]></string>
     <string name="_bx_forum_cat_General"><![CDATA[General]]></string>

+ 3 - 3
modules/boonex/forum/install/sql/disable.sql

@@ -21,9 +21,9 @@ DELETE FROM `sys_menu_items` WHERE `module` = @sName OR `set_name` IN('bx_forum_
 
 
 -- GRID
-DELETE FROM `sys_objects_grid` WHERE `object` LIKE 'bx_forum%';
-DELETE FROM `sys_grid_fields` WHERE `object` LIKE 'bx_forum%';
-DELETE FROM `sys_grid_actions` WHERE `object` LIKE 'bx_forum%';
+DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_forum', 'bx_forum_administration', 'bx_forum_common', 'bx_forum_categories');
+DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_forum', 'bx_forum_administration', 'bx_forum_common', 'bx_forum_categories');
+DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_forum', 'bx_forum_administration', 'bx_forum_common', 'bx_forum_categories');
 
 
 -- ACL

+ 23 - 4
modules/boonex/forum/install/sql/enable.sql

@@ -80,13 +80,20 @@ INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `lay
 INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
 ('bx_forum_updated', 1, @sName, '_bx_forum_page_block_title_updated_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_forum";s:6:"method";s:14:"browse_updated";s:6:"params";a:1:{i:0;s:5:"table";}}', 0, 1, 1);
 
--- PAGE: entries by category
+-- PAGE: categories
 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 
 ('bx_forum_categories', 'discussions-categories', '_bx_forum_page_title_sys_entries_categories', '_bx_forum_page_title_entries_categories', @sName, 5, 2147483647, 1, '', '', '', '', 0, 1, 0, 'BxForumPageBrowse', 'modules/boonex/forum/classes/BxForumPageBrowse.php');
 
 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_forum_categories', 1, @sName, '', '_bx_forum_page_block_title_entries_categories', 13, 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:13:"bx_forum_cats";i:1;a:1:{s:10:"show_empty";b:1;}}s:5:"class";s:20:"TemplServiceCategory";}', 0, 0, 1, 0);
---('bx_forum_categories', 1, @sName, '_bx_forum_page_block_title_sys_entries_by_category', '_bx_forum_page_block_title_entries_by_category', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_forum";s:6:"method";s:15:"browse_category";s:6:"params";a:1:{i:0;s:7:"gallery";}}', 0, 0, 1, 1);
+('bx_forum_categories', 1, @sName, '', '_bx_forum_page_block_title_entries_categories', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_forum";s:6:"method";s:17:"browse_categories";}', 0, 0, 1, 0);
+
+-- PAGE: entries by category
+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 
+('bx_forum_category', 'discussions-category', '_bx_forum_page_title_sys_entries_by_category', '_bx_forum_page_title_entries_by_category', @sName, 5, 2147483647, 1, 'page.php?i=discussions-category', '', '', '', 0, 1, 0, 'BxForumPageBrowse', 'modules/boonex/forum/classes/BxForumPageBrowse.php');
+
+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_forum_category', 1, @sName, '_bx_forum_page_block_title_sys_entries_by_category', '_bx_forum_page_block_title_entries_by_category', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_forum";s:6:"method";s:15:"browse_category";s:6:"params";a:1:{i:0;s:5:"table";}}', 0, 0, 1, 1);
+
 
 -- PAGE: entries of author
 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 
@@ -96,13 +103,14 @@ INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `t
 ('bx_forum_author', 1, @sName, '', '_bx_forum_page_block_title_entries_actions', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_forum";s:6:"method";s:18:"my_entries_actions";}', 0, 0, 1, 0),
 ('bx_forum_author', 1, @sName, '_bx_forum_page_block_title_sys_entries_of_author', '_bx_forum_page_block_title_entries_of_author', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_forum";s:6:"method";s:13:"browse_author";}', 0, 0, 1, 1);
 
+
 -- PAGE: module home
 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 
 ('bx_forum_home', 'discussions-home', '_bx_forum_page_title_sys_home', '_bx_forum_page_title_home', @sName, 2, 2147483647, 1, 'page.php?i=discussions-home', '', '', '', 0, 1, 0, 'BxForumPageBrowse', 'modules/boonex/forum/classes/BxForumPageBrowse.php');
 
 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_forum_home', 1, @sName, '', '_bx_forum_page_block_title_latest_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_forum";s:6:"method";s:13:"browse_latest";s:6:"params";a:1:{i:0;s:5:"table";}}', 0, 1, 1, 0),
-('bx_forum_home', 2, @sName, '', '_bx_forum_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:13:"bx_forum_cats";i:1;a:1:{s:10:"show_empty";b:1;}}s:5:"class";s:20:"TemplServiceCategory";}', 0, 1, 1, 0),
+('bx_forum_home', 2, @sName, '', '_bx_forum_page_block_title_cats', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_forum";s:6:"method";s:17:"browse_categories";}', 0, 1, 1, 0),
 ('bx_forum_home', 2, @sName, '', '_bx_forum_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:8:"bx_forum";i:1;s:8:"bx_forum";}s:5:"class";s:20:"TemplServiceMetatags";}', 0, 1, 1, 1);
 
 -- PAGE: module manage own
@@ -267,6 +275,17 @@ INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon
 ('bx_forum_common', 'single', 'delete', '_bx_forum_grid_action_title_adm_delete', 'remove', 1, 1, 2),
 ('bx_forum_common', 'single', 'settings', '_bx_forum_grid_action_title_adm_more_actions', 'cog', 1, 0, 3);
 
+-- GRIDS: categories manager
+INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_mode`, `sorting_fields`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
+('bx_forum_categories', 'Array', '', '', 'category', '', '', 10, NULL, 'start', '', 'title', 'auto', '', 192, 'BxForumGridCategories', 'modules/boonex/forum/classes/BxForumGridCategories.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `params`, `order`) VALUES
+('bx_forum_categories', 'title', '_bx_forum_grid_column_title_title', '60%', '', 1),
+('bx_forum_categories', 'visible_for_levels', '_bx_forum_grid_column_title_visible_for_levels', '40%', '', 2);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `confirm`, `order`) VALUES
+('bx_forum_categories', 'single', 'show_to', '_bx_forum_grid_action_title_show_to', '', 0, 1);
+
 
 -- ACL
 INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES

+ 6 - 0
modules/boonex/forum/install/sql/install.sql

@@ -25,6 +25,12 @@ CREATE TABLE IF NOT EXISTS `bx_forum_discussions` (
   KEY `lr_timestamp` (`lr_timestamp`)
 );
 
+CREATE TABLE IF NOT EXISTS `bx_forum_categories` (
+  `category` int(11) NOT NULL default '0',
+  `visible_for_levels` int(11) NOT NULL default '2147483647',
+  PRIMARY KEY (`category`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
 -- TABLE: storages & transcoders
 CREATE TABLE IF NOT EXISTS `bx_forum_files` (
   `id` int(11) NOT NULL AUTO_INCREMENT,

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

@@ -2,7 +2,7 @@ SET @sName = 'bx_forum';
 
 
 -- TABLES: entries
-DROP TABLE IF EXISTS `bx_forum_discussions`, `bx_forum_files`, `bx_forum_photos_resized`, `bx_forum_cmts`, `bx_forum_views_track`, `bx_forum_meta_keywords`, `bx_forum_reports`, `bx_forum_reports_track`;
+DROP TABLE IF EXISTS `bx_forum_discussions`, `bx_forum_categories`, `bx_forum_files`, `bx_forum_photos_resized`, `bx_forum_cmts`, `bx_forum_views_track`, `bx_forum_meta_keywords`, `bx_forum_reports`, `bx_forum_reports_track`;
 
 
 -- STORAGES & TRANSCODERS

+ 22 - 0
modules/boonex/forum/js/studio.js

@@ -0,0 +1,22 @@
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Forum Forum
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+function BxForumStudio(oOptions) {
+	this._sActionsUrl = oOptions.sActionUrl;
+    this._sObjName = oOptions.sObjName == undefined ? 'oFormStudio' : oOptions.sObjName;
+    this._sAnimationEffect = oOptions.sAnimationEffect == undefined ? 'fade' : oOptions.sAnimationEffect;
+    this._iAnimationSpeed = oOptions.iAnimationSpeed == undefined ? 'slow' : oOptions.iAnimationSpeed;
+}
+
+BxForumStudio.prototype.onChangeVisibleFor = function(oSelect) {
+	$('#bx-form-element-visible_for_levels').bx_anim($(oSelect).val() == 'all' ? 'hide' : 'show', this.sAnimationEffect, this.iAnimationSpeed, function() {
+		$('.bx-popup-applied:visible')._dolPopupSetPosition();
+	});
+};

+ 7 - 0
modules/boonex/forum/template/categories.html

@@ -0,0 +1,7 @@
+<div class="bx-category-list">
+	<bx_repeat:categories>
+		<div class="bx-category-list-item">
+			<a href="__link__">__title__</a> (__count__)
+		</div>
+	</bx_repeat:categories>
+</div>

+ 22 - 0
modules/boonex/forum/template/category_visible_for.html

@@ -0,0 +1,22 @@
+<div class="bx-forum-visible-for bx-def-color-bg-block">
+    <div class="bx-forum-visible-for-cnt">
+        __form__
+        <script type="text/javascript">
+            $(document).ready(function () {
+            	if($("[bx_grid_action_single = 'delete_icon']").length > 0)
+            	    glGrids.__object__._bindActionsSingle($("#__form_id__"));
+
+                $("#__form_id__").ajaxForm({ 
+                    dataType: "json",
+                    beforeSubmit: function (formData, jqForm, options) {
+                        bx_loading($("#__form_id__"), true);
+                    },
+                    success: function (data) {
+                        $(".bx-popup-applied:visible").dolPopupHide();
+                        glGrids.__object__.processJson(data, '__action__');
+                    }
+                });
+            });
+        </script>
+    </div>
+</div>

+ 19 - 2
modules/boonex/russian/data/langs/bx_forum/ru.xml

@@ -66,6 +66,7 @@
     <string name="_bx_forum_page_title_browse"><![CDATA[Форум]]></string>
 	<string name="_bx_forum_page_title_search_results"><![CDATA[Обсуждения, соответствующие "{0}"]]></string>
 	<string name="_bx_forum_page_title_browse_by_author"><![CDATA[Обсуждения {display_name}]]></string>
+	<string name="_bx_forum_page_title_browse_by_category"><![CDATA[Обсуждения в {category_name}]]></string>
 	<string name="_bx_forum_page_title_browse_new"><![CDATA[Новые]]></string>
     <string name="_bx_forum_page_title_browse_latest"><![CDATA[Недавние]]></string>
     <string name="_bx_forum_page_title_browse_top"><![CDATA[ТОП]]></string>
@@ -97,8 +98,10 @@
     <string name="_bx_forum_page_title_sys_entries_categories"><![CDATA[Категории]]></string>
     <string name="_bx_forum_page_title_entries_categories"><![CDATA[Категории]]></string>
     <string name="_bx_forum_page_block_title_entries_categories"><![CDATA[Категории]]></string>
-    <string name="_bx_forum_page_block_title_entries_by_category"><![CDATA[Обсуждения в <a href="{link}">{title}</a>]]></string>
+    <string name="_bx_forum_page_title_sys_entries_by_category"><![CDATA[Обсуждения в категории]]></string>
+    <string name="_bx_forum_page_title_entries_by_category"><![CDATA[Обсуждения в {category_name}]]></string>
     <string name="_bx_forum_page_block_title_sys_entries_by_category"><![CDATA[Обсуждения в категории]]></string>
+    <string name="_bx_forum_page_block_title_entries_by_category"><![CDATA[Обсуждения в {category_name}]]></string>
     <string name="_bx_forum_page_title_sys_entries_of_author"><![CDATA[Обсуждения автора]]></string>
     <string name="_bx_forum_page_title_entries_of_author"><![CDATA[{display_name} - Обсуждения]]></string>
     <string name="_bx_forum_page_block_title_entries_of_author"><![CDATA[<a href="{profile_link}">{display_name}</a> - Обсуждения]]></string>   
@@ -165,6 +168,7 @@
     <string name="_bx_forum_menu_item_title_forum"><![CDATA[обсуждение]]></string>
     <string name="_bx_forum_menu_item_title_system_unreplied_discussions"><![CDATA[Количество неотвеченных дискуссий]]></string>
     <string name="_bx_forum_menu_item_title_unreplied_discussions"><![CDATA[{addon} неотвеченных дискуссий]]></string>
+    <string name="_bx_forum_lmi_cpt_categories"><![CDATA[Категории]]></string>
 
 	<string name="_bx_forum_grid_filter_item_title_adm_select_one_filter1"><![CDATA[Все статусы]]></string>
 	<string name="_bx_forum_grid_filter_item_title_adm_active"><![CDATA[Активные]]></string>
@@ -173,12 +177,25 @@
     <string name="_bx_forum_grid_column_title_adm_title"><![CDATA[Заголовок]]></string>
     <string name="_bx_forum_grid_column_title_adm_added"><![CDATA[Добавленные]]></string>
     <string name="_bx_forum_grid_column_title_adm_author"><![CDATA[Автор]]></string>
+    <string name="_bx_forum_grid_column_title_title"><![CDATA[Категория]]></string>
+    <string name="_bx_forum_grid_column_title_visible_for_levels"><![CDATA[Видимо для]]></string>
     <string name="_bx_forum_grid_action_title_adm_edit"><![CDATA[Редактировать]]></string>
     <string name="_bx_forum_grid_action_title_adm_delete"><![CDATA[Удалить]]></string>
     <string name="_bx_forum_grid_action_title_adm_more_actions"><![CDATA[Дополнительные действия]]></string>
+    <string name="_bx_forum_grid_action_title_add"><![CDATA[Новое сообщение]]></string>
+    <string name="_bx_forum_grid_action_title_show_to"><![CDATA[Показать]]></string>
     <string name="_bx_forum_grid_action_err_delete"><![CDATA[Невозможно удалить выбранное(ные) обсуждение(ния).]]></string>
     <string name="_bx_forum_grid_txt_account_manager"><![CDATA[Перенаправить в Управление аккаунтом.]]></string>
-    <string name="_bx_forum_grid_action_title_add"><![CDATA[Новое сообщение]]></string>
+	<string name="_bx_forum_grid_txt_manage_visibility"><![CDATA[Управление настройками видимости.]]></string>
+	<string name="_bx_forum_grid_show_to_popup"><![CDATA[Категория видна:]]></string>
+    <string name="_bx_forum_grid_txt_visible_for"><![CDATA[Видимо для]]></string>
+    <string name="_bx_forum_grid_txt_visible_for_all"><![CDATA[Всех]]></string>
+	<string name="_bx_forum_grid_txt_visible_for_levels"><![CDATA[Выбрать Уровни]]></string>
+	<string name="_bx_forum_grid_txt_visible_for_selected"><![CDATA[Выбранные уровни]]></string>
+	<string name="_bx_forum_grid_inf_visible_for_levels"><![CDATA[Выбрать членства, которым разрешено просматривать данную категорию.]]></string>
+	<string name="_bx_forum_grid_err_show_to"><![CDATA[Невозможно обновить категорию.]]></string>
+	<string name="_bx_forum_grid_btn_save"><![CDATA[Сохранить]]></string>
+	<string name="_bx_forum_grid_btn_cancel"><![CDATA[Отменить]]></string>
 
     <string name="_bx_forum_pre_lists_cats"><![CDATA[Категории обсуждений]]></string>
     <string name="_bx_forum_cat_General"><![CDATA[Общие]]></string>