Changeset 20284
- Timestamp:
- 2011/02/21 02:51:58 (13 years ago)
- Location:
- branches/version-2_5-dev/data/class
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/class/helper/SC_Helper_DB.php
r20231 r20284 254 254 $arrRet = $objQuery->select($col, $from, $where); 255 255 256 $arrParentID = $this->sfGetParents('dtb_category', 'parent_category_id', 'category_id', $parent_category_id);256 $arrParentID = SC_Helper_DB_Ex::sfGetParents('dtb_category', 'parent_category_id', 'category_id', $parent_category_id); 257 257 258 258 foreach($arrRet as $key => $array) { -
branches/version-2_5-dev/data/class/pages/products/LC_Page_Products_CategoryList.php
r20116 r20284 66 66 67 67 // カテゴリー情報を取得する。 68 $this->lfGetCategories(@$_GET['category_id'], true, $this); 68 $objFormParam = $this->lfInitParam($_REQUEST); 69 $arrCategoryData = $this->lfGetCategories($objFormParam->getValue('category_id'), true, $this); 70 $this->arrCategory = $arrCategoryData["arrCategory"]; 71 $this->arrChildren = $arrCategoryData["arrChildren"]; 69 72 $this->tpl_subtitle = $this->arrCategory['category_name']; 70 73 } … … 80 83 81 84 /* カテゴリIDの正当性チェック */ 82 function lfCheckCategoryId() { 83 $objDb = new SC_Helper_DB_Ex(); 84 $category_id = $_POST['category_id'] ? $_POST['category_id'] : $_GET['category_id']; 85 if (!defined('MOBILE_SITE') && !isset($_REQUEST['category_id'])) 86 SC_Utils_Ex::sfDispSiteError(CATEGORY_NOT_FOUND); 87 if ($category_id 88 && (!SC_Utils_Ex::sfIsInt($category_id) 89 || SC_Utils_Ex::sfIsZeroFilling($category_id) 90 || !$objDb->sfIsRecord('dtb_category', 'category_id', (array)$category_id, 'del_flg = 0'))) 91 SC_Utils_Ex::sfDispSiteError(CATEGORY_NOT_FOUND); 85 function lfCheckCategoryId($category_id) { 86 if ($category_id && !SC_Helper_DB_Ex::sfIsRecord('dtb_category', 'category_id', (array)$category_id, 'del_flg = 0')){ 87 return 0; 88 } 89 return $category_id; 92 90 } 93 91 … … 102 100 */ 103 101 function lfGetCategories($category_id, $count_check = false, &$objPage) { 104 $objDb = new SC_Helper_DB_Ex();105 102 // カテゴリーの正しいIDを取得する。 106 $arrCategory_id = $objDb->sfGetCategoryId('', $category_id); 107 $category_id = $arrCategory_id[0]; 103 $category_id = $this->lfCheckCategoryId($category_id); 108 104 if ($category_id == 0) { 109 105 SC_Utils_Ex::sfDispSiteError(CATEGORY_NOT_FOUND); … … 113 109 $arrChildren = array(); // 子カテゴリー 114 110 115 $arrAll = $objDb->sfGetCatTree($category_id, $count_check);111 $arrAll = SC_Helper_DB_Ex::sfGetCatTree($category_id, $count_check); 116 112 foreach ($arrAll as $category) { 117 113 // 選択されたカテゴリーの場合 … … 149 145 } 150 146 151 // 結果を格納する。 152 $objPage->arrCategory = $arrCategory; 153 $objPage->arrChildren = $arrChildren; 147 return array("arrChildren"=>$arrChildren, "arrCategory"=>$arrCategory); 154 148 } 149 150 /** 151 * ユーザ入力値の処理 152 * 153 * @return object 154 */ 155 function lfInitParam($arrRequest) { 156 $objFormParam = new SC_FormParam(); 157 $objFormParam->addParam("カテゴリID", "category_id", INT_LEN, "n", array('NUM_CHECK',"MAX_LENGTH_CHECK")); 158 // 値の取得 159 $objFormParam->setParam($arrRequest); 160 // 入力値の変換 161 $objFormParam->convParam(); 162 return $objFormParam; 163 } 164 165 155 166 } 156 167 ?>
Note: See TracChangeset
for help on using the changeset viewer.