Changeset 22796 for branches/version-2_12-dev/data/class/pages/admin/design
- Timestamp:
- 2013/05/02 18:11:36 (13 years ago)
- Location:
- branches/version-2_12-dev/data/class/pages/admin/design
- Files:
-
- 7 edited
-
LC_Page_Admin_Design.php (modified) (11 diffs)
-
LC_Page_Admin_Design_Bloc.php (modified) (15 diffs)
-
LC_Page_Admin_Design_CSS.php (modified) (12 diffs)
-
LC_Page_Admin_Design_Header.php (modified) (9 diffs)
-
LC_Page_Admin_Design_MainEdit.php (modified) (11 diffs)
-
LC_Page_Admin_Design_Template.php (modified) (13 diffs)
-
LC_Page_Admin_Design_UpDown.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/pages/admin/design/LC_Page_Admin_Design.php
r22567 r22796 32 32 * @version $Id$ 33 33 */ 34 class LC_Page_Admin_Design extends LC_Page_Admin_Ex 35 { 34 class LC_Page_Admin_Design extends LC_Page_Admin_Ex { 36 35 37 36 // }}} … … 43 42 * @return void 44 43 */ 45 function init() 46 { 44 function init() { 47 45 parent::init(); 48 46 $this->tpl_mainpage = 'design/index.tpl'; … … 61 59 * @return void 62 60 */ 63 function process() 64 { 61 function process() { 65 62 $this->action(); 66 63 $this->sendResponse(); … … 72 69 * @return void 73 70 */ 74 function action() 75 { 71 function action() { 76 72 77 73 $objLayout = new SC_Helper_PageLayout_Ex(); … … 152 148 * @return void 153 149 */ 154 function destroy() 155 { 150 function destroy() { 156 151 parent::destroy(); 157 152 } … … 164 159 * @return void 165 160 */ 166 function lfInitParam(&$objFormParam, $bloc_cnt = 0) 167 { 161 function lfInitParam(&$objFormParam, $bloc_cnt = 0) { 168 162 $objFormParam->addParam('ページID', 'page_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); 169 163 $objFormParam->addParam('端末種別ID', 'device_type_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); … … 187 181 * @return array レイアウト情報の配列 188 182 */ 189 function getLayout($device_type_id, $page_id, &$objLayout) 190 { 183 function getLayout($device_type_id, $page_id, &$objLayout) { 191 184 $arrResults = array(); 192 185 $i = 0; … … 219 212 * @return void 220 213 */ 221 function copyBloc(&$arrDest, $arrFrom, $cnt) 222 { 214 function copyBloc(&$arrDest, $arrFrom, $cnt) { 223 215 $arrDest[$cnt]['target_id'] = $this->arrTarget[$arrFrom['target_id']]; 224 216 $arrDest[$cnt]['bloc_id'] = $arrFrom['bloc_id']; … … 235 227 * @return bool 存在する場合 true 236 228 */ 237 function existsBloc($arrBloc, $arrToBlocs) 238 { 229 function existsBloc($arrBloc, $arrToBlocs) { 239 230 foreach ($arrToBlocs as $arrToBloc) { 240 231 if ($arrBloc['bloc_id'] === $arrToBloc['bloc_id']) { … … 252 243 * @return string プレビューを行う tpl_mainpage ファイル名 253 244 */ 254 function savePreviewData($page_id, &$objLayout) 255 { 245 function savePreviewData($page_id, &$objLayout) { 256 246 $arrPageData = $objLayout->getPageProperties(DEVICE_TYPE_PC, $page_id); 257 247 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 268 258 * @return void 269 259 */ 270 function placingBlocs(&$objFormParam, $is_preview = false) 271 { 260 function placingBlocs(&$objFormParam, $is_preview = false) { 272 261 $page_id = $is_preview ? 0 : $objFormParam->getValue('page_id'); 273 262 $device_type_id = $objFormParam->getValue('device_type_id'); -
branches/version-2_12-dev/data/class/pages/admin/design/LC_Page_Admin_Design_Bloc.php
r22610 r22796 32 32 * @version $Id$ 33 33 */ 34 class LC_Page_Admin_Design_Bloc extends LC_Page_Admin_Ex 35 { 34 class LC_Page_Admin_Design_Bloc extends LC_Page_Admin_Ex { 36 35 37 36 // }}} … … 43 42 * @return void 44 43 */ 45 function init() 46 { 44 function init() { 47 45 parent::init(); 48 46 $this->tpl_mainpage = 'design/bloc.tpl'; … … 62 60 * @return void 63 61 */ 64 function process() 65 { 62 function process() { 66 63 $this->action(); 67 64 $this->sendResponse(); … … 73 70 * @return void 74 71 */ 75 function action() 76 { 72 function action() { 77 73 78 74 $objFormParam = new SC_FormParam_Ex(); … … 86 82 $this->device_type_id = $objFormParam->getValue('device_type_id', DEVICE_TYPE_PC); 87 83 88 $objBloc = new SC_Helper_Bloc_Ex($this->device_type_id);89 84 $objLayout = new SC_Helper_PageLayout_Ex(); 90 85 … … 93 88 case 'confirm': 94 89 if (!$is_error) { 95 $this->arrErr = $this->lfCheckError($objFormParam, $this->arrErr, $obj Bloc);90 $this->arrErr = $this->lfCheckError($objFormParam, $this->arrErr, $objLayout); 96 91 if (SC_Utils_Ex::isBlank($this->arrErr)) { 97 $result = $this->doRegister($objFormParam, $obj Bloc);92 $result = $this->doRegister($objFormParam, $objLayout); 98 93 if ($result !== false) { 99 94 $arrPram = array( … … 113 108 case 'delete': 114 109 if (!$is_error) { 115 if ($this->doDelete($objFormParam, $obj Bloc)) {110 if ($this->doDelete($objFormParam, $objLayout)) { 116 111 $arrPram = array( 117 112 'device_type_id' => $this->device_type_id, … … 135 130 if (!$is_error) { 136 131 // ブロック一覧を取得 137 $this->arrBlocList = $obj Bloc->getList();132 $this->arrBlocList = $objLayout->getBlocs($this->device_type_id); 138 133 // bloc_id が指定されている場合にはブロックデータの取得 139 134 if (!SC_Utils_Ex::isBlank($this->bloc_id)) { 140 $arrBloc = $this->getBlocTemplate($this-> bloc_id, $objBloc);135 $arrBloc = $this->getBlocTemplate($this->device_type_id, $this->bloc_id, $objLayout); 141 136 $objFormParam->setParam($arrBloc); 142 137 } … … 155 150 * @return void 156 151 */ 157 function destroy() 158 { 152 function destroy() { 159 153 parent::destroy(); 160 154 } … … 166 160 * @return void 167 161 */ 168 function lfInitParam(&$objFormParam) 169 { 162 function lfInitParam(&$objFormParam) { 170 163 $objFormParam->addParam('ブロックID', 'bloc_id', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); 171 164 $objFormParam->addParam('端末種別ID', 'device_type_id', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); … … 178 171 * ブロックのテンプレートを取得する. 179 172 * 173 * @param integer $device_type_id 端末種別ID 180 174 * @param integer $bloc_id ブロックID 181 * @param SC_Helper_ Bloc_Ex $objBloc SC_Helper_Bloc_Exインスタンス175 * @param SC_Helper_PageLayout $objLayout SC_Helper_PageLayout インスタンス 182 176 * @return array ブロック情報の配列 183 177 */ 184 function getBlocTemplate($bloc_id, SC_Helper_Bloc_Ex &$objBloc) 185 { 186 $arrBloc = $objBloc->get($bloc_id); 187 return $arrBloc; 178 function getBlocTemplate($device_type_id, $bloc_id, &$objLayout) { 179 $arrBloc = $objLayout->getBlocs($device_type_id, 'bloc_id = ?', array($bloc_id)); 180 if (SC_Utils_Ex::isAbsoluteRealPath($arrBloc[0]['tpl_path'])) { 181 $tpl_path = $arrBloc[0]['tpl_path']; 182 } else { 183 $tpl_path = SC_Helper_PageLayout_Ex::getTemplatePath($device_type_id) . BLOC_DIR . $arrBloc[0]['tpl_path']; 184 } 185 if (file_exists($tpl_path)) { 186 $arrBloc[0]['bloc_html'] = file_get_contents($tpl_path); 187 } 188 return $arrBloc[0]; 188 189 } 189 190 … … 195 196 * 196 197 * @param SC_FormParam $objFormParam SC_FormParam インスタンス 197 * @param SC_Helper_ Bloc $objBloc SC_Helper_Blocインスタンス198 * @param SC_Helper_PageLayout $objLayout SC_Helper_PageLayout インスタンス 198 199 * @return integer|boolean 登録が成功した場合, 登録したブロックID; 199 200 * 失敗した場合 false 200 201 */ 201 function doRegister(&$objFormParam, SC_Helper_Bloc_Ex &$objBloc) 202 { 202 function doRegister(&$objFormParam, &$objLayout) { 203 203 $arrParams = $objFormParam->getHashArray(); 204 $result = $objBloc->save($arrParams); 205 206 if (!$result) { 204 205 $objQuery =& SC_Query_Ex::getSingletonInstance(); 206 $objQuery->begin(); 207 208 // blod_id が空の場合は新規登録 209 $is_new = SC_Utils_Ex::isBlank($arrParams['bloc_id']); 210 $bloc_dir = $objLayout->getTemplatePath($arrParams['device_type_id']) . BLOC_DIR; 211 // 既存データの重複チェック 212 if (!$is_new) { 213 $arrExists = $objLayout->getBlocs($arrParams['device_type_id'], 'bloc_id = ?', array($arrParams['bloc_id'])); 214 215 // 既存のファイルが存在する場合は削除しておく 216 $exists_file = $bloc_dir . $arrExists[0]['filename'] . '.tpl'; 217 if (file_exists($exists_file)) { 218 unlink($exists_file); 219 } 220 } 221 222 $table = 'dtb_bloc'; 223 $arrValues = $objQuery->extractOnlyColsOf($table, $arrParams); 224 $arrValues['tpl_path'] = $arrParams['filename'] . '.tpl'; 225 $arrValues['update_date'] = 'CURRENT_TIMESTAMP'; 226 227 // 新規登録 228 if ($is_new || SC_Utils_Ex::isBlank($arrExists)) { 229 $objQuery->setOrder(''); 230 $arrValues['bloc_id'] = 1 + $objQuery->max('bloc_id', $table, 'device_type_id = ?', 231 array($arrValues['device_type_id'])); 232 $arrValues['create_date'] = 'CURRENT_TIMESTAMP'; 233 $objQuery->insert($table, $arrValues); 234 } 235 // 更新 236 else { 237 $objQuery->update($table, $arrValues, 'bloc_id = ? AND device_type_id = ?', 238 array($arrValues['bloc_id'], $arrValues['device_type_id'])); 239 } 240 241 $bloc_path = $bloc_dir . $arrValues['tpl_path']; 242 if (!SC_Helper_FileManager_Ex::sfWriteFile($bloc_path, $arrParams['bloc_html'])) { 207 243 $this->arrErr['err'] = '※ ブロックの書き込みに失敗しました<br />'; 208 } 209 210 return $result; 244 $objQuery->rollback(); 245 return false; 246 } 247 248 $objQuery->commit(); 249 return $arrValues['bloc_id']; 211 250 } 212 251 … … 215 254 * 216 255 * @param SC_FormParam $objFormParam SC_FormParam インスタンス 217 * @param SC_Helper_ Bloc $objBloc SC_Helper_Blocインスタンス256 * @param SC_Helper_PageLayout $objLayout SC_Helper_PageLayout インスタンス 218 257 * @return boolean 登録が成功した場合 true; 失敗した場合 false 219 258 */ 220 function doDelete(&$objFormParam, SC_Helper_Bloc_Ex &$objBloc) 221 { 259 function doDelete(&$objFormParam, &$objLayout) { 222 260 $arrParams = $objFormParam->getHashArray(); 223 $result = $objBloc->delete($arrParams['bloc_id']); 224 225 if (!$result) { 261 $objQuery =& SC_Query_Ex::getSingletonInstance(); 262 $objQuery->begin(); 263 264 $arrExists = $objLayout->getBlocs($arrParams['device_type_id'], 'bloc_id = ? AND deletable_flg = 1', 265 array($arrParams['bloc_id'])); 266 $is_error = false; 267 if (!SC_Utils_Ex::isBlank($arrExists)) { 268 $objQuery->delete('dtb_bloc', 'bloc_id = ? AND device_type_id = ?', 269 array($arrExists[0]['bloc_id'], $arrExists[0]['device_type_id'])); 270 $objQuery->delete('dtb_blocposition', 'bloc_id = ? AND device_type_id = ?', 271 array($arrExists[0]['bloc_id'], $arrExists[0]['device_type_id'])); 272 273 $bloc_dir = $objLayout->getTemplatePath($arrParams['device_type_id']) . BLOC_DIR; 274 $exists_file = $bloc_dir . $arrExists[0]['filename'] . '.tpl'; 275 276 // ファイルの削除 277 if (file_exists($exists_file)) { 278 if (!unlink($exists_file)) { 279 $is_error = true; 280 } 281 } 282 } else { 283 $is_error = true; 284 } 285 286 if ($is_error) { 226 287 $this->arrErr['err'] = '※ ブロックの削除に失敗しました<br />'; 227 } 228 229 return $result; 288 $objQuery->rollback(); 289 return false; 290 } 291 $objQuery->commit(); 292 return true; 230 293 } 231 294 … … 236 299 * @return array エラーメッセージの配列 237 300 */ 238 function lfCheckError(&$objFormParam, &$arrErr, SC_Helper_Bloc_Ex &$objBloc) 239 { 301 function lfCheckError(&$objFormParam, &$arrErr, &$objLayout) { 240 302 $arrParams = $objFormParam->getHashArray(); 241 303 $objErr = new SC_CheckError_Ex($arrParams); … … 252 314 $arrValues[] = $arrParams['bloc_id']; 253 315 } 254 $arrBloc = $obj Bloc->getWhere($where, $arrValues);316 $arrBloc = $objLayout->getBlocs($arrParams['device_type_id'], $where, $arrValues); 255 317 if (!SC_Utils_Ex::isBlank($arrBloc)) { 256 318 $objErr->arrErr['filename'] = '※ 同じファイル名のデータが存在しています。別のファイル名を入力してください。<br />'; -
branches/version-2_12-dev/data/class/pages/admin/design/LC_Page_Admin_Design_CSS.php
r22567 r22796 32 32 * @version $Id$ 33 33 */ 34 class LC_Page_Admin_Design_CSS extends LC_Page_Admin_Ex 35 { 34 class LC_Page_Admin_Design_CSS extends LC_Page_Admin_Ex { 36 35 37 36 // }}} … … 43 42 * @return void 44 43 */ 45 function init() 46 { 44 function init() { 47 45 parent::init(); 48 46 $this->tpl_mainpage = 'design/css.tpl'; … … 61 59 * @return void 62 60 */ 63 function process() 64 { 61 function process() { 65 62 $this->action(); 66 63 $this->sendResponse(); … … 72 69 * @return void 73 70 */ 74 function action() 75 { 71 function action() { 76 72 77 73 $objLayout = new SC_Helper_PageLayout_Ex(); … … 146 142 * @return void 147 143 */ 148 function destroy() 149 { 144 function destroy() { 150 145 parent::destroy(); 151 146 } … … 157 152 * @return void 158 153 */ 159 function lfInitParam(&$objFormParam) 160 { 154 function lfInitParam(&$objFormParam) { 161 155 $objFormParam->addParam('端末種別ID', 'device_type_id', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); 162 156 $objFormParam->addParam('CSSファイル名', 'css_name', STEXT_LEN, 'a', array('MAX_LENGTH_CHECK')); … … 178 172 * @return boolean 登録が成功した場合 true; 失敗した場合 false 179 173 */ 180 function doRegister($css_dir, $css_name, $old_css_name, $css_path, $css_data) 181 { 174 function doRegister($css_dir, $css_name, $old_css_name, $css_path, $css_data) { 182 175 $objFileManager = new SC_Helper_FileManager_Ex(); 183 176 … … 203 196 * @return boolean 削除が成功した場合 true; 失敗した場合 false 204 197 */ 205 function doDelete($css_path) 206 { 198 function doDelete($css_path) { 207 199 if (!unlink($css_path)) { 208 200 $this->arrErr['err'] = '※ CSSの削除に失敗しました<br />'; … … 218 210 * @return array ファイルリスト 219 211 */ 220 function getCSSList($css_dir) 221 { 212 function getCSSList($css_dir) { 222 213 $objFileManager = new SC_Helper_FileManager_Ex(); 223 214 … … 240 231 * @return array エラーメッセージの配列 241 232 */ 242 function lfCheckError(&$objFormParam, &$arrErr) 243 { 233 function lfCheckError(&$objFormParam, &$arrErr) { 244 234 $arrParams = $objFormParam->getHashArray(); 245 235 $objErr = new SC_CheckError_Ex($arrParams); … … 276 266 * @return string CSSディレクトリ 277 267 */ 278 function getCSSDir($device_type_id) 279 { 268 function getCSSDir($device_type_id) { 280 269 return SC_Helper_PageLayout_Ex::getTemplatePath($device_type_id, true) . 'css/'; 281 270 } … … 286 275 * @return boolean 287 276 */ 288 function checkPath($str) 289 { 277 function checkPath($str) { 290 278 // 含む場合はfalse 291 279 if (preg_match('|\./|', $str)) { -
branches/version-2_12-dev/data/class/pages/admin/design/LC_Page_Admin_Design_Header.php
r22567 r22796 32 32 * @version $Id$ 33 33 */ 34 class LC_Page_Admin_Design_Header extends LC_Page_Admin_Ex 35 { 34 class LC_Page_Admin_Design_Header extends LC_Page_Admin_Ex { 36 35 37 36 // }}} … … 43 42 * @return void 44 43 */ 45 function init() 46 { 44 function init() { 47 45 parent::init(); 48 46 $this->tpl_mainpage = 'design/header.tpl'; … … 62 60 * @return void 63 61 */ 64 function process() 65 { 62 function process() { 66 63 $this->action(); 67 64 $this->sendResponse(); … … 73 70 * @return void 74 71 */ 75 function action() 76 { 72 function action() { 77 73 78 74 $objFormParam = new SC_FormParam_Ex(); … … 125 121 * @return void 126 122 */ 127 function destroy() 128 { 123 function destroy() { 129 124 parent::destroy(); 130 125 } … … 136 131 * @return void 137 132 */ 138 function lfInitParam(&$objFormParam) 139 { 133 function lfInitParam(&$objFormParam) { 140 134 $objFormParam->addParam('端末種別ID', 'device_type_id', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); 141 135 $objFormParam->addParam('division', 'division', STEXT_LEN, 'a', array('MAX_LENGTH_CHECK')); … … 150 144 * @return array エラーメッセージの配列 151 145 */ 152 function lfCheckError(&$objFormParam, &$arrErr) 153 { 146 function lfCheckError(&$objFormParam, &$arrErr) { 154 147 $arrParams = $objFormParam->getHashArray(); 155 148 $objErr = new SC_CheckError_Ex($arrParams); … … 167 160 * @return integer|boolean 登録が成功した場合 true; 失敗した場合 false 168 161 */ 169 function doRegister(&$objFormParam) 170 { 162 function doRegister(&$objFormParam) { 171 163 $division = $objFormParam->getValue('division'); 172 164 $contents = $objFormParam->getValue($division); … … 187 179 * @return string|boolean 成功した場合, テンプレートのパス; 失敗した場合 false 188 180 */ 189 function getTemplatePath($device_type_id, $division) 190 { 181 function getTemplatePath($device_type_id, $division) { 191 182 $tpl_path = SC_Helper_PageLayout_Ex::getTemplatePath($device_type_id) . '/' . $division . '.tpl'; 192 183 if (file_exists($tpl_path)) { -
branches/version-2_12-dev/data/class/pages/admin/design/LC_Page_Admin_Design_MainEdit.php
r22567 r22796 32 32 * @version $Id$ 33 33 */ 34 class LC_Page_Admin_Design_MainEdit extends LC_Page_Admin_Ex 35 { 34 class LC_Page_Admin_Design_MainEdit extends LC_Page_Admin_Ex { 36 35 37 36 // }}} … … 43 42 * @return void 44 43 */ 45 function init() 46 { 44 function init() { 47 45 parent::init(); 48 46 $this->tpl_mainpage = 'design/main_edit.tpl'; … … 61 59 * @return void 62 60 */ 63 function process() 64 { 61 function process() { 65 62 $this->action(); 66 63 $this->sendResponse(); … … 72 69 * @return void 73 70 */ 74 function action() 75 { 71 function action() { 76 72 77 73 $objLayout = new SC_Helper_PageLayout_Ex(); … … 145 141 * @return void 146 142 */ 147 function destroy() 148 { 143 function destroy() { 149 144 parent::destroy(); 150 145 } … … 158 153 * @return void 159 154 */ 160 function lfInitParam(&$objFormParam) 161 { 155 function lfInitParam(&$objFormParam) { 162 156 $objFormParam->addParam('ページID', 'page_id', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); 163 157 $objFormParam->addParam('端末種別ID', 'device_type_id', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); … … 178 172 * @return array ページデータの配列 179 173 */ 180 function getTplMainpage($device_type_id, $page_id, &$objLayout) 181 { 174 function getTplMainpage($device_type_id, $page_id, &$objLayout) { 182 175 $arrPageData = $objLayout->getPageProperties($device_type_id, $page_id); 183 176 … … 203 196 * 失敗した場合 false 204 197 */ 205 function doRegister(&$objFormParam, &$objLayout) 206 { 198 function doRegister(&$objFormParam, &$objLayout) { 207 199 $filename = $objFormParam->getValue('filename'); 208 200 $arrParams['device_type_id'] = $objFormParam->getValue('device_type_id'); … … 259 251 * @return integer ページID 260 252 */ 261 function registerPage($arrParams, &$objLayout) 262 { 253 function registerPage($arrParams, &$objLayout) { 263 254 $objQuery =& SC_Query_Ex::getSingletonInstance(); 264 255 … … 304 295 * @return array エラーメッセージの配列 305 296 */ 306 function lfCheckError(&$objFormParam, &$arrErr) 307 { 297 function lfCheckError(&$objFormParam, &$arrErr) { 308 298 $arrParams = $objFormParam->getHashArray(); 309 299 $objErr = new SC_CheckError_Ex($arrParams); … … 354 344 * @return boolean 作成に成功した場合 true 355 345 */ 356 function createPHPFile($filename) 357 { 346 function createPHPFile($filename) { 358 347 $path = USER_REALDIR . $filename . '.php'; 359 348 -
branches/version-2_12-dev/data/class/pages/admin/design/LC_Page_Admin_Design_Template.php
r22567 r22796 31 31 * @version $Id$ 32 32 */ 33 class LC_Page_Admin_Design_Template extends LC_Page_Admin_Ex 34 { 33 class LC_Page_Admin_Design_Template extends LC_Page_Admin_Ex { 35 34 36 35 // }}} … … 42 41 * @return void 43 42 */ 44 function init() 45 { 43 function init() { 46 44 parent::init(); 47 45 $this->tpl_mainpage = 'design/template.tpl'; … … 62 60 * @return void 63 61 */ 64 function process() 65 { 62 function process() { 66 63 $this->action(); 67 64 $this->sendResponse(); … … 73 70 * @return void 74 71 */ 75 function action() 76 { 72 function action() { 77 73 78 74 $objFormParam = new SC_FormParam_Ex(); … … 142 138 * @return void 143 139 */ 144 function destroy() 145 { 140 function destroy() { 146 141 parent::destroy(); 147 142 } … … 153 148 * @return void 154 149 */ 155 function lfInitParam(&$objFormParam) 156 { 150 function lfInitParam(&$objFormParam) { 157 151 $objFormParam->addParam('端末種別ID', 'device_type_id', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); 158 152 $objFormParam->addParam('template_code', 'template_code', STEXT_LEN, 'a', array('EXIST_CHECK', 'SPTAB_CHECK','MAX_LENGTH_CHECK', 'ALNUM_CHECK')); … … 168 162 * @return void 169 163 */ 170 function doUpdateMasterData($template_code, $device_type_id) 171 { 164 function doUpdateMasterData($template_code, $device_type_id) { 172 165 $masterData = new SC_DB_MasterData_Ex(); 173 166 … … 204 197 * @return void 205 198 */ 206 function updateBloc($filepath) 207 { 199 function updateBloc($filepath) { 208 200 $sql = file_get_contents($filepath); 209 201 if ($sql !== false) { … … 227 219 * @return boolean 成功した場合 true; 失敗した場合 false 228 220 */ 229 function doDelete($template_code, $device_type_id) 230 { 221 function doDelete($template_code, $device_type_id) { 231 222 if ($template_code == $this->getTemplateName($device_type_id) 232 223 || $template_code == $this->getTemplateName($device_type_id, true)) { … … 276 267 * @return boolean 成功した場合 true; 失敗した場合 false 277 268 */ 278 function doRegister($template_code, $device_type_id) 279 { 269 function doRegister($template_code, $device_type_id) { 280 270 281 271 $tpl_dir = USER_TEMPLATE_REALDIR . $template_code . '/'; … … 307 297 * @return boolean 成功した場合 true; 失敗した場合 false 308 298 */ 309 function doDownload($template_code) 310 { 299 function doDownload($template_code) { 311 300 $from_dir = USER_TEMPLATE_REALDIR . $template_code . '/'; 312 301 $to_dir = SMARTY_TEMPLATES_REALDIR . $template_code . '/_packages/'; … … 329 318 * @return array テンプレート情報の配列 330 319 */ 331 function getAllTemplates($device_type_id) 332 { 320 function getAllTemplates($device_type_id) { 333 321 $objQuery =& SC_Query_Ex::getSingletonInstance(); 334 322 return $objQuery->select('*', 'dtb_templates', 'device_type_id = ?', array($device_type_id)); … … 342 330 * @return string テンプレート名 343 331 */ 344 function getTemplateName($device_type_id, $isDefault = false) 345 { 332 function getTemplateName($device_type_id, $isDefault = false) { 346 333 switch ($device_type_id) { 347 334 case DEVICE_TYPE_MOBILE: -
branches/version-2_12-dev/data/class/pages/admin/design/LC_Page_Admin_Design_UpDown.php
r22567 r22796 32 32 * @version $Id$ 33 33 */ 34 class LC_Page_Admin_Design_UpDown extends LC_Page_Admin_Ex 35 { 34 class LC_Page_Admin_Design_UpDown extends LC_Page_Admin_Ex { 36 35 37 36 // }}} … … 43 42 * @return void 44 43 */ 45 function init() 46 { 44 function init() { 47 45 parent::init(); 48 46 $this->tpl_mainpage = 'design/up_down.tpl'; … … 63 61 * @return void 64 62 */ 65 function process() 66 { 63 function process() { 67 64 $this->action(); 68 65 $this->sendResponse(); … … 76 73 * @return void 77 74 */ 78 function action() 79 { 75 function action() { 80 76 81 77 $objFormParam = new SC_FormParam_Ex(); … … 114 110 * @return void 115 111 */ 116 function destroy() 117 { 112 function destroy() { 118 113 parent::destroy(); 119 114 } … … 125 120 * @return object SC_UploadFileのインスタンス 126 121 */ 127 function lfInitUploadFile($objForm) 128 { 122 function lfInitUploadFile($objForm) { 129 123 $pkg_dir = SMARTY_TEMPLATES_REALDIR . $objForm->getValue('template_code'); 130 124 $objUpFile = new SC_UploadFile_Ex(TEMPLATE_TEMP_REALDIR, $pkg_dir); … … 139 133 * @return void 140 134 */ 141 function lfInitParam(&$objFormParam) 142 { 135 function lfInitParam(&$objFormParam) { 143 136 $objFormParam->addParam('テンプレートコード', 'template_code', STEXT_LEN, 'a', array('EXIST_CHECK', 'SPTAB_CHECK','MAX_LENGTH_CHECK', 'ALNUM_CHECK')); 144 137 $objFormParam->addParam('テンプレート名', 'template_name', STEXT_LEN, 'KVa', array('EXIST_CHECK', 'SPTAB_CHECK','MAX_LENGTH_CHECK')); … … 153 146 * @return array エラー情報を格納した連想配列, エラーが無ければ(多分)nullを返す 154 147 */ 155 function lfCheckError(&$objFormParam, &$objUpFile) 156 { 148 function lfCheckError(&$objFormParam, &$objUpFile) { 157 149 $arrErr = $objFormParam->checkError(); 158 150 $template_code = $objFormParam->getValue('template_code'); … … 205 197 * @return boolean 成功した場合 true; 失敗した場合 false 206 198 */ 207 function doUpload($objFormParam, $objUpFile) 208 { 199 function doUpload($objFormParam, $objUpFile) { 209 200 $template_code = $objFormParam->getValue('template_code'); 210 201 $template_name = $objFormParam->getValue('template_name');
Note: See TracChangeset
for help on using the changeset viewer.
