From 51d75253566780e01eed2d61353f09a88a95205d Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Thu, 17 Dec 2009 06:42:59 +0000 Subject: [PATCH] * adjust the UI. --- trunk/module/tree/control.php | 22 ++++++++++++++-------- trunk/module/tree/view/browse.html.php | 10 +++++----- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/trunk/module/tree/control.php b/trunk/module/tree/control.php index ce07b26b0e..2d5a8c8be9 100644 --- a/trunk/module/tree/control.php +++ b/trunk/module/tree/control.php @@ -43,26 +43,31 @@ class tree extends control /* 模块列表。*/ public function browse($productID, $viewType, $currentModuleID = 0) { - $this->setProduct($productID); + $product = $this->product->findByID($productID); if($viewType == 'product') { - $header['title'] = $this->lang->tree->manageProduct . $this->lang->colon . $this->product->name; - $position[] = html::a($this->createLink('product', 'browse', "product=$productID"), $this->product->name); - $position[] = $this->lang->tree->manageProduct; + /* 设置菜单。*/ + $this->product->setMenu($this->product->getPairs(), $productID); + $this->lang->tree->menu = $this->lang->product->menu; $this->lang->set('menugroup.tree', 'product'); + + /* 设置导航。*/ + $header['title'] = $this->lang->tree->manageProduct . $this->lang->colon . $product->name; + $position[] = html::a($this->createLink('product', 'browse', "product=$productID"), $product->name); + $position[] = $this->lang->tree->manageProduct; } elseif($viewType == 'bug') { - $header['title'] = $this->lang->tree->manageBug . $this->lang->colon . $this->product->name; - $position[] = html::a($this->createLink('bug', 'browse', "product=$productID"), $this->product->name); + $header['title'] = $this->lang->tree->manageBug . $this->lang->colon . $product->name; + $position[] = html::a($this->createLink('bug', 'browse', "product=$productID"), $product->name); $position[] = $this->lang->tree->manageBug; $this->lang->set('menugroup.tree', 'qa'); } elseif($viewType == 'case') { - $header['title'] = $this->lang->tree->manageCase . $this->lang->colon . $this->product->name; - $position[] = html::a($this->createLink('testcase', 'browse', "product=$productID"), $this->product->name); + $header['title'] = $this->lang->tree->manageCase . $this->lang->colon . $product->name; + $position[] = html::a($this->createLink('testcase', 'browse', "product=$productID"), $product->name); $position[] = $this->lang->tree->manageCase; $this->lang->set('menugroup.tree', 'qa'); } @@ -71,6 +76,7 @@ class tree extends control $this->assign('header', $header); $this->assign('position', $position); $this->assign('productID', $productID); + $this->assign('product', $product); $this->assign('viewType', $viewType); $this->assign('modules', $this->tree->getTreeMenu($productID, $viewType, $rooteModuleID = 0, array('treeModel', 'createManageLink'))); $this->assign('sons', $this->tree->getSons($productID, $currentModuleID, $viewType)); diff --git a/trunk/module/tree/view/browse.html.php b/trunk/module/tree/view/browse.html.php index 04e205e670..bdd759dc36 100644 --- a/trunk/module/tree/view/browse.html.php +++ b/trunk/module/tree/view/browse.html.php @@ -24,9 +24,9 @@ ?> -
+
-
'> + id}&viewType=$viewType");?>'>
@@ -44,18 +44,18 @@
- '> + id}&viewType=$viewType");?>'>
tree->manageChild;?>
createLink('tree', 'browse', "product=$productID&viewType=$viewType"), $this->product->name); + echo html::a($this->createLink('tree', 'browse', "product={$product->id}&viewType=$viewType"), $product->name); echo $lang->arrow; foreach($parentModules as $module) { - echo html::a($this->createLink('tree', 'browse', "product=$productID&viewType=$viewType&moduleID=$module->id"), $module->name); + echo html::a($this->createLink('tree', 'browse', "product={$product->id}&viewType=$viewType&moduleID=$module->id"), $module->name); echo $lang->arrow; } ?>