Ignore:
Timestamp:
2011/03/13 19:34:53 (13 years ago)
Author:
kotani
Message:

#920 (デザイン管理でプレビューを押すとシステムエラー)

  • PC以外のデバイスではプレビューできないようにした
  • レイアウト設定以外ではプレビューできないようにした
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/class/pages/admin/design/LC_Page_Admin_Design_Header.php

    r20560 r20618  
    8787        // テンプレートのパス 
    8888        $template_path = $this->lfGetTemplatePath($device_type_id); 
    89         $preview_template_path = $this->lfGetPreviewTemplatePath(); 
    9089 
    9190        // データ更新処理 
     
    9392            $division = $_POST['division']; 
    9493            $content = $_POST[$division]; // TODO no checked? 
    95             // プレビュー用のテンプレートに書き込む 
    96             $preview_template = $preview_template_path.'/'.$division.'.tpl'; 
    97             $this->lfUpdateTemplate($preview_template, $content); 
    9894 
    9995            switch ($this->getMode()) { 
     
    104100                $this->tpl_onload="alert('登録が完了しました。');"; 
    105101                break; 
    106             case 'preview': 
    107                 if ($division == 'header') $this->header_prev = 'on'; 
    108                 if ($division == 'footer') $this->footer_prev = 'on'; 
    109                 $this->header_row = isset($_POST['header_row']) ? $_POST['header_row'] : $this->header_row; 
    110                 $this->footer_row = isset($_POST['footer_row']) ? $_POST['footer_row'] : $this->footer_row; 
    111                 break; 
    112102            default: 
    113103                // なにもしない 
    114104                break; 
    115105            } 
    116         }else{ 
    117             // postでデータが渡されなければ新規読み込みと判断をし、 
    118             // プレビュー用テンプレートに正規のテンプレートをロードする 
    119             $templates = array( 
    120                 'header.tpl', 
    121                 'footer.tpl' 
    122             ); 
    123             $this->lfLoadPreviewTemplates($preview_template_path, $template_path, $templates); 
    124106        } 
    125107 
    126108        // テキストエリアに表示 
    127         $this->header_data = file_get_contents($preview_template_path . '/header.tpl'); 
    128         $this->footer_data = file_get_contents($preview_template_path . '/footer.tpl'); 
     109        $this->header_data = file_get_contents($template_path . '/header.tpl'); 
     110        $this->footer_data = file_get_contents($template_path . '/footer.tpl'); 
    129111 
    130112        // ブラウザタイプ 
    131113        $this->browser_type = isset($_POST['browser_type']) ? $_POST['browser_type'] : ""; 
    132     } 
    133  
    134     protected function lfLoadPreviewTemplates($preview_template_path, $template_path, $templates) { 
    135         if (!is_dir($preview_template_path)) { 
    136             mkdir($preview_template_path); 
    137         } 
    138         foreach($templates as $template) { 
    139             $source = $template_path . '/' . $template; 
    140             $dest = $preview_template_path . '/' . $template; 
    141             copy($source, $dest); 
    142         } 
    143114    } 
    144115 
     
    154125    } 
    155126 
    156     protected function lfGetPreviewTemplatePath() { 
    157         return USER_INC_REALDIR . 'preview'; 
    158     } 
    159  
    160127    /** 
    161128     * デストラクタ. 
Note: See TracChangeset for help on using the changeset viewer.