Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
PermissionsDialog.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
11 
13 {
19  public function execute()
20  {
21  $integrationId = (int)$this->getRequest()->getParam(self::PARAM_INTEGRATION_ID);
22  if ($integrationId) {
23  try {
24  $integrationData = $this->_integrationService->get($integrationId)->getData();
25  $this->_registry->register(self::REGISTRY_KEY_CURRENT_INTEGRATION, $integrationData);
26  } catch (IntegrationException $e) {
27  $this->messageManager->addError($e->getMessage());
28  $this->_redirect('*/*/');
29  return;
30  } catch (\Exception $e) {
31  $this->_logger->critical($e);
32  $this->messageManager->addError(__('Internal error. Check exception log for details.'));
33  $this->_redirect('*/*');
34  return;
35  }
36  } else {
37  $this->messageManager->addError(__('Integration ID is not specified or is invalid.'));
38  $this->_redirect('*/*/');
39  return;
40  }
41 
43  $handleNodes = $this->_view->getLayout()->getUpdate()->getFileLayoutUpdatesXml()->xpath(
44  '//referenceBlock[@name="integration.activate.permissions.tabs"]/../@id'
45  );
46  $handles = [];
47  if (is_array($handleNodes)) {
48  foreach ($handleNodes as $node) {
49  $handles[] = (string)$node;
50  }
51  }
52  $this->_view->loadLayout($handles);
53  $this->_view->renderLayout();
54  }
55 }
__()
Definition: __.php:13