• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/block.php
  • Класс: BitrixLandingBlock
  • Вызов: Block::getBlockNamespace
static function getBlockNamespace($code)
{
	static $paths = array();
	static $namespace = array();

	if (!is_string($code))
	{
		return '';
	}

	$code = trim($code);

	if (isset($paths[$code]))
	{
		return $paths[$code];
	}

	$paths[$code] = '';

	$namespaces = self::getNamespaces();
	$generalPaths = self::getGeneralPaths();

	// get first needed block from end
	foreach (array_reverse($namespaces) as $subdir)
	{
		foreach ($generalPaths as $path)
		{
			$path = Manager::getDocRoot() . $path;
			if (file_exists($path . '/' . $subdir . '/' . $code . '/.description.php'))
			{
				$paths[$code] = $subdir;
				break 2;
			}
		}
	}

	return $paths[$code];
}