CCrmViewHelper::GetGridOptionalColumns

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmViewHelper
  4. GetGridOptionalColumns
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_view_helper.php
  • Класс: \CCrmViewHelper
  • Вызов: CCrmViewHelper::GetGridOptionalColumns
static function GetGridOptionalColumns($gridID)
{
	$aOptions = CUserOptions::GetOption('main.interface.grid', $gridID, array());
	if(!(isset($aOptions['views']) && is_array($aOptions['views'])))
	{
		$aOptions['views'] = [];
	}
	if(!array_key_exists('default', $aOptions['views']))
	{
		$aOptions['views']['default'] = ['columns'=>''];
	}
	if(($aOptions['current_view'] ?? '') == '' || !array_key_exists($aOptions['current_view'], $aOptions['views']))
	{
		$aOptions['current_view'] = 'default';
	}
	$aCurView = $aOptions['views'][$aOptions['current_view']];
	$aColsTmp = explode(',', $aCurView['columns']);
	$aCols = array();
	foreach($aColsTmp as $col)
		if(trim($col)<>'')
			$aCols[] = trim($col);

	return $aCols;
}

Добавить комментарий