source: branches/rel/html/admin/design/header.php @ 12157

Revision 12157, 2.6 KB checked in by uehara, 16 years ago (diff)
Line 
1<?php
2/*
3 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
4 *
5 * http://www.lockon.co.jp/
6 */
7require_once("../../require.php");
8
9class LC_Page {
10    var $arrForm;
11    var $arrHidden;
12
13    function LC_Page() {
14        $this->tpl_mainpage = 'design/header.tpl';
15        $this->tpl_subnavi  = 'design/subnavi.tpl';
16        $this->header_row = 13;
17        $this->footer_row = 13;
18        $this->tpl_subno = "header";
19        $this->tpl_mainno = "design";
20        $this->tpl_subtitle = '¥Ø¥Ã¥À¡¼Ž¥¥Õ¥Ã¥¿¡¼ÊÔ½¸';
21        $this->tpl_onload = 'comment_start(); comment_end();';
22    }
23}
24
25$objPage = new LC_Page();
26$objView = new SC_AdminView();
27
28// ǧ¾Ú²ÄÈݤÎȽÄê
29$objSess = new SC_Session();
30sfIsSuccess($objSess);
31
32$division = $_POST['division'];
33$pre_DIR = USER_INC_PATH . 'preview/';
34
35// ¥Ç¡¼¥¿¹¹¿·½èÍý
36if ($division != ''){
37    // ¥×¥ì¥Ó¥å¡¼Íѥƥó¥×¥ì¡¼¥È¤Ë½ñ¤­¹þ¤ß   
38    $fp = fopen($pre_DIR.$division.'.tpl',"w");
39    fwrite($fp, $_POST[$division]);
40    fclose($fp);
41
42    // ÅÐÏ¿»þ¤Ï¥×¥ì¥Ó¥å¡¼Íѥƥó¥×¥ì¡¼¥È¤ò¥³¥Ô¡¼¤¹¤ë
43    if ($_POST['mode'] == 'confirm'){
44        copy($pre_DIR.$division.".tpl", USER_INC_PATH . $division . ".tpl");
45        // ´°Î»¥á¥Ã¥»¡¼¥¸¡Ê¥×¥ì¥Ó¥å¡¼»þ¤Ïɽ¼¨¤·¤Ê¤¤¡Ë
46        $objPage->tpl_onload="alert('ÅÐÏ¿¤¬´°Î»¤·¤Þ¤·¤¿¡£');";
47       
48        // ¥Æ¥­¥¹¥È¥¨¥ê¥¢¤ÎÉý¤ò¸µ¤ËÌ᤹(½èÍý¤ÎÅý°ì¤Î¤¿¤á)
49        $_POST['header_row'] = "";
50        $_POST['footer_row'] = "";
51    }else if ($_POST['mode'] == 'preview'){
52        if ($division == "header") $objPage->header_prev = "on";
53        if ($division == "footer") $objPage->footer_prev = "on";
54    }
55
56    // ¥Ø¥Ã¥À¡¼¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß(¥×¥ì¥Ó¥å¡¼¥Ç¡¼¥¿)
57    $header_data = file_get_contents($pre_DIR . "header.tpl");
58   
59    // ¥Õ¥Ã¥¿¡¼¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß(¥×¥ì¥Ó¥å¡¼¥Ç¡¼¥¿)
60    $footer_data = file_get_contents($pre_DIR . "footer.tpl");
61}else{
62    // post¤Ç¥Ç¡¼¥¿¤¬ÅϤµ¤ì¤Ê¤±¤ì¤Ð¿·µ¬Æɤ߹þ¤ß¤ÈȽÃǤò¤·¡¢¥×¥ì¥Ó¥å¡¼Íѥǡ¼¥¿¤òÀµµ¬¤Î¥Ç¡¼¥¿¤Ç¾å½ñ¤­¤¹¤ë
63    if (!is_dir($pre_DIR)) {
64        mkdir($pre_DIR);
65    }
66    copy(USER_INC_PATH . "header.tpl", $pre_DIR . "header.tpl");
67    copy(USER_INC_PATH . "footer.tpl", $pre_DIR . "footer.tpl");
68   
69    // ¥Ø¥Ã¥À¡¼¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß
70    $header_data = file_get_contents(USER_INC_PATH . "header.tpl");
71    // ¥Õ¥Ã¥¿¡¼¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß
72    $footer_data = file_get_contents(USER_INC_PATH . "footer.tpl");
73
74}
75
76// ¥Æ¥­¥¹¥È¥¨¥ê¥¢¤Ëɽ¼¨
77$objPage->header_data = $header_data;
78$objPage->footer_data = $footer_data;
79
80if ($_POST['header_row'] != ''){
81    $objPage->header_row = $_POST['header_row'];
82}
83
84if ($_POST['footer_row'] != ''){
85    $objPage->footer_row = $_POST['footer_row'];
86}
87
88// ¥Ö¥é¥¦¥¶¥¿¥¤¥×
89$objPage->browser_type = $_POST['browser_type'];
90
91// ²èÌ̤Îɽ¼¨
92$objView->assignobj($objPage);
93$objView->display(MAIN_FRAME);
94
95//---------------------------------------------------------------------------------------------------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.