From 84a12e28df045b63a415f09e383a0d0f8e9c2099 Mon Sep 17 00:00:00 2001 From: hide_d Date: Thu, 2 May 2019 00:50:24 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A7=80=EB=8F=84=20=EB=93=B1=EC=9D=84=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=ED=95=A0=20=EA=B2=BD=EC=9A=B0=20css,=20js?= =?UTF-8?q?=EB=A5=BC=20=EC=83=88=EB=A1=9C=20=EC=84=A4=EC=A0=95=ED=95=98?= =?UTF-8?q?=EB=8A=94=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- f_install/j_update_js_css_path.php | 117 +++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 f_install/j_update_js_css_path.php diff --git a/f_install/j_update_js_css_path.php b/f_install/j_update_js_css_path.php new file mode 100644 index 00000000..27b4fc10 --- /dev/null +++ b/f_install/j_update_js_css_path.php @@ -0,0 +1,117 @@ +setReadOnly(); +if($session->userGrade < 6){ + Json::die([ + 'result'=>false, + 'reason'=>'관리자 아님' + ]); +} + +$servHost = Util::getReq('serv_host'); +$sharedIconPath = Util::getReq('shared_icon_path'); +$gameImagePath = Util::getReq('game_image_path'); + +if($servHost){ + if(!$sharedIconPath || $gameImagePath){ + Json::die([ + 'result'=>false, + 'reason'=>'serv_host가 지정된 경우, sharedIconPath와 gameImagePath가 모두 지정되어야합니다.' + ]); + } + + $sharedIconPath = WebUtil::resolveRelativePath($sharedIconPath, $servHost); + $gameImagePath = WebUtil::resolveRelativePath($gameImagePath, $servHost); + + $result = Util::generateFileUsingSimpleTemplate( + __dir__.'/templates/ServConfig.orig.php', + ROOT.'/d_setting/ServConfig.php', + [ + 'serverBasePath'=>$servHost, + 'sharedIconPath'=>$sharedIconPath, + 'gameImagePath'=>$gameImagePath + ], + true + ); + + if ($result !== true) { + Json::die([ + 'result'=>false, + 'reason'=>$result + ]); + } +} +else if($sharedIconPath || $gameImagePath){ + $servHost = ServConfig::$serverWebPath; + if($sharedIconPath){ + $sharedIconPath = WebUtil::resolveRelativePath($sharedIconPath, $servHost); + } + else{ + $sharedIconPath = ServConfig::$sharedIconPath; + } + + if($gameImagePath){ + $gameImagePath = WebUtil::resolveRelativePath($gameImagePath, $servHost); + } + else{ + $gameImagePath = ServConfig::$gameImagePath; + } + + $result = Util::generateFileUsingSimpleTemplate( + __dir__.'/templates/ServConfig.orig.php', + ROOT.'/d_setting/ServConfig.php', + [ + 'serverBasePath'=>$servHost, + 'sharedIconPath'=>$sharedIconPath, + 'gameImagePath'=>$gameImagePath + ], + true + ); + + if ($result !== true) { + Json::die([ + 'result'=>false, + 'reason'=>$result + ]); + } +} +else{ + $servHost = ServConfig::$serverWebPath; + $sharedIconPath = ServConfig::$sharedIconPath; + $gameImagePath = ServConfig::$gameImagePath; +} + + + +$result = Util::generateFileUsingSimpleTemplate( + __dir__.'/templates/common_path.orig.js', + ROOT.'/d_shared/common_path.js', + [ + 'serverBasePath'=>$servHost, + 'sharedIconPath'=>$sharedIconPath, + 'gameImagePath'=>$gameImagePath + ], + true +); + + +$result = Util::generateFileUsingSimpleTemplate( + __dir__.'/templates/common.orig.css', + ROOT.'/d_shared/common.css', + [ + 'serverBasePath'=>$servHost, + 'sharedIconPath'=>$sharedIconPath, + 'gameImagePath'=>$gameImagePath + ], + true +); + +if ($result !== true) { + Json::die([ + 'result'=>false, + 'reason'=>$result + ]); +}