| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | require_once("../../require.php"); |
|---|
| 4 | |
|---|
| 5 | class LC_Page { |
|---|
| 6 | var $arrForm; |
|---|
| 7 | var $arrHidden; |
|---|
| 8 | |
|---|
| 9 | function LC_Page() { |
|---|
| 10 | $this->tpl_mainpage = 'design/header.tpl'; |
|---|
| 11 | $this->tpl_subnavi = 'design/subnavi.tpl'; |
|---|
| 12 | $this->header_row = 13; |
|---|
| 13 | $this->footer_row = 13; |
|---|
| 14 | $this->tpl_subno = "header"; |
|---|
| 15 | $this->tpl_mainno = "design"; |
|---|
| 16 | $this->tpl_subtitle = '¥Ø¥Ã¥À¡¼¥¥Õ¥Ã¥¿¡¼ÊÔ½¸'; |
|---|
| 17 | $this->tpl_onload = 'comment_start(); comment_end();'; |
|---|
| 18 | } |
|---|
| 19 | } |
|---|
| 20 | |
|---|
| 21 | $objPage = new LC_Page(); |
|---|
| 22 | $objView = new SC_AdminView(); |
|---|
| 23 | |
|---|
| 24 | // ǧ¾Ú²ÄÈݤÎȽÄê |
|---|
| 25 | $objSess = new SC_Session(); |
|---|
| 26 | sfIsSuccess($objSess); |
|---|
| 27 | |
|---|
| 28 | $division = $_POST['division']; |
|---|
| 29 | $tpl_DIR = ROOT_DIR . INCLUDE_DIR; |
|---|
| 30 | $pre_DIR = ROOT_DIR . INCLUDE_DIR. 'preview/'; |
|---|
| 31 | |
|---|
| 32 | // ¥Ç¡¼¥¿¹¹¿·½èÍý |
|---|
| 33 | if ($division != ''){ |
|---|
| 34 | // ¥×¥ì¥Ó¥å¡¼Íѥƥó¥×¥ì¡¼¥È¤Ë½ñ¤¹þ¤ß |
|---|
| 35 | $fp = fopen($pre_DIR.$division.'.tpl',"w"); |
|---|
| 36 | fwrite($fp, $_POST[$division]); |
|---|
| 37 | fclose($fp); |
|---|
| 38 | |
|---|
| 39 | // ÅÐÏ¿»þ¤Ï¥×¥ì¥Ó¥å¡¼Íѥƥó¥×¥ì¡¼¥È¤ò¥³¥Ô¡¼¤¹¤ë |
|---|
| 40 | if ($_POST['mode'] == 'confirm'){ |
|---|
| 41 | copy($pre_DIR.$division.".tpl", $tpl_DIR.$division.".tpl"); |
|---|
| 42 | } |
|---|
| 43 | |
|---|
| 44 | // ¥Ø¥Ã¥À¡¼¥Õ¥¡¥¤¥ë¤ÎÆÉ¤ß¹þ¤ß(¥×¥ì¥Ó¥å¡¼¥Ç¡¼¥¿) |
|---|
| 45 | $header_data = file_get_contents($pre_DIR . "header.tpl"); |
|---|
| 46 | |
|---|
| 47 | // ¥Õ¥Ã¥¿¡¼¥Õ¥¡¥¤¥ë¤ÎÆÉ¤ß¹þ¤ß(¥×¥ì¥Ó¥å¡¼¥Ç¡¼¥¿) |
|---|
| 48 | $footer_data = file_get_contents($pre_DIR . "footer.tpl"); |
|---|
| 49 | |
|---|
| 50 | }else{ |
|---|
| 51 | // post¤Ç¥Ç¡¼¥¿¤¬ÅϤµ¤ì¤Ê¤±¤ì¤Ð¿·µ¬ÆÉ¤ß¹þ¤ß¤ÈȽÃǤò¤·¡¢¥×¥ì¥Ó¥å¡¼Íѥǡ¼¥¿¤òÀµµ¬¤Î¥Ç¡¼¥¿¤Ç¾å½ñ¤¤¹¤ë |
|---|
| 52 | if (!is_dir($pre_DIR)) { |
|---|
| 53 | mkdir($pre_DIR); |
|---|
| 54 | } |
|---|
| 55 | copy($tpl_DIR . "header.tpl", $pre_DIR . "header.tpl"); |
|---|
| 56 | copy($tpl_DIR . "footer.tpl", $pre_DIR . "footer.tpl"); |
|---|
| 57 | |
|---|
| 58 | // ¥Ø¥Ã¥À¡¼¥Õ¥¡¥¤¥ë¤ÎÆÉ¤ß¹þ¤ß |
|---|
| 59 | $header_data = file_get_contents($tpl_DIR . "header.tpl"); |
|---|
| 60 | // ¥Õ¥Ã¥¿¡¼¥Õ¥¡¥¤¥ë¤ÎÆÉ¤ß¹þ¤ß |
|---|
| 61 | $footer_data = file_get_contents($tpl_DIR . "footer.tpl"); |
|---|
| 62 | |
|---|
| 63 | } |
|---|
| 64 | |
|---|
| 65 | // ¥Æ¥¥¹¥È¥¨¥ê¥¢¤Ëɽ¼¨ |
|---|
| 66 | $objPage->header_data = $header_data; |
|---|
| 67 | $objPage->footer_data = $footer_data; |
|---|
| 68 | |
|---|
| 69 | if ($_POST['header_row'] != ''){ |
|---|
| 70 | $objPage->header_row = $_POST['header_row']; |
|---|
| 71 | } |
|---|
| 72 | |
|---|
| 73 | if ($_POST['footer_row'] != ''){ |
|---|
| 74 | $objPage->footer_row = $_POST['footer_row']; |
|---|
| 75 | } |
|---|
| 76 | |
|---|
| 77 | // ²èÌ̤Îɽ¼¨ |
|---|
| 78 | $objView->assignobj($objPage); |
|---|
| 79 | $objView->display(MAIN_FRAME); |
|---|
| 80 | |
|---|
| 81 | //--------------------------------------------------------------------------------------------------------------------------------------------------------- |
|---|