From 18065ba29b82d82394958587e9f279cfbbb00e83 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 26 Apr 2011 08:32:01 +0000 Subject: [PATCH] * fix for bug --- module/tree/control.php | 12 +++++++++++- module/tree/js/browse.js | 27 +++------------------------ module/tree/view/browse.html.php | 10 +++++----- 3 files changed, 19 insertions(+), 30 deletions(-) diff --git a/module/tree/control.php b/module/tree/control.php index 2f535e5cc8..64709381f7 100644 --- a/module/tree/control.php +++ b/module/tree/control.php @@ -53,7 +53,17 @@ class tree extends control if($viewType == 'story') { $this->product->setMenu($this->product->getPairs(), $rootID, 'story'); - $this->view->allProduct = $this->product->getPairs(); + $products = $this->product->getPairs(); + $allProduct = array(); + foreach($products as $key => $productVal) + { + if($key == $rootID) continue; + $allProduct[$key] = $productVal; + } + $this->view->allProduct =$allProduct; + $keys = array_keys($allProduct); + $this->view->key = $keys[0]; + $this->view->productModules = $this->tree->getOptionMenu($keys[0], 'story'); $this->lang->tree->menu = $this->lang->product->menu; $this->lang->set('menugroup.tree', 'product'); diff --git a/module/tree/js/browse.js b/module/tree/js/browse.js index 2e78bd4bb1..7b821d7b75 100644 --- a/module/tree/js/browse.js +++ b/module/tree/js/browse.js @@ -14,33 +14,12 @@ function syncModule(rootID) }) }); $.each(modules, function(key, value) - { - if(value) $('#sonModule').append("
"); - }) - }) -} -function syncProductModule(rootID) -{ - link = createLink('tree', 'ajaxGetSonModules', 'moduleID=' + $('#productModule').val() + '&rootID=' + rootID); - $.getJSON(link, function(modules) - { - $('.helplink').addClass('hidden'); - $.each(modules, function(key, value) - { - moduleName = value; - $('.text-3').each(function() - { - if(this.value == moduleName) modules[key] = null; - if(!this.value) $(this).parent().addClass('hidden'); - }) - }); - $('#sonModule').empty(); - $.each(modules, function(key, value) - { + { if(value) $('#sonModule').append("
"); }) }) } + function syncProduct(obj) { link = createLink('tree', 'ajaxGetModules', 'rootID=' + obj.value); @@ -53,7 +32,7 @@ function syncProduct(obj) $('#productModule').append('