Changeset 10422 for temp/trunk/html


Ignore:
Timestamp:
2006/12/07 18:15:07 (20 years ago)
Author:
uehara
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • temp/trunk/html/admin/design/template.php

    r10252 r10422  
    6868 
    6969// ÅÐÏ¿¤ò²¡¤µ¤ì¤¿¤Ð¤¢¤Ë¤ÏDB¤Ø¥Ç¡¼¥¿¤ò¹¹¿·¤Ë¹Ô¤¯ 
    70 if ($_POST['mode'] == "confirm"){ 
     70switch($_POST['mode']) { 
     71case 'confirm': 
    7172    // DB¤Ø¥Ç¡¼¥¿¹¹¿· 
    7273    lfUpdData(); 
     
    7778    // ´°Î»¥á¥Ã¥»¡¼¥¸ 
    7879    $objPage->tpl_onload="alert('ÅÐÏ¿¤¬´°Î»¤·¤Þ¤·¤¿¡£');"; 
    79  
     80    break; 
     81case 'download': 
     82    lfDownloadTemplate($_POST['check_template']); 
     83    break; 
     84default: 
     85    break; 
    8086} 
    8187 
     
    311317} 
    312318 
    313 // ¥Õ¥©¥ë¥À¤ò¥³¥Ô¡¼¤¹¤ë 
     319/************************************************************************************************************** 
     320 * ´Ø¿ô̾   ¡§lfDownloadTemplate 
     321 * ½èÍýÆâÍÆ ¡§¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë°µ½Ì¤·¤Æ¥À¥¦¥ó¥í¡¼¥É¤¹¤ë 
     322 * °ú¿ô1    ¡§¥Æ¥ó¥×¥ì¡¼¥È¥³¡¼¥É 
     323 * Ìá¤êÃÍ   ¡§¤Ê¤· 
     324 **************************************************************************************************************/ 
     325function lfDownloadTemplate($template_code){ 
     326    $filename = $template_code. ".tar.gz"; 
     327    $dl_file = USER_TEMPLATE_PATH.$filename; 
     328     
     329    // ¥Õ¥¡¥¤¥ë¤Î°µ½Ì 
     330    $tar = new Archive_Tar($dl_file.".tar.gz", TRUE); 
     331    //bkup¥Õ¥©¥ë¥À¤Ë°Üư¤¹¤ë 
     332    chdir(USER_TEMPLATE_PATH); 
     333    //°µ½Ì¤ò¤ª¤³¤Ê¤¦ 
     334    $zip = $tar->create("./" . $template_code . "/"); 
     335     
     336    // ¥À¥¦¥ó¥í¡¼¥É³«»Ï 
     337    Header("Content-disposition: attachment; filename=${dl_file}"); 
     338    Header("Content-type: application/octet-stream; name=${dl_file}"); 
     339    header("Content-Length: " .filesize($dl_file));  
     340    readfile ($dl_file); 
     341    // °µ½Ì¥Õ¥¡¥¤¥ëºï½ü 
     342    unlink($dl_file); 
     343    exit(); 
     344} 
     345 
     346/************************************************************************************************************** 
     347 * ´Ø¿ô̾   ¡§lfFolderCopy 
     348 * ½èÍýÆâÍÆ ¡§¥Õ¥©¥ë¥À¤ò¥³¥Ô¡¼¤¹¤ë 
     349 * °ú¿ô1    ¡§¥³¥Ô¡¼¸µ¥Ñ¥¹ 
     350 * °ú¿ô2¡¡¡¡¡§¥³¥Ô¡¼Àè¥Ñ¥¹ 
     351 * Ìá¤êÃÍ   ¡§¤Ê¤· 
     352 **************************************************************************************************************/ 
    314353function lfFolderCopy($taget_path, $save_path){ 
    315354 
Note: See TracChangeset for help on using the changeset viewer.