Changeset 16676
- Timestamp:
- 2007/11/04 20:07:39 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/feature-module-update/data/class/pages/admin/design/LC_Page_Admin_Design_Bloc.php
r16582 r16676 106 106 107 107 if (!isset($_POST['mode'])) $_POST['mode'] = ""; 108 109 // プレビュー表示110 if ($_POST['mode'] == "preview") {108 109 switch($_POST['mode']) { 110 case 'preview': 111 111 // プレビューファイル作成 112 112 $prev_path = USER_INC_PATH . 'preview/bloc_preview.tpl'; 113 // TODO 一応, is_write 等でチェックすべき? 113 // ディレクトリの作成 114 SC_Utils::sfMakeDir($prev_path); 114 115 $fp = fopen($prev_path,"w"); 115 116 fwrite($fp, $_POST['bloc_html']); // FIXME いきなり POST はちょっと... … … 123 124 $this->arrBlocData['filename'] = $_POST['filename']; 124 125 $this->text_row = $_POST['html_area_row']; 125 }else{ 126 $this->preview = "off"; 127 } 128 129 // データ登録処理 130 if ($_POST['mode'] == 'confirm') { 131 126 break; 127 case 'confirm': 128 $this->preview = "off"; 132 129 // エラーチェック 133 130 $this->arrErr = $this->lfErrorCheck($_POST); … … 138 135 $this->lfEntryBlocData($_POST); 139 136 140 // ファイルの削除 141 //$del_file=BLOC_PATH . $arrBlocData[0]['filename']. '.tpl'; 142 $del_file = USER_PATH . $arrBlocData[0]['tpl_path']; 143 if (file_exists($del_file)) { 144 unlink($del_file); 137 // 旧ファイルの削除 138 $old_bloc_path = USER_PATH . $arrBlocData[0]['tpl_path']; 139 if (file_exists($old_bloc_path)) { 140 unlink($old_bloc_path); 145 141 } 146 142 147 143 // ファイル作成 148 $fp = fopen(USER_PATH . BLOC_DIR . $_POST['filename'] . '.tpl',"w"); 144 $new_bloc_path = USER_PATH . BLOC_DIR . $_POST['filename'] . ".tpl"; 145 // ディレクトリの作成 146 SC_Utils::sfMakeDir($new_bloc_path); 147 $fp = fopen($new_bloc_path,"w"); 149 148 fwrite($fp, $_POST['bloc_html']); // FIXME いきなり POST はちょっと... 150 149 fclose($fp); … … 160 159 $this->arrBlocData = $_POST; 161 160 } 162 } 163 164 // データ削除処理 165 if ($_POST['mode'] == 'delete') { 166 167 // DBへデータを更新する 168 $objDBConn = new SC_DbConn; // DB操作オブジェクト 169 $sql = ""; // データ更新SQL生成用 170 $ret = ""; // データ更新結果格納用 171 $arrDelData = array(); // 更新データ生成用 161 break; 162 case 'delete': 163 $this->preview = "off"; 164 // DBへデータを更新する 165 $objDBConn = new SC_DbConn; // DB操作オブジェクト 166 $sql = ""; // データ更新SQL生成用 167 $ret = ""; // データ更新結果格納用 168 $arrDelData = array(); // 更新データ生成用 172 169 173 170 // 更新データ生成 … … 193 190 } 194 191 $this->sendRedirect($this->getLocation("./bloc.php")); 195 } 192 break; 193 default: 194 if(isset($_POST['mode'])) { 195 GC_Utils::gfPrintLog("MODEエラー:".$_POST['mode']); 196 } 197 break; 198 } 196 199 197 200 // 画面の表示
Note: See TracChangeset
for help on using the changeset viewer.