Index: temp/trunk/html/admin/design/template.php
===================================================================
--- temp/trunk/html/admin/design/template.php	(revision 10252)
+++ temp/trunk/html/admin/design/template.php	(revision 10422)
@@ -68,5 +68,6 @@
 
 // ÅÐÏ¿¤ò²¡¤µ¤ì¤¿¤Ð¤¢¤Ë¤ÏDB¤Ø¥Ç¡¼¥¿¤ò¹¹¿·¤Ë¹Ô¤¯
-if ($_POST['mode'] == "confirm"){
+switch($_POST['mode']) {
+case 'confirm':
 	// DB¤Ø¥Ç¡¼¥¿¹¹¿·
 	lfUpdData();
@@ -77,5 +78,10 @@
 	// ´°Î»¥á¥Ã¥»¡¼¥¸
 	$objPage->tpl_onload="alert('ÅÐÏ¿¤¬´°Î»¤·¤Þ¤·¤¿¡£');";
-
+	break;
+case 'download':
+	lfDownloadTemplate($_POST['check_template']);
+	break;
+default:
+	break;
 }
 
@@ -311,5 +317,38 @@
 }
 
-// ¥Õ¥©¥ë¥À¤ò¥³¥Ô¡¼¤¹¤ë
+/**************************************************************************************************************
+ * ´Ø¿ôÌ¾	¡§lfDownloadTemplate
+ * ½èÍýÆâÍÆ	¡§¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë°µ½Ì¤·¤Æ¥À¥¦¥ó¥í¡¼¥É¤¹¤ë
+ * °ú¿ô1	¡§¥Æ¥ó¥×¥ì¡¼¥È¥³¡¼¥É
+ * Ìá¤êÃÍ	¡§¤Ê¤·
+ **************************************************************************************************************/
+function lfDownloadTemplate($template_code){
+	$filename = $template_code. ".tar.gz";
+	$dl_file = USER_TEMPLATE_PATH.$filename;
+	
+	// ¥Õ¥¡¥¤¥ë¤Î°µ½Ì
+	$tar = new Archive_Tar($dl_file.".tar.gz", TRUE);
+	//bkup¥Õ¥©¥ë¥À¤Ë°ÜÆ°¤¹¤ë
+	chdir(USER_TEMPLATE_PATH);
+	//°µ½Ì¤ò¤ª¤³¤Ê¤¦
+	$zip = $tar->create("./" . $template_code . "/");
+	
+	// ¥À¥¦¥ó¥í¡¼¥É³«»Ï
+	Header("Content-disposition: attachment; filename=${dl_file}");
+	Header("Content-type: application/octet-stream; name=${dl_file}");
+	header("Content-Length: " .filesize($dl_file)); 
+	readfile ($dl_file);
+	// °µ½Ì¥Õ¥¡¥¤¥ëºï½ü
+	unlink($dl_file);
+	exit();
+}
+
+/**************************************************************************************************************
+ * ´Ø¿ôÌ¾	¡§lfFolderCopy
+ * ½èÍýÆâÍÆ	¡§¥Õ¥©¥ë¥À¤ò¥³¥Ô¡¼¤¹¤ë
+ * °ú¿ô1	¡§¥³¥Ô¡¼¸µ¥Ñ¥¹
+ * °ú¿ô2¡¡¡¡¡§¥³¥Ô¡¼Àè¥Ñ¥¹
+ * Ìá¤êÃÍ	¡§¤Ê¤·
+ **************************************************************************************************************/
 function lfFolderCopy($taget_path, $save_path){
 
