本文整理汇总了PHP中oxRegistry::getConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP oxRegistry::getConfig方法的具体用法?PHP oxRegistry::getConfig怎么用?PHP oxRegistry::getConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oxRegistry
的用法示例。
在下文中一共展示了oxRegistry::getConfig方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* Executes parent method parent::render(), creates delivery category tree,
* passes data to Smarty engine and returns name of template file "delivery_main.tpl".
*
* @return string
*/
public function render()
{
parent::render();
$soxId = $this->getEditObjectId();
if ($soxId != "-1" && isset($soxId)) {
$this->_createCategoryTree("artcattree");
// load object
$oDelivery = oxNew("oxdelivery");
$oDelivery->load($soxId);
$this->_aViewData["edit"] = $oDelivery;
//Disable editing for derived articles
if ($oDelivery->isDerived()) {
$this->_aViewData['readonly'] = true;
}
}
$iAoc = oxRegistry::getConfig()->getRequestParameter("aoc");
if ($iAoc == 1) {
$oDeliveryArticlesAjax = oxNew('delivery_articles_ajax');
$this->_aViewData['oxajax'] = $oDeliveryArticlesAjax->getColumns();
return "popups/delivery_articles.tpl";
} elseif ($iAoc == 2) {
$oDeliveryCategoriesAjax = oxNew('delivery_categories_ajax');
$this->_aViewData['oxajax'] = $oDeliveryCategoriesAjax->getColumns();
return "popups/delivery_categories.tpl";
}
return "delivery_articles.tpl";
}
示例2: testAdminLoginWithOldPasswordMultishop
/**
* Tries to login with old password from different subshop, makes sure there are no crashes
*/
public function testAdminLoginWithOldPasswordMultishop()
{
$this->setAdminMode(true);
//faking cookie check
$oUtils = $this->getMock("oxUtilsServer", array("getOxCookie"));
$oUtils->expects($this->any())->method("getOxCookie")->will($this->returnValue(array("test" => "test")));
oxRegistry::set("oxUtilsServer", $oUtils);
//creating test admin user
$oUser = $this->_createUser($this->_sDefaultUserName, $this->_sOldEncodedPassword, $this->_sOldSalt);
//updating user over oxBase methods as oxUser restricts rights update
$oUpdUser = oxNew('oxBase');
$oUpdUser->init("oxuser");
$oUpdUser->load($oUser->getId());
$oUpdUser->oxuser__oxrights = new oxField(1);
$oUpdUser->oxuser__oxshopid = new oxField(1);
$oUpdUser->save();
//set active shop 2
oxRegistry::getConfig()->setShopId(2);
//perform the login
$this->_login($this->_sDefaultUserName, $this->_sDefaultUserPassword);
$oUser->load($oUser->getId());
$this->assertEquals(1, $oUser->oxuser__oxshopid->value, "User shop ID changed");
$this->assertSame($oUser->getId(), oxRegistry::getSession()->getVariable('auth'), 'User ID is missing in session.');
$this->assertNotSame($this->_sOldEncodedPassword, $oUser->oxuser__oxpassword->value, 'Old and new passwords must not match.');
$this->assertNotSame($this->_sOldSalt, $oUser->oxuser__oxpasssalt->value, 'Old and new salt must not match.');
}
示例3: _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;
}
示例4: addSel
/**
* Adds selection lists to article.
*/
public function addSel()
{
$aAddSel = $this->_getActionIds('oxselectlist.oxid');
$soxId = oxRegistry::getConfig()->getRequestParameter('synchoxid');
// adding
if (oxRegistry::getConfig()->getRequestParameter('all')) {
$sSLViewName = $this->_getViewName('oxselectlist');
$aAddSel = $this->_getAll($this->_addFilter("select {$sSLViewName}.oxid " . $this->_getQuery()));
}
if ($soxId && $soxId != "-1" && is_array($aAddSel)) {
$oDb = oxDb::getDb();
foreach ($aAddSel as $sAdd) {
$oNew = oxNew("oxbase");
$oNew->init("oxobject2selectlist");
$sObjectIdField = 'oxobject2selectlist__oxobjectid';
$sSelectetionIdField = 'oxobject2selectlist__oxselnid';
$sOxSortField = 'oxobject2selectlist__oxsort';
$oNew->{$sObjectIdField} = new oxField($soxId);
$oNew->{$sSelectetionIdField} = new oxField($sAdd);
$sSql = "select max(oxsort) + 1 from oxobject2selectlist where oxobjectid = {$oDb->quote($soxId)} ";
$oNew->{$sOxSortField} = new oxField((int) $oDb->getOne($sSql, false, false));
$oNew->save();
}
}
}
示例5: smarty_modifier_oxmultilangassign
/**
* Smarty function
* -------------------------------------------------------------
* Purpose: Modifies provided language constant with it's translation
* usage: [{$val|oxmultilangassign}]
* -------------------------------------------------------------
*
* @param string $sIdent language constant ident
* @param mixed $args for constants using %s notations
*
* @return string
*/
function smarty_modifier_oxmultilangassign($sIdent, $args = null)
{
if (!isset($sIdent)) {
$sIdent = 'IDENT MISSING';
}
$oLang = oxRegistry::getLang();
$oConfig = oxRegistry::getConfig();
$oShop = $oConfig->getActiveShop();
$iLang = $oLang->getTplLanguage();
$blShowError = true;
if ($oShop->isProductiveMode()) {
$blShowError = false;
}
try {
$sTranslation = $oLang->translateString($sIdent, $iLang, $oLang->isAdmin());
$blTranslationNotFound = !$oLang->isTranslated();
} catch (\OxidEsales\EshopCommunity\Core\Exception\LanguageException $oEx) {
// is thrown in debug mode and has to be caught here, as smarty hangs otherwise!
}
if (!$blTranslationNotFound) {
if ($args) {
if (is_array($args)) {
$sTranslation = vsprintf($sTranslation, $args);
} else {
$sTranslation = sprintf($sTranslation, $args);
}
}
} elseif ($blShowError) {
$sTranslation = 'ERROR: Translation for ' . $sIdent . ' not found!';
}
return $sTranslation;
}
示例6: 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');
}
示例7: onDeactivate
/**
* Is called on module deactivation. Deletes the theme settings. Note that after deactivation the settings
* will be lost.
*/
public static function onDeactivate()
{
$iShopId = oxRegistry::getConfig()->getShopId();
$sThemeName = self::_getThemeName();
$sDeleteSQL = "\n DELETE\n oxconfig.*,\n oxconfigdisplay.*\n FROM `oxconfig`\n LEFT JOIN `oxconfigdisplay`\n ON ( `oxconfig`.`OXID` = `oxconfigdisplay`.`OXID` )\n WHERE `oxconfig`.`OXMODULE` = ? AND `oxconfig`.`oxshopid` = ?\n ";
oxDb::getDb()->Execute($sDeleteSQL, array('theme:' . $sThemeName, $iShopId));
}
示例8: render
/**
* Executes parent method parent::render(), creates discount category tree,
* passes data to Smarty engine and returns name of template file "discount_main.tpl".
*
* @return string
*/
public function render()
{
parent::render();
$soxId = $this->getEditObjectId();
if (isset($soxId) && $soxId != '-1') {
// load object
$oDiscount = oxNew('oxdiscount');
$oDiscount->load($soxId);
$this->_aViewData['edit'] = $oDiscount;
//disabling derived items
if ($oDiscount->isDerived()) {
$this->_aViewData['readonly'] = true;
}
// generating category tree for artikel choose select list
$this->_createCategoryTree("artcattree");
}
$iAoc = oxRegistry::getConfig()->getRequestParameter("aoc");
if ($iAoc == 1) {
$oDiscountArticlesAjax = oxNew('discount_articles_ajax');
$this->_aViewData['oxajax'] = $oDiscountArticlesAjax->getColumns();
return "popups/discount_articles.tpl";
} elseif ($iAoc == 2) {
$oDiscountCategoriesAjax = oxNew('discount_categories_ajax');
$this->_aViewData['oxajax'] = $oDiscountCategoriesAjax->getColumns();
return "popups/discount_categories.tpl";
}
return 'discount_articles.tpl';
}
示例9: _getQuery
/**
* Returns SQL query for data to fetc
*
* @return string
*/
protected function _getQuery()
{
// looking for table/view
$sArtTable = $this->_getViewName('oxarticles');
$sO2CView = $this->_getViewName('oxobject2category');
$oDb = oxDb::getDb();
$oConfig = oxRegistry::getConfig();
$sVendorId = $oConfig->getRequestParameter('oxid');
$sSynchVendorId = $oConfig->getRequestParameter('synchoxid');
// vendor selected or not ?
if (!$sVendorId) {
$sQAdd = ' from ' . $sArtTable . ' where ' . $sArtTable . '.oxshopid="' . $oConfig->getShopId() . '" and 1 ';
$sQAdd .= $oConfig->getConfigParam('blVariantsSelection') ? '' : " and {$sArtTable}.oxparentid = '' and {$sArtTable}.oxvendorid != " . $oDb->quote($sSynchVendorId);
} else {
// selected category ?
if ($sSynchVendorId && $sSynchVendorId != $sVendorId) {
$sQAdd = " from {$sO2CView} left join {$sArtTable} on ";
$sQAdd .= $oConfig->getConfigParam('blVariantsSelection') ? " ( {$sArtTable}.oxid = {$sO2CView}.oxobjectid or {$sArtTable}.oxparentid = oxobject2category.oxobjectid )" : " {$sArtTable}.oxid = {$sO2CView}.oxobjectid ";
$sQAdd .= 'where ' . $sArtTable . '.oxshopid="' . $oConfig->getShopId() . '" and ' . $sO2CView . '.oxcatnid = ' . $oDb->quote($sVendorId) . ' and ' . $sArtTable . '.oxvendorid != ' . $oDb->quote($sSynchVendorId);
} else {
$sQAdd = " from {$sArtTable} where {$sArtTable}.oxvendorid = " . $oDb->quote($sVendorId);
}
$sQAdd .= $oConfig->getConfigParam('blVariantsSelection') ? '' : " and {$sArtTable}.oxparentid = '' ";
}
return $sQAdd;
}
示例10: render
/**
* 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;
}
}
$iAoc = oxRegistry::getConfig()->getRequestParameter("aoc");
if ($iAoc == 1) {
$oDeliverysetPaymentAjax = oxNew('deliveryset_payment_ajax');
$this->_aViewData['oxajax'] = $oDeliverysetPaymentAjax->getColumns();
return "popups/deliveryset_payment.tpl";
} elseif ($iAoc == 2) {
$oDeliverysetCountryAjax = oxNew('deliveryset_country_ajax');
$this->_aViewData['oxajax'] = $oDeliverysetCountryAjax->getColumns();
return "popups/deliveryset_country.tpl";
}
return "deliveryset_payment.tpl";
}
示例11: addCatToAttr
/**
* Adds category to Attributes list
*/
public function addCatToAttr()
{
$aAddCategory = $this->_getActionIds('oxcategories.oxid');
$soxId = oxRegistry::getConfig()->getRequestParameter('synchoxid');
$oAttribute = oxNew("oxattribute");
// adding
if (oxRegistry::getConfig()->getRequestParameter('all')) {
$sCatTable = $this->_getViewName('oxcategories');
$aAddCategory = $this->_getAll($this->_addFilter("select {$sCatTable}.oxid " . $this->_getQuery()));
}
if ($oAttribute->load($soxId) && is_array($aAddCategory)) {
$oDb = oxDb::getDb();
foreach ($aAddCategory as $sAdd) {
$oNewGroup = oxNew("oxbase");
$oNewGroup->init("oxcategory2attribute");
$sOxSortField = 'oxcategory2attribute__oxsort';
$sObjectIdField = 'oxcategory2attribute__oxobjectid';
$sAttributeIdField = 'oxcategory2attribute__oxattrid';
$sOxIdField = 'oxattribute__oxid';
$oNewGroup->{$sObjectIdField} = new oxField($sAdd);
$oNewGroup->{$sAttributeIdField} = new oxField($oAttribute->{$sOxIdField}->value);
$sSql = "select max(oxsort) + 1 from oxcategory2attribute where oxobjectid = '{$sAdd}' ";
$oNewGroup->{$sOxSortField} = new oxField((int) $oDb->getOne($sSql, false, false));
$oNewGroup->save();
}
}
$this->resetContentCache();
}
示例12: save
/**
* Saves user extended information.
*
* @return mixed
*/
public function save()
{
parent::save();
$soxId = $this->getEditObjectId();
if (!$this->_allowAdminEdit($soxId)) {
return false;
}
$aParams = oxRegistry::getConfig()->getRequestParameter("editval");
$oUser = oxNew("oxuser");
if ($soxId != "-1") {
$oUser->load($soxId);
} else {
$aParams['oxuser__oxid'] = null;
}
// checkbox handling
$aParams['oxuser__oxactive'] = $oUser->oxuser__oxactive->value;
$blNewsParams = oxRegistry::getConfig()->getRequestParameter("editnews");
if (isset($blNewsParams)) {
$oNewsSubscription = $oUser->getNewsSubscription();
$oNewsSubscription->setOptInStatus((int) $blNewsParams);
$oNewsSubscription->setOptInEmailStatus((int) oxRegistry::getConfig()->getRequestParameter("emailfailed"));
}
$oUser->assign($aParams);
$oUser->save();
// set oxid if inserted
$this->setEditObjectId($oUser->getId());
}
示例13: execute
/**
* Executes the current command.
*
* @param InputInterface $input An InputInterface instance
* @param OutputInterface $output An OutputInterface instance
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
// allow empty password
$dbPwd = \oxRegistry::getConfig()->getConfigParam('dbPwd');
if (!empty($dbPwd)) {
$dbPwd = '-p' . $dbPwd;
}
$file = $input->getOption('file');
if (!empty($file)) {
$file = "> " . $file;
} else {
$file = "";
}
$exec = sprintf("mysqldump -h%s %s -u%s %s %s 2>&1", \oxRegistry::getConfig()->getConfigParam('dbHost'), $dbPwd, \oxRegistry::getConfig()->getConfigParam('dbUser'), \oxRegistry::getConfig()->getConfigParam('dbName'), $file);
exec($exec, $commandOutput, $returnValue);
if ($returnValue > 0) {
$output->writeln('<error>' . implode(PHP_EOL, $commandOutput) . '</error>');
return;
}
if (!empty($file)) {
$output->writeln("<info>Dump {$input->getOption('file')} created.</info>");
} else {
$output->writeln($commandOutput);
}
}
示例14: render
/**
* 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 (oxException $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');
}
}
示例15: cleanup
public static function cleanup()
{
$oDb = oxDb::getDb();
$sShopId = oxRegistry::getConfig()->getShopId();
$sQuery = "DELETE FROM `oxseo` WHERE `OXSTDURL` LIKE '%StylaSEO_Output%' and oxshopid = " . $oDb->quote($sShopId) . " ;";
$oDb->Execute($sQuery);
}