• Модуль: intranet
  • Путь к файлу: ~/bitrix/modules/intranet/lib/controller/searchentity.php
  • Класс: BitrixIntranetControllerSearchEntity
  • Вызов: SearchEntity::getAllAction
public function getAllAction($entity)
{
	$entity = trim($entity);

	if ($entity == '')
	{
		$this->addError(new Error(Loc::getMessage('INTRANET_CONTROLLER_SEARCHENTITY_GETALL_ENTITY_EMPTY'), 'INTRANET_CONTROLLER_SEARCHENTITY_GETALL_ENTITY_EMPTY'));
		return null;
	}
	if (!in_array($entity, self::getAllEntities()))
	{
		$this->addError(new Error(Loc::getMessage('INTRANET_CONTROLLER_SEARCHENTITY_GETALL_ENTITY_INCORRECT'), 'INTRANET_CONTROLLER_SEARCHENTITY_GETALL_ENTITY_INCORRECT'));
		return null;
	}


	$items = array();

	if ($entity == self::ENTITY_SONETGROUPS)
	{
		$sonetGroupsList = CB24SearchTitle::getSonetGroups();
		foreach($sonetGroupsList as $group)
		{
			$items['G'.$group['ID']] = CB24SearchTitle::convertAjaxToClientDb($group, $entity);
		}
	}
	elseif ($entity == self::ENTITY_MENUITEMS)
	{
		$menuItemsList = CB24SearchTitle::getMenuItems();
		foreach($menuItemsList as $menuItem)
		{
			$items['M'.$menuItem['URL']] = CB24SearchTitle::convertAjaxToClientDb($menuItem, $entity);
		}
	}

	return array(
		'items' => $items
	);
}