- Timestamp:
- 2007/09/20 14:14:52 (16 years ago)
- Location:
- branches/feature-templates
- Files:
-
- 2 added
- 2 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/feature-templates/data/Smarty/templates/admin/design/subnavi.tpl
r17 r15775 8 8 <table width="141" border="0" cellspacing="0" cellpadding="0" summary=" " id="menu_navi"> 9 9 <!--¥Ê¥Ó--> 10 <!----> 10 11 <tr><td class=<!--{if $tpl_subno != 'layout'}-->"navi"<!--{else}-->"navi-on"<!--{/if}-->><a href="./index.php" onMouseOver="naviStyleChange('layout', '#a5a5a5')" <!--{if $tpl_subno != 'layout'}-->onMouseOut="naviStyleChange('layout', '#636469')"<!--{/if}--> id="layout"><img src="<!--{$smarty.const.URL_DIR}-->img/contents/icon.jpg" width="15" height="9" alt="" border="0"><span class="navi_text">¥ì¥¤¥¢¥¦¥ÈÀßÄê</span></a></td></tr> 11 12 <tr><td><img src="<!--{$smarty.const.URL_DIR}-->img/contents/navi_line.gif" width="140" height="2" alt=""></td></tr> … … 18 19 <tr><td class=<!--{if $tpl_subno != 'css'}-->"navi"<!--{else}-->"navi-on"<!--{/if}-->><a href="./css.php" onMouseOver="naviStyleChange('css', '#a5a5a5')" <!--{if $tpl_subno != 'css'}-->onMouseOut="naviStyleChange('css', '#636469')"<!--{/if}--> id="css"><img src="<!--{$smarty.const.URL_DIR}-->img/contents/icon.jpg" width="15" height="9" alt="" border="0"><span class="navi_text">CSSÊÔ½¸</span></a></td></tr> 19 20 <tr><td><img src="<!--{$smarty.const.URL_DIR}-->img/contents/navi_line.gif" width="140" height="2" alt=""></td></tr> 20 21 21 <tr><td class=<!--{if $tpl_subno != 'template'}-->"navi"<!--{else}-->"navi-on"<!--{/if}-->><a href="./template.php" onMouseOver="naviStyleChange('template', '#a5a5a5')" <!--{if $tpl_subno != 'template'}-->onMouseOut="naviStyleChange('template', '#636469')"<!--{/if}--> id="template"><img src="<!--{$smarty.const.URL_DIR}-->img/contents/icon.jpg" width="15" height="9" alt="" border="0"><span class="navi_text">¥Æ¥ó¥×¥ì¡¼¥ÈÀßÄê</span></a></td></tr> 22 22 <tr><td><img src="<!--{$smarty.const.URL_DIR}-->img/contents/navi_line.gif" width="140" height="2" alt=""></td></tr> 23 <!--{if $tpl_subno == 'template'}--> 24 <tr><td class=<!--{if $tpl_subno_template != 'top'}-->"subnavi"<!--{else}-->"subnavi-on"<!--{/if}-->><a href="./template.php?tpl_subno_template=<!--{$arrSubnavi.title.1}-->" onMouseOver="naviStyleChange('top', '#b7b7b7')" <!--{if $tpl_subno_template != 'top'}-->onMouseOut="naviStyleChange('top', '#818287')"<!--{/if}--> id="top"><span class="subnavi_text">TOP¥Ú¡¼¥¸</span></a></td></tr> 25 <tr><td><img src="<!--{$smarty.const.URL_DIR}-->img/contents/navi_subline.gif" width="140" height="2" alt=""></td></tr> 26 <tr><td class=<!--{if $tpl_subno_template != 'product'}-->"subnavi"<!--{else}-->"subnavi-on"<!--{/if}-->><a href="./template.php?tpl_subno_template=<!--{$arrSubnavi.title.2}-->" onMouseOver="naviStyleChange('product', '#b7b7b7')" <!--{if $tpl_subno_template != 'product'}-->onMouseOut="naviStyleChange('product', '#818287')"<!--{/if}--> id="product"><span class="subnavi_text">¾¦ÉʰìÍ÷¥Ú¡¼¥¸</span></a></td></tr> 27 <tr><td><img src="<!--{$smarty.const.URL_DIR}-->img/contents/navi_subline.gif" width="140" height="2" alt=""></td></tr> 28 <tr><td class=<!--{if $tpl_subno_template != 'detail'}-->"subnavi"<!--{else}-->"subnavi-on"<!--{/if}-->><a href="./template.php?tpl_subno_template=<!--{$arrSubnavi.title.3}-->" onMouseOver="naviStyleChange('detail', '#b7b7b7')" <!--{if $tpl_subno_template != 'detail'}-->onMouseOut="naviStyleChange('detail', '#818287')"<!--{/if}--> id="detail"><span class="subnavi_text">¾¦Éʾܺ٥ڡ¼¥¸</span></a></td></tr> 29 <tr><td><img src="<!--{$smarty.const.URL_DIR}-->img/contents/navi_subline.gif" width="140" height="2" alt=""></td></tr> 30 <tr><td class=<!--{if $tpl_subno_template != 'mypage'}-->"subnavi"<!--{else}-->"subnavi-on"<!--{/if}-->><a href="./template.php?tpl_subno_template=<!--{$arrSubnavi.title.4}-->" onMouseOver="naviStyleChange('mypage', '#b7b7b7')" <!--{if $tpl_subno_template != 'mypage'}-->onMouseOut="naviStyleChange('mypage', '#818287')"<!--{/if}--> id="mypage"><span class="subnavi_text">MY¥Ú¡¼¥¸</span></a></td></tr> 31 <tr><td><img src="<!--{$smarty.const.URL_DIR}-->img/contents/navi_subline.gif" width="140" height="2" alt=""></td></tr> 32 <tr><td class=<!--{if $tpl_subno_template != 'upload'}-->"subnavi"<!--{else}-->"subnavi-on"<!--{/if}-->><a href="./upload.php" onMouseOver="naviStyleChange('upload', '#b7b7b7')" <!--{if $tpl_subno_template != 'upload'}-->onMouseOut="naviStyleChange('upload', '#818287')"<!--{/if}--> id="upload"><span class="subnavi_text">¥¢¥Ã¥×¥í¡¼¥É</span></a></td></tr> 33 <tr><td><img src="<!--{$smarty.const.URL_DIR}-->img/contents/navi_subline.gif" width="140" height="2" alt=""></td></tr> 34 <!--{/if}--> 35 23 <tr><td class=<!--{if $tpl_subno != 'up_down'}-->"navi"<!--{else}-->"navi-on"<!--{/if}-->><a href="./up_down.php" onMouseOver="naviStyleChange('up_down', '#a5a5a5')" <!--{if $tpl_subno != 'up_down'}-->onMouseOut="naviStyleChange('up_down', '#636469')"<!--{/if}--> id="up_down"><img src="<!--{$smarty.const.URL_DIR}-->img/contents/icon.jpg" width="15" height="9" alt="" border="0"><span class="navi_text">±¯ÌßÛ°ÄÞ/ÀÞ³ÝÛ°ÄÞ</span></a></td></tr> 24 <tr><td><img src="<!--{$smarty.const.URL_DIR}-->img/contents/navi_line.gif" width="140" height="2" alt=""></td></tr> 36 25 <!--¥Ê¥Ó--> 37 26 </table> -
branches/feature-templates/data/Smarty/templates/admin/design/template.tpl
r15056 r15775 6 6 */ 7 7 *}--> 8 <script type="text/javascript"><!-- 9 function submitRegister() { 10 var form = document.form1; 11 var msg = "¥Æ¥ó¥×¥ì¡¼¥È¤òÊѹ¹¤·¤Þ¤¹¡£\n´û¸¤Î¥Ç¡¼¥¿¤Ï¾å½ñ¤¤µ¤ì¤Þ¤¹¤¬¤è¤í¤·¤¤¤Ç¤¹¤«¡©"; 12 13 if (window.confirm(msg)) { 14 form['mode'].value = 'register'; 15 form.submit(); 16 } 17 } 18 // --> 19 </script> 8 20 <!--¡ú¡ú¥á¥¤¥ó¥³¥ó¥Æ¥ó¥Ä¡ú¡ú--> 9 21 <table width="878" border="0" cellspacing="0" cellpadding="0" summary=" "> 10 <form name="form1" id="form1" method="post" action="<!--{$smarty.server.PHP_SELF|escape}-->" onsubmit="return lfnModeSubmit('confirm')"> 11 <!--{foreach from=$smarty.post key="key" item="item"}--> 12 <!--{if $key ne "mode"}--><input type="hidden" name="<!--{$key|escape}-->" value="<!--{$item|escape}-->"> 13 <!--{/if}--> 14 <!--{/foreach}--> 22 <form name="form1" method="post" action=""> 15 23 <input type="hidden" name="mode" value=""> 16 <input type="hidden" name="tpl_subno_template" value="<!--{$tpl_subno_template}-->"> 24 <input type="hidden" name="template_code_delete" value=""> 25 <input type="hidden" name="uniqid" value="<!--{$uniqid}-->"> 17 26 <tr valign="top"> 18 27 <td background="<!--{$smarty.const.URL_DIR}-->img/contents/navi_bg.gif" height="402"> … … 41 50 <tr> 42 51 <td background="<!--{$smarty.const.URL_DIR}-->img/contents/contents_title_left_bg.gif"><img src="<!--{$smarty.const.URL_DIR}-->img/contents/contents_title_left.gif" width="22" height="12" alt=""></td> 43 <td bgcolor="#636469" width="638" class="fs14n"><span class="white"><!--¥³¥ó¥Æ¥ó¥Ä¥¿¥¤¥È¥ë--> <!--{$template_name}--></span></td>52 <td bgcolor="#636469" width="638" class="fs14n"><span class="white"><!--¥³¥ó¥Æ¥ó¥Ä¥¿¥¤¥È¥ë-->¥Æ¥ó¥×¥ì¡¼¥ÈÀßÄê</span></td> 44 53 <td background="<!--{$smarty.const.URL_DIR}-->img/contents/contents_title_right_bg.gif"><img src="<!--{$smarty.const.URL_DIR}-->img/common/_.gif" width="18" height="1" alt=""></td> 45 54 </tr> … … 51 60 </tr> 52 61 </table> 62 63 <table width="678" border="0" cellspacing="1" cellpadding="8" summary=" "> 64 <tr bgcolor="#f2f1ec" class="fs12n"> 65 <td> 66 ¥Æ¥ó¥×¥ì¡¼¥È¤òÁªÂò¤·¡¢¡Ö¤³¤ÎÆâÍÆ¤ÇÅÐÏ¿¤¹¤ë¡×¥Ü¥¿¥ó¤ò²¡¤¹¤È¡¢<br> 67 ÁªÂò¤·¤¿¥Æ¥ó¥×¥ì¡¼¥È¤Ø¥Ç¥¶¥¤¥ó¤òÊѹ¹¤¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£<br> 68 <br> 69 Êѹ¹¤·¤¿¾ì¹ç¡¢²¼¤Î¥Õ¥¡¥¤¥ë¤¬¾å½ñ¤¤µ¤ì¤Þ¤¹¡£ 70 <ul> 71 <li>user_data/css/contents.css</li> 72 <li>user_data/include/*</li> 73 <li>user_data/templates/mypage/*</li> 74 <li>user_data/templates/detail.tpl</li> 75 <li>user_data/templates/list.tpl</li> 76 <li>user_data/templates/top.tpl</li> 77 </ul> 78 </td> 79 </tr> 80 <tr bgcolor="#ffffff" class="fs12n"> 81 <td> 82 <table width="650" bgcolor="#cccccc" border="0" cellspacing="1" cellpadding="5" summary=" "> 83 <tr bgcolor="#f2f1ec" align="center" class="fs12n"> 84 <td width="">ÁªÂò</td> 85 <td width="">̾Á°</td> 86 <td width="">ÊݸÀè</td> 87 <!--<td width="50">³Îǧ</td>--> 88 <td width="50">ºï½ü</td> 89 </tr> 90 <!--{foreach from=$templates item=tpl}--> 91 <!--{assign var=tplcode value=$tpl.template_code}--> 92 <tr bgcolor="#ffffff" align="center" class="fs12"> 93 <td width="" ><input type="radio" name="template_code" value="<!--{$tplcode|escape}-->" <!--{if $tplcode == $now_template}-->checked<!--{/if}-->></td> 94 <td width=""><!--{$tpl.template_name|escape}--></td> 95 <td width="">user_data/tpl_packages/<!--{$tplcode|escape}-->/</td> 96 <!--<td width=""><span class="icon_confirm"><a href="" onClick="">³Îǧ</span></a></td>--> 97 <td width=""><span class="icon_delete"><a href="" onClick="fnModeSubmit('delete','template_code_delete','<!--{$tplcode}-->');return false;">ºï½ü</a></span></td> 98 </tr> 99 <!--{/foreach}--> 53 100 54 <table width="678" border="0" cellspacing="1" cellpadding="8" summary=" "> 55 <tr class="fs12n"> 56 <td bgcolor="#f2f1ec" align="center"><strong>¸½ºß¤Î¥Æ¥ó¥×¥ì¡¼¥È</strong></td> 57 </tr> 58 <tr class="fs12n"> 59 <td bgcolor="#ffffff" align="center"><img height=500 width=400 src="<!--{$smarty.const.URL_DIR}--><!--{$arrTemplate.image[$MainImage]}-->" name="main_img" ></td> 60 </tr> 61 </table> 62 63 <table width="678" border="0" cellspacing="0" cellpadding="0" summary=" "> 64 <tr><td colspan="3"><img src="<!--{$smarty.const.URL_DIR}-->img/contents/main_bar.jpg" width="678" height="10" alt=""></td></tr> 101 </table> 102 </td> 103 </tr> 65 104 </table> 66 105 67 <table width="678" border="0" cellspacing="1" cellpadding="8" summary=" ">68 <tr class="fs12n">69 <td bgcolor="#f2f1ec" align="center" colspan="3"><strong>¥Æ¥ó¥×¥ì¡¼¥È°ìÍ÷</strong></td>70 </tr>71 72 <!--{section name=template loop=$arrTemplate.image step=3}-->73 <!--{*foreach key=key item=item from=$arrTemplate.image*}-->74 <tr>75 <!--{assign var=cnt value=$smarty.section.template.iteration-1}-->76 <!--{assign var=key value=$cnt*$smarty.section.template.step}-->77 <!--{assign var=code value=$arrTemplate.code[$key]}-->78 <!--{assign var=image value=$arrTemplate.image[$code]}-->79 <td bgcolor="#ffffff" align="center"><!--{$arrTemplate[template]}-->80 <span class="fs12">¡Ú<!--{$code}-->¡Û</span><br/>81 <label for="radio<!--{$key}-->"><img src="<!--{$smarty.const.URL_DIR}--><!--{$image}-->" width="160" height="200" name="<!--{$key}-->" alt="<!--{$code}-->"></label><br>82 <span class="fs10n"><label for="radio<!--{$key}-->"><input type="radio" name="check_template" value="<!--{$code}-->" id="radio<!--{$key}-->" onClick="ChangeImage('<!--{$smarty.const.URL_DIR}--><!--{$image}-->');" <!--{if $arrTemplate.check[$code] != ""}-->checked<!--{/if}-->>ÁªÂò</label></span>83 </td>84 <!--{assign var=cnt value=$smarty.section.template.iteration-1}-->85 <!--{assign var=key value=$cnt*$smarty.section.template.step+1}-->86 <!--{assign var=code value=$arrTemplate.code[$key]}-->87 <!--{assign var=image value=$arrTemplate.image[$code]}-->88 <!--{if $image != ""}-->89 <td bgcolor="#ffffff" align="center"><!--{$arrTemplate[template]}-->90 <span class="fs12">¡Ú<!--{$code}-->¡Û</span><br/>91 <label for="radio<!--{$key}-->"><img src="<!--{$smarty.const.URL_DIR}--><!--{$image}-->" width="160" height="200" name="<!--{$key}-->" alt="<!--{$code}-->></label><br>92 <span class="fs10n"><label for="radio<!--{$key}-->"><input type="radio" name="check_template" value="<!--{$code}-->" id="radio<!--{$key}-->" onClick="ChangeImage('<!--{$smarty.const.URL_DIR}--><!--{$image}-->');" <!--{if $arrTemplate.check[$code] != ""}-->checked<!--{/if}-->>ÁªÂò</label></span>93 </td>94 <!--{/if}-->95 <!--{assign var=cnt value=$smarty.section.template.iteration-1}-->96 <!--{assign var=key value=$cnt*$smarty.section.template.step+2}-->97 <!--{assign var=code value=$arrTemplate.code[$key]}-->98 <!--{assign var=image value=$arrTemplate.image[$code]}-->99 <!--{if $image != ""}-->100 <td bgcolor="#ffffff" align="center"><!--{$arrTemplate[template]}-->101 <span class="fs12">¡Ú<!--{$code}-->¡Û</span><br/>102 <label for="radio<!--{$key}-->"><img src="<!--{$smarty.const.URL_DIR}--><!--{$image}-->" width="160" height="200" name="<!--{$key}-->" alt="<!--{$code}-->></label><br>103 <span class="fs10n"><label for="radio<!--{$key}-->"><input type="radio" name="check_template" value="<!--{$code}-->" id="radio<!--{$key}-->" onClick="ChangeImage('<!--{$smarty.const.URL_DIR}--><!--{$image}-->');" <!--{if $arrTemplate.check[$code] != ""}-->checked<!--{/if}-->>ÁªÂò</label></span>104 </td>105 <!--{/if}-->106 107 </tr>108 <!--{/section}-->109 </table>110 111 106 <table width="678" border="0" cellspacing="0" cellpadding="0" summary=" "> 112 107 <tr> … … 121 116 <tr> 122 117 <td> 123 <a href="javascript:fnModeSubmit('download', '', '');"><img onMouseover="chgImgImageSubmit('<!--{$smarty.const.URL_DIR}-->img/contents/btn_download_on.jpg',this)" onMouseout="chgImgImageSubmit('<!--{$smarty.const.URL_DIR}-->img/contents/btn_download.jpg',this)" src="<!--{$smarty.const.URL_DIR}-->img/contents/btn_download.jpg" width="123" height="24" alt="¥À¥¦¥ó¥í¡¼¥É" border="0" name="subm"></a> 124 <input type="image" onMouseover="chgImgImageSubmit('<!--{$smarty.const.URL_DIR}-->img/contents/btn_regist_on.jpg',this)" onMouseout="chgImgImageSubmit('<!--{$smarty.const.URL_DIR}-->img/contents/btn_regist.jpg',this)" src="<!--{$smarty.const.URL_DIR}-->img/contents/btn_regist.jpg" width="123" height="24" alt="¤³¤ÎÆâÍÆ¤ÇÅÐÏ¿¤¹¤ë" border="0" name="subm"> 118 <a href="" onClick="submitRegister();return false;"> 119 <img onMouseover="chgImgImageSubmit('<!--{$smarty.const.URL_DIR}-->img/contents/btn_regist_on.jpg',this)" onMouseout="chgImgImageSubmit('<!--{$smarty.const.URL_DIR}-->img/contents/btn_regist.jpg',this)" src="<!--{$smarty.const.URL_DIR}-->img/contents/btn_regist.jpg" width="123" height="24" alt="¤³¤ÎÆâÍÆ¤ÇÅÐÏ¿¤¹¤ë" border="0" name="subm"> 120 </a> 125 121 </td> 126 122 </tr> … … 151 147 </table> 152 148 <!--¡ú¡ú¥á¥¤¥ó¥³¥ó¥Æ¥ó¥Ä¡ú¡ú--> 153 154 <script type="text/javascript">155 function ChangeImage(strUrl)156 {157 document.main_img.src=strUrl;158 }159 160 // ¥â¡¼¥É¤È¥¡¼¤ò»ØÄꤷ¤ÆSUBMIT¤ò¹Ô¤¦¡£161 function lfnModeSubmit(mode) {162 if(!window.confirm('ÅÐÏ¿¤·¤Æ¤âµ¹¤·¤¤¤Ç¤¹¤«?')){163 return false;164 }165 document.form1['mode'].value = mode;166 return true;167 }168 169 170 </script> -
branches/feature-templates/html/admin/design/template.php
r17 r15775 5 5 * http://www.lockon.co.jp/ 6 6 */ 7 require_once("../../require.php"); 8 require_once(DATA_PATH . "module/Tar.php"); 9 require_once(DATA_PATH . "include/file_manager.inc"); 10 require_once(DATA_PATH . "module/SearchReplace.php"); 7 require_once '../require.php'; 8 require_once DATA_PATH . "module/Tar.php"; 9 require_once DATA_PATH . "module/SearchReplace.php"; 10 require_once DATA_PATH . "include/file_manager.inc"; 11 sfPrintR($_POST); 12 13 // ǧ¾Ú²ÄÈݤÎȽÄê 14 $objSession = new SC_Session(); 15 sfIsSuccess($objSession); 11 16 12 17 class LC_Page { 13 var $arrForm; 14 var $arrHidden; 15 var $arrSubnavi = array( 16 'title' => array( 17 1 => 'top', 18 2 => 'product', 19 3 => 'detail', 20 4 => 'mypage' 21 ), 22 'name' =>array( 23 1 => 'TOP¥Ú¡¼¥¸', 24 2 => '¾¦ÉʰìÍ÷¥Ú¡¼¥¸', 25 3 => '¾¦Éʾܺ٥ڡ¼¥¸', 26 4 => 'MY¥Ú¡¼¥¸' 27 ) 28 ); 18 var $tpl_mainpage = 'design/template.tpl'; 19 var $tpl_subnavi = 'design/subnavi.tpl'; 20 var $tpl_subno = 'template'; 21 var $tpl_mainno = "design"; 22 var $tpl_subtitle = '¥Æ¥ó¥×¥ì¡¼¥ÈÀßÄê'; 29 23 30 function LC_Page() { 31 $this->tpl_mainpage = 'design/template.tpl'; 32 $this->tpl_subnavi = 'design/subnavi.tpl'; 33 $this->tpl_subno = 'template'; 34 $this->tpl_subno_template = $this->arrSubnavi['title'][1]; 35 $this->tpl_TemplateName = $this->arrTemplateName['name'][1]; 36 $this->tpl_mainno = "design"; 37 $this->tpl_subtitle = '¥Æ¥ó¥×¥ì¡¼¥ÈÀßÄê'; 38 } 24 var $arrErr = array(); 25 var $arrForm = array(); 39 26 } 40 27 41 28 $objPage = new LC_Page(); 29 30 // uniqid¤ò¥Æ¥ó¥×¥ì¡¼¥È¤ØËä¤á¹þ¤ß 31 $objPage->uniqid = $objSession->getUniqId(); 32 42 33 $objView = new SC_AdminView(); 43 $objSess = new SC_Session();44 34 45 // ǧ¾Ú²ÄÈݤÎȽÄê 46 $objSess = new SC_Session(); 47 sfIsSuccess($objSess); 35 switch(lfGetMode()) { 48 36 49 // GET¤ÎÃͤò¼õ¤±¼è¤ë 50 $get_tpl_subno_template = $_GET['tpl_subno_template']; 37 // ÅÐÏ¿¥Ü¥¿¥ó²¡²¼»þ 38 case 'register': 39 // ²èÌÌÁ«°Ü¤ÎÀµÅöÀ¥Á¥§¥Ã¥¯ 40 if (!sfIsValidTransition($objSession)) { 41 sfDispError(''); 42 } 43 // ¥Ñ¥é¥á¡¼¥¿¸¡¾Ú 44 $objForm = lfInitRegister(); 45 if ($objForm->checkError()) { 46 sfDispError(''); 47 } 51 48 52 // GET¤ÇÃͤ¬Á÷¤é¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¤½¤ÎÃͤò¸µ¤Ë²èÌÌɽ¼¨¤òÀÚ¤êÂØ¤¨¤ë 53 if ($get_tpl_subno_template != ""){ 54 // Á÷¤é¤ì¤Æ¤¤¿Ãͤ¬ÇÛÎó¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤ÐTOP¤òɽ¼¨ 55 if (in_array($get_tpl_subno_template,$objPage->arrSubnavi['title'])){ 56 $tpl_subno_template = $get_tpl_subno_template; 57 }else{ 58 $tpl_subno_template = $objPage->arrSubnavi['title'][1]; 59 } 60 } else { 61 // GET¤ÇÃͤ¬¤Ê¤±¤ì¤ÐPOST¤ÎÃͤò»ÈÍѤ¹¤ë 62 if ($_POST['tpl_subno_template'] != ""){ 63 $tpl_subno_template = $_POST['tpl_subno_template']; 64 }else{ 65 $tpl_subno_template = $objPage->arrSubnavi['title'][1]; 66 } 67 } 68 $objPage->tpl_subno_template = $tpl_subno_template; 69 $key = array_keys($objPage->arrSubnavi['title'], $tpl_subno_template); 70 $objPage->template_name = $objPage->arrSubnavi['name'][$key[0]]; 49 $template_code = $objForm->getValue('template_code'); 71 50 72 // ÅÐÏ¿¤ò²¡¤µ¤ì¤¿¤Ð¤¢¤Ë¤ÏDB¤Ø¥Ç¡¼¥¿¤ò¹¹¿·¤Ë¹Ô¤¯ 73 switch($_POST['mode']) { 74 case 'confirm': 75 // DB¤Ø¥Ç¡¼¥¿¹¹¿· 76 lfUpdData(); 77 78 // ¥Æ¥ó¥×¥ì¡¼¥È¤Î¾å½ñ¤ 79 lfChangeTemplate(); 80 81 // ´°Î»¥á¥Ã¥»¡¼¥¸ 82 $objPage->tpl_onload="alert('ÅÐÏ¿¤¬´°Î»¤·¤Þ¤·¤¿¡£');"; 83 break; 84 case 'download': 85 lfDownloadTemplate($_POST['check_template']); 86 break; 51 // DB¤Ø»ÈÍѤ¹¤ë¥Æ¥ó¥×¥ì¡¼¥È¤òÅÐÏ¿ 52 lfRegisterTemplate($template_code); 53 54 // ¥Æ¥ó¥×¥ì¡¼¥È¤Î¾å½ñ¤ 55 lfChangeTemplate($template_code); 56 57 $objView->_smarty->clear_compiled_tpl(); 58 59 // ´°Î»¥á¥Ã¥»¡¼¥¸ 60 $objPage->tpl_onload="alert('ÅÐÏ¿¤¬´°Î»¤·¤Þ¤·¤¿¡£');"; 61 break; 62 63 // ºï½ü¥Ü¥¿¥ó²¡²¼»þ 64 case 'delete': 65 // ²èÌÌÁ«°Ü¤ÎÀµÅöÀ¥Á¥§¥Ã¥¯ 66 if (!sfIsValidTransition($objSession)) { 67 sfDispError(''); 68 } 69 // ¥Ñ¥é¥á¡¼¥¿¸¡¾Ú 70 $objForm = lfInitDelete(); 71 if ($objForm->checkError()) { 72 sfDispError(''); 73 } 74 75 $template_code = $objForm->getValue('template_code_delete'); 76 77 //TODO¡¡dtb_baseinfo¤Îtoptpl¤ò¥¯¥ê¥¢ 78 //TODO¡¡dtb_templates¤«¤éºï½ü 79 //TODO¡¡use_data/packageÆâ¤Î³ºÅö¥Õ¥¡¥¤¥ë¤òºï½ü 80 break; 81 82 // ¥×¥ì¥Ó¥å¡¼¥Ü¥¿¥ó²¡²¼»þ 83 case 'preview': 84 break; 85 87 86 default: 88 87 break; 89 88 } 90 89 91 // POSTÃͤΰú¤·Ñ¤® 92 $objPage->arrForm = $_POST; 93 94 // ²èÁü¼èÆÀ 95 $tpl_arrTemplate = array(); 96 $objPage->arrTemplate = lfgetTemplate(); 97 98 // ¥Ç¥Õ¥©¥ë¥È¥Á¥§¥Ã¥¯¼èÆÀ 99 $objPage->MainImage = $objPage->arrTemplate['check']; 100 $objPage->arrTemplate['check'] = array($objPage->arrTemplate['check']=>"check"); 90 // default¥Ñ¥é¥á¡¼¥¿¤Î¥»¥Ã¥È 91 $objPage->templates = lfGetAllTemplates(); 92 $objPage->now_template = lfGetNowtemplate(); 101 93 102 94 // ²èÌ̤Îɽ¼¨ … … 104 96 $objView->display(MAIN_FRAME); 105 97 106 //--------------------------------------------------------------------------------------------------------------------------------------------------------- 107 108 /************************************************************************************************************** 109 * ´Ø¿ô̾ ¡§lfgetTemplate 110 * ½èÍýÆâÍÆ ¡§²èÌ̤Ëɽ¼¨¤¹¤ë²èÁü¤ò¼èÆÀ¤¹¤ë 111 * °ú¿ô ¡§¤Ê¤· 112 * Ìá¤êÃÍ ¡§²èÌ̤Ëɽ¼¨¤¹¤ë²èÁü(ÇÛÎó) 113 **************************************************************************************************************/ 114 function lfgetTemplate(){ 115 global $objPage; 116 $filepath = "user_data/templates/"; 117 118 $arrTemplateImage = array(); // ²èÌÌɽ¼¨²èÁü³ÊǼÍÑ 119 $Image = ""; // ¥¤¥á¡¼¥¸¤ÎÇÛÎóÍ×ÁÇ̾³ÊǼÍÑ 120 $disp = ""; 121 $arrDefcheck = array(); // radio¥Ü¥¿¥ó¤Î¥Ç¥Õ¥©¥ë¥È¥Á¥§¥Ã¥¯³ÊǼÍÑ 122 123 // DB¤«¤é¸½ºßÁªÂò¤µ¤ì¤Æ¤¤¤ë¥Ç¡¼¥¿¼èÆÀ 124 $arrDefcheck = lfgetTemplaeBaseData(); 125 126 // ¥Æ¥ó¥×¥ì¡¼¥È¥Ç¡¼¥¿¤ò¼èÆÀ¤¹¤ë 127 $objQuery = new SC_Query(); 128 $sql = "SELECT template_code,template_name FROM dtb_templates ORDER BY create_date DESC"; 129 $arrTemplate = $objQuery->getall($sql); 130 131 switch($objPage->tpl_subno_template) { 132 // TOP 133 case $objPage->arrSubnavi['title'][1]: 134 $Image = "TopImage.jpg"; // ¥¤¥á¡¼¥¸¤ÎÇÛÎóÍ×ÁÇ̾³ÊǼÍÑ 135 $disp = $objPage->arrSubnavi['title'][1]; 136 break; 137 138 // ¾¦ÉʰìÍ÷ 139 case $objPage->arrSubnavi['title'][2]: 140 $Image = "ProdImage.jpg"; // ¥¤¥á¡¼¥¸¤ÎÇÛÎóÍ×ÁÇ̾³ÊǼÍÑ 141 $disp = $objPage->arrSubnavi['title'][2]; 142 break; 143 144 // ¾¦Éʾܺ٠145 case $objPage->arrSubnavi['title'][3]: 146 $Image = "DetailImage.jpg"; // ¥¤¥á¡¼¥¸¤ÎÇÛÎóÍ×ÁÇ̾³ÊǼÍÑ 147 $disp = $objPage->arrSubnavi['title'][3]; 148 break; 149 150 // MY¥Ú¡¼¥¸ 151 case $objPage->arrSubnavi['title'][4]: 152 $Image = "MypageImage.jpg"; //¥¤¥á¡¼¥¸¤ÎÇÛÎóÍ×ÁÇ̾³ÊǼÍÑ 153 $disp = $objPage->arrSubnavi['title'][4]; 154 break; 155 } 156 157 // ²èÁüɽ¼¨ÇÛÎóºîÀ® 158 foreach($arrTemplate as $key => $val){ 159 $arrTemplateImage['image'][$val['template_code']] = $filepath . $val['template_code'] . "/" . $Image; 160 $arrTemplateImage['code'][$key] = $val['template_code']; 161 } 162 163 // ½é´ü¥Á¥§¥Ã¥¯ 164 if (isset($arrDefcheck[$disp])){ 165 $arrTemplateImage['check'] = $arrDefcheck[$disp]; 166 }else{ 167 $arrTemplateImage['check'] = 1; 168 } 169 170 return $arrTemplateImage; 98 /** 99 * POST¤µ¤ì¤ëmode¥Ñ¥é¥á¡¼¥¿¤ò¼èÆÀ¤¹¤ë. 100 * 101 * @param void 102 * @return string mode¥Ñ¥é¥á¡¼¥¿, ̵¤±¤ì¤Ðnull 103 */ 104 function lfGetMode(){ 105 if (isset($_POST['mode'])) return $_POST['mode']; 171 106 } 172 107 173 /************************************************************************************************************** 174 * ´Ø¿ô̾ ¡§lfgetTemplaeBaseData 175 * ½èÍýÆâÍÆ ¡§DB¤ËÊݸ¤µ¤ì¤Æ¤¤¤ë¥Æ¥ó¥×¥ì¡¼¥È¥Ç¡¼¥¿¤ò¼èÆÀ¤¹¤ë 176 * °ú¿ô ¡§¤Ê¤· 177 * Ìá¤êÃÍ ¡§DB¤ËÊݸ¤µ¤ì¤Æ¤¤¤ë¥Æ¥ó¥×¥ì¡¼¥È¥Ç¡¼¥¿(ÇÛÎó) 178 **************************************************************************************************************/ 179 function lfgetTemplaeBaseData(){ 180 $objDBConn = new SC_DbConn; // DBÁàºî¥ª¥Ö¥¸¥§¥¯¥È 181 $sql = ""; // ¥Ç¡¼¥¿¼èÆÀSQLÀ¸À®ÍÑ 182 $arrRet = array(); // ¥Ç¡¼¥¿¼èÆÀÍÑ 183 184 $sql = "SELECT top_tpl AS top, product_tpl AS product, detail_tpl AS detail, mypage_tpl AS mypage FROM dtb_baseinfo"; 185 $arrRet = $objDBConn->getAll($sql); 186 187 return $arrRet[0]; 108 function lfInitRegister() { 109 $objForm = new SC_FormParam(); 110 $objForm->addParam( 111 'template_code', 'template_code', STEXT_LEN, '', 112 array("EXIST_CHECK","SPTAB_CHECK","MAX_LENGTH_CHECK", "ALNUM_CHECK") 113 ); 114 $objForm->setParam($_POST); 115 116 return $objForm; 188 117 } 189 118 190 /************************************************************************************************************** 191 * ´Ø¿ô̾ ¡§lfUpdData 192 * ½èÍýÆâÍÆ ¡§DB¤Ë¥Ç¡¼¥¿¤òÊݸ¤¹¤ë 193 * °ú¿ô ¡§¤Ê¤· 194 * Ìá¤êÃÍ ¡§À®¸ù TRUE¡¢¥¨¥é¡¼ FALSE 195 **************************************************************************************************************/ 196 function lfUpdData(){ 197 global $objPage; 198 $objDBConn = new SC_DbConn; // DBÁàºî¥ª¥Ö¥¸¥§¥¯¥È 199 $sql = ""; // ¥Ç¡¼¥¿¼èÆÀSQLÀ¸À®ÍÑ 200 $arrRet = array(); // ¥Ç¡¼¥¿¼èÆÀÍÑ(¹¹¿·È½Äê) 119 function lfInitDelete() { 120 $objForm = new SC_FormParam(); 121 $objForm->addParam( 122 'template_code_delete', 'template_code_delete', STEXT_LEN, '', 123 array("EXIST_CHECK","SPTAB_CHECK","MAX_LENGTH_CHECK", "ALNUM_CHECK") 124 ); 125 $objForm->setParam($_POST); 201 126 202 // ¥Ç¡¼¥¿¼èÆÀ 203 $sql = "SELECT top_tpl AS top, product_tpl AS product, detail_tpl AS detail, mypage_tpl AS mypage FROM dtb_baseinfo"; 204 $arrRet = $objDBConn->getAll($sql); 205 206 $chk_tpl = $_POST['check_template']; 207 // ¥Ç¡¼¥¿¤¬¼èÆÀ¤Ç¤¤Ê¤±¤ì¤ÐINSERT¡¢¤Ç¤¤ì¤ÐUPDATE 208 if (isset($arrRet[0])){ 209 // UPDATE 210 $arrVal = $arrRet[0]; 211 212 // TOP¤òÊѹ¹¤·¤¿¾ì¹ç¤Ë¤ÏÁ´²èÌÌÊѹ¹ 213 if ($objPage->tpl_subno_template == $objPage->arrSubnavi['title'][1]){ 214 $arrVal = array($chk_tpl,$chk_tpl,$chk_tpl,$chk_tpl); 215 }else{ 216 $arrVal[$objPage->tpl_subno_template] = $chk_tpl; 217 } 218 $sql= "update dtb_baseinfo set top_tpl = ?, product_tpl = ?, detail_tpl = ?, mypage_tpl = ?, update_date = now()"; 219 }else{ 220 // INSERT 221 $arrVal = array(null,null,null,null); 222 223 // TOP¤òÊѹ¹¤·¤¿¾ì¹ç¤Ë¤ÏÁ´²èÌÌÊѹ¹ 224 if ($objPage->tpl_subno_template == $objPage->arrSubnavi['title'][1]){ 225 $arrVal = array($chk_tpl,$chk_tpl,$chk_tpl,$chk_tpl); 226 }else{ 227 $arrVal[$chk_tpl-1] =$chk_tpl; 228 } 229 $sql= "insert into dtb_baseinfo (top_tpl,product_tpl,detail_tpl,mypage_tpl, update_date) values (?,?,?,?,now());"; 230 } 231 232 // SQL¼Â¹Ô 233 $arrRet = $objDBConn->query($sql,$arrVal); 234 235 return $arrRet; 127 return $objForm; 128 } 129 /** 130 * ¸½ºßŬÍѤ·¤Æ¤¤¤ë¥Æ¥ó¥×¥ì¡¼¥È¥Ñ¥Ã¥±¡¼¥¸Ì¾¤ò¼èÆÀ¤¹¤ë. 131 * 132 * @param void 133 * @return string ¥Æ¥ó¥×¥ì¡¼¥È¥Ñ¥Ã¥±¡¼¥¸Ì¾ 134 */ 135 function lfGetNowTemplate() { 136 $objQuery = new SC_Query(); 137 $arrRet = $objQuery->select('top_tpl', 'dtb_baseinfo'); 138 if (isset($arrRet[0]['top_tpl'])) { 139 return $arrRet[0]['top_tpl']; 140 } 141 return null; 236 142 } 237 143 238 /************************************************************************************************************** 239 * ´Ø¿ô̾ ¡§lfChangeTemplate 240 * ½èÍýÆâÍÆ ¡§¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë¤ò¾å½ñ¤¤¹¤ë 241 * °ú¿ô ¡§¤Ê¤· 242 * Ìá¤êÃÍ ¡§À®¸ù TRUE¡¢¥¨¥é¡¼ FALSE 243 **************************************************************************************************************/ 244 function lfChangeTemplate(){ 245 global $objPage; 246 $tpl_path = USER_PATH . "templates/"; 247 $inc_path = USER_PATH . "include/"; 248 $css_path = USER_PATH . "css/"; 249 250 $tpl_name = ""; 251 $tpl_element = ""; 252 253 $chk_tpl = $_POST['check_template']; 254 $path = $tpl_path . $chk_tpl . "/"; 255 $taget_tpl_path = $path . "/templates/"; 256 $taget_inc_path = $path . "/include/"; 257 $taget_css_path = $path . "/css/"; 258 $save_tpl_path = $tpl_path; 259 260 switch($objPage->tpl_subno_template) { 261 // TOP 262 case $objPage->arrSubnavi['title'][1]: 263 $tpl_element = "TopTemplate"; // ¥¤¥á¡¼¥¸¤ÎÇÛÎóÍ×ÁÇ̾³ÊǼÍÑ 264 $tpl_name = "top.tpl"; 265 break; 266 267 // ¾¦ÉʰìÍ÷ 268 case $objPage->arrSubnavi['title'][2]: 269 $tpl_element = "ProdTemplate"; // ¥¤¥á¡¼¥¸¤ÎÇÛÎóÍ×ÁÇ̾³ÊǼÍÑ 270 $tpl_name = "list.tpl"; 271 break; 272 273 // ¾¦Éʾܺ٠274 case $objPage->arrSubnavi['title'][3]: 275 $tpl_element = "DetailTemplate"; // ¥¤¥á¡¼¥¸¤ÎÇÛÎóÍ×ÁÇ̾³ÊǼÍÑ 276 $tpl_name = "detail.tpl"; 277 break; 278 279 // MY¥Ú¡¼¥¸ 280 case $objPage->arrSubnavi['title'][4]: 281 $tpl_element = "MypageTemplate"; //¥¤¥á¡¼¥¸¤ÎÇÛÎóÍ×ÁÇ̾³ÊǼÍÑ 282 $tpl_name = "mypage.tpl"; 283 break; 144 /** 145 * »ÈÍѤ¹¤ë¥Æ¥ó¥×¥ì¡¼¥È¤òDB¤ØÅÐÏ¿¤¹¤ë 146 */ 147 function lfRegisterTemplate($template_code) { 148 $objQuery = new SC_Query(); 149 $objQuery->update( 150 'dtb_baseinfo', 151 array('top_tpl'=> $template_code) 152 ); 153 } 154 /** 155 * ¥Æ¥ó¥×¥ì¡¼¥È¤ò¾å½ñ¤¥³¥Ô¡¼¤¹¤ë. 156 */ 157 function lfChangeTemplate($template_code){ 158 $from = TPL_PKG_PATH . $template_code . '/user_edit/'; 284 159 285 default: 286 break; 287 } 288 289 // ²èÁü¥Ñ¥¹¤ò½ñ¤´¹¤¨ 290 $img_path = '<!--{$smarty.const.URL_DIR}-->img/'; 291 $displace_path = '<!--{$smarty.const.URL_DIR}-->'. USER_DIR . 'templates/' . $chk_tpl . '/img/'; 292 $fs = new File_SearchReplace($img_path, $displace_path, "", $path, true); 293 $fs->doSearch(); 294 295 // TOP¤òÊѹ¹¤·¤¿¾ì¹ç¤Ë¤ÏÁ´²èÌÌÊѹ¹ 296 if ($objPage->tpl_subno_template == $objPage->arrSubnavi['title'][1]){ 297 // ¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë¤ò¥³¥Ô¡¼ 298 copy($taget_tpl_path . "top.tpl", $save_tpl_path . "top.tpl"); 299 copy($taget_tpl_path . "list.tpl", $save_tpl_path . "list.tpl"); 300 copy($taget_tpl_path . "detail.tpl", $save_tpl_path . "detail.tpl"); 301 302 // mypage¤Ï¥Õ¥©¥ë¥À¤´¤È¥³¥Ô¡¼ 303 lfFolderCopy($taget_tpl_path."mypage/", $save_tpl_path . "mypage/"); 304 305 // ¥Ö¥í¥Ã¥¯¥Ç¡¼¥¿¤Î¥³¥Ô¡¼ 306 lfFolderCopy($taget_inc_path."bloc/", $inc_path . "bloc/"); 307 308 // ¥Ø¥Ã¥À¡¼,¥Õ¥Ã¥¿¡¼¥³¥Ô¡¼ 309 copy($taget_inc_path . "header.tpl", $inc_path . "header.tpl"); 310 copy($taget_inc_path . "footer.tpl", $inc_path . "footer.tpl"); 311 312 // CSS¥Õ¥¡¥¤¥ë¤Î¥³¥Ô¡¼ 313 copy($taget_css_path . "contents.css", $css_path . "contents.css"); 314 315 // mypage¤Î¾ì¹ç¤Ë¤Ï¥Õ¥©¥ë¥À¤´¤È¥³¥Ô¡¼¤¹¤ë 316 }elseif($objPage->tpl_subno_template == $objPage->arrSubnavi['title'][4]){ 317 lfFolderCopy($taget_tpl_path."mypage/", $save_tpl_path."mypage/"); 318 }else{ 319 // ¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë¤ò¥³¥Ô¡¼ 320 copy($taget_tpl_path . $tpl_name, $save_tpl_path . $tpl_name); 321 } 322 323 // ²èÁü¥Ñ¥¹¤ò¸µ¤ËÌ᤹ 324 $fs = new File_SearchReplace($displace_path, $img_path, "", $path, true); 325 $fs->doSearch(); 160 if (!file_exists($from)) { 161 $mess = $from . '¤Ï¸ºß¤·¤Þ¤»¤ó'; 162 } else { 163 $to = USER_PATH; 164 $to = HTML_PATH . 'user_data2/'; 165 $mess = sfCopyDir($from, $to, '', true); 166 } 167 return $mess; 326 168 } 327 169 328 /************************************************************************************************************** 329 * ´Ø¿ô̾ ¡§lfDownloadTemplate 330 * ½èÍýÆâÍÆ ¡§¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë°µ½Ì¤·¤Æ¥À¥¦¥ó¥í¡¼¥É¤¹¤ë 331 * °ú¿ô1 ¡§¥Æ¥ó¥×¥ì¡¼¥È¥³¡¼¥É 332 * Ìá¤êÃÍ ¡§¤Ê¤· 333 **************************************************************************************************************/ 334 function lfDownloadTemplate($template_code){ 335 $filename = $template_code. ".tar.gz"; 336 $dl_file = USER_TEMPLATE_PATH.$filename; 337 338 // IMG¥Õ¥©¥ë¥À¤ò¥³¥Ô¡¼ 339 $mess = ""; 340 $mess = sfCopyDir(HTML_PATH."img/", USER_TEMPLATE_PATH.$template_code."/img/", $mess); 341 342 // ¥Õ¥¡¥¤¥ë¤Î°µ½Ì 343 $tar = new Archive_Tar($dl_file, TRUE); 344 // ¥Õ¥¡¥¤¥ë°ìÍ÷¼èÆÀ 345 $arrFileHash = sfGetFileList(USER_TEMPLATE_PATH.$template_code); 346 foreach($arrFileHash as $val) { 347 $arrFileList[] = $val['file_name']; 348 } 349 // ¥Ç¥£¥ì¥¯¥È¥ê¤ò°Üư 350 chdir(USER_TEMPLATE_PATH.$template_code); 351 352 //°µ½Ì¤ò¤ª¤³¤Ê¤¦ 353 $zip = $tar->create($arrFileList); 354 355 // ¥À¥¦¥ó¥í¡¼¥É³«»Ï 356 Header("Content-disposition: attachment; filename=${filename}"); 357 Header("Content-type: application/octet-stream; name=${dl_file}"); 358 header("Content-Length: " .filesize($dl_file)); 359 readfile ($dl_file); 360 // °µ½Ì¥Õ¥¡¥¤¥ëºï½ü 361 unlink($dl_file); 362 363 exit(); 170 function lfGetAllTemplates() { 171 $objQuery = new SC_Query(); 172 $arrRet = $objQuery->select('*', 'dtb_templates'); 173 if (empty($arrRet)) return array(); 174 175 return $arrRet; 364 176 } 365 366 /************************************************************************************************************** 367 * ´Ø¿ô̾ ¡§lfFolderCopy 368 * ½èÍýÆâÍÆ ¡§¥Õ¥©¥ë¥À¤ò¥³¥Ô¡¼¤¹¤ë 369 * °ú¿ô1 ¡§¥³¥Ô¡¼¸µ¥Ñ¥¹ 370 * °ú¿ô2¡¡¡¡¡§¥³¥Ô¡¼Àè¥Ñ¥¹ 371 * Ìá¤êÃÍ ¡§¤Ê¤· 372 **************************************************************************************************************/ 373 function lfFolderCopy($taget_path, $save_path){ 374 375 // ¥Õ¥©¥ë¥ÀÆâ¤Î¥Õ¥¡¥¤¥ë¤ò¼èÆÀ¤¹¤ë 376 $arrMypage=glob($taget_path . "*" ); 377 378 // ¥Õ¥©¥ë¥À¤¬¤Ê¤±¤ì¤ÐºîÀ®¤¹¤ë 379 if(!is_dir($save_path)){ 380 mkdir($save_path); 381 } 382 383 // ¥Õ¥©¥ë¥ÀÆâ¤òÁ´¤Æ¥³¥Ô¡¼ 384 foreach($arrMypage as $key => $val){ 385 $matches = array(); 386 mb_ereg("^(.*[\/])(.*)",$val, $matches); 387 $data=$matches[2]; 388 copy($val, $save_path . $data); 389 } 390 } 177 ?>
Note: See TracChangeset
for help on using the changeset viewer.