public function Render(Renderer $renderer) { try { $errorReporting = error_reporting(null); GetApplication()->SetOperation(OPERATION_COMMIT_DELETE); $this->grid->SetState(OPERATION_COMMIT_DELETE); $this->grid->GetState()->SetUseGetToExtractPrimaryKeys(true); $this->grid->ProcessMessages(); header('Content-Type: text/xml'); if ($this->grid->GetErrorMessage() != '') { $xmlWriter = XMLWriterFactory::CreateXMLWriter(); $xmlWriter->StartDocument('1.0', 'UTF-8'); $xmlWriter->StartElement('response'); $xmlWriter->WriteElement('type', 'error'); $xmlWriter->WriteElement('error_message', $this->grid->GetErrorMessage()); $xmlWriter->EndElement('response'); echo $xmlWriter->GetResult(); } else { $xmlWriter = XMLWriterFactory::CreateXMLWriter(); $xmlWriter->StartDocument('1.0', 'UTF-8'); $xmlWriter->StartElement('response'); $xmlWriter->WriteElement('type', 'OK'); $xmlWriter->EndElement('response'); echo $xmlWriter->GetResult(); } error_reporting($errorReporting); } catch (Exception $e) { echo '<?xml version="1.0" encoding="UTF-8"?><response><type>error</type><error_message>' . htmlspecialchars($e->getMessage()) . '</error_message></response>'; } }
function DoProcessMessages() { if (GetOperation() != OPERATION_RSS) { //if (isset($this->AdvancedSearchControl) && $this->OpenAdvancedSearchByDefault()) //if (!$this->AdvancedSearchControl->HasCondition()) // GetApplication()->SetOperation(OPERATION_ADVANCED_SEARCH); $this->grid->SetState(GetOperation()); $advancedSearchApplied = false; if (isset($this->AdvancedSearchControl)) { $advancedSearchApplied = $this->AdvancedSearchControl->ProcessMessages(); } $this->grid->ProcessMessages(); if (isset($this->pageNavigator)) { $this->pageNavigator->ProcessMessages(); } if ($advancedSearchApplied) { $link = $this->CreateLinkBuilder(); header('Location: ' . $link->GetLink()); exit; } } }
public function ProcessMessages() { GetApplication()->SetOperation(OPERATION_VIEW); $this->grid->SetState(OPERATION_VIEW); $this->grid->ProcessMessages(); }
protected function ChangeState($stateIdentifier) { GetApplication()->SetOperation($stateIdentifier); $this->grid->SetState($stateIdentifier); }