Changeset 20618 for branches/version-2_5-dev/data/class/pages/admin/design/LC_Page_Admin_Design_Header.php
- Timestamp:
- 2011/03/13 19:34:53 (13 years ago)
- 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 87 87 // テンプレートのパス 88 88 $template_path = $this->lfGetTemplatePath($device_type_id); 89 $preview_template_path = $this->lfGetPreviewTemplatePath();90 89 91 90 // データ更新処理 … … 93 92 $division = $_POST['division']; 94 93 $content = $_POST[$division]; // TODO no checked? 95 // プレビュー用のテンプレートに書き込む96 $preview_template = $preview_template_path.'/'.$division.'.tpl';97 $this->lfUpdateTemplate($preview_template, $content);98 94 99 95 switch ($this->getMode()) { … … 104 100 $this->tpl_onload="alert('登録が完了しました。');"; 105 101 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;112 102 default: 113 103 // なにもしない 114 104 break; 115 105 } 116 }else{117 // postでデータが渡されなければ新規読み込みと判断をし、118 // プレビュー用テンプレートに正規のテンプレートをロードする119 $templates = array(120 'header.tpl',121 'footer.tpl'122 );123 $this->lfLoadPreviewTemplates($preview_template_path, $template_path, $templates);124 106 } 125 107 126 108 // テキストエリアに表示 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'); 129 111 130 112 // ブラウザタイプ 131 113 $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 }143 114 } 144 115 … … 154 125 } 155 126 156 protected function lfGetPreviewTemplatePath() {157 return USER_INC_REALDIR . 'preview';158 }159 160 127 /** 161 128 * デストラクタ.
Note: See TracChangeset
for help on using the changeset viewer.