Index: /branches/version-2_12-dev/data/Smarty/templates/admin/products/product_rank.tpl
===================================================================
--- /branches/version-2_12-dev/data/Smarty/templates/admin/products/product_rank.tpl	(revision 22571)
+++ /branches/version-2_12-dev/data/Smarty/templates/admin/products/product_rank.tpl	(revision 22597)
@@ -43,37 +43,10 @@
     <!--{* ▼画面左 *}-->
     <div id="products-rank-left">
-        <a href="?"><img src="<!--{$TPL_URLPATH}-->img/contents/folder_close.gif" alt="フォルダ" />&nbsp;ホーム</a><br />
-        <!--{section name=cnt loop=$arrTree}-->
-            <!--{assign var=level value="`$arrTree[cnt].level`}-->
-
-            <!--{* 上の階層表示の時にdivを閉じる *}-->
-            <!--{assign var=close_cnt value="`$before_level-$level+1`}-->
-            <!--{if $close_cnt > 0}-->
-                <!--{section name=n loop=$close_cnt}--></div><!--{/section}-->
-            <!--{/if}-->
-
-            <!--{* スペース繰り返し *}-->
-            <!--{section name=n loop=$level}-->　　<!--{/section}-->
-
-            <!--{* カテゴリ名表示 *}-->
-            <!--{assign var=disp_name value="`$arrTree[cnt].category_id`.`$arrTree[cnt].category_name`"}-->
-            <a href="?" onclick="fnModeSubmit('tree', 'parent_category_id', <!--{$arrTree[cnt].category_id}-->); return false">
-            <!--{if $arrForm.parent_category_id == $arrTree[cnt].category_id}-->
-                <img src="<!--{$TPL_URLPATH}-->img/contents/folder_open.gif" alt="フォルダ" />
-            <!--{else}-->
-                <img src="<!--{$TPL_URLPATH}-->img/contents/folder_close.gif" alt="フォルダ" />
-            <!--{/if}-->
-            <!--{$disp_name|sfCutString:10:false|h}-->(<!--{$arrTree[cnt].product_count|default:0}-->)</a>
-            <br />
-            <!--{if $arrTree[cnt].display == true}-->
-                <div id="f<!--{$arrTree[cnt].category_id}-->">
-            <!--{else}-->
-                <div id="f<!--{$arrTree[cnt].category_id}-->" style="display:none">
-            <!--{/if}-->
-            <!--{if $smarty.section.cnt.last}-->
-                <!--{section name=n loop=$level}--></div><!--{/section}-->
-            <!--{/if}-->
-            <!--{assign var=before_level value="`$arrTree[cnt].level`}-->
-        <!--{/section}-->
+        <ul>
+            <li>
+                <a href="?"><img src="<!--{$TPL_URLPATH}-->img/contents/folder_close.gif" alt="フォルダ" />&nbsp;ホーム</a>
+                <!--{include file="`$smarty.const.TEMPLATE_ADMIN_REALDIR`products/product_rank_tree_fork.tpl" children=$arrTree treeID="f0" display=1}-->
+            </li>
+        </ul>
     </div>
     <!--{* ▲画面左 *}-->
Index: /branches/version-2_12-dev/data/Smarty/templates/admin/products/product_rank_tree_fork.tpl
===================================================================
--- /branches/version-2_12-dev/data/Smarty/templates/admin/products/product_rank_tree_fork.tpl	(revision 22597)
+++ /branches/version-2_12-dev/data/Smarty/templates/admin/products/product_rank_tree_fork.tpl	(revision 22597)
@@ -0,0 +1,50 @@
+<!--{*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2013 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *}-->
+
+<ul<!--{if $treeID != ""}--> id="<!--{$treeID}-->"<!--{/if}--><!--{if !$display}--> style="display: none;"<!--{/if}-->>
+<!--{foreach from=$children item=child}-->
+    <li class="level<!--{$child.level}-->">
+        <!--{* カテゴリ名表示 *}-->
+        <!--{assign var=disp_name value="`$child.category_id`.`$child.category_name`"}-->
+        <!--{if $child.level != $smarty.const.LEVEL_MAX}-->
+            <a href="?" onclick="fnModeSubmit('tree', 'parent_category_id', <!--{$child.category_id}-->); return false;">
+            <!--{if $arrForm.parent_category_id == $child.category_id}-->
+                <img src="<!--{$TPL_URLPATH}-->img/contents/folder_open.gif" alt="フォルダ" />
+            <!--{else}-->
+                <img src="<!--{$TPL_URLPATH}-->img/contents/folder_close.gif" alt="フォルダ" />
+            <!--{/if}-->
+            <!--{$disp_name|sfCutString:10:false|h}--></a>
+        <!--{else}-->
+            <img src="<!--{$TPL_URLPATH}-->img/contents/folder_close.gif" alt="フォルダ" />
+            <!--{$disp_name|sfCutString:10:false|h}-->
+        <!--{/if}-->
+        <!--{if in_array($child.category_id, $arrParentID)}-->
+            <!--{assign var=disp_child value=1}-->
+        <!--{else}-->
+            <!--{assign var=disp_child value=0}-->
+        <!--{/if}-->
+        <!--{if isset($child.children|smarty:nodefaults)}-->
+            <!--{include file="`$smarty.const.TEMPLATE_ADMIN_REALDIR`products/product_rank_tree_fork.tpl" children=$child.children treeID="f`$child.category_id`" display=$disp_child}-->
+        <!--{/if}-->
+    </li>
+<!--{/foreach}-->
+</ul>
Index: /branches/version-2_12-dev/data/class/pages/admin/products/LC_Page_Admin_Products_ProductRank.php
===================================================================
--- /branches/version-2_12-dev/data/class/pages/admin/products/LC_Page_Admin_Products_ProductRank.php	(revision 22567)
+++ /branches/version-2_12-dev/data/class/pages/admin/products/LC_Page_Admin_Products_ProductRank.php	(revision 22597)
@@ -72,6 +72,6 @@
     {
 
-        $objQuery =& SC_Query_Ex::getSingletonInstance();
         $objDb = new SC_Helper_DB_Ex();
+        $objCategory = new SC_Helper_Category_Ex();
 
         $this->tpl_pageno = isset($_POST['pageno']) ? $_POST['pageno'] : '';
@@ -104,9 +104,9 @@
         }
 
-        $this->arrTree = $objDb->sfGetCatTree($this->arrForm['parent_category_id']);
+        $this->arrTree = $objCategory->getTree();
+        $this->arrParentID = $objCategory->getTreeTrail($this->arrForm['parent_category_id']);     
         $this->arrProductsList = $this->lfGetProduct($this->arrForm['parent_category_id']);
-        $arrBread = array();
-        $objDb->findTree($this->arrTree, $this->arrForm['parent_category_id'], $arrBread);
-        $this->tpl_bread_crumbs = SC_Utils_Ex::jsonEncode($arrBread);
+        $arrBread = $objCategory->getTreeTrail($this->arrForm['parent_category_id'], FALSE);
+        $this->tpl_bread_crumbs = SC_Utils_Ex::jsonEncode(array_reverse($arrBread));
 
     }
Index: /branches/version-2_12-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Category.php
===================================================================
--- /branches/version-2_12-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Category.php	(revision 22596)
+++ /branches/version-2_12-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Category.php	(revision 22597)
@@ -184,11 +184,9 @@
         $this->arrList = $this->findCategoiesByParentCategoryId($parent_category_id);
         // カテゴリツリーを取得
-//        $this->arrTree = $objDb->sfGetCatTree($parent_category_id);
         $this->arrTree = $objCategory->getTree();
         $this->arrParentID = $objCategory->getTreeTrail($parent_category_id);
         // ぱんくずの生成
-        $arrBread = array();
-        $objDb->findTree($this->arrTree, $parent_category_id, $arrBread);
-        $this->tpl_bread_crumbs = SC_Utils_Ex::jsonEncode($arrBread);
+        $arrBread = $objCategory->getTreeTrail($this->arrForm['parent_category_id'], FALSE);
+        $this->tpl_bread_crumbs = SC_Utils_Ex::jsonEncode(array_reverse($arrBread));
 
     }
Index: /branches/version-2_12-dev/data/class/util/SC_Utils.php
===================================================================
--- /branches/version-2_12-dev/data/class/util/SC_Utils.php	(revision 22590)
+++ /branches/version-2_12-dev/data/class/util/SC_Utils.php	(revision 22597)
@@ -1930,5 +1930,5 @@
      * @param integer $max_depth
      * @param array $correction
-     * @param integer $base_id
+     * @param integer $root_id
      * @return array ツリーの配列
      */
@@ -1994,7 +1994,8 @@
      * @param array $correction 階層構造が含まれている配列
      * @param integer $root_id ルートID
+     * @param boolean $id_only IDだけの配列を返す場合はtrue
      * @return array 親ID配列
      */
-    public static function getTreeTrail($start_id, $primary_key, $glue_key, $correction = array(), $root_id = 0)
+    public static function getTreeTrail($start_id, $primary_key, $glue_key, $correction = array(), $root_id = 0, $id_only = TRUE)
     {
         $arrIDToKay = SC_Utils_Ex::makeArrayIDToKey($primary_key, $correction);
@@ -2002,5 +2003,9 @@
         $arrTrail = array();
         while ($id != $root_id && !SC_Utils_Ex::isBlank($id)) {
-            $arrTrail[] = $id;
+            if ($id_only) {
+                $arrTrail[] = $id;
+            } else {
+                $arrTrail[] = $arrIDToKay[$id];
+            }
             if (isset($arrIDToKay[$id][$glue_key])) {
                 $id = $arrIDToKay[$id][$glue_key];
Index: /branches/version-2_12-dev/data/class/helper/SC_Helper_Category.php
===================================================================
--- /branches/version-2_12-dev/data/class/helper/SC_Helper_Category.php	(revision 22595)
+++ /branches/version-2_12-dev/data/class/helper/SC_Helper_Category.php	(revision 22597)
@@ -113,10 +113,11 @@
      * 
      * @param integer $category_id 起点のカテゴリーID
+     * @param boolean $id_only IDだけの配列を返す場合はtrue
      * @return array
      */
-    public function getTreeTrail($category_id)
+    public function getTreeTrail($category_id, $id_only = TRUE)
     {
         $arrCategory = $this->getList();
-        $arrTrailID = SC_Utils_Ex::getTreeTrail($category_id, 'category_id', 'parent_category_id', $arrCategory);
+        $arrTrailID = SC_Utils_Ex::getTreeTrail($category_id, 'category_id', 'parent_category_id', $arrCategory, 0, $id_only);
         return $arrTrailID;
     }
