Changeset 20693
- Timestamp:
- 2011/03/17 21:39:18 (12 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/design/bloc.tpl
r20645 r20693 25 25 <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> 26 26 <input type="hidden" name="mode" value="" /> 27 <input type="hidden" name="bloc_id" value="<!--{$bloc_id }-->" />27 <input type="hidden" name="bloc_id" value="<!--{$bloc_id|h}-->" /> 28 28 <input type="hidden" name="device_type_id" value="<!--{$device_type_id|h}-->" /> 29 29 … … 77 77 <td><!--{$item.bloc_name}--></td> 78 78 <td class="center"> 79 <a href="?bloc_id=<!--{$item.bloc_id }-->&device_type_id=<!--{$device_type_id}-->" >編集</a>79 <a href="?bloc_id=<!--{$item.bloc_id|h}-->&device_type_id=<!--{$device_type_id|h}-->" >編集</a> 80 80 </td> 81 81 <td class="center"> 82 82 <!--{if $item.deletable_flg == 1}--> 83 <a href="javascript:;" onclick="fnFormModeSubmit('form_bloc','delete','bloc_id', this.name.substr(3));">削除</a>84 <input type="hidden" value="<!--{$item.bloc_id }-->" name="del_id<!--{$item.bloc_id}-->" />83 <a href="javascript:;" onclick="fnFormModeSubmit('form_bloc','delete','bloc_id',<!--{$item.bloc_id|h}-->);">削除</a> 84 <input type="hidden" value="<!--{$item.bloc_id|h}-->" name="del_id<!--{$item.bloc_id|h}-->" /> 85 85 <!--{/if}--> 86 86 </td> -
branches/version-2_5-dev/data/class/pages/admin/design/LC_Page_Admin_Design_Bloc.php
r20629 r20693 73 73 */ 74 74 function action() { 75 // ページIDを取得 76 if (isset($_REQUEST['bloc_id']) && is_numeric($_REQUEST['bloc_id'])) { 77 $bloc_id = $_REQUEST['bloc_id']; 78 } else { 79 $bloc_id = null; 80 } 75 $objFormParam = new SC_FormParam_Ex(); 76 $this->lfInitParam($objFormParam, $_REQUEST); 77 78 // ページIDを取得 79 $bloc_id = $objFormParam->getValue('bloc_id'); 81 80 $this->bloc_id = $bloc_id; 82 81 83 82 // 端末種別IDを取得 84 if (isset($_REQUEST['device_type_id']) 85 && is_numeric($_REQUEST['device_type_id'])) { 86 $device_type_id = $_REQUEST['device_type_id']; 87 } else { 88 $device_type_id = DEVICE_TYPE_PC; 89 } 83 $device_type_id = $objFormParam->getValue('device_type_id'); 84 // if (isset($_REQUEST['device_type_id']) 85 // && is_numeric($_REQUEST['device_type_id'])) { 86 // $device_type_id = $_REQUEST['device_type_id']; 87 // } else { 88 // $device_type_id = DEVICE_TYPE_PC; 89 // } 90 90 91 91 $this->objLayout = new SC_Helper_PageLayout_Ex(); … … 160 160 case 'delete': 161 161 // DBへデータを更新する 162 $objQuery = new SC_Query_Ex(); // DB操作オブジェクト162 $objQuery =& SC_Query_Ex::getSingletonInstance(); 163 163 $sql = ""; // データ更新SQL生成用 164 164 $ret = ""; // データ更新結果格納用 165 $arrDelData = array(); // 更新データ生成用166 167 // 更新データ生成168 $arrUpdData = array($arrData['bloc_name'], BLOC_DIR . $arrData['filename'] . '.tpl', $arrData['filename']);169 165 170 166 // bloc_id が空でない場合にはdeleteを実行 171 if ($_POST['bloc_id'] !== '') { 172 // SQL生成 173 $sql = " DELETE FROM dtb_bloc WHERE bloc_id = ? AND device_type_id = ?"; 174 // SQL実行 175 $ret = $objQuery->query($sql,array($_POST['bloc_id'], $device_type_id)); 167 if ($bloc_id !== '') { 168 $objQuery->delete('dtb_bloc', 'bloc_id = ? AND device_type_id = ?', array($bloc_id, $device_type_id)); 176 169 177 170 // ページに配置されているデータも削除する 178 $sql = "DELETE FROM dtb_blocposition WHERE bloc_id = ? AND device_type_id = ?"; 179 // SQL実行 180 $ret = $objQuery->query($sql,array($_POST['bloc_id'], $device_type_id)); 171 $objQuery->delete('dtb_blocposition', 'bloc_id = ? AND device_type_id = ?', array($bloc_id, $device_type_id)); 181 172 182 173 // ファイルの削除 … … 205 196 206 197 /** 198 * パラメータ情報の初期化 199 * 200 * @param object $objFormParam SC_FormParamインスタンス 201 * @param array $arrPost $_POSTデータ 202 * @return void 203 */ 204 function lfInitParam(&$objFormParam, $arrPost) { 205 $objFormParam->addParam("ブロックID", "bloc_id", INT_LEN, 'n', array("NUM_CHECK", "MAX_LENGTH_CHECK")); 206 $objFormParam->addParam("端末種別ID", "device_type_id", INT_LEN, 'n', array("NUM_CHECK", "MAX_LENGTH_CHECK"), DEVICE_TYPE_PC); 207 $objFormParam->setParam($arrPost); 208 $objFormParam->convParam(); 209 } 210 211 /** 207 212 * ブロック情報を取得する. 208 213 * … … 225 230 */ 226 231 function lfEntryBlocData($arrData, $device_type_id){ 227 $objQuery = new SC_Query_Ex(); // DB操作オブジェクト232 $objQuery =& SC_Query_Ex::getSingletonInstance(); 228 233 $sql = ""; // データ更新SQL生成用 229 234 $ret = ""; // データ更新結果格納用
Note: See TracChangeset
for help on using the changeset viewer.