* Refactor zanode::destroy.
This commit is contained in:
@@ -93,10 +93,11 @@ $config->zanode->dtable->fieldList['actions']['list']['createImage']['hint']
|
||||
$config->zanode->dtable->fieldList['actions']['list']['createImage']['url'] = array('module' => 'zanode', 'method' => 'createImage', 'params' => 'zanodeID={id}');
|
||||
$config->zanode->dtable->fieldList['actions']['list']['createImage']['data-toggle'] = 'modal';
|
||||
|
||||
$config->zanode->dtable->fieldList['actions']['list']['destroy']['icon'] = 'trash';
|
||||
$config->zanode->dtable->fieldList['actions']['list']['destroy']['hint'] = $lang->zanode->destroy;
|
||||
$config->zanode->dtable->fieldList['actions']['list']['destroy']['url'] = array('module' => 'zanode', 'method' => 'destory', 'params' => 'zanodeID={id}');
|
||||
$config->zanode->dtable->fieldList['actions']['list']['destroy']['className'] = 'ajax-submit';
|
||||
$config->zanode->dtable->fieldList['actions']['list']['destroy']['icon'] = 'trash';
|
||||
$config->zanode->dtable->fieldList['actions']['list']['destroy']['hint'] = $lang->zanode->destroy;
|
||||
$config->zanode->dtable->fieldList['actions']['list']['destroy']['url'] = array('module' => 'zanode', 'method' => 'destory', 'params' => 'zanodeID={id}');
|
||||
$config->zanode->dtable->fieldList['actions']['list']['destroy']['class'] = 'ajax-submit';
|
||||
$config->zanode->dtable->fieldList['actions']['list']['destroy']['data-confirm'] = $lang->zanode->confirmDelete;
|
||||
|
||||
$config->zanode->snapshotDtable = new stdclass();
|
||||
|
||||
|
||||
@@ -331,29 +331,18 @@ class zanode extends control
|
||||
}
|
||||
|
||||
/**
|
||||
* 销毁执行节点。
|
||||
* Desctroy node.
|
||||
*
|
||||
* @param int $nodeID
|
||||
* @param string $confirm
|
||||
* @param int $nodeID
|
||||
* @return void
|
||||
*/
|
||||
public function destroy($nodeID, $confirm = 'no')
|
||||
public function destroy(int $nodeID)
|
||||
{
|
||||
if($confirm == 'no')
|
||||
{
|
||||
return print(js::confirm($this->lang->zanode->confirmDelete, inlink('destroy', "zanodeID={$nodeID}&confirm=yes")));
|
||||
}
|
||||
|
||||
$error = $this->zanode->destroy($nodeID);
|
||||
if(!empty($error)) return $this->sendError($error, true);
|
||||
|
||||
if(!empty($error))
|
||||
{
|
||||
return print(js::alert($error));
|
||||
}
|
||||
else
|
||||
{
|
||||
return print(js::alert($this->lang->zanode->actionSuccess) . js::locate($this->createLink('zanode', 'browse'), 'parent.parent'));
|
||||
}
|
||||
return $this->sendSuccess(array('message' => $this->lang->zanode->actionSuccess, 'load' => true));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user