Ejemplo n.º 1
0
 /**
  * Adds this payments to this set
  */
 public function addPayToSet()
 {
     $aChosenSets = $this->_getActionIds('oxpayments.oxid');
     $soxId = $this->getConfig()->getRequestParameter('synchoxid');
     // adding
     if ($this->getConfig()->getRequestParameter('all')) {
         $sPayTable = $this->_getViewName('oxpayments');
         $aChosenSets = $this->_getAll($this->_addFilter("select {$sPayTable}.oxid " . $this->_getQuery()));
     }
     if ($soxId && $soxId != "-1" && is_array($aChosenSets)) {
         $oDb = oxDb::getDb();
         foreach ($aChosenSets as $sChosenSet) {
             // check if we have this entry already in
             $sID = $oDb->getOne("select oxid from oxobject2payment where oxpaymentid = " . $oDb->quote($sChosenSet) . "  and oxobjectid = " . $oDb->quote($soxId) . " and oxtype = 'oxdelset'", false, false);
             if (!isset($sID) || !$sID) {
                 $oObject = oxNew('oxbase');
                 $oObject->init('oxobject2payment');
                 $oObject->oxobject2payment__oxpaymentid = new oxField($sChosenSet);
                 $oObject->oxobject2payment__oxobjectid = new oxField($soxId);
                 $oObject->oxobject2payment__oxtype = new oxField("oxdelset");
                 $oObject->save();
             }
         }
     }
 }
Ejemplo n.º 2
0
 /**
  * Returns seo uri
  *
  * @return string
  */
 public function getEntryUri()
 {
     $oContent = oxNew('oxcontent');
     if ($oContent->load($this->getEditObjectId())) {
         return $this->_getEncoder()->getContentUri($oContent, $this->getEditLang());
     }
 }
 /**
  * Collects article crosselling and attributes information, passes
  * them to Smarty engine and returns name or template file
  * "article_crossselling.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $this->_aViewData['edit'] = $oArticle = oxNew('oxarticle');
     // crossselling
     $this->_createCategoryTree("artcattree");
     // accessoires
     $this->_createCategoryTree("artcattree2");
     $soxId = $this->getEditObjectId();
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $oArticle->load($soxId);
         if ($oArticle->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
     }
     $iAoc = oxRegistry::getConfig()->getRequestParameter("aoc");
     if ($iAoc == 1) {
         $oArticleCrossellingAjax = oxNew('article_crossselling_ajax');
         $this->_aViewData['oxajax'] = $oArticleCrossellingAjax->getColumns();
         return "popups/article_crossselling.tpl";
     } elseif ($iAoc == 2) {
         $oArticleAccessoriesAjax = oxNew('article_accessories_ajax');
         $this->_aViewData['oxajax'] = $oArticleAccessoriesAjax->getColumns();
         return "popups/article_accessories.tpl";
     }
     return "article_crossselling.tpl";
 }
Ejemplo n.º 4
0
 /**
  * Executes parent method parent::render(), creates deliveryset category tree,
  * passes data to Smarty engine and returns name of template file "deliveryset_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     $myConfig = $this->getConfig();
     $sTheme = $this->_sTheme = $this->getEditObjectId();
     $sShopId = $myConfig->getShopId();
     if (!isset($sTheme)) {
         $sTheme = $this->_sTheme = $this->getConfig()->getConfigParam('sTheme');
     }
     $oTheme = oxNew('oxTheme');
     if ($oTheme->load($sTheme)) {
         $this->_aViewData["oTheme"] = $oTheme;
         try {
             $aDbVariables = $this->loadConfVars($sShopId, $this->_getModuleForConfigVars());
             $this->_aViewData["var_constraints"] = $aDbVariables['constraints'];
             $this->_aViewData["var_grouping"] = $aDbVariables['grouping'];
             foreach ($this->_aConfParams as $sType => $sParam) {
                 $this->_aViewData[$sParam] = $aDbVariables['vars'][$sType];
             }
         } catch (oxException $oEx) {
             oxRegistry::get("oxUtilsView")->addErrorToDisplay($oEx);
             $oEx->debugOut();
         }
     } else {
         oxRegistry::get("oxUtilsView")->addErrorToDisplay(oxNew("oxException", 'EXCEPTION_THEME_NOT_LOADED'));
     }
     return 'theme_config.tpl';
 }
Ejemplo n.º 5
0
 /**
  * Sets dependencies.
  *
  * @param oxRequiredFieldValidator $oFieldValidator
  */
 public function __construct($oFieldValidator = null)
 {
     if (is_null($oFieldValidator)) {
         $oFieldValidator = oxNew('oxRequiredFieldValidator');
     }
     $this->setFieldValidator($oFieldValidator);
 }
 /**
  * Collects article attributes and selection lists, passes them to Smarty engine,
  * returns name of template file "article_attribute.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $this->_aViewData['edit'] = $oArticle = oxNew('oxarticle');
     $soxId = $this->getEditObjectId();
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $oArticle->load($soxId);
         if ($oArticle->isDerived()) {
             $this->_aViewData["readonly"] = true;
         }
     }
     $aColumns = array();
     $iAoc = oxConfig::getParameter("aoc");
     if ($iAoc == 1) {
         include_once 'inc/article_attribute.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/article_attribute.tpl";
     } elseif ($iAoc == 2) {
         include_once 'inc/article_selection.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/article_selection.tpl";
     }
     return "article_attribute.tpl";
 }
Ejemplo n.º 7
0
 protected function _getFileManger()
 {
     if (is_null($this->_oFileManger)) {
         $this->_oFileManger = oxNew('fileManager');
     }
     return $this->_oFileManger;
 }
Ejemplo n.º 8
0
 /**
  * Return PayPal config
  *
  * @return oePayPalConfig
  */
 public function getPayPalConfig()
 {
     if (is_null($this->_oPayPalConfig)) {
         $this->setPayPalConfig(oxNew('oePayPalConfig'));
     }
     return $this->_oPayPalConfig;
 }
