CBPRuntime :: GetActivityDescription: Bitrix method

      
<?php 
//  CBPRuntime :: GetActivityDescription()
//  /dist/bitrix/modules/bizproc/classes/general/runtime.php:447

    
public function GetActivityDescription($code$lang false)
    {
        if (
preg_match("#[^a-zA-Z0-9_]#"$code))
            return 
null;
        if (
strlen($code) <= 0)
            return 
null;

        
$code strtolower($code);
        if (
substr($code03) == "cbp")
            
$code substr($code3);
        if (
strlen($code) <= 0)
            return 
null;

        
$filePath "";
        
$fileDir "";
        foreach (
$this->arActivityFolders as $folder)
        {
            if (
file_exists($folder."/".$code."/".$code.".php") && is_file($folder."/".$code."/".$code.".php"))
            {
                
$filePath $folder."/".$code."/.description.php";
                
$fileDir $folder."/".$code;
                break;
            }
        }

        if (
strlen($filePath) > 0)
        {
            
$arActivityDescription = array();
            if (
file_exists($filePath) && is_file($filePath))
            {
                
$this->LoadActivityLocalization($fileDir".description.php");
                include(
$filePath);
            }
            
$arActivityDescription["PATH_TO_ACTIVITY"] = $fileDir;

            return 
$arActivityDescription;
        }

        if (
strpos($code, static::REST_ACTIVITY_PREFIX) === 0)
        {
            
$code substr($codestrlen(static::REST_ACTIVITY_PREFIX));
            
$result RestActivityTable::getList(array(
                
'filter' => array('=INTERNAL_CODE' => $code)
            ));
            
$activity $result->fetch();
            if (
$activity)
            {
                return 
$this->makeRestActivityDescription($activity$lang);
            }
        }

        return 
null;
    }