CPhotogalleryElement::OnAfterIBlockElementAdd: Bitrix method

      
<?php 
//  CPhotogalleryElement :: OnAfterIBlockElementAdd()
//  /dist/bitrix/modules/photogallery/classes/general/element.php:201

    
function OnAfterIBlockElementAdd($res)
    {
        
$ID doubleval($res["ID"]); 
        if (
CPhotogalleryElement::CheckElement($ID$arElement$arSection$arGallery))
        {
            
$GLOBALS["UF_GALLERY_SIZE"] = $GLOBALS["PHOTOGALLERY_VARS"]["arGalleries"][$arGallery["ID"]]["UF_GALLERY_SIZE"] = (doubleval($arGallery["UF_GALLERY_SIZE"]) + $arElement["FILE"]["FILE_SIZE"]); 
            
$arFields = array(
                
"IBLOCK_ID" => $arElement["IBLOCK_ID"], 
                
"UF_GALLERY_SIZE" => $GLOBALS["UF_GALLERY_SIZE"]);
            
$bs = new CIBlockSection;
            
$GLOBALS["USER_FIELD_MANAGER"]->EditFormAddFields("IBLOCK_".$arElement["IBLOCK_ID"]."_SECTION"$arFields);
            
$res $bs->Update($arGallery["ID"], $arFieldsfalsefalse);
        }
        return 
true;
    }