00001 <?php 00002 00003 class EFire_Downloader extends oxAdminView 00004 { 00010 protected $_sThisTemplate = "efire_downloader.tpl"; 00011 00012 public function render() 00013 { 00014 $this->_aViewData['sEfiUsername'] = htmlspecialchars($this->getConfig()->getConfigParam('sEfiUsername')); 00015 $this->_aViewData['sEfiPassword'] = htmlspecialchars($this->getConfig()->getConfigParam('sEfiPassword')); 00016 00017 return parent::render(); 00018 } 00019 00025 public function getConnector() 00026 { 00027 $oConfig = $this->getConfig(); 00028 00029 $sEtUsername = $this->getConfig()->getParameter("etUsername"); 00030 $sEtPassword = $this->getConfig()->getParameter("etPassword"); 00031 00032 $oConnector = oxNew("oxefidownloader"); 00033 00034 $sShopVersion = $this->getConfig()->getEdition() . " " . $this->getConfig()->getVersion(); 00035 00036 $blSaveCredentials = $this->getConfig()->getParameter('blSaveCredentials'); 00037 00038 try { 00039 $oConnector->downloadConnector($sEtUsername, $sEtPassword, $sShopVersion, $blSaveCredentials); 00040 $this->_aViewData['message'] = oxLang::getInstance()->translateString('EFIRE_DOWNLOADER_SUCCESS'); 00041 } catch (Exception $e) { 00042 oxUtilsView::getInstance()->addErrorToDisplay(sprintf(oxLang::getInstance()->translateString('EFIRE_DOWNLOADER_ERROR'), $e->getMessage())); 00043 } 00044 } 00045 }