Ejemplo n.º 9
0
 /**
  * Returns oxState object
  *
  * @return oxState
  */
 protected function _getStateObject()
 {
     if (is_null($this->_oStateObject)) {
         $this->_oStateObject = oxNew('oxState');
     }
     return $this->_oStateObject;
 }
 /**
  * Executes parent method parent::render()
  * passes data to Smarty engine and returns name of template file "deliveryset_payment.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $odeliveryset = oxNew("oxdeliveryset");
         $odeliveryset->setLanguage($this->_iEditLang);
         $odeliveryset->load($soxId);
         $oOtherLang = $odeliveryset->getAvailableInLangs();
         if (!isset($oOtherLang[$this->_iEditLang])) {
             // echo "language entry doesn't exist! using: ".key($oOtherLang);
             $odeliveryset->setLanguage(key($oOtherLang));
             $odeliveryset->load($soxId);
         }
         $this->_aViewData["edit"] = $odeliveryset;
         //Disable editing for derived articles
         if ($odeliveryset->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
     }
     $aColumns = array();
     $iAoc = oxConfig::getParameter("aoc");
     if ($iAoc == 1) {
         include_once 'inc/deliveryset_payment.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/deliveryset_payment.tpl";
     } elseif ($iAoc == 2) {
         include_once 'inc/deliveryset_country.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/deliveryset_country.tpl";
     }
     return "deliveryset_payment.tpl";
 }
Ejemplo n.º 11
0
 /**
  * Non static getter returning str handler. The sense of getStr() and _getStrHandler() is
  * to be possible to call this method statically ( oxStr::getStr() ), yet leaving the
  * possibility to extend it in modules by overriding _getStrHandler() method.
  *
  * @return object
  */
 protected function _getStrHandler()
 {
     if (oxRegistry::getConfig()->isUtf() && function_exists('mb_strlen')) {
         return oxNew("oxStrMb");
     }
     return oxNew("oxStrRegular");
 }
