From a7772498e2148859add9968a100476afbb43e97e Mon Sep 17 00:00:00 2001 From: chicpro Date: Mon, 15 Apr 2013 10:39:21 +0900 Subject: [PATCH] =?UTF-8?q?get=5Fskin=5Fjavascript=20=ED=95=A8=EC=88=98=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common.lib.php | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/lib/common.lib.php b/lib/common.lib.php index 3da1f3716..2a140bb3d 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -1798,13 +1798,16 @@ function delete_editor_thumbnail($contents) } // 스킨 style sheet 파일 얻기 -function get_skin_stylesheet($skin_path) +function get_skin_stylesheet($skin_path, $dir='') { if(!$skin_path) return ""; $str = ""; + if($dir) + $skin_path .= '/'.$dir; + $skin_url = G4_URL.str_replace("\\", "/", str_replace(G4_PATH, "", $skin_path)); if(is_dir($skin_path)) { @@ -1825,4 +1828,36 @@ function get_skin_stylesheet($skin_path) return $str; } + +// 스킨 javascript 파일 얻기 +function get_skin_javascript($skin_path, $dir='js') +{ + if(!$skin_path) + return ""; + + $str = ""; + + if($dir) + $skin_path .= '/'.$dir; + + $skin_url = G4_URL.str_replace("\\", "/", str_replace(G4_PATH, "", $skin_path)); + + if(is_dir($skin_path)) { + if($dh = opendir($skin_path)) { + while(($file = readdir($dh)) !== false) { + if($file == "." || $file == "..") + continue; + + if(is_dir($skin_path.'/'.$file)) + continue; + + if(preg_match("/\.(js)$/i", $file)) + $str .= ''."\n"; + } + closedir($dh); + } + } + + return $str; +} ?> \ No newline at end of file