CPhotogalleryElement::OnAfterRecalcGalleries: Bitrix method

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

    
function OnAfterRecalcGalleries($IBLOCK_ID$INDEX)
    {
        if (
$IBLOCK_ID <= 0)
            return 
false
        
$arFilters = array(
            array(
"IBLOCK_ID" => $IBLOCK_ID"SECTION_ID" => 0">UF_GALLERY_SIZE" => 0"!UF_GALLERY_RECALC" => $INDEX.""), 
            array(
"IBLOCK_ID" => $IBLOCK_ID"SECTION_ID" => 0">UF_GALLERY_SIZE" => 0"UF_GALLERY_RECALC" => false)); 
        
$bs = new CIBlockSection;
        foreach (
$arFilters as $arFilter)
        {
            
$db_res CIBlockSection::GetList(array("ID" => "ASC"), $arFilter); 
            if (
$db_res && $res $db_res->Fetch())
            {
                
                do 
                {
                    
$arFields = array(
                        
"IBLOCK_ID" => $IBLOCK_ID
                        
"UF_GALLERY_SIZE" => 0);
                    
$GLOBALS["UF_GALLERY_SIZE"] = 0
                    
$GLOBALS["USER_FIELD_MANAGER"]->EditFormAddFields("IBLOCK_".$IBLOCK_ID."_SECTION"$arFields);
                    
$bs->Update($res["ID"], $arFieldsfalsefalse);
                } while (
$res $db_res->Fetch()); 
            }
        }
    }