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_MainEdit.php

    r20560 r20618  
    106106 
    107107        switch ($this->getMode()) { 
    108         case 'preview': 
    109             $this->lfPreviewPageData($page_id, $device_type_id); 
    110             exit; 
    111             break; 
    112  
    113108        case 'delete': 
    114109            if (!$this->objLayout->lfCheckBaseData($page_id, $device_type_id)) { 
     
    166161 
    167162        return $arrPageData[0]; 
    168     } 
    169  
    170     /** 
    171      * プレビュー画面を表示する. 
    172      * 
    173      * @param integer $page_id_old 元のページID 
    174      * @param integer $device_type_id 端末種別ID 
    175      * @return void 
    176      */ 
    177     function lfPreviewPageData($page_id_old, $device_type_id) { 
    178  
    179         // プレビューの場合ページIDを0にセットする。 
    180         $page_id = '0'; 
    181         $url = 'preview/index'; 
    182  
    183         $arrPreData = $this->objLayout->lfGetPageData("page_id = ? AND device_type_id = ?", 
    184                                                       array($page_id, $device_type_id)); 
    185  
    186         // DBへデータを更新する 
    187         $this->lfEntryPageData( 
    188             $device_type_id, 
    189             $page_id, 
    190             $_POST['page_name'], 
    191             $url, 
    192             $_POST['header_chk'], 
    193             $_POST['footer_chk'] 
    194         ); 
    195  
    196         // TPLファイル作成 
    197         $cre_tpl = $this->objLayout->getTemplatePath($device_type_id) . "{$url}.tpl"; 
    198         $this->lfCreateFile($cre_tpl, $_POST['tpl_data']); 
    199  
    200         // blocposition を削除 
    201         $objQuery = new SC_Query_Ex(); // DB操作オブジェクト 
    202         $ret = $objQuery->delete('dtb_blocposition', 'page_id = 0 AND device_type_id = ?', array($device_type_id)); 
    203  
    204         if ($page_id_old != "") { 
    205             // 登録データを取得 
    206             $sql = 'SELECT target_id, bloc_id, bloc_row FROM dtb_blocposition WHERE page_id = ? AND device_type_id = ?'; 
    207             $ret = $objQuery->getAll($sql, array($page_id_old, $device_type_id)); 
    208  
    209             // blocposition を複製 
    210             foreach($ret as $row){ 
    211                 $row['page_id'] = $page_id; 
    212                 $row['device_type_id'] = $device_type_id; 
    213                 $objQuery->insert('dtb_blocposition', $row); 
    214             } 
    215         } 
    216         $_SESSION['preview'] = 'ON'; 
    217         SC_Response_Ex::sendRedirectFromUrlPath('preview/' . DIR_INDEX_PATH, array('filename' => $arrPageData[0]['filename'])); 
    218163    } 
    219164 
Note: See TracChangeset for help on using the changeset viewer.