public function deleteSiteByIdAction()
    {
        $translator = $this->getServiceLocator()->get('translator');
        $request = $this->getRequest();
        $domainId = null;
        $success = 0;
        $textTitle = 'tr_meliscms_tool_site';
        $textMessage = '';
        
        $eventDatas = array();
        $this->getEventManager()->trigger('meliscms_site_delete_by_id_start', $this, $eventDatas);
        
        if($request->isPost()) {

            $domainTable = $this->getServiceLocator()->get('MelisEngineTableSiteDomain');
            $site404Table = $this->getServiceLocator()->get('MelisEngineTableSite404');
            
            $siteID = (int) $request->getPost('siteid');
            $siteEnv = $request->getPost('env');
            $site404PageId = $request->getPost('site404Page');
            
            $domainData = $domainTable->getDataBySiteIdAndEnv($siteID,$siteEnv);
            $domainData = $domainData->current();
            
            if($domainData)
            {
                $domainId = $domainData->sdom_id;
                
                $domainTable->deleteByField('sdom_id', $domainId);
                
                $success = 1;
                $textMessage = 'tr_meliscms_tool_site_delete_env_success';
            }
            else
            {
                $textMessage = 'tr_meliscms_tool_site_delete_env_failed';
            }
        }
        
        $response = array(
            'success' => $success,
            'textTitle' => $textTitle,
            'textMessage' => $textMessage,
        );
        
        $this->getEventManager()->trigger('meliscms_site_delete_by_id_end', $this, array_merge($response, array('typeCode' => 'CMS_SITE_ENV_DELETE', 'itemId' => $domainId)));
        
        return new JsonModel($response);
    }