get_skin_javascript 함수 추가

This commit is contained in:
chicpro
2013-04-15 10:39:21 +09:00
parent 3e4fbe7f12
commit a7772498e2

View File

@ -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 .= '<srcript src="'.$skin_url.'/'.$file.'"></script>'."\n";
}
closedir($dh);
}
}
return $str;
}
?>