Changeset 16935


Ignore:
Timestamp:
2007/12/20 12:30:25 (16 years ago)
Author:
adachi
Message:

#212 プレービュー時にテンプレートが見つからない不具合を修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update/data/class/pages/admin/design/LC_Page_Admin_Design.php

    r16741 r16935  
    121121            if ($_POST['mode'] == 'preview') { 
    122122                $page_id = '0'; 
    123             }  
     123            } 
    124124            $masterData = new SC_DB_MasterData_Ex(); 
    125125            $arrTarget = $masterData->getMasterData("mtb_target"); 
    126              
     126 
    127127            // 更新用にデータを整える 
    128128            $arrUpdBlocData = array(); 
     
    159159                $arrUpdBlocData[$key]['bloc_row'] = $bloc_row; 
    160160                $arrUpdBlocData[$key]['page_id']    =  $page_id;    // ページID 
    161                  
     161 
    162162                /* 
    163163                ターゲットID 1:レフトナビ 2:ライトナビ 3:イン画面上部 4:メイン画面下部 5:欄外 
     
    431431        $arrUpdData = array();          // 更新データ生成用 
    432432        $filename = $arrPageData[0]['filename']; 
    433          
     433 
    434434        $arrPreData = $objLayout->lfgetPageData(" page_id = ? " , array("0")); 
    435435 
    436         // tplファイルの削除 
     436        // XXX tplファイルの削除 
    437437        $del_tpl = USER_PATH . "templates/" . $filename . '.tpl'; 
    438438 
     
    446446        if($filename == ""){ 
    447447            $tplfile = TEMPLATE_DIR . "mypage/index"; 
     448            $filename = 'mypage'; 
    448449        } 
    449450 
    450451        // プレビュー用tplファイルのコピー 
    451         copy($tplfile . ".tpl", USER_PATH . "templates/" 
    452              . TEMPLATE_NAME . "/" . $filename . ".tpl"); 
     452        $copyTo = USER_PATH . "templates/preview/" . TEMPLATE_NAME . "/" . $filename . ".tpl"; 
     453 
     454        if (!is_dir(dirname($copyTo))) { 
     455            mkdir(dirname($copyTo)); 
     456        } 
     457 
     458        copy($tplfile . ".tpl", $copyTo); 
    453459 
    454460        // 更新データの取得 
Note: See TracChangeset for help on using the changeset viewer.