Index: branches/feature-module-update/html/frontparts/bloc/category.php
===================================================================
--- branches/rel/html/frontparts/bloc/category.php (revision 12157)
+++ branches/feature-module-update/html/frontparts/bloc/category.php (revision 15078)
@@ -6,8 +6,8 @@
*/
class LC_CatPage {
- function LC_CatPage() {
- /** ɬ¤ºÊѹ¹¤¹¤ë **/
- $this->tpl_mainpage = BLOC_PATH . 'category.tpl'; // ¥á¥¤¥ó
- }
+ function LC_CatPage() {
+ /** 必ず変更する **/
+ $this->tpl_mainpage = BLOC_PATH . 'category.tpl'; // メイン
+ }
}
@@ -15,8 +15,8 @@
$objSubView = new SC_SiteView();
-// ÁªÂòÃæ¤Î¥«¥Æ¥´¥êID¤òȽÄꤹ¤ë
-$category_id = sfGetCategoryId($_GET['product_id'], $_GET['category_id']);
+// 選択中のカテゴリIDを判定する
+$category_id = SC_Utils::sfGetCategoryId($_GET['product_id'], $_GET['category_id']);
-// ÁªÂòÃæ¤Î¥«¥Æ¥´¥êID
+// 選択中のカテゴリID
$objSubPage->tpl_category_id = $category_id;
$objSubPage = lfGetCatTree($category_id, true, $objSubPage);
@@ -25,37 +25,37 @@
$objSubView->display($objSubPage->tpl_mainpage);
//-----------------------------------------------------------------------------------------------------------------------------------
-// ¥«¥Æ¥´¥ê¥Ä¥ê¡¼¤Î¼èÆÀ
+// カテゴリツリーの取得
function lfGetCatTree($parent_category_id, $count_check = false, $objSubPage) {
- $objQuery = new SC_Query();
- $col = "*";
- $from = "dtb_category left join dtb_category_total_count using (category_id)";
- // ÅÐÏ¿¾¦ÉÊ¿ô¤Î¥Á¥§¥Ã¥¯
- if($count_check) {
- $where = "del_flg = 0 AND product_count > 0";
- } else {
- $where = "del_flg = 0";
- }
- $objQuery->setoption("ORDER BY rank DESC");
- $arrRet = $objQuery->select($col, $from, $where);
-
- $arrParentID = sfGetParents($objQuery, 'dtb_category', 'parent_category_id', 'category_id', $parent_category_id);
- $arrBrothersID = sfGetBrothersArray($arrRet, 'parent_category_id', 'category_id', $arrParentID);
- $arrChildrenID = sfGetUnderChildrenArray($arrRet, 'parent_category_id', 'category_id', $parent_category_id);
-
- $objSubPage->root_parent_id = $arrParentID[0];
-
- $arrDispID = array_merge($arrBrothersID, $arrChildrenID);
-
- foreach($arrRet as $key => $array) {
- foreach($arrDispID as $val) {
- if($array['category_id'] == $val) {
- $arrRet[$key]['display'] = 1;
- break;
- }
- }
- }
-
- $objSubPage->arrTree = $arrRet;
- return $objSubPage;
+ $objQuery = new SC_Query();
+ $col = "*";
+ $from = "dtb_category left join dtb_category_total_count using (category_id)";
+ // 登録商品数のチェック
+ if($count_check) {
+ $where = "del_flg = 0 AND product_count > 0";
+ } else {
+ $where = "del_flg = 0";
+ }
+ $objQuery->setoption("ORDER BY rank DESC");
+ $arrRet = $objQuery->select($col, $from, $where);
+
+ $arrParentID = SC_Utils::sfGetParents($objQuery, 'dtb_category', 'parent_category_id', 'category_id', $parent_category_id);
+ $arrBrothersID = SC_Utils::sfGetBrothersArray($arrRet, 'parent_category_id', 'category_id', $arrParentID);
+ $arrChildrenID = SC_Utils::sfGetUnderChildrenArray($arrRet, 'parent_category_id', 'category_id', $parent_category_id);
+
+ $objSubPage->root_parent_id = $arrParentID[0];
+
+ $arrDispID = array_merge($arrBrothersID, $arrChildrenID);
+
+ foreach($arrRet as $key => $array) {
+ foreach($arrDispID as $val) {
+ if($array['category_id'] == $val) {
+ $arrRet[$key]['display'] = 1;
+ break;
+ }
+ }
+ }
+
+ $objSubPage->arrTree = $arrRet;
+ return $objSubPage;
}
?>