CBPCalc::FunctionConvert: Bitrix method

      
<?php 
//  CBPCalc :: FunctionConvert()
//  /dist/bitrix/modules/bizproc/classes/general/calc.php:1201

    
private function FunctionConvert($args)
    {
        if (!
is_array($args))
            
$args = [$args];

        
$ar $this->ArrgsToArray($args);
        
$val array_shift($ar);
        
$type array_shift($ar);
        
$attr array_shift($ar);

        
$type strtolower($type);
        if (
$type === 'printableuserb24')
        {
            
$result = [];

            
$users CBPHelper::StripUserPrefix($val);
            if (!
is_array($users))
                
$users = [$users];

            foreach (
$users as $userId)
            {
                
$db CUser::GetByID($userId);
                if (
$ar $db->GetNext())
                {
                    
$ix randString(5);
                    
$attr = (!empty($attr) ? 'href="'.$attr.'"' 'href="#" onClick="return false;"');
                    
$result[] = '<a class="feed-post-user-name" id="bp_'.$userId.'_'.$ix.'" '.$attr.' bx-post-author-id="'.$userId.'" bx-post-author-gender="'.$ar['PERSONAL_GENDER'].'" bx-tooltip-user-id="'.$userId.'">'.CUser::FormatName(CSite::GetNameFormat(false), $arfalse).'</a>';
                }
            }

            
$result implode(", "$result);
        }
        elseif (
$type == 'printableuser')
        {
            
$result = [];

            
$users CBPHelper::StripUserPrefix($val);
            if (!
is_array($users))
                
$users = [$users];

            foreach (
$users as $userId)
            {
                
$db CUser::GetByID($userId);
                if (
$ar $db->GetNext())
                    
$result[] = CUser::FormatName(CSite::GetNameFormat(false), $arfalse);
            }

            
$result implode(", "$result);

        }
        else
        {
            
$result $val;
        }

        return 
$result;
    }