diff --git a/module/zahost/control.php b/module/zahost/control.php index f016d936e2..c6b80f992a 100644 --- a/module/zahost/control.php +++ b/module/zahost/control.php @@ -303,7 +303,7 @@ class zahost extends control * @access public * @return void */ - public function ajaxImageList($hostID, $templateID = null) + public function ajaxImageList($hostID, $templateID = 0) { $host = $this->zahost->getById($hostID); $imageList = $this->zahost->getImageList($host, $templateID); diff --git a/module/zahost/model.php b/module/zahost/model.php index 006546b1b1..02b21154b9 100644 --- a/module/zahost/model.php +++ b/module/zahost/model.php @@ -175,10 +175,11 @@ class zahostModel extends model * Get image files from ZAgent server. * * @param object $host + * @param int $templateID * @access public * @return array */ - public function getImageList($host, $templateID = null) + public function getImageList($host, $templateID = 0) { $result = json_decode(commonModel::http("http://{$host->publicIP}:8086/api/v1/kvm/listTmpl?token={$host->secret}")); if(empty($result) || $result->code != 200) @@ -197,7 +198,7 @@ class zahostModel extends model $imageList[] = array('name' => $image->name); } - /* templateID is not empty means editing template. */ + /* Template ID is not empty means editing template. */ if($templateID) foreach($usedImageList as $usedImage) $imageList[] = array('name' => $usedImage->imageName); return $imageList;