Changeset 19967 for branches/version-2_5-dev/data
- Timestamp:
- 2011/01/19 14:36:49 (13 years ago)
- Location:
- branches/version-2_5-dev/data
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/Smarty/templates/admin/basis/seo.tpl
r19954 r19967 24 24 <form name="form1" id="form1" method="post" action="?" onSubmit="return window.confirm('登録しても宜しいですか');"> 25 25 <input type="hidden" name="mode" value="confirm"> 26 <input type="hidden" name="device_type_id" value="" /> 26 27 <input type="hidden" name="page_id" value="" /> 27 28 <div id="basis" class="contents-main"> 28 29 <!--{if count($arrPageData) > 0 }--> 29 <!--{foreach name=page key=key item=item from=$arrPageData}--> 30 <input type="hidden" name="disp_flg<!--{$item.page_id}-->" value="<!--{$disp_flg[$item.page_id]}-->" /> 30 <!--{foreach name=device key=device_key item=arrDevicePageData from=$arrPageData}--> 31 <!--{if count($arrDevicePageData) > 0 }--> 32 <!--{foreach name=page key=key item=item from=$arrDevicePageData}--> 31 33 <!-- <!--{$item.page_name}--> ここから --> 32 <h2><!--{$item.page_name}--> <!--{$item.url}--><a href="#" id="switch<!--{$item.page_id}-->" style="float:right " onClick="fnDispChange('disp<!--{$item.page_id}-->', 'switch<!--{$item.page_id}-->', 'disp_flg<!--{$item.page_id}-->');"><!--{if $disp_flg[$item.page_id] == ""}--> >> 非表示<!--{else}--> << 表示<!--{/if}--></a></h2> 34 <!--{if $smarty.foreach.page.first == true}--><h1><!--{$arrDeviceTypeName[$item.device_type_id]}--></h1><!--{/if}--> 35 <h2><!--{$item.page_name}--> <!--{$item.url}--></h2> 33 36 34 <div id="disp<!--{$item.page_id}-->" style="display:<!--{$disp_flg[$item.page_id]}-->"> 37 <div id=" 38 _<!--{$item.device_type_id}-->_<!--{$item.page_id}-->"> 35 39 <table> 36 40 <tr> 37 41 <th>メタタグ:Author</th> 38 42 <td> 39 <span class="attention"><!--{$arrErr[$item. page_id].author}--></span>40 <input type="text" name="meta[<!--{$item. page_id}-->][author]" value="<!--{$item.author|h}-->" maxlength="<!--{$smarty.const.STEXT_LEN}-->" size="60" class="box60" style='<!--{if $arrErr[$item.page_id].author != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}-->;<!--{/if}-->' /><span class="attention"> (上限<!--{$smarty.const.STEXT_LEN}-->文字)</span></td>43 <span class="attention"><!--{$arrErr[$item.device_type_id][$item.page_id].author}--></span> 44 <input type="text" name="meta[<!--{$item.device_type_id}-->][<!--{$item.page_id}-->][author]" value="<!--{$item.author|h}-->" maxlength="<!--{$smarty.const.STEXT_LEN}-->" size="60" class="box60" style='<!--{if $arrErr[$item.page_id].author != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}-->;<!--{/if}-->' /><span class="attention"> (上限<!--{$smarty.const.STEXT_LEN}-->文字)</span></td> 41 45 </tr> 42 46 <tr> 43 47 <th>メタタグ:Description</th> 44 48 <td> 45 <span class="attention"><!--{$arrErr[$item. page_id].description}--></span>46 <input type="text" name="meta[<!--{$item. page_id}-->][description]" value="<!--{$item.description|h}-->" maxlength="<!--{$smarty.const.STEXT_LEN}-->" size="60" class="box60" style='<!--{if $arrErr[$item.page_id].description != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}-->;<!--{/if}-->' /><span class="attention"> (上限<!--{$smarty.const.STEXT_LEN}-->文字)</span></td>49 <span class="attention"><!--{$arrErr[$item.device_type_id][$item.page_id].description}--></span> 50 <input type="text" name="meta[<!--{$item.device_type_id}-->][<!--{$item.page_id}-->][description]" value="<!--{$item.description|h}-->" maxlength="<!--{$smarty.const.STEXT_LEN}-->" size="60" class="box60" style='<!--{if $arrErr[$item.page_id].description != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}-->;<!--{/if}-->' /><span class="attention"> (上限<!--{$smarty.const.STEXT_LEN}-->文字)</span></td> 47 51 </tr> 48 52 <tr> 49 53 <th>メタタグ:Keywords</th> 50 54 <td> 51 <span class="attention"><!--{$arrErr[$item. page_id].keyword}--></span>52 <input type="text" name="meta[<!--{$item. page_id}-->][keyword]" value="<!--{$item.keyword|h}-->" maxlength="<!--{$smarty.const.STEXT_LEN}-->" size="60" class="box60" style='<!--{if $arrErr[$item.page_id].keyword != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}-->;<!--{/if}-->' /><span class="attention"> (上限<!--{$smarty.const.STEXT_LEN}-->文字)</span></td>55 <span class="attention"><!--{$arrErr[$item.device_type_id][$item.page_id].keyword}--></span> 56 <input type="text" name="meta[<!--{$item.device_type_id}-->][<!--{$item.page_id}-->][keyword]" value="<!--{$item.keyword|h}-->" maxlength="<!--{$smarty.const.STEXT_LEN}-->" size="60" class="box60" style='<!--{if $arrErr[$item.page_id].keyword != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}-->;<!--{/if}-->' /><span class="attention"> (上限<!--{$smarty.const.STEXT_LEN}-->文字)</span></td> 53 57 </tr> 54 58 </table> … … 56 60 <div class="btn-area"> 57 61 <ul> 58 <li><a class="btn-action" href="javascript:;" onclick="document.form1. page_id.value = <!--{$item.page_id}-->; fnFormModeSubmit('form1', 'confirm', '', ''); return false;"><span class="btn-next">この内容で登録する</span></a></li>62 <li><a class="btn-action" href="javascript:;" onclick="document.form1.device_type_id.value = <!--{$item.device_type_id}-->; document.form1.page_id.value = <!--{$item.page_id}-->; fnFormModeSubmit('form1', 'confirm', '', ''); return false;"><span class="btn-next">この内容で登録する</span></a></li> 59 63 </ul> 60 64 </div> … … 62 66 </div> 63 67 <!-- <!--{$item.page_name}--> ここまで --> 68 <!--{/foreach}--> 69 <!--{/if}--> 64 70 <!--{/foreach}--> 65 71 <!--{else}--> -
branches/version-2_5-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Seo.php
r19805 r19967 57 57 $this->arrPref = $masterData->getMasterData('mtb_pref'); 58 58 $this->arrTAXRULE = $masterData->getMasterData("mtb_taxrule"); 59 $this->arrDeviceTypeName[DEVICE_TYPE_PC] = 'PCサイト'; 60 $this->arrDeviceTypeName[DEVICE_TYPE_MOBILE] = 'モバイルサイト'; 61 $this->arrDeviceTypeName[DEVICE_TYPE_SMARTPHONE] = 'スマートフォン'; 59 62 } 60 63 … … 76 79 function action() { 77 80 $objSess = new SC_Session(); 78 $objQuery = new SC_Query();79 81 80 82 // 認証可否の判定 … … 82 84 83 85 // データの取得 84 $objLayout = new SC_Helper_PageLayout_Ex(); 85 $this->arrPageData = $objLayout->lfgetPageData(" edit_flg = 2 "); 86 87 if (isset($_POST['page_id'])) { 88 $page_id = $_POST['page_id']; 89 } else { 90 $page_id = ""; 91 } 86 $this->arrPageData = $this->lfGetSeoPageData(); 87 88 $device_type_id = (isset($_POST['device_type_id'])) ? $_POST['device_type_id'] : ''; 89 $page_id = (isset($_POST['page_id'])) ? $_POST['page_id'] : ''; 92 90 93 91 if (!isset($_POST['mode'])) $_POST['mode'] = ""; … … 95 93 if($_POST['mode'] == "confirm") { 96 94 // エラーチェック 97 $this->arrErr[$ page_id] = $this->lfErrorCheck($_POST['meta'][$page_id]);95 $this->arrErr[$device_type_id][$page_id] = $this->lfErrorCheck($_POST['meta'][$device_type_id][$page_id]); 98 96 99 97 // エラーがなければデータを更新 100 if(count($this->arrErr[$ page_id]) == 0) {98 if(count($this->arrErr[$device_type_id][$page_id]) == 0) { 101 99 102 100 // 更新データの変換 103 $arrMETA = $this->lfConvertParam($_POST['meta'][$ page_id]);101 $arrMETA = $this->lfConvertParam($_POST['meta'][$device_type_id][$page_id]); 104 102 105 103 // 更新データ配列生成 106 $arrUpdData = array($arrMETA['author'], $arrMETA['description'], $arrMETA['keyword'], $ page_id);104 $arrUpdData = array($arrMETA['author'], $arrMETA['description'], $arrMETA['keyword'], $device_type_id, $page_id); 107 105 // データ更新 108 106 $this->lfUpdPageData($arrUpdData); 109 107 }else{ 110 108 // POSTのデータを再表示 111 $arrPageData = $this->lfSetData($ arrPageData, $_POST['meta']);109 $arrPageData = $this->lfSetData($this->arrPageData, $_POST['meta']); 112 110 $this->arrPageData = $arrPageData; 113 111 } 114 112 } 115 113 116 $arrDisp_flg = array();117 114 // エラーがなければデータの取得 118 if(count($this->arrErr[$ page_id]) == 0) {115 if(count($this->arrErr[$device_type_id][$page_id]) == 0) { 119 116 // データの取得 120 $arrPageData = $objLayout->lfgetPageData(" edit_flg = 2 "); 121 $this->arrPageData = $arrPageData; 122 } 123 124 // 表示・非表示切り替え 125 foreach($arrPageData as $key => $val){ 126 $arrDisp_flg[$val['page_id']] = $_POST['disp_flg'.$val['page_id']]; 127 } 128 129 $this->disp_flg = $arrDisp_flg; 117 $this->arrPageData = $this->lfGetSeoPageData(); 118 } 130 119 } 131 120 … … 157 146 $sql .= " keyword = ? "; 158 147 $sql .= " WHERE "; 159 $sql .= " page_id = ? "; 148 $sql .= " device_type_id = ? "; 149 $sql .= " AND page_id = ? "; 160 150 $sql .= " "; 161 151 … … 191 181 function lfSetData($arrPageData, $arrDispData){ 192 182 193 foreach($arrPageData as $key => $val){ 194 $page_id = $val['page_id']; 195 $arrPageData[$key]['author'] = $arrDispData[$page_id]['author']; 196 $arrPageData[$key]['description'] = $arrDispData[$page_id]['description']; 197 $arrPageData[$key]['keyword'] = $arrDispData[$page_id]['keyword']; 183 foreach($arrPageData as $device_key => $arrVal){ 184 foreach($arrVal as $key => $val) { 185 $device_type_id = $val['device_type_id']; 186 $page_id = $val['page_id']; 187 $arrPageData[$device_key][$key]['author'] = $arrDispData[$device_type_id][$page_id]['author']; 188 $arrPageData[$device_key][$key]['description'] = $arrDispData[$device_type_id][$page_id]['description']; 189 $arrPageData[$device_key][$key]['keyword'] = $arrDispData[$device_type_id][$page_id]['keyword']; 190 } 198 191 } 199 192 … … 227 220 return $array; 228 221 } 222 223 /** 224 * SEO管理で設定するページのデータを取得する 225 * 226 * @param void 227 * @return array $arrRet ページデータ($arrRet[デバイスタイプID]) 228 */ 229 function lfGetSeoPageData() { 230 $objLayout = new SC_Helper_PageLayout_Ex(); 231 $arrRet = array(); 232 233 $arrRet[DEVICE_TYPE_PC] = $objLayout->lfgetPageData('edit_flg = ? AND device_type_id = ?', array('2', DEVICE_TYPE_PC)); 234 $arrRet[DEVICE_TYPE_MOBILE] = $objLayout->lfgetPageData('edit_flg = ? AND device_type_id = ?', array('2', DEVICE_TYPE_MOBILE)); 235 $arrRet[DEVICE_TYPE_SMARTPHONE] = $objLayout->lfgetPageData('edit_flg = ? AND device_type_id = ?', array('2', DEVICE_TYPE_SMARTPHONE)); 236 237 return $arrRet; 238 } 229 239 } 230 240 ?>
Note: See TracChangeset
for help on using the changeset viewer.