Changeset 17136
- Timestamp:
- 2008/03/12 20:12:49 (16 years ago)
- Location:
- branches/comu-ver2
- Files:
-
- 1 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/comu-ver2/data/class/pages/admin/design/LC_Page_Admin_Design_Template.php
r16769 r17136 112 112 $this->lfRegisterTemplate($template_code); 113 113 114 // テンプレートの上書き115 $this->lfChangeTemplate($template_code);116 117 114 // XXX コンパイルファイルのクリア処理を行う 118 115 $objView->_smarty->clear_compiled_tpl(); 116 117 // ブロック位置を更新 118 $this->lfChangeBloc($template_code); 119 119 120 120 // 完了メッセージ … … 253 253 array("id", "remarks", "rank")); 254 254 } 255 255 256 /** 256 * テンプレートを上書きコピーする.257 * ブロック位置の更新 257 258 */ 258 function lfChangeTemplate($template_code){ 259 $from = TPL_PKG_PATH . $template_code . '/user_edit/'; 260 261 if (!file_exists($from)) { 262 $mess = $from . 'は存在しません'; 263 } else { 264 $to = USER_PATH; 265 $mess = sfCopyDir($from, $to, '', true); 259 function lfChangeBloc($template_code) { 260 $objQuery = new SC_Query(); 261 $filepath = USER_TEMPLATE_PATH. $template_code. "/sql/update_bloc.sql"; 262 263 // ブロック位置更新SQLファイル有 264 if(file_exists($filepath)) { 265 if($fp = fopen($filepath, "r")) { 266 $sql = fread($fp, filesize($filepath)); 267 fclose($fp); 268 } 269 // 改行、タブを1スペースに変換 270 $sql = preg_replace("/[\r\n\t]/", " " ,$sql); 271 $sql_split = split(";", $sql); 272 foreach($sql_split as $key => $val){ 273 if (trim($val) != "") { 274 $objQuery->query($val); 275 } 276 } 266 277 } 267 return $mess; 278 } 279 280 /** 281 * テンプレートパッケージの削除 282 */ 283 function lfDeleteTemplate($template_code) { 284 // DB更新 285 $objQuery = new SC_Query(); 286 $objQuery->delete('dtb_templates', 'template_code = ?', array($template_code)); 287 // テンプレート削除 288 $templates_dir = SMARTY_TEMPLATES_DIR. $template_code. "/"; 289 SC_Utils_Ex::sfDelFile($templates_dir); 290 // ユーザーデータ削除 291 $user_dir = USER_TEMPLATE_PATH. $template_code. "/"; 292 SC_Utils_Ex::sfDelFile($user_dir); 268 293 } 269 294 … … 275 300 return $arrRet; 276 301 } 277 278 function lfDeleteTemplate($template_code) {279 $objQuery = new SC_Query();280 $objQuery->delete('dtb_templates', 'template_code = ?', array($template_code));281 282 SC_Utils_Ex::sfDelFile(TPL_PKG_PATH . $template_code);283 }284 302 } 285 303 ?>
Note: See TracChangeset
for help on using the changeset viewer.