Changeset 22602 for branches/version-2_12-dev/data/class
- Timestamp:
- 2013/03/05 08:52:08 (13 years ago)
- Location:
- branches/version-2_12-dev/data/class
- Files:
-
- 2 edited
-
pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Category.php (modified) (2 diffs)
-
util/SC_Utils.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Category.php
r22595 r22602 37 37 // }}} 38 38 // {{{ functions 39 public $arrParentID; 39 40 40 41 /** … … 133 134 $arrTree = $objCategory->getTree(); 134 135 135 $ arrCategory = $objCategory->getList();136 $this->arrParentID = array(); 136 137 foreach ($arrParentCategoryId as $category_id) { 137 138 $arrParentID = $objCategory->getTreeTrail($category_id); 138 $arrBrothersID = SC_Utils_Ex::sfGetBrothersArray( 139 $arrCategory, 140 'parent_category_id', 141 'category_id', 142 $arrParentID 143 ); 144 $arrChildrenID = SC_Utils_Ex::sfGetUnderChildrenArray( 145 $arrCategory, 146 'parent_category_id', 147 'category_id', 148 $category_id 149 ); 139 $this->arrParentID = array_merge($this->arrParentID, $arrParentID); 150 140 $this->root_parent_id[] = $arrParentID[0]; 151 $this->arrDispID = array_merge($arrBrothersID, $arrChildrenID);152 141 } 153 142 -
branches/version-2_12-dev/data/class/util/SC_Utils.php
r22597 r22602 1093 1093 } 1094 1094 1095 /* 階層構造のテーブルから与えられたIDの兄弟を取得する */1096 function sfGetBrothersArray($arrData, $pid_name, $id_name, $arrPID)1097 {1098 $max = count($arrData);1099 1100 $arrBrothers = array();1101 foreach ($arrPID as $id) {1102 // 親IDを検索する1103 for ($i = 0; $i < $max; $i++) {1104 if ($arrData[$i][$id_name] == $id) {1105 $parent = $arrData[$i][$pid_name];1106 break;1107 }1108 }1109 // 兄弟IDを検索する1110 for ($i = 0; $i < $max; $i++) {1111 if ($arrData[$i][$pid_name] == $parent) {1112 $arrBrothers[] = $arrData[$i][$id_name];1113 }1114 }1115 }1116 return $arrBrothers;1117 }1118 1119 1095 /* 階層構造のテーブルから与えられたIDの直属の子を取得する */ 1120 1096 function sfGetUnderChildrenArray($arrData, $pid_name, $id_name, $parent)
Note: See TracChangeset
for help on using the changeset viewer.
