Ignore:
Timestamp:
2007/08/27 17:49:31 (13 years ago)
Author:
nanasess
Message:

クラス化対応

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update/html/frontparts/bloc/category.php

    r15152 r15367  
    55 * http://www.lockon.co.jp/ 
    66 */ 
    7 class LC_CatPage { 
    8     function LC_CatPage() { 
    9         /** 必ず変更する **/ 
    10         $this->tpl_mainpage = BLOC_PATH . 'category.tpl';   // メイン 
    11     } 
    12 } 
    137 
    14 $objSubPage = new LC_CatPage(); 
    15 $objSubView = new SC_SiteView(); 
     8// {{{ requires 
     9require_once(CLASS_PATH . "page_extends/frontparts/bloc/LC_Page_FrontParts_Bloc_Category_Ex.php"); 
    1610 
    17 // 選択中のカテゴリIDを判定する 
    18 $category_id = SC_Utils::sfGetCategoryId($_GET['product_id'], $_GET['category_id']); 
     11// }}} 
     12// {{{ generate page 
    1913 
    20 // 選択中のカテゴリID 
    21 $objSubPage->tpl_category_id = $category_id; 
    22 $objSubPage = lfGetCatTree($category_id, true, $objSubPage); 
    23  
    24 $objSubView->assignobj($objSubPage); 
    25 $objSubView->display($objSubPage->tpl_mainpage); 
    26 //----------------------------------------------------------------------------------------------------------------------------------- 
    27 // カテゴリツリーの取得 
    28 function lfGetCatTree($parent_category_id, $count_check = false, $objSubPage) { 
    29     $objQuery = new SC_Query(); 
    30     $col = "*"; 
    31     $from = "dtb_category left join dtb_category_total_count using (category_id)"; 
    32     // 登録商品数のチェック 
    33     if($count_check) { 
    34         $where = "del_flg = 0 AND product_count > 0"; 
    35     } else { 
    36         $where = "del_flg = 0"; 
    37     } 
    38     $objQuery->setoption("ORDER BY rank DESC"); 
    39     $arrRet = $objQuery->select($col, $from, $where); 
    40  
    41     $arrParentID = SC_Utils_Ex::sfGetParents($objQuery, 'dtb_category', 'parent_category_id', 'category_id', $parent_category_id); 
    42     $arrBrothersID = SC_Utils_Ex::sfGetBrothersArray($arrRet, 'parent_category_id', 'category_id', $arrParentID); 
    43     $arrChildrenID = SC_Utils_Ex::sfGetUnderChildrenArray($arrRet, 'parent_category_id', 'category_id', $parent_category_id); 
    44  
    45     $objSubPage->root_parent_id = $arrParentID[0]; 
    46  
    47     $arrDispID = array_merge($arrBrothersID, $arrChildrenID); 
    48  
    49     foreach($arrRet as $key => $array) { 
    50         foreach($arrDispID as $val) { 
    51             if($array['category_id'] == $val) { 
    52                 $arrRet[$key]['display'] = 1; 
    53                 break; 
    54             } 
    55         } 
    56     } 
    57  
    58     $objSubPage->arrTree = $arrRet; 
    59     return $objSubPage; 
    60 } 
     14$objPage = new LC_Page_FrontParts_BLoc_Category_Ex(); 
     15$objPage->init(); 
     16$objPage->process(); 
     17register_shutdown_function(array($objPage, "destroy")); 
    6118?> 
Note: See TracChangeset for help on using the changeset viewer.