本文整理汇总了PHP中oxRegistry::get方法的典型用法代码示例。如果您正苦于以下问题:PHP oxRegistry::get方法的具体用法?PHP oxRegistry::get怎么用?PHP oxRegistry::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oxRegistry
的用法示例。
在下文中一共展示了oxRegistry::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _prepareWhereQuery
/**
* Adds active promotion check
*
* @param array $aWhere SQL condition array
* @param string $sqlFull SQL query string
*
* @return $sQ
*/
protected function _prepareWhereQuery($aWhere, $sqlFull)
{
$sQ = parent::_prepareWhereQuery($aWhere, $sqlFull);
$sDisplayType = (int) oxRegistry::getConfig()->getRequestParameter('displaytype');
$sTable = getViewName("oxactions");
//searchong for empty oxfolder fields
if ($sDisplayType) {
$sNow = date('Y-m-d H:i:s', oxRegistry::get("oxUtilsDate")->getTime());
switch ($sDisplayType) {
case 1:
// active
$sQ .= " and {$sTable}.oxactivefrom < '{$sNow}' and {$sTable}.oxactiveto > '{$sNow}' ";
break;
case 2:
// upcoming
$sQ .= " and {$sTable}.oxactivefrom > '{$sNow}' ";
break;
case 3:
// expired
$sQ .= " and {$sTable}.oxactiveto < '{$sNow}' and {$sTable}.oxactiveto != '0000-00-00 00:00:00' ";
break;
}
}
return $sQ;
}
示例2: render
/**
* 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';
}
示例3: _setupNavigation
/**
* Sets up navigation for current view
*
* @param string $sNode None name
*/
protected function _setupNavigation($sNode)
{
$myAdminNavig = $this->getNavigation();
$sNode = oxRegistry::getConfig()->getRequestParameter("menu");
// active tab
$iActTab = oxRegistry::getConfig()->getRequestParameter('actedit');
$iActTab = $iActTab ? $iActTab : $this->_iDefEdit;
$sActTab = $iActTab ? "&actedit={$iActTab}" : '';
// list url
$this->_aViewData['listurl'] = $myAdminNavig->getListUrl($sNode) . $sActTab;
// edit url
$sEditUrl = $myAdminNavig->getEditUrl($sNode, $iActTab) . $sActTab;
if (!getStr()->preg_match("/^http(s)?:\\/\\//", $sEditUrl)) {
//internal link, adding path
/** @var oxUtilsUrl $oUtilsUrl */
$oUtilsUrl = oxRegistry::get("oxUtilsUrl");
$sSelfLinkParameter = $this->getViewConfig()->getViewConfigParam('selflink');
$sEditUrl = $oUtilsUrl->appendParamSeparator($sSelfLinkParameter) . $sEditUrl;
}
$this->_aViewData['editurl'] = $sEditUrl;
// tabs
$this->_aViewData['editnavi'] = $myAdminNavig->getTabs($sNode, $iActTab);
// active tab
$this->_aViewData['actlocation'] = $myAdminNavig->getActiveTab($sNode, $iActTab);
// default tab
$this->_aViewData['default_edit'] = $myAdminNavig->getActiveTab($sNode, $this->_iDefEdit);
// passign active tab number
$this->_aViewData['actedit'] = $iActTab;
// buttons
$this->_aViewData['bottom_buttons'] = $myAdminNavig->getBtn($sNode);
}
示例4: addPaymentMethod
/**
* Add PayPal payment method set EN and DE long descriptions
*/
public static function addPaymentMethod()
{
$aPaymentDescriptions = array('en' => '<div>When selecting this payment method you are being redirected to PayPal where you can login into your account or open a new account. In PayPal you are able to authorize the payment. As soon you have authorized the payment, you are again redirected to our shop where you can confirm your order.</div> <div style="margin-top: 5px">Only after confirming the order, transfer of money takes place.</div>', 'de' => '<div>Bei Auswahl der Zahlungsart PayPal werden Sie im nächsten Schritt zu PayPal weitergeleitet. Dort können Sie sich in Ihr PayPal-Konto einloggen oder ein neues PayPal-Konto eröffnen und die Zahlung autorisieren. Sobald Sie Ihre Daten für die Zahlung bestätigt haben, werden Sie automatisch wieder zurück in den Shop geleitet, um die Bestellung abzuschließen.</div> <div style="margin-top: 5px">Erst dann wird die Zahlung ausgeführt.</div>');
$oPayment = oxNew('oxPayment');
if (!$oPayment->load('oxidpaypal')) {
$oPayment->setId('oxidpaypal');
$oPayment->oxpayments__oxactive = new oxField(1);
$oPayment->oxpayments__oxdesc = new oxField('PayPal');
$oPayment->oxpayments__oxaddsum = new oxField(0);
$oPayment->oxpayments__oxaddsumtype = new oxField('abs');
$oPayment->oxpayments__oxfromboni = new oxField(0);
$oPayment->oxpayments__oxfromamount = new oxField(0);
$oPayment->oxpayments__oxtoamount = new oxField(10000);
$oLanguage = oxRegistry::get('oxLang');
$aLanguages = $oLanguage->getLanguageIds();
foreach ($aPaymentDescriptions as $sLanguageAbbreviation => $sDescription) {
$iLanguageId = array_search($sLanguageAbbreviation, $aLanguages);
if ($iLanguageId !== false) {
$oPayment->setLanguage($iLanguageId);
$oPayment->oxpayments__oxlongdesc = new oxField($sDescription);
$oPayment->save();
}
}
}
}
示例5: send
/**
* Composes and sends drawal form, returns false if some parameters are missing
*
* @return bool
*/
public function send()
{
$aParams = $this->getConfig()->getRequestParameter('editval');
// checking email address
if (!oxRegistry::getUtils()->isValidEmail($aParams['pswdf_email'])) {
oxRegistry::get("oxUtilsView")->addErrorToDisplay('ERROR_MESSAGE_INPUT_NOVALIDEMAIL');
return false;
}
// spam spider prevension
$sMac = $this->getConfig()->getRequestParameter('c_mac');
$sMacHash = $this->getConfig()->getRequestParameter('c_mach');
$oCaptcha = $this->getCaptcha();
if (!$oCaptcha->pass($sMac, $sMacHash)) {
// even if there is no exception, use this as a default display method
oxRegistry::get("oxUtilsView")->addErrorToDisplay('MESSAGE_WRONG_VERIFICATION_CODE');
return false;
}
$sSubject = $this->getConfig()->getRequestParameter('c_subject');
if (!$aParams['pswdf_ordernr'] || !$aParams['pswdf_articles'] || !$aParams['pswdf_orderdate'] || !$aParams['pswdf_receiveddate'] || !$aParams['pswdf_name'] || !$aParams['pswdf_address'] || !$aParams['pswdf_email'] || !$aParams['pswdf_drawaldate']) {
// even if there is no exception, use this as a default display method
oxRegistry::get("oxUtilsView")->addErrorToDisplay('ERROR_MESSAGE_INPUT_NOTALLFIELDS');
return false;
}
$oShop = $this->getConfig()->getActiveShop();
$oLang = oxRegistry::getLang();
$sMessage = $oLang->translateString('PSWDF_MSG2') . "\r\n\r\n" . $oLang->translateString('PSWDF_ORDERNR') . " " . $aParams['pswdf_ordernr'] . "\r\n" . $oLang->translateString('PSWDF_DATE_ARTICLES') . " " . $aParams['pswdf_articles'] . "\r\n" . $oLang->translateString('PSWDF_DATE_ORDER') . " " . $aParams['pswdf_orderdate'] . "\r\n" . $oLang->translateString('PSWDF_DATE_RECEIVED') . " " . $aParams['pswdf_receiveddate'] . "\r\n\r\n" . $oLang->translateString('PSWDF_NAME') . " " . $aParams['pswdf_name'] . "\r\n" . $oLang->translateString('PSWDF_ADDRESS') . " " . $aParams['pswdf_address'] . "\r\n" . $oLang->translateString('PSWDF_EMAIL') . " " . $aParams['pswdf_email'] . "\r\n" . $oLang->translateString('PSWDF_DATE_DRAWAL') . " " . $aParams['pswdf_drawaldate'] . "\r\n";
$oEmail = oxNew('oxemail');
$blSendToOwner = $oEmail->sendEmail($oShop->oxshops__oxorderemail->value, $oLang->translateString('PSWDF_SUBJECT') . " " . $aParams['pswdf_name'] . " (#" . $aParams['pswdf_ordernr'] . ")", $sMessage);
$blSendToCustomer = $oEmail->sendEmail($aParams['pswdf_email'], $oLang->translateString('PSWDF_SUBJECT_CUSTOMER') . " " . $aParams['pswdf_name'] . " (#" . $aParams['pswdf_ordernr'] . ")", $sMessage);
if ($blSendToOwner && $blSendToCustomer) {
$this->_blDrawalFormSendStatus = 1;
} else {
oxRegistry::get("oxUtilsView")->addErrorToDisplay('ERROR_MESSAGE_CHECK_EMAIL');
}
}
示例6: fakeOrder
public function fakeOrder($oUser, $oBasket)
{
$this->_setUser($oUser);
$this->_loadFromBasket($oBasket);
$oUserPayment = $this->_setPayment($oBasket->getPaymentId());
$this->oxorder__oxordernr = new oxField("777");
$sDate = date('Y-m-d H:i:s', oxRegistry::get("oxUtilsDate")->getTime());
$this->oxorder__oxorderdate = new oxField($sDate);
$this->oxorder__oxsenddate = new oxField($sDate);
$this->_oUser = $oUser;
$this->_oBasket = $oBasket;
$this->_oPayment = $oUserPayment;
/*
oxRegistry::getUtils()->writeToLog(print_r($oBasket,true),"log.log");
$this->_aVoucherList = $oBasket->getVouchers();
//var_dump($oBasket->getVouchers());
if (is_array($this->_aVoucherList))
{
foreach ($this->_aVoucherList as $sVoucherId => $oSimpleVoucher)
{
$oVoucher = oxNew('oxvoucher');
$oVoucher->load($sVoucherId);
$this->_aVoucherList[$sVoucherId] = $oVoucher;
}
}
*/
}
示例7: testPrepareStrForSearch
public function testPrepareStrForSearch()
{
$this->assertEquals(' ä ö ü Ä Ö Ü ß &', oxRegistry::get("oxUtilsString")->prepareStrForSearch(' ä ö ü Ä Ö Ü ß &'));
$this->assertEquals(' häuser', oxRegistry::get("oxUtilsString")->prepareStrForSearch(' häuser'));
$this->assertEquals('', oxRegistry::get("oxUtilsString")->prepareStrForSearch('qwertz'));
$this->assertEquals('', oxRegistry::get("oxUtilsString")->prepareStrforSearch(''));
}
示例8: request_product
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');
}
示例9: render
/**
* 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();
$sModuleId = $this->_sModuleId = $this->getEditObjectId();
$sShopId = $myConfig->getShopId();
$oModule = oxNew('oxModule');
if ($sModuleId && $oModule->load($sModuleId)) {
try {
$aDbVariables = $this->_loadMetadataConfVars($oModule->getInfo("settings"));
$this->_aViewData["var_constraints"] = $aDbVariables['constraints'];
$this->_aViewData["var_grouping"] = $aDbVariables['grouping'];
$iCount = 0;
foreach ($this->_aConfParams as $sType => $sParam) {
$this->_aViewData[$sParam] = $aDbVariables['vars'][$sType];
$iCount += count($aDbVariables['vars'][$sType]);
}
} catch (oxException $oEx) {
oxRegistry::get("oxUtilsView")->addErrorToDisplay($oEx);
$oEx->debugOut();
}
} else {
oxRegistry::get("oxUtilsView")->addErrorToDisplay(new oxException('EXCEPTION_MODULE_NOT_LOADED'));
}
$this->_aViewData["oModule"] = $oModule;
return 'module_config.tpl';
}
示例10: getContentUri
/**
* Returns SEO uri for content object. Includes parent category path info if
* content is assigned to it
*
* @param oxcontent $oCont content category object
* @param int $iLang language
* @param bool $blRegenerate if TRUE forces seo url regeneration
*
* @return string
*/
public function getContentUri($oCont, $iLang = null, $blRegenerate = false)
{
if (!isset($iLang)) {
$iLang = $oCont->getLanguage();
}
//load details link from DB
if ($blRegenerate || !($sSeoUrl = $this->_loadFromDb('oxContent', $oCont->getId(), $iLang))) {
if ($iLang != $oCont->getLanguage()) {
$sId = $oCont->getId();
$oCont = oxNew('oxContent');
$oCont->loadInLang($iLang, $sId);
}
$sSeoUrl = '';
if ($oCont->getCategoryId() && $oCont->getType() === 2) {
$oCat = oxNew('oxCategory');
if ($oCat->loadInLang($iLang, $oCont->oxcontents__oxcatid->value)) {
$sParentId = $oCat->oxcategories__oxparentid->value;
if ($sParentId && $sParentId != 'oxrootid') {
$oParentCat = oxNew('oxCategory');
if ($oParentCat->loadInLang($iLang, $oCat->oxcategories__oxparentid->value)) {
$sSeoUrl .= oxRegistry::get("oxSeoEncoderCategory")->getCategoryUri($oParentCat);
}
}
}
}
$sSeoUrl .= $this->_prepareTitle($oCont->oxcontents__oxtitle->value, false, $oCont->getLanguage()) . '/';
$sSeoUrl = $this->_processSeoUrl($sSeoUrl, $oCont->getId(), $iLang);
$this->_saveToDb('oxcontent', $oCont->getId(), $oCont->getBaseStdLink($iLang), $sSeoUrl, $iLang);
}
return $sSeoUrl;
}
示例11: execute
/**
* {@inheritdoc}
*/
public function execute(oxIOutput $oOutput)
{
$oInput = $this->getInput();
$oDebugOutput = $oInput->hasOption(array('n', 'no-debug')) ? oxNew('oxNullOutput') : $oOutput;
try {
$aModuleIds = $this->_parseModuleIds();
$aShopConfigs = $this->_parseShopConfigs();
} catch (oxInputException $oEx) {
$oOutput->writeLn($oEx->getMessage());
return;
}
/** @var oxModuleStateFixer $oModuleStateFixer */
$oModuleStateFixer = oxRegistry::get('oxModuleStateFixer');
/** @var oxModule $oModule */
$oModule = oxNew('oxModule');
foreach ($aShopConfigs as $oConfig) {
$oDebugOutput->writeLn('[DEBUG] Working on shop id ' . $oConfig->getShopId());
foreach ($aModuleIds as $sModuleId) {
if (!$oModule->load($sModuleId)) {
$oDebugOutput->writeLn("[DEBUG] {$sModuleId} can not be loaded - skipping");
continue;
}
$oDebugOutput->writeLn("[DEBUG] Fixing {$sModuleId} module");
$oModuleStateFixer->fix($oModule, $oConfig);
}
$oDebugOutput->writeLn();
}
$oOutput->writeLn('Fixed module states successfully');
}
示例12: getRemoteContent
public function getRemoteContent($username)
{
$seoServerUrl = oxRegistry::getConfig()->getConfigParam('styla_seo_server');
if (!$seoServerUrl) {
$seoServerUrl = self::SEO_URL;
}
$basedir = oxRegistry::getConfig()->getConfigParam('styla_seo_basedir');
if (!$basedir) {
$basedir = StylaSEO_Setup::STYLA_BASEDIR;
}
// Get the correct url for the server's url parameter
$request = oxRegistry::get('oxUtilsServer')->getServerVar('REQUEST_URI');
$request = substr($request, strpos($request, $basedir) + strlen($basedir) + 1);
$url = rtrim($seoServerUrl, '/') . '/clients/' . $username . '?url=' . urlencode($request);
$cache_key = preg_replace('/[\\/:]/i', '-', 'stylaseo_' . $url);
if (!($arr = $this->loadFromCache($cache_key))) {
try {
$arr = $this->_fetchSeoData($url);
if ($arr) {
$this->saveToCache($cache_key, $arr);
}
} catch (Exception $e) {
echo 'ERROR: ' . $e->getMessage();
return false;
}
}
return $arr;
}
示例13: onActivate
/**
* clear cache and reloading smarty object
*/
public static function onActivate()
{
self::_clearCache();
self::install();
// reloading smarty object after activation
oxRegistry::get("oxUtilsView")->getSmarty(true);
}
示例14: _formResponse
/**
* 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;
}
示例15: tearDown
/**
* Clean-up oxarticles table + parent::tearDown()
*/
protected function tearDown()
{
$this->cleanUpTable('oxarticles');
$oDb = oxDb::getInstance();
$oDb->setConfig(oxRegistry::get('oxConfigFile'));
parent::tearDown();
}