getRestAlias(); $dataObj = $this->_getDataObj(); $dataObj->initGridData($blockId); if (!$dataObj->getGridData()) { $this->_setBackUrl(BASE_URL_LANGUAGE . '/' . PARENT_PAGE_FINAL); $this->_setBackError('Grid ID is wrong.'); $this->_doBack(); } return parent::exec(); } protected function _updateBackUrl() { $gridData = $this->_getDataObj()->getGridData(); if (!empty($gridData)) { $backUrl = BASE_URL_LANGUAGE . '/' . PARENT_PAGE_FINAL . '?action=edit&id=' . $gridData['id']; } else { $backUrl = BASE_URL_LANGUAGE . '/' . PARENT_PAGE_FINAL; } $this->_setBackUrl($backUrl); return $this; } protected function _setBackMessage($messageKey) { return $this; } protected function _doList() { $this->_doBack(); } protected function _doBack() { $this->_updateBackUrl(); parent::_doBack(); } protected function _doCancel() { $this->_updateBackUrl(); parent::_doCancel(); } protected function _getFormOptions($type = null) { $options = parent::_getFormOptions($type); if ('edit' == $type) { $data = $this->_getDataObj()->getData(); $options['blockSize'] = ['width' => $data['width'], 'height' => $data['height']]; } return $options; } }