Пример #1
0
 /**
  * @param CDomain $oDomain
  * @return bool
  */
 public function UpdateDomain(CDomain $oDomain)
 {
     if (!$this->oDomainsApi->UpdateDomain($oDomain)) {
         $this->lastErrorCode = $this->oDomainsApi->GetLastErrorCode();
         $this->lastErrorMessage = $this->oDomainsApi->GetLastErrorMessage();
         return false;
     }
     if (CSession::Has(AP_SESS_DOMAIN_NEXT_EDIT_ID) && $oDomain->IdDomain === CSession::Get(AP_SESS_DOMAIN_NEXT_EDIT_ID, null)) {
         CSession::Clear(AP_SESS_DOMAIN_NEXT_EDIT_ID);
     }
     return true;
 }
Пример #2
0
 /**
  * @param CDomain $oDomain
  * @return bool
  */
 public function UpdateDomain(CDomain $oDomain)
 {
     $aTabs = $this->GetTabList($oDomain);
     if (is_array($aTabs) && count($aTabs) > 0) {
         $aTabKeys = array_keys($aTabs);
         if (!in_array($oDomain->DefaultTab, $aTabKeys)) {
             $oDomain->DefaultTab = $aTabKeys[0];
         }
     }
     if (!$this->oDomainsApi->UpdateDomain($oDomain)) {
         $this->lastErrorCode = $this->oDomainsApi->GetLastErrorCode();
         $this->lastErrorMessage = $this->oDomainsApi->GetLastErrorMessage();
         return false;
     }
     if (CSession::Has(AP_SESS_DOMAIN_NEXT_EDIT_ID) && $oDomain->IdDomain === CSession::Get(AP_SESS_DOMAIN_NEXT_EDIT_ID, null)) {
         CSession::Clear(AP_SESS_DOMAIN_NEXT_EDIT_ID);
     }
     return true;
 }