Ejemplo n.º 12
0
 /**
  * Executes parent method parent::render(), creates oxpricealarm object
  * and passes it's data to Smarty engine. Returns name of template file
  * "pricealarm_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     $config = $this->getConfig();
     parent::render();
     $shopId = $config->getShopId();
     //articles price in subshop and baseshop can be different
     $this->_aViewData['iAllCnt'] = 0;
     $query = "\n            SELECT oxprice, oxartid\n            FROM oxpricealarm\n            WHERE oxsended = '000-00-00 00:00:00' AND oxshopid = '{$shopId}' ";
     $result = oxDb::getDb()->select($query);
     if ($result != false && $result->count() > 0) {
         $simpleCache = array();
         while (!$result->EOF) {
             $price = $result->fields[0];
             $articleId = $result->fields[1];
             if (isset($simpleCache[$articleId])) {
                 if ($simpleCache[$articleId] <= $price) {
                     $this->_aViewData['iAllCnt'] += 1;
                 }
             } else {
                 $article = oxNew("oxArticle");
                 if ($article->load($articleId)) {
                     $articlePrice = $simpleCache[$articleId] = $article->getPrice()->getBruttoPrice();
                     if ($articlePrice <= $price) {
                         $this->_aViewData['iAllCnt'] += 1;
                     }
                 }
             }
             $result->fetchRow();
         }
     }
     return "pricealarm_mail.tpl";
 }
Ejemplo n.º 13
0
 /**
  * Prepares tag for search in db
  *
  * @param string $sTag tag to prepare
  *
  * @return string
  */
 protected function _prepareTag($sTag)
 {
     if ($this->_oTagPrepareUtil == null) {
         $this->_oTagPrepareUtil = oxNew('oxtagcloud');
     }
     return $sTag = $this->_oTagPrepareUtil->prepareTags($sTag);
 }
 public function request_product()
 {
     $myConfig = $this->getConfig();
     $myUtils = oxRegistry::getUtils();
     //control captcha
     $sMac = oxRegistry::getConfig()->getRequestParameter('c_mac');
     $sMacHash = oxRegistry::getConfig()->getRequestParameter('c_mach');
     $oCaptcha = $this->getCaptcha();
     if (!$oCaptcha->pass($sMac, $sMacHash)) {
         oxRegistry::get("oxUtilsView")->addErrorToDisplay('MESSAGE_WRONG_VERIFICATION_CODE');
         return;
     }
     /** @var oxMailValidator $oMailValidator */
     $oMailValidator = oxNew('oxMailValidator');
     $aParams = oxRegistry::getConfig()->getRequestParameter('pa');
     if (!isset($aParams['email']) || !$oMailValidator->isValidEmail($aParams['email'])) {
         oxRegistry::get("oxUtilsView")->addErrorToDisplay('MESSAGE_INVALID_EMAIL');
         return;
     }
     $aParams['aid'] = $this->getProduct()->getId();
     $oArticleRequest = oxNew("psarticlerequest");
     $oArticleRequest->psarticlerequest__oxuserid = new oxField(oxRegistry::getSession()->getVariable('usr'));
     $oArticleRequest->psarticlerequest__oxemail = new oxField($aParams['email']);
     $oArticleRequest->psarticlerequest__oxartid = new oxField($aParams['aid']);
     $oArticleRequest->psarticlerequest__oxshopid = new oxField($myConfig->getShopId());
     $oArticleRequest->psarticlerequest__oxlang = new oxField(oxRegistry::getLang()->getBaseLanguage());
     $oArticleRequest->psarticlerequest__oxstatus = new oxField(psArticleRequest::STATUS_RECEIVED);
     $oArticleRequest->save();
     $oEmail = oxNew("oxEmail");
     $oEmail->sendArticleRequestNotification($aParams, $oArticleRequest);
     $this->_iArticleRequestStatus = 1;
     oxRegistry::get("oxUtilsView")->addErrorToDisplay('PS_ARTICLEREQUEST_SUCCESS');
 }
 /**
  * Generate DB views
  */
 public static function genViews()
 {
     $oShop = oxNew('oxShop');
     if ($oShop->load(oxRegistry::getConfig()->getShopId())) {
         $oShop->generateViews();
     }
 }
