本文整理汇总了PHP中oxConfig::getParameter方法的典型用法代码示例。如果您正苦于以下问题:PHP oxConfig::getParameter方法的具体用法?PHP oxConfig::getParameter怎么用?PHP oxConfig::getParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oxConfig
的用法示例。
在下文中一共展示了oxConfig::getParameter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
/**
* Saves user extended information.
*
* @return mixed
*/
public function save()
{
parent::save();
$soxId = $this->getEditObjectId();
if (!$this->_allowAdminEdit($soxId)) {
return false;
}
$aParams = oxConfig::getParameter("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 = oxConfig::getParameter("editnews");
if (isset($blNewsParams)) {
$oNewsSubscription = $oUser->getNewsSubscription();
$oNewsSubscription->setOptInStatus((int) $blNewsParams);
$oNewsSubscription->setOptInEmailStatus((int) oxConfig::getParameter("emailfailed"));
}
$oUser->assign($aParams);
$oUser->save();
// set oxid if inserted
$this->setEditObjectId($oUser->getId());
}
示例2: send
public function send()
{
$aParams = oxConfig::getParameter("editval");
// loads submited values
$this->_aRegParams = $aParams;
$blSubscribe = oxConfig::getParameter("subscribeStatus");
if ($blSubscribe) {
//subscribe
$url = SUBSCRIPTION_URL;
//$this->getConfig()->getConfigParam( 'pbtPommoUrl' );
$fields = array('Email' => urlencode($aParams['oxuser__oxusername']), 'pommo_signup' => urlencode("true"));
foreach ($fields as $key => $value) {
$fields_string .= $key . '=' . $value . '&';
}
rtrim($fields_string, '&');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, count($fields));
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
} else {
//unsubscribe
}
//disable Opt-In To avoid OXID Mails
$this->getConfig()->setConfigParam('blOrderOptInEmail', false);
return parent::send();
}
示例3: save
/**
* Speichert den Standort mit den jeweiligen Parameter
* Saves selection list parameters changes.
*
* @return mixed
*/
public function save()
{
parent::save();
$this->resetContentCache();
$soxId = $this->getEditObjectId();
$aParams = oxConfig::getParameter("editval");
if (!isset($aParams['stores__store_active'])) {
$aParams['stores__store_active'] = 0;
}
$oShoplocator = oxNew("shoplocator");
if (isset($aParams['stores__store_address'])) {
$address = str_replace(' ', '', $aParams['stores__store_address']) . "+" . $aParams['stores__store_city'] . "+" . $aParams['stores__store_zip'];
$pc = file_get_contents('http://maps.googleapis.com/maps/api/geocode/json?address=' . $address . '&sensor=false');
$output = json_decode($pc);
$aParams['stores__store_latitude'] = $output->results[0]->geometry->location->lat;
$aParams['stores__store_logitude'] = $output->results[0]->geometry->location->lng;
}
if ($soxId != "-1") {
$oShoplocator->load($soxId);
} else {
$aParams['stores__oxid'] = null;
}
//Disable editing for derived articles
if ($oShoplocator->isDerived()) {
return;
}
$oShoplocator->assign($aParams);
$oShoplocator->save();
// set oxid if inserted
$this->setEditObjectId($oShoplocator->getId());
}
示例4: 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 ($soxId != '-1' && isset($soxId)) {
// 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->_getCategoryTree("artcattree", null);
}
$aColumns = array();
$iAoc = oxConfig::getParameter("aoc");
if ($iAoc == 1) {
include_once 'inc/discount_articles.inc.php';
$this->_aViewData['oxajax'] = $aColumns;
return "popups/discount_articles.tpl";
} elseif ($iAoc == 2) {
include_once 'inc/discount_categories.inc.php';
$this->_aViewData['oxajax'] = $aColumns;
return "popups/discount_categories.tpl";
}
return 'discount_articles.tpl';
}
示例5: 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();
$sChosenArtCat2 = oxConfig::getParameter("artcat2");
if ($soxId != "-1" && isset($soxId)) {
$sChosenArtCat2 = $this->_getCategoryTree("artcattree", $sChosenArtCat2);
// load object
$oDelivery = oxNew("oxdelivery");
$oDelivery->load($soxId);
$this->_aViewData["edit"] = $oDelivery;
//Disable editing for derived articles
if ($oDelivery->isDerived()) {
$this->_aViewData['readonly'] = true;
}
}
$aColumns = array();
$iAoc = oxConfig::getParameter("aoc");
if ($iAoc == 1) {
include_once 'inc/delivery_articles.inc.php';
$this->_aViewData['oxajax'] = $aColumns;
return "popups/delivery_articles.tpl";
} elseif ($iAoc == 2) {
include_once 'inc/delivery_categories.inc.php';
$this->_aViewData['oxajax'] = $aColumns;
return "popups/delivery_categories.tpl";
}
return "delivery_articles.tpl";
}
示例6: _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) oxConfig::getParameter('displaytype');
$sTable = getViewName("oxactions");
//searchong for empty oxfolder fields
if ($sDisplayType) {
$sNow = date('Y-m-d H:i:s', oxUtilsDate::getInstance()->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;
}
示例7: save
/**
* Saves changed shop configuration parameters.
*
* @return mixed
*/
public function save()
{
$myConfig = $this->getConfig();
$sOxId = $this->getEditObjectId();
// base parameters
$aConfStrs = oxConfig::getParameter("confstrs");
$aConfAArs = oxConfig::getParameter("confaarrs");
$aConfBools = oxConfig::getParameter("confbools");
// validating language Ids
if (is_array($aConfAArs['aTsLangIds'])) {
$blActive = isset($aConfBools["blTsWidget"]) && $aConfBools["blTsWidget"] == "true" ? true : false;
$sPkg = "OXID_ESALES";
$aActiveLangs = array();
foreach ($aConfAArs['aTsLangIds'] as $sLangId => $sId) {
$aActiveLangs[$sLangId] = false;
if ($sId) {
$sTsUser = $myConfig->getConfigParam('sTsUser');
$sTsPass = $myConfig->getConfigParam('sTsPass');
// validating and switching on/off
$sResult = $this->_validateId($sId, (bool) $blActive, $sTsUser, $sTsPass, $sPkg);
// keeping activation state
$aActiveLangs[$sLangId] = $sResult == "OK" ? true : false;
// error message
if ($sResult && $sResult != "OK") {
$this->_aViewData["errorsaving"] = "DYN_TRUSTED_RATINGS_ERR_{$sResult}";
}
}
}
$myConfig->saveShopConfVar("arr", "aTsActiveLangIds", $aActiveLangs, $sOxId);
}
parent::save();
}
示例8: 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;
}
}
$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";
}
示例9: render
/**
* 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";
}
示例10: render
/**
* 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
$sChosenArtCat = $this->_getCategoryTree("artcattree", oxConfig::getParameter("artcat"));
// accessoires
$sChosenArtCat2 = $this->_getCategoryTree("artcattree2", oxConfig::getParameter("artcat2"));
$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_crossselling.inc.php';
$this->_aViewData['oxajax'] = $aColumns;
return "popups/article_crossselling.tpl";
} elseif ($iAoc == 2) {
include_once 'inc/article_accessories.inc.php';
$this->_aViewData['oxajax'] = $aColumns;
return "popups/article_accessories.tpl";
}
return "article_crossselling.tpl";
}
示例11: changePassword
/**
* changes current user password
*
* @return null
*/
public function changePassword()
{
$oUser = $this->getUser();
if (!$oUser) {
return;
}
$sOldPass = oxConfig::getParameter('password_old', true);
$sNewPass = oxConfig::getParameter('password_new', true);
$sConfPass = oxConfig::getParameter('password_new_confirm', true);
if ($oExcp = $oUser->checkPassword($sNewPass, $sConfPass, true)) {
switch ($oExcp->getMessage()) {
case 'EXCEPTION_INPUT_EMPTYPASS':
case 'EXCEPTION_INPUT_PASSTOOSHORT':
return oxUtilsView::getInstance()->addErrorToDisplay('ACCOUNT_PASSWORD_ERRPASSWORDTOSHORT', false, true);
default:
return oxUtilsView::getInstance()->addErrorToDisplay('ACCOUNT_PASSWORD_ERRPASSWDONOTMATCH', false, true);
}
}
if (!$sOldPass || !$oUser->isSamePassword($sOldPass)) {
return oxUtilsView::getInstance()->addErrorToDisplay('ACCOUNT_PASSWORD_ERRINCORRECTCURRENTPASSW', false, true, 'user');
}
// testing passed - changing password
$oUser->setPassword($sNewPass);
if ($oUser->save()) {
$this->_blPasswordChanged = true;
}
}
示例12: init
/**
* Checks for currency parameter set in URL, session or post
* variables. If such were found - loads all currencies possible
* in shop, searches if passed is available (if no - default
* currency is set the first defined in admin). Then sets currency
* parameter so session ($myConfig->setActShopCurrency($iCur)),
* loads basket and forces ir to recalculate (oBasket->blCalcNeeded
* = true). Finally executes parent::init().
*
* @return null
*/
public function init()
{
// Performance
$myConfig = $this->getConfig();
if (!$myConfig->getConfigParam('bl_perfLoadCurrency')) {
//#861C - show first currency
$aCurrencies = $myConfig->getCurrencyArray();
$this->_oActCur = current($aCurrencies);
return;
}
$iCur = oxConfig::getParameter('cur');
if (isset($iCur)) {
$aCurrencies = $myConfig->getCurrencyArray();
if (!isset($aCurrencies[$iCur])) {
$iCur = 0;
}
// set new currency
$myConfig->setActShopCurrency($iCur);
// recalc basket
$oBasket = $this->getSession()->getBasket();
$oBasket->onUpdate();
}
$iActCur = $myConfig->getShopCurrency();
$this->aCurrencies = $myConfig->getCurrencyArray($iActCur);
$this->_oActCur = $this->aCurrencies[$iActCur];
//setting basket currency (M:825)
if (!isset($oBasket)) {
$oBasket = $this->getSession()->getBasket();
}
$oBasket->setBasketCurrency($this->_oActCur);
parent::init();
}
示例13: _setupNavigation
/**
* Sets up navigation for current view
*
* @param string $sNode None name
*
* @return null
*/
protected function _setupNavigation($sNode)
{
$myAdminNavig = $this->getNavigation();
$sNode = oxConfig::getParameter("menu");
// active tab
$iActTab = oxConfig::getParameter('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
$sEditUrl = oxUtilsUrl::getInstance()->appendParamSeparator($this->getViewConfig()->getViewConfigParam('selflink')) . $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);
}
示例14: smarty_insert_oxid_nocache
/**
* Smarty plugin
* -------------------------------------------------------------
* File: insert.oxid_nocache.php
* Type: string, html
* Name: oxid_nocache
* Purpose: Inserts Items not cached
* -------------------------------------------------------------
*
* @param array $params params
* @param Smarty &$smarty clever simulation of a method
*
* @return string
*/
function smarty_insert_oxid_nocache($params, &$smarty)
{
$myConfig = oxConfig::getInstance();
$smarty->caching = false;
/* if( isset( $smarty->oxobject->oProduct))
$smarty->assign_by_ref( "product", $smarty->oxobject->oProduct);*/
// #1184M - specialchar search
$sSearchParamForHTML = oxConfig::getParameter("searchparam");
$sSearchParamForLink = rawurlencode(oxConfig::getParameter("searchparam", true));
if ($sSearchParamForHTML) {
$smarty->assign_by_ref("searchparamforhtml", $sSearchParamForHTML);
$smarty->assign_by_ref("searchparam", $sSearchParamForLink);
}
$sSearchCat = oxConfig::getParameter("searchcnid");
if ($sSearchCat) {
$smarty->assign_by_ref("searchcnid", rawurldecode($sSearchCat));
}
foreach (array_keys($params) as $key) {
$viewData =& $params[$key];
$smarty->assign_by_ref($key, $viewData);
}
$sOutput = $smarty->fetch($params['tpl']);
$smarty->caching = false;
return $sOutput;
}
示例15: addpaytoset
/**
* Adds this payments to this set
*
* @return null
*/
public function addpaytoset()
{
$aChosenSets = $this->_getActionIds('oxpayments.oxid');
$soxId = oxConfig::getParameter('synchoxid');
// adding
if (oxConfig::getParameter('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'");
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();
}
}
}
}