diff --git a/module/api/control.php b/module/api/control.php index 62561e69ee..e5cd23e96c 100755 --- a/module/api/control.php +++ b/module/api/control.php @@ -447,8 +447,6 @@ class api extends control */ public function editLib($id) { - $lib = $this->doc->getLibById($id); - if(!empty($_POST)) { $this->doc->updateApiLib($id); @@ -458,9 +456,18 @@ class api extends control return $this->sendSuccess(array('message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "redirectParentWindow($id)")); } + $lib = $this->doc->getLibById($id); $type = 'nolink'; - if(!empty($lib->product)) $type = 'product'; - if(!empty($lib->project)) $type = 'project'; + if(!empty($lib->product)) + { + $type = 'product'; + $this->view->object = $this->loadModel('product')->getByID($lib->product); + } + if(!empty($lib->project)) + { + $type = 'project'; + $this->view->object = $this->loadModel('project')->getById($lib->project); + } if($type != 'nolink') $this->lang->api->aclList['default'] = sprintf($this->lang->doclib->aclList['default'], $this->lang->{$type}->common); if($type == 'nolink') unset($this->lang->api->aclList['default']); diff --git a/module/api/view/editlib.html.php b/module/api/view/editlib.html.php index e7260859bd..f5b0be4632 100644 --- a/module/api/view/editlib.html.php +++ b/module/api/view/editlib.html.php @@ -1,12 +1,12 @@ - * @package doc - * @version $Id: createlib.html.php 975 2010-07-29 03:30:25Z jajacn@126.com $ + * @package api + * @version $Id: editlib.html.php 975 2010-07-29 03:30:25Z jajacn@126.com $ * @link http://www.zentao.net */ ?> @@ -22,24 +22,12 @@
+ - - - - '> - - - - '> - - + + +
api->libType;?> - api->libTypeList, $type, "onchange='toggleLibType(this.value)'")?> -
api->product;?> - product, "class='form-control chosen'")?> -
api->project;?> - project, "class='form-control chosen'")?> - api->{$type};?>name?>
api->name?> name, "class='form-control'");?>