advertising :: UnInstallFiles: Bitrix method

      
<?php 
//  advertising :: UnInstallFiles()
//  /dist/bitrix/modules/advertising/install/index.php:185

    
function UnInstallFiles()
    {
        global 
$DB;

        if (!
array_key_exists("savedata"$_REQUEST) || $_REQUEST["savedata"] !== "Y")
        {
            
$db_res $DB->Query("SELECT ID FROM b_file WHERE MODULE_ID = 'advertising'");
            while (
$arRes $db_res->Fetch())
            {
                
CFile::Delete($arRes["ID"]);
            }
        }

        
DeleteDirFiles($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/advertising/install/admin"$_SERVER["DOCUMENT_ROOT"]."/bitrix/admin");
        
DeleteDirFiles($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/advertising/install/themes/.default/"$_SERVER["DOCUMENT_ROOT"]."/bitrix/themes/.default");//css
        
DeleteDirFilesEx("/bitrix/themes/.default/icons/advertising/");//icons
        
DeleteDirFilesEx("/bitrix/images/advertising/");//images
        
DeleteDirFilesEx("/bitrix/js/advertising/");
        
DeleteDirFiles($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/advertising/install/public"$_SERVER["DOCUMENT_ROOT"]."/bitrix");

        return 
true;
    }