%PDF- %PDF-
Server IP : 37.220.80.31 / Your IP : 18.191.233.34 Web Server : Apache/2.4.52 (Ubuntu) System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64 User : www-root ( 1010) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/modules/bitrix.eshop/install/wizards/bitrix/eshop/site/services/main/ |
Upload File : |
<? if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die(); //echo "WIZARD_SITE_ID=".WIZARD_SITE_ID." | "; //echo "WIZARD_SITE_PATH=".WIZARD_SITE_PATH." | "; //echo "WIZARD_RELATIVE_PATH=".WIZARD_RELATIVE_PATH." | "; //echo "WIZARD_ABSOLUTE_PATH=".WIZARD_ABSOLUTE_PATH." | "; //echo "WIZARD_TEMPLATE_ID=".WIZARD_TEMPLATE_ID." | "; //echo "WIZARD_TEMPLATE_RELATIVE_PATH=".WIZARD_TEMPLATE_RELATIVE_PATH." | "; //echo "WIZARD_TEMPLATE_ABSOLUTE_PATH=".WIZARD_TEMPLATE_ABSOLUTE_PATH." | "; //echo "WIZARD_THEME_ID=".WIZARD_THEME_ID." | "; //echo "WIZARD_THEME_RELATIVE_PATH=".WIZARD_THEME_RELATIVE_PATH." | "; //echo "WIZARD_THEME_ABSOLUTE_PATH=".WIZARD_THEME_ABSOLUTE_PATH." | "; //echo "WIZARD_SERVICE_RELATIVE_PATH=".WIZARD_SERVICE_RELATIVE_PATH." | "; //echo "WIZARD_SERVICE_ABSOLUTE_PATH=".WIZARD_SERVICE_ABSOLUTE_PATH." | "; //echo "WIZARD_IS_RERUN=".WIZARD_IS_RERUN." | "; //die(); if (!defined("WIZARD_TEMPLATE_ID")) return; $bitrixTemplateDir = $_SERVER["DOCUMENT_ROOT"].BX_PERSONAL_ROOT."/templates/".WIZARD_TEMPLATE_ID; CopyDirFiles( $_SERVER["DOCUMENT_ROOT"].WizardServices::GetTemplatesPath(WIZARD_RELATIVE_PATH."/site")."/".WIZARD_TEMPLATE_ID, $bitrixTemplateDir, $rewrite = true, $recursive = true, $delete_after_copy = false, $exclude = "themes" ); //Attach template to default site $obSite = CSite::GetList('def', 'desc', Array("LID" => WIZARD_SITE_ID)); if ($arSite = $obSite->Fetch()) { $arTemplates = Array(); $found = false; $foundEmpty = false; $obTemplate = CSite::GetTemplateList($arSite["LID"]); while($arTemplate = $obTemplate->Fetch()) { if(!$found && trim($arTemplate["CONDITION"]) == '') { $arTemplate["TEMPLATE"] = WIZARD_TEMPLATE_ID; $found = true; } if($arTemplate["TEMPLATE"] == "empty") { $foundEmpty = true; continue; } $arTemplates[]= $arTemplate; } if (!$found) $arTemplates[]= Array("CONDITION" => "", "SORT" => 150, "TEMPLATE" => WIZARD_TEMPLATE_ID); $arFields = Array( "TEMPLATE" => $arTemplates, "NAME" => $arSite["NAME"], ); $obSite = new CSite(); $obSite->Update($arSite["LID"], $arFields); } $wizrdTemplateId = $wizard->GetVar("wizTemplateID"); if (!in_array($wizrdTemplateId, array("eshop_bootstrap", "eshop_vertical", "eshop_horizontal", "eshop_vertical_popup"))) $wizrdTemplateId = "eshop_bootstrap"; COption::SetOptionString("main", "wizard_template_id", $wizrdTemplateId, false, WIZARD_SITE_ID); function ___writeToAreasFile($fn, $text) { $fd = @fopen($fn, "wb"); if(!$fd) return false; if(false === fwrite($fd, $text)) { fclose($fd); return false; } fclose($fd); if(defined("BX_FILE_PERMISSIONS")) @chmod($fn, BX_FILE_PERMISSIONS); } //logo $templateID = $wizard->GetVar("templateID"); $themeID = $wizard->GetVar($templateID."_themeID"); $fLogo = CFile::GetByID($wizard->GetVar("siteLogo")); $logo = $fLogo->Fetch(); $fLogoRetina = CFile::GetByID($wizard->GetVar("siteLogoRetina")); $logoRetina = $fLogoRetina->Fetch(); if($logo || $logoRetina) { if ($logo) { $strOldFile = str_replace("//", "/", WIZARD_SITE_ROOT_PATH."/".(COption::GetOptionString("main", "upload_dir", "upload"))."/".$logo["SUBDIR"]."/".$logo["FILE_NAME"]); @copy($strOldFile, WIZARD_SITE_PATH."include/logo.png"); CFile::Delete($fLogo); } if($logoRetina) { $strOldFile = str_replace("//", "/", WIZARD_SITE_ROOT_PATH."/".(COption::GetOptionString("main", "upload_dir", "upload"))."/".$logoRetina["SUBDIR"]."/".$logoRetina["FILE_NAME"]); @copy($strOldFile, WIZARD_SITE_PATH."include/logo_retina.png"); CFile::Delete($fLogoRetina); } $retinaPath = file_exists(WIZARD_SITE_ROOT_PATH."include/logo_retina.png") ? WIZARD_SITE_PATH."include/logo_retina.png" : ""; $content = '<img src="'.WIZARD_SITE_DIR.'include/logo.png"'.($retinaPath ? ' srcset="'.$retinaPath.' 2x"' : "").'/>'; ___writeToAreasFile(WIZARD_SITE_PATH."include/company_logo.php", $content); } elseif(WIZARD_INSTALL_DEMO_DATA || !file_exists(WIZARD_SITE_PATH."/include/company_logo.php") && !file_exists(WIZARD_SITE_PATH."/include/logo.png")) { copy(WIZARD_ABSOLUTE_PATH."/site/templates/eshop_bootstrap/themes/".$themeID."/images/logo.png", WIZARD_SITE_PATH."include/logo.png"); copy(WIZARD_ABSOLUTE_PATH."/site/templates/eshop_bootstrap/themes/".$themeID."/images/logo_retina.png", WIZARD_SITE_PATH."include/logo_retina.png"); ___writeToAreasFile(WIZARD_SITE_PATH."include/company_logo.php", '<img src="'.WIZARD_SITE_DIR.'include/logo.png" srcset="'.WIZARD_SITE_DIR.'include/logo_retina.png" />'); } $fLogoMobile = CFile::GetByID($wizard->GetVar("siteLogoMobile")); $logoMobile = $fLogoMobile->Fetch(); $fLogoMobileRetina = CFile::GetByID($wizard->GetVar("siteLogoMobileRetina")); $logoMobileRetina = $fLogoMobileRetina->Fetch(); if($logoMobile || $logoMobileRetina) { if ($logoMobile) { $strOldFile = str_replace("//", "/", WIZARD_SITE_ROOT_PATH."/".(COption::GetOptionString("main", "upload_dir", "upload"))."/".$logoMobile["SUBDIR"]."/".$logoMobile["FILE_NAME"]); @copy($strOldFile, WIZARD_SITE_PATH."include/logo_mobile.png"); CFile::Delete($fLogoMobile); } if($logoMobileRetina) { $strOldFile = str_replace("//", "/", WIZARD_SITE_ROOT_PATH."/".(COption::GetOptionString("main", "upload_dir", "upload"))."/".$logoMobileRetina["SUBDIR"]."/".$logoMobileRetina["FILE_NAME"]); @copy($strOldFile, WIZARD_SITE_PATH."include/logo_mobile_retina.png"); CFile::Delete($fLogoMobileRetina); } $retinaPath = file_exists(WIZARD_SITE_ROOT_PATH."include/logo_mobile_retina.png") ? WIZARD_SITE_PATH."include/logo_mobile_retina.png" : ""; $content = '<img src="'.WIZARD_SITE_DIR.'include/logo_mobile.png"'.($retinaPath ? ' srcset="'.$retinaPath.' 2x"' : "").'/>'; ___writeToAreasFile(WIZARD_SITE_PATH."include/company_logo_mobile.php", $content); } elseif(WIZARD_INSTALL_DEMO_DATA || !file_exists(WIZARD_SITE_PATH."/include/company_logo_mobile.php") && !file_exists(WIZARD_SITE_PATH."/include/logo_mobile.png") /*|| __isDefaultLogoOrText(WIZARD_SITE_PATH."/include/company_name.php")*/) { copy(WIZARD_ABSOLUTE_PATH."/site/templates/eshop_bootstrap/themes/".$themeID."/images/logo_mobile.png", WIZARD_SITE_PATH."include/logo_mobile.png"); copy(WIZARD_ABSOLUTE_PATH."/site/templates/eshop_bootstrap/themes/".$themeID."/images/logo_mobile_retina.png", WIZARD_SITE_PATH."include/logo_mobile_retina.png"); ___writeToAreasFile(WIZARD_SITE_PATH."include/company_logo_mobile.php", '<img src="'.WIZARD_SITE_DIR.'include/logo_mobile.png" srcset="'.WIZARD_SITE_DIR.'include/logo_mobile_retina.png" />'); } ?>