Ejemplo n.º 16
0
 /**
  * Saves category description text to DB.
  *
  * @return mixed
  */
 public function save()
 {
     parent::save();
     $myConfig = $this->getConfig();
     $soxId = $this->getEditObjectId();
     $aParams = oxRegistry::getConfig()->getRequestParameter("editval");
     $oCategory = oxNew("oxCategory");
     $iCatLang = oxRegistry::getConfig()->getRequestParameter("catlang");
     $iCatLang = $iCatLang ? $iCatLang : 0;
     if ($soxId != "-1") {
         $oCategory->loadInLang($iCatLang, $soxId);
     } else {
         $aParams['oxcategories__oxid'] = null;
     }
     //Disable editing for derived items
     if ($oCategory->isDerived()) {
         return;
     }
     $oCategory->setLanguage(0);
     $oCategory->assign($aParams);
     $oCategory->setLanguage($iCatLang);
     $oCategory->save();
     // set oxid if inserted
     $this->setEditObjectId($oCategory->getId());
 }
Ejemplo n.º 17
0
 /**
  * Executes parent method parent::render() and returns name of template
  * file "shop_list.tpl".
  *
  * @return string
  */
 public function render()
 {
     $myConfig = $this->getConfig();
     parent::render();
     $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
     if (isset($soxId) && $soxId != self::NEW_SHOP_ID) {
         // load object
         $oShop = oxNew('oxShop');
         if (!$oShop->load($soxId)) {
             $soxId = $myConfig->getBaseShopId();
             $oShop->load($soxId);
         }
         $this->_aViewData['editshop'] = $oShop;
     }
     // default page number 1
     $this->_aViewData['default_edit'] = 'shop_main';
     $this->_aViewData['updatemain'] = $this->_blUpdateMain;
     $this->updateNavigation();
     if ($this->_aViewData['updatenav']) {
         //skipping requirements checking when reloading nav frame
         oxRegistry::getSession()->setVariable("navReload", true);
     }
     //making sure we really change shops on low level
     if ($soxId && $soxId != self::NEW_SHOP_ID) {
         $myConfig->setShopId($soxId);
         oxRegistry::getSession()->setVariable('currentadminshop', $soxId);
     }
     return 'shop_list.tpl';
 }
 /**
  * Returns formed request which should be returned during testing.
  *
  * @return oxOnlineModulesNotifierRequest
  */
 protected function getExpectedRequest()
 {
     $oRequest = oxNew('oxOnlineModulesNotifierRequest');
     $sShopUrl = $this->getConfig()->getShopUrl();
     $oRequest->edition = $this->getConfig()->getEdition();
     $oRequest->version = $this->getConfig()->getVersion();
     $oRequest->shopUrl = $sShopUrl;
     $oRequest->pVersion = '1.1';
     $oRequest->productId = 'eShop';
     $modules = new stdClass();
     $modules->module = array();
     $aModulesInfo = array();
     $aModulesInfo[] = array('id' => 'extending_1_class', 'version' => '1.0', 'activeInShop' => array($sShopUrl));
     $aModulesInfo[] = array('id' => 'extending_1_class_3_extensions', 'version' => '1.0', 'activeInShop' => array($sShopUrl));
     $aModulesInfo[] = array('id' => 'extending_3_blocks', 'version' => '1.0', 'activeInShop' => array());
     $aModulesInfo[] = array('id' => 'extending_3_classes', 'version' => '1.0', 'activeInShop' => array());
     $aModulesInfo[] = array('id' => 'extending_3_classes_with_1_extension', 'version' => '1.0', 'activeInShop' => array());
     $aModulesInfo[] = array('id' => 'no_extending', 'version' => '1.0', 'activeInShop' => array());
     $aModulesInfo[] = array('id' => 'with_1_extension', 'version' => '1.0', 'activeInShop' => array());
     $aModulesInfo[] = array('id' => 'with_2_files', 'version' => '1.0', 'activeInShop' => array());
     $aModulesInfo[] = array('id' => 'with_2_settings', 'version' => '1.0', 'activeInShop' => array());
     $aModulesInfo[] = array('id' => 'with_2_templates', 'version' => '1.0', 'activeInShop' => array());
     $aModulesInfo[] = array('id' => 'with_events', 'version' => '1.0', 'activeInShop' => array());
     $aModulesInfo[] = array('id' => 'with_everything', 'version' => '1.0', 'activeInShop' => array($sShopUrl));
     foreach ($aModulesInfo as $aModuleInfo) {
         $module = new stdClass();
         $module->id = $aModuleInfo['id'];
         $module->version = $aModuleInfo['version'];
         $module->activeInShops = new stdClass();
         $module->activeInShops->activeInShop = $aModuleInfo['activeInShop'];
         $modules->module[] = $module;
     }
     $oRequest->modules = $modules;
     return $oRequest;
 }
