Changeset 10361 for temp/trunk/html/admin
- Timestamp:
- 2006/12/06 15:52:29 (20 years ago)
- File:
-
- 1 edited
-
temp/trunk/html/admin/design/upload.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
temp/trunk/html/admin/design/upload.php
r10359 r10361 23 23 $objView = new SC_AdminView(); 24 24 $objSess = new SC_Session(); 25 $objQuery = new SC_Query(); 25 26 26 27 // ǧ¾Ú²ÄÈݤÎȽÄê … … 29 30 30 31 // ¥Õ¥¡¥¤¥ë´ÉÍý¥¯¥é¥¹ 31 $objUpFile = new SC_UploadFile( USER_TEMPLATE_PATH.$_POST['template_code'], USER_TEMPLATE_PATH);32 $objUpFile = new SC_UploadFile(TEMPLATE_TEMP_DIR, USER_TEMPLATE_PATH.$_POST['template_code']); 32 33 // ¥Õ¥¡¥¤¥ë¾ðÊó¤Î½é´ü²½ 33 34 lfInitFile(); … … 40 41 case 'upload': 41 42 $objFormParam->setParam($_POST); 43 $arrRet = $objFormParam->getHashArray(); 44 42 45 $objPage->arrErr = lfErrorCheck(); 43 46 44 mkdir ("/path/to/my/dir", 0700); 45 46 // ¥Õ¥¡¥¤¥ë¤òÊݸ 47 // ¥Õ¥¡¥¤¥ë¤ò°ì»þ¥Õ¥©¥ë¥À¤ØÊݸ 47 48 $ret = $objUpFile->makeTempFile('template_file', false); 48 49 if($ret != "") { 49 50 $objPage->arrErr['template_file'] = $ret; 50 51 } else if(count($objPage->arrErr) <= 0) { 52 // ¥Õ¥©¥ë¥ÀºîÀ® 53 $ret = @mkdir(USER_TEMPLATE_PATH.$arrRet['template_code']); 54 // °ì»þ¥Õ¥©¥ë¥À¤«¤éÊݸ¥Ç¥£¥ì¥¯¥È¥ê¤Ø°Üư 55 $objUpFile->moveTempFile(); 51 56 $objPage->tpl_onload = "alert('¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë¤ò¥¢¥Ã¥×¥í¡¼¥É¤·¤Þ¤·¤¿¡£');"; 52 57 } … … 87 92 * ÀâÌÀ¡¡¡§¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ 88 93 */ 89 function lfErrorCheck() { 90 94 function lfErrorCheck($arrList) { 91 95 global $objQuery; 92 96 global $objFormParam; 93 97 94 $arrRet = $objFormParam->getHashArray(); 95 $objErr = new SC_CheckError($arrRet); 98 $objErr = new SC_CheckError($arrList); 96 99 $objErr->arrErr = $objFormParam->checkError(); 97 100 101 // Ʊ̾¤Î¥Õ¥©¥ë¥À¤¬Â¸ºß¤¹¤ë¾ì¹ç¤Ï¥¨¥é¡¼ 102 if(file_exists(USER_TEMPLATE_PATH.$arrList['template_code'])) { 103 $objErr->arrErr = "¢¨ Ʊ̾¤Î¥Õ¥¡¥¤¥ë¤¬¤¹¤Ç¤Ë¸ºß¤·¤Þ¤¹¡£<br/>"; 104 } 105 // DB¤Ë¤¹¤Ç¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¥Á¥§¥Ã¥¯ 106 $ret = $objQuery->get("dtb_templates", "template_code", "template_code = ?", array($arrList['template_code'])); 107 if($ret != "") { 108 $objErr->arrErr = "¢¨ ¤¹¤Ç¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥Æ¥ó¥×¥ì¡¼¥È¥³¡¼¥É¤Ç¤¹¡£<br/>"; 109 } 110 98 111 return $objErr->arrErr; 99 112 } 113 114 function lfRegistTemplate($arrList) { 115 global $objQuery; 116 117 // INSERT¤¹¤ëÃͤòºîÀ®¤¹¤ë¡£ 118 $sqlval['name'] = $arrList['template_code']; 119 $sqlval['category_id'] = $arrList['template_name']; 120 $sqlval['create_date'] = "now()"; 121 $sqlval['update_date'] = "now()"; 122 123 $objQuery->insert("dtb_templates", $sqlval); 124 } 125
Note: See TracChangeset
for help on using the changeset viewer.
