diff --git a/module/zahost/model.php b/module/zahost/model.php index 2bd34027c2..0751265257 100644 --- a/module/zahost/model.php +++ b/module/zahost/model.php @@ -540,6 +540,10 @@ class zahostModel extends model public function buildOperateViewMenu($host) { if($host->deleted) return ''; + $nodeList = $this->loadModel('zanode')->getListByHost($host->id); + $disabled = ''; + $title = !empty($nodeList) ? $this->lang->zahost->undeletedNotice : $this->lang->zahost->delete; + if($nodeList) $disabled = 'disabled'; $menu = ''; $params = "hostID=$host->id"; @@ -547,7 +551,7 @@ class zahostModel extends model $menu .= $this->buildMenu('zahost', 'browseImage', $params, $host, 'view', 'mirror', '', 'iframe', true, '', $this->lang->zahost->image->browseImage); $menu .= "
"; $menu .= $this->buildMenu('zahost', 'edit', $params, $host, 'view'); - $menu .= $this->buildMenu('zahost', 'delete', $params, $host, 'view', 'trash', 'hiddenwin'); + $menu .= $this->buildMenu('zahost', 'delete', $params, $host, 'view', 'trash', 'hiddenwin', $disabled, true, '', $title); return $menu; }