Ejemplo n.º 19
0
 /**
  * Checks if given token is valid, formats HTTP headers,
  * and outputs file to buffer.
  *
  * If token is not valid, redirects to start page.
  */
 public function render()
 {
     $sFileOrderId = oxRegistry::getConfig()->getRequestParameter('sorderfileid');
     if ($sFileOrderId) {
         $oArticleFile = oxNew('oxFile');
         try {
             /** @var oxOrderFile $oOrderFile */
             $oOrderFile = oxNew('oxOrderFile');
             if ($oOrderFile->load($sFileOrderId)) {
                 $sFileId = $oOrderFile->getFileId();
                 $blLoadedAndExists = $oArticleFile->load($sFileId) && $oArticleFile->exist();
                 if ($sFileId && $blLoadedAndExists && $oOrderFile->processOrderFile()) {
                     $oArticleFile->download();
                 } else {
                     $sError = "ERROR_MESSAGE_FILE_DOESNOT_EXIST";
                 }
             }
         } catch (\OxidEsales\EshopCommunity\Core\Exception\StandardException $oEx) {
             $sError = "ERROR_MESSAGE_FILE_DOWNLOAD_FAILED";
         }
     } else {
         $sError = "ERROR_MESSAGE_WRONG_DOWNLOAD_LINK";
     }
     if ($sError) {
         $oEx = new oxExceptionToDisplay();
         $oEx->setMessage($sError);
         oxRegistry::get("oxUtilsView")->addErrorToDisplay($oEx, false);
         oxRegistry::getUtils()->redirect(oxRegistry::getConfig()->getShopUrl() . 'index.php?cl=account_downloads');
     }
 }
Ejemplo n.º 20
0
 /**
  * User Agent getter.
  *
  * @return oeThemeSwitcherUserAgent
  */
 public function oeThemeSwitcherGetUserAgent()
 {
     if (is_null($this->_oUserAgent)) {
         $this->_oUserAgent = oxNew('oeThemeSwitcherUserAgent');
     }
     return $this->_oUserAgent;
 }
Ejemplo n.º 21
0
 /**
  * Rewrite of oxid's getPaymentList method
  * adds some errors to the payment selection if necessary
  *
  * @overload
  */
 public function render()
 {
     $oxConfig = oxConfig::getInstance();
     // @TODO verify if fastcheckout-data should only be set if fastcheckout is active
     // @TODO see if we need the request without verifying if fastCheckoutData exists
     if ($this->getUser() && $this->_isFastCheckoutAllowed()) {
         $this->_payments = new Services_Paymill_Payments(trim($oxConfig->getShopConfVar('PAYMILL_PRIVATEKEY')), paymill_util::API_ENDPOINT);
         $this->_fastCheckoutData = oxNew('paymill_fastcheckout');
         $this->_fastCheckoutData->load($this->getUser()->getId());
         $this->_setPayment($this->_fastCheckoutData->paymill_fastcheckout__paymentid_cc->rawValue);
         if (array_key_exists('last4', $this->_payment)) {
             $this->addTplParam('fastCheckoutCc', 'true');
             $this->_setPaymillCcPaymentData();
         } else {
             $this->addTplParam('fastCheckoutCc', 'false');
         }
         $this->_setPayment($this->_fastCheckoutData->paymill_fastcheckout__paymentid_elv->rawValue);
         if (array_key_exists('account', $this->_payment) || array_key_exists('iban', $this->_payment)) {
             $this->addTplParam('fastCheckoutElv', 'true');
             $this->_setPaymillElvPaymentData();
         } else {
             $this->addTplParam('fastCheckoutElv', 'false');
         }
     } else {
         $this->addTplParam('fastCheckoutCc', 'false');
         $this->addTplParam('fastCheckoutElv', 'false');
     }
     $this->addTplParam('paymillPublicKey', trim($oxConfig->getShopConfVar('PAYMILL_PUBLICKEY')));
     $this->addTplParam('paymillUtil', oxNew('paymill_util'));
     $this->_addToTplWhichCreditCardsToShow();
     $this->addTplParam('paymillCompliance', $oxConfig->getShopConfVar('PAYMILL_COMPLIANCE'));
     return parent::render();
 }
