Esempio n. 1
0
 public function addPopup($text, $title = 'Debug Information')
 {
     if (null === $text) {
         return null;
     }
     if (!($popups = $this->session->getData(self::GROUP_ID))) {
         $popups = [];
     }
     if (!is_string($text)) {
         $text = print_r($text, true);
     }
     $popups[] = ['title' => $title, 'text' => $text];
     $this->session->setData(self::GROUP_ID, $popups);
     return count($popups) - 1;
 }
Esempio n. 2
0
 /**
  * Register module
  *
  * @param        $module
  * @param        $version
  * @param string $type
  */
 public function register($module, $version, $type = 'install')
 {
     if (null === $module || null === $version) {
         return;
     }
     $sessionDataKey = 'is_registered_' . $module;
     if ($this->session->getData($sessionDataKey)) {
         return;
     }
     $curl = new \Magento\Framework\HTTP\Client\Curl();
     try {
         $curl->post(self::EXTENSION_REGISTER_URL, ['module' => $module, 'version' => $version, 'site_url' => $this->getAllUrls(), 'type' => $type]);
         $this->session->setData($sessionDataKey, true);
     } catch (Exception $e) {
     }
 }
Esempio n. 3
0
 /**
  * Update system data for current VDE environment
  *
  * @param string $areaCode
  * @param \Magento\Framework\App\RequestInterface $request
  * @return void
  */
 public function update($areaCode, \Magento\Framework\App\RequestInterface $request)
 {
     $mode = $request->getAlias('editorMode') ?: self::MODE_NAVIGATION;
     $this->_themeContext->setEditableThemeById($request->getAlias('themeId'));
     if (!$request->isAjax()) {
         $this->_backendSession->setData(self::CURRENT_URL_SESSION_KEY, $request->getPathInfo());
         $this->_backendSession->setData(self::CURRENT_MODE_SESSION_KEY, $mode);
     }
     $this->_injectUrlModel($mode);
     $this->_emulateArea($mode, $areaCode);
     $this->_setTheme();
     $this->_disableCache();
 }
Esempio n. 4
0
 /**
  * Retrieve grid
  *
  * @param string $paramName
  * @param mixed $default
  * @return mixed
  */
 public function getParam($paramName, $default = null)
 {
     $sessionParamName = $this->getId() . $paramName;
     if ($this->getRequest()->has($paramName)) {
         $param = $this->getRequest()->getParam($paramName);
         if ($this->_saveParametersInSession) {
             $this->_backendSession->setData($sessionParamName, $param);
         }
         return $param;
     } elseif ($this->_saveParametersInSession && ($param = $this->_backendSession->getData($sessionParamName))) {
         return $param;
     }
     return $default;
 }
Esempio n. 5
0
 /**
  * Set items to storage
  *
  * @param array $items
  * @return $this
  */
 public function setItems(array $items)
 {
     $this->_items = $items;
     $this->_backendSession->setData($this->_getStorageKey(), $this->_items);
     return $this;
 }