HCE Project DC service web UI  0.2
Hierarchical Cluster Engine DC service web UI
 All Classes Namespaces Files Functions Variables Pages
SiteDeleteController.php
Go to the documentation of this file.
1 <?php
2 
4 {
5  public function actionIndex($siteId, $state)
6  {
7  $this->renderPartial("__siteDeleteDialog", array(
8  'id' => $siteId,
9  'state' => $state
10  ));
11  }
12 
13  public function actionDelete($siteId, $state, $type = 1)
14  {
15  $disabledOk = true;
16  if ($state !=2) {
17  $disabledOk = $this->disableSite($siteId);
18  }
19  if ($disabledOk) {
20  $this->deleteSite($siteId, $type);
21  }
22  Yii::app()->request->redirect($_SERVER['HTTP_REFERER']);
23  }
24 
25  public function disableSite($siteId)
26  {
27  $_POST["id"] = $siteId;
28  $_POST["state"] = 2;
29  $commandUpdate = new SiteUpdate('SITE_UPDATE(disable site)', 'Disable site');
30  return $commandUpdate->updateSiteInfo();
31  }
32  public function deleteSite($siteId, $type)
33  {
34  $commandDelete = new SiteDelete;
35  $commandDelete->commandDelete($siteId, $type);
36  unset($commandDelete);
37  }
38 }