Ejemplo n.º 22
0
 /**
  * Get currently logged in admin user id
  *
  * @return string
  */
 protected function getUserId()
 {
     $user = oxNew('oxUser');
     if ($user->loadAdminUser()) {
         return $user->getId();
     }
 }
Ejemplo n.º 23
0
 public function testEncodingAndDecodingGivesDifferentResultWithIncorrectKey()
 {
     $oEncryptor = oxNew('oxEncryptor');
     $oDecryptor = oxNew('oxDecryptor');
     $sEncrypted = $oEncryptor->encrypt('testString', 'correctKey');
     $this->assertNotSame('testString', $oDecryptor->decrypt($sEncrypted, 'incorrectKey'));
 }
Ejemplo n.º 24
0
 /**
  * Magic call method making a default workflow call to Paymorrow API.
  *
  * @param string $sMethodName
  * @param array  $aArguments
  *
  * @return array
  */
 public function __call($sMethodName, $aArguments)
 {
     // Get all gateway related instances: client, data provider and response, handler
     /** @var OxpsOxid2Paymorrow $oOxidToPm */
     $oOxidToPm = oxNew('OxpsOxid2Paymorrow');
     /** @var OxpsPaymorrowClient|PaymorrowClient $oClient */
     $oClient = $this->getPmClient();
     /** @var OxpsPaymorrowEshopDataProvider $oDataProvider */
     $oDataProvider = $oOxidToPm->getEshopDataProvider();
     /** @var OxpsPaymorrowResponseHandler $oResponseHandler */
     $oResponseHandler = oxRegistry::get('OxpsPaymorrowResponseHandler');
     // Set method URL
     $oClient->setEndPoint($this->getEndPointUrl() . $sMethodName);
     // Collect auth data and perform a request
     $aResponseData = $oClient->sendRequest(array_merge($oDataProvider->collectCommonData(), (array) reset($aArguments)));
     // Check it response is OK or an error
     if (isset($aResponseData['response_status']) and $aResponseData['response_status'] === 'OK') {
         $sResponseHandlerMethodFormat = 'handle%sResponseOK';
     } else {
         $sResponseHandlerMethodFormat = 'handle%sResponseError';
     }
     // Call the response handler method
     $sResponseHandlerMethod = sprintf($sResponseHandlerMethodFormat, ucfirst($sMethodName));
     $oResponseHandler->{$sResponseHandlerMethod}($aResponseData);
     // Return formatted response data
     return $this->prepareResponseData($aResponseData);
 }
Ejemplo n.º 25
0
 /**
  * Parse response message received from Online License Key Check web service and save it to response object.
  *
  * @param string $sRawResponse
  *
  * @throws oxException
  *
  * @return oxOnlineLicenseCheckResponse
  */
 protected function _formResponse($sRawResponse)
 {
     /** @var oxUtilsXml $oUtilsXml */
     $oUtilsXml = oxRegistry::get("oxUtilsXml");
     if (empty($sRawResponse) || !($oDomDoc = $oUtilsXml->loadXml($sRawResponse))) {
         throw new oxException('OLC_ERROR_RESPONSE_NOT_VALID');
     }
     if ($oDomDoc->documentElement->nodeName != $this->_sResponseElement) {
         throw new oxException('OLC_ERROR_RESPONSE_UNEXPECTED');
     }
     $oResponseNode = $oDomDoc->firstChild;
     if (!$oResponseNode->hasChildNodes()) {
         throw new oxException('OLC_ERROR_RESPONSE_NOT_VALID');
     }
     $oNodes = $oResponseNode->childNodes;
     /** @var oxOnlineLicenseCheckResponse $oResponse */
     $oResponse = oxNew('oxOnlineLicenseCheckResponse');
     // iterate through response node to get response parameters
     for ($i = 0; $i < $oNodes->length; $i++) {
         $sNodeName = $oNodes->item($i)->nodeName;
         $sNodeValue = $oNodes->item($i)->nodeValue;
         $oResponse->{$sNodeName} = $sNodeValue;
     }
     return $oResponse;
 }
Ejemplo n.º 26
0
 protected function _getMysqlManager()
 {
     if (is_null($this->_oMysqlManger)) {
         $this->_oMysqlManger = oxNew('mysqlManager');
     }
     return $this->_oMysqlManger;
 }
Ejemplo n.º 27
0
 /**
  * Returns view ID (for template engine caching).
  *
  * @return string   $this->_sViewId view id
  */
 public function getViewId()
 {
     $oUBase = oxNew('aList');
     $sViewId = $oUBase->getViewId();
     $sViewId .= $this->getConfig()->oeThemeSwitcherGetActiveThemeId();
     return $sViewId;
 }
Ejemplo n.º 28
0
 /**
  * @covers Helper_Modules::render
  */
 public function testRenderTpl()
 {
     $oTestClass = oxNew('Helper_Modules');
     $this->assertSame($oTestClass->render(), $oTestClass->getTemplateName());
     // $aViewData = $oTestClass->getViewData();
     // $this->assertType('array', $aViewData['aModules']);
 }
Ejemplo n.º 29
0
 public function testFormatDBDate()
 {
     $oUtilsDate = oxNew('oxUtilsDate');
     $oNullVar = null;
     $this->assertNull($oUtilsDate->formatDBDate($oNullVar));
     $this->assertNull($oUtilsDate->formatDBDate(false));
     $this->assertNotNull($oUtilsDate->formatDBDate(true));
     $aDates[] = array("14.11.2008", "2008-11-14", false);
     $aDates[] = array("2007-07-20 12:02:07", "2007-07-20 12:02:07", true);
     $aDates[] = array("2007-07-20", "2007-07-20", true);
     $aDates[] = array("-", "0000-00-00", false);
     $aDates[] = array("-", "0000-00-00 00:00:00", false);
     $aDates[] = array("0000-00-00 00:00:00", "-", false);
     $aDates[] = array("19.08.2007", "19.08.2007", false);
     $aDates[] = array("2007-08-20", "20.08.2007", true);
     $aDates[] = array("19.08.2007 12:02:07", "19.08.2007 12:02:07", false);
     $aDates[] = array("2007-08-19 12:02:07", "19.08.2007 12:02:07", true);
     $aDates[] = array("2007-08-19", "19.08.2007", true);
     $aDates[] = array("2007-08-19 12:02:07", "19.08.2007 12:02:07", true);
     $aDates[] = array("22.03.2003 10:04:09", "20030322100409", false);
     $aDates[] = array("2003-03-22 10:04:09", "20030322100409", true);
     $aDates[] = array("22.03.2003", "20030322", false);
     $aDates[] = array("2003-03-22", "20030322", true);
     $aDates[] = array(date("d.m.Y"), "simpleDateFormat", false);
     $aDates[] = array(date("Y-m-d"), "simpleDateFormat", true);
     foreach ($aDates as $aDate) {
         list($sResult, $sInput, $blForce) = $aDate;
         $this->assertEquals($sResult, $oUtilsDate->formatDBDate($sInput, $blForce));
     }
 }
Ejemplo n.º 30
0
 public function testSetGetAdminMode()
 {
     $oOxSuperCfg = oxNew('oxSuperCfg');
     $this->assertFalse($oOxSuperCfg->isAdmin());
     $oOxSuperCfg->setAdminMode(true);
     $this->assertTrue($oOxSuperCfg->isAdmin());
 }