当前位置: 首页>>代码示例>>PHP>>正文


PHP oxSession::getVar方法代码示例

本文整理汇总了PHP中oxSession::getVar方法的典型用法代码示例。如果您正苦于以下问题:PHP oxSession::getVar方法的具体用法?PHP oxSession::getVar怎么用?PHP oxSession::getVar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在oxSession的用法示例。


在下文中一共展示了oxSession::getVar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: smarty_insert_oxid_newbasketitem

/**
 * Smarty plugin
 * -------------------------------------------------------------
 * File: insert.oxid_newbasketitem.php
 * Type: string, html
 * Name: newbasketitem
 * Purpose: Used for tracking in econda, etracker etc.
 * -------------------------------------------------------------
 *
 * @param array  $params  params
 * @param Smarty &$smarty clever simulation of a method
 *
 * @return string
 */
function smarty_insert_oxid_newbasketitem($params, &$smarty)
{
    $myConfig = oxConfig::getInstance();
    $aTypes = array('0' => 'none', '1' => 'message', '2' => 'popup', '3' => 'basket');
    $iType = $myConfig->getConfigParam('iNewBasketItemMessage');
    // If corect type of message is expected
    if ($iType && $params['type'] && $params['type'] != $aTypes[$iType]) {
        return '';
    }
    //name of template file where is stored message text
    $sTemplate = $params['tpl'] ? $params['tpl'] : 'inc_newbasketitem.snippet.tpl';
    //allways render for ajaxstyle popup
    $blRender = $params['ajax'] && $iType == 2;
    //fetching article data
    $oNewItem = oxSession::getVar('_newitem');
    $oBasket = oxSession::getInstance()->getBasket();
    if ($oNewItem) {
        // loading article object here because on some system passing article by session couses problems
        $oNewItem->oArticle = oxNew('oxarticle');
        $oNewItem->oArticle->Load($oNewItem->sId);
        // passing variable to template with unique name
        $smarty->assign('_newitem', $oNewItem);
        // deleting article object data
        oxSession::deleteVar('_newitem');
        $blRender = true;
    }
    // returning generated message content
    if ($blRender) {
        return $smarty->fetch($sTemplate);
    }
}
开发者ID:JulianaSchuster,项目名称:oxid-frontend,代码行数:45,代码来源:insert.oxid_newbasketitem.php

示例2: save

 /**
  * Saves main orders configuration parameters.
  *
  * @return string
  */
 public function save()
 {
     parent::save();
     $soxId = $this->getEditObjectId();
     $aParams = oxConfig::getParameter("editval");
     // shopid
     $sShopID = oxSession::getVar("actshop");
     $aParams['oxorder__oxshopid'] = $sShopID;
     $oOrder = oxNew("oxorder");
     if ($soxId != "-1") {
         $oOrder->load($soxId);
     } else {
         $aParams['oxorder__oxid'] = null;
     }
     $oOrder->assign($aParams);
     $aDynvalues = oxConfig::getParameter("dynvalue");
     if (isset($aDynvalues)) {
         // #411 Dodger
         $oPayment = oxNew("oxuserpayment");
         $oPayment->load($oOrder->oxorder__oxpaymentid->value);
         $oPayment->oxuserpayments__oxvalue->setValue(oxUtils::getInstance()->assignValuesToText($aDynvalues));
         $oPayment->save();
     }
     // keeps old delivery cost
     $oOrder->reloadDelivery(false);
     // keeps old discount
     $oOrder->reloadDiscount(false);
     $oOrder->recalculateOrder();
     // set oxid if inserted
     $this->setEditObjectId($oOrder->getId());
 }
开发者ID:JulianaSchuster,项目名称:oxid-frontend,代码行数:36,代码来源:order_main.php

示例3: addme

 /**
  * Validates email
  * address. If email is wrong - returns false and exits. If email
  * address is OK - creates prcealarm object and saves it
  * (oxpricealarm::save()). Sends pricealarm notification mail
  * to shop owner.
  *
  * @return  bool    false on error
  */
 public function addme()
 {
     $myConfig = $this->getConfig();
     $myUtils = oxUtils::getInstance();
     //control captcha
     $sMac = oxConfig::getParameter('c_mac');
     $sMacHash = oxConfig::getParameter('c_mach');
     $oCaptcha = oxNew('oxCaptcha');
     if (!$oCaptcha->pass($sMac, $sMacHash)) {
         $this->_iPriceAlarmStatus = 2;
         return;
     }
     $aParams = oxConfig::getParameter('pa');
     if (!isset($aParams['email']) || !$myUtils->isValidEmail($aParams['email'])) {
         $this->_iPriceAlarmStatus = 0;
         return;
     }
     $oCur = $myConfig->getActShopCurrencyObject();
     // convert currency to default
     $dPrice = $myUtils->currency2Float($aParams['price']);
     $oAlarm = oxNew("oxpricealarm");
     $oAlarm->oxpricealarm__oxuserid = new oxField(oxSession::getVar('usr'));
     $oAlarm->oxpricealarm__oxemail = new oxField($aParams['email']);
     $oAlarm->oxpricealarm__oxartid = new oxField($aParams['aid']);
     $oAlarm->oxpricealarm__oxprice = new oxField($myUtils->fRound($dPrice, $oCur));
     $oAlarm->oxpricealarm__oxshopid = new oxField($myConfig->getShopId());
     $oAlarm->oxpricealarm__oxcurrency = new oxField($oCur->name);
     $oAlarm->oxpricealarm__oxlang = new oxField(oxLang::getInstance()->getBaseLanguage());
     $oAlarm->save();
     // Send Email
     $oEmail = oxNew('oxemail');
     $this->_iPriceAlarmStatus = (int) $oEmail->sendPricealarmNotification($aParams, $oAlarm);
 }
开发者ID:JulianaSchuster,项目名称:oxid-frontend,代码行数:42,代码来源:pricealarm.php

示例4: render

 /**
  * Creates shop object, passes shop data to Smarty engine and returns name of
  * template file "dyn_adbutler.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $oShop = oxNew("oxshop");
     $oShop->load(oxSession::getVar("actshop"));
     $this->_aViewData["edit"] = $oShop;
     return "dyn_adbutler.tpl";
 }
开发者ID:JulianaSchuster,项目名称:oxid-frontend,代码行数:14,代码来源:dyn_adbutler.php

示例5: _getFileName

 protected function _getFileName()
 {
     $sFileName = '';
     if (oxSession::hasVar('debugPHP') && oxSession::getVar('debugPHP') !== true) {
         $sFileName = oxSession::getVar('debugPHP');
     }
     return $sFileName .= isAdmin() ? '_admin' : '_shop';
 }
开发者ID:OXIDprojects,项目名称:debugax,代码行数:8,代码来源:chromephpfile.php

示例6: updateViews

 /**
  * Performs full view update
  *
  * @return mixed
  */
 public function updateViews()
 {
     //preventing edit for anyone except malladmin
     if (oxSession::getVar("malladmin")) {
         oxDb::getInstance()->updateViews();
         $this->_aViewData["blViewSuccess"] = true;
     }
 }
开发者ID:JulianaSchuster,项目名称:oxid-frontend,代码行数:13,代码来源:tools_list.php

示例7: _getErrors

 /**
  * return page errors array
  *
  * @return array
  */
 protected function _getErrors()
 {
     $aErrors = oxSession::getVar('Errors');
     if (null === $aErrors) {
         $aErrors = array();
     }
     return $aErrors;
 }
开发者ID:JulianaSchuster,项目名称:oxid-frontend,代码行数:13,代码来源:exceptionerror.php

示例8: _canUpdate

 /**
  * Checks if the license key update is allowed.
  *
  * @return bool
  */
 protected function _canUpdate()
 {
     $myConfig = $this->getConfig();
     $blIsMallAdmin = oxSession::getVar('malladmin');
     if (!$blIsMallAdmin) {
         return false;
     }
     if ($myConfig->isDemoShop()) {
         return false;
     }
     return true;
 }
开发者ID:JulianaSchuster,项目名称:oxid-frontend,代码行数:17,代码来源:shop_license.php

示例9: info

 /**
  * Class constructor, assigns template file name passed by URL
  * or stored in session ("tpl", "infotpl").
  *
  * Template variables:
  * <b>tpl</b>
  *
  * Session variables:
  * <b>infotpl</b>
  */
 public function info()
 {
     // assign template name
     $sTplName = oxConfig::getParameter('tpl');
     $sTplName = $sTplName ? $sTplName : oxSession::getVar('infotpl');
     if ($sTplName) {
         // security fix so that you cant access files from outside template dir
         $sTplName = basename($sTplName);
         oxSession::setVar('infotpl', $sTplName);
     }
     $this->_sThisTemplate = $sTplName;
 }
开发者ID:JulianaSchuster,项目名称:oxid-frontend,代码行数:22,代码来源:info.php

示例10: getViewName

function getViewName($sTable, $iLangId = null, $sShopId = null)
{
    $myConfig = oxRegistry::getConfig();
    // Benutzergruppe aus Moduleinstellungen auslesen bis CE 4.8.9 !!!
    // ab CE 4.9.0 ist die Funktion oxConfig::getInstance() nicht mehr verfügbar!!
    $vtec_GruppenID = oxConfig::getInstance()->getConfigParam('vtec_spezialgruppe');
    // Ab CE 4.9.0 gilt dieser Eintrag! Obigen Code bitte auskommentieren!!!
    /* $vtec_GruppenID = oxRegistry::getConfig()->getConfigParam('vtec_spezialgruppe'); */
    // Ansicht...
    $sVtecAnsicht = $sTable;
    //This config option should only be used in emergency case.
    //Originally it was planned for the case when admin area is not reached due to the broken views.
    if (!$myConfig->getConfigParam('blSkipViewUsage')) {
        $sViewSfx = "";
        $sAnsichtSfx = "";
        // neue Ansichtsendung
        $blIsMultiLang = in_array($sTable, oxRegistry::getLang()->getMultiLangTables());
        if ($iLangId != -1 && $blIsMultiLang) {
            $oLang = oxRegistry::getLang();
            $iLangId = $iLangId !== null ? $iLangId : oxRegistry::getLang()->getBaseLanguage();
            $sAbbr = $oLang->getLanguageAbbr($iLangId);
            $sViewSfx .= "_" . $sAbbr;
        }
        if ($sVtecAnsicht == "oxarticles") {
            $ox_User_ID = oxSession::getVar("usr");
            // bis CE 4.8.9
            /* $ox_User_ID = oxRegistry::getSession()->getVariable("usr"); */
            // ab CE 4.9.0, obigen Code auskommentieren!!
            $ox_User = oxNew("oxUser");
            $ox_User->load($ox_User_ID);
            if (!$ox_User->isAdmin()) {
                $oxGruppen = $ox_User->getUserGroups();
                $vtecInSpezGruppe = false;
                foreach ($oxGruppen as $oxGruppe) {
                    if ($oxGruppe->getId() == $vtec_GruppenID) {
                        $vtecInSpezGruppe = true;
                    }
                }
                if (!$vtecInSpezGruppe) {
                    $sAnsichtSfx = "_vsg";
                }
            }
        }
        if ($sViewSfx || ($iLangId == -1 || $sShopId == -1) && $blIsMultiLang) {
            return "oxv_" . $sTable . $sViewSfx . $sAnsichtSfx;
        }
    }
    return $sTable;
}
开发者ID:vendingtechnik,项目名称:VTEC_Spezialgruppe,代码行数:49,代码来源:vtec_spezialfunktionen.php

示例11: render

 /**
  * Executes parent method parent::render() and returns name of template
  * file "shop.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $sCurrentAdminShop = oxSession::getVar("currentadminshop");
     if (!$sCurrentAdminShop) {
         if (oxSession::getVar("malladmin")) {
             $sCurrentAdminShop = "oxbaseshop";
         } else {
             $sCurrentAdminShop = oxSession::getVar("actshop");
         }
     }
     $this->_aViewData["currentadminshop"] = $sCurrentAdminShop;
     oxSession::setVar("currentadminshop", $sCurrentAdminShop);
     return "shop.tpl";
 }
开发者ID:JulianaSchuster,项目名称:oxid-frontend,代码行数:21,代码来源:shop.php

示例12: nextTick

 /**
  * Does Export line by line on position iCnt
  *
  * @param integer $iCnt export position
  *
  * @return bool
  */
 public function nextTick($iCnt)
 {
     $iExportedItems = $iCnt;
     $blContinue = false;
     if ($oArticle = $this->getOneArticle($iCnt, $blContinue)) {
         $myConfig = oxConfig::getInstance();
         $oSmarty = oxUtilsView::getInstance()->getSmarty();
         $oSmarty->assign("sCustomHeader", oxSession::getVar("sExportCustomHeader"));
         $oSmarty->assign_by_ref("linenr", $iCnt);
         $oSmarty->assign_by_ref("article", $oArticle);
         $oSmarty->assign("spr", $myConfig->getConfigParam('sCSVSign'));
         $oSmarty->assign("encl", $myConfig->getConfigParam('sGiCsvFieldEncloser'));
         $this->write($oSmarty->fetch("genexport.tpl", $this->getViewId()));
         return ++$iExportedItems;
     }
     return $blContinue;
 }
开发者ID:JulianaSchuster,项目名称:oxid-frontend,代码行数:24,代码来源:genexport_do.php

示例13: getWishUser

 /**
  * return the user which is owner of the wish list
  *
  * @return object | bool
  */
 public function getWishUser()
 {
     if ($this->_oWishUser === null) {
         $this->_oWishUser = false;
         $sUserId = oxConfig::getParameter('wishid') ? oxConfig::getParameter('wishid') : oxSession::getVar('wishid');
         if ($sUserId) {
             $oUser = oxNew('oxuser');
             if ($oUser->load($sUserId)) {
                 // passing wishlist information
                 $this->_oWishUser = $oUser;
                 // store this one to session
                 oxSession::setVar('wishid', $sUserId);
             }
         }
     }
     return $this->_oWishUser;
 }
开发者ID:JulianaSchuster,项目名称:oxid-frontend,代码行数:22,代码来源:wishlist.php

示例14: executePayment

 /**
  * @overload
  */
 public function executePayment($dAmount, &$oOrder)
 {
     if (!in_array($oOrder->oxorder__oxpaymenttype->rawValue, array("paymill_cc", "paymill_elv"))) {
         return parent::executePayment($dAmount, $oOrder);
     }
     if (oxSession::hasVar('paymill_token')) {
         $this->_token = oxSession::getVar('paymill_token');
     } else {
         oxUtilsView::getInstance()->addErrorToDisplay("No Token was provided");
         oxUtils::getInstance()->redirect($this->getConfig()->getSslShopUrl() . 'index.php?cl=payment', false);
     }
     $this->getSession()->setVar("paymill_identifier", time());
     $this->_apiUrl = paymill_util::API_ENDPOINT;
     $this->_iLastErrorNo = null;
     $this->_sLastError = null;
     $this->_initializePaymentProcessor($dAmount, $oOrder);
     if ($this->_getPaymentShortCode($oOrder->oxorder__oxpaymenttype->rawValue) === 'cc') {
         $this->_paymentProcessor->setPreAuthAmount((int) oxSession::getVar('paymill_authorized_amount'));
     }
     $this->_loadFastCheckoutData();
     $this->_existingClientHandling($oOrder);
     if ($this->_token === 'dummyToken') {
         $prop = 'paymill_fastcheckout__paymentid_' . $this->_getPaymentShortCode($oOrder->oxorder__oxpaymenttype->rawValue);
         $this->_paymentProcessor->setPaymentId($this->_fastCheckoutData->{$prop}->rawValue);
     }
     $result = $this->_paymentProcessor->processPayment();
     $this->log($result ? 'Payment results in success' : 'Payment results in failure', null);
     if ($result) {
         $saveData = array('oxid' => $oOrder->oxorder__oxuserid->rawValue, 'clientid' => $this->_paymentProcessor->getClientId());
         if (oxConfig::getInstance()->getShopConfVar('PAYMILL_ACTIVATE_FASTCHECKOUT')) {
             $paymentColumn = 'paymentID_' . strtoupper($this->_getPaymentShortCode($oOrder->oxorder__oxpaymenttype->rawValue));
             $saveData[$paymentColumn] = $this->_paymentProcessor->getPaymentId();
         }
         $this->_fastCheckoutData->assign($saveData);
         $this->_fastCheckoutData->save();
         if (oxConfig::getInstance()->getShopConfVar('PAYMILL_SET_PAYMENTDATE')) {
             $this->_setPaymentDate($oOrder);
         }
         // set transactionId to session for updating the description after order execute
         $transactionId = $this->_paymentProcessor->getTransactionId();
         $this->getSession()->setVar('paymillPgTransId', $transactionId);
     } else {
         oxUtilsView::getInstance()->addErrorToDisplay($this->_getErrorMessage($this->_paymentProcessor->getErrorCode()));
     }
     return $result;
 }
开发者ID:SiWe0401,项目名称:paymill-oxid-4.6,代码行数:49,代码来源:paymill_paymentgateway.php

示例15: render

 /**
  * Executes parent method parent::render(), creates oxnewsletter object
  * and passes it's data to Smarty engine, returns name of template file
  * "newsletter_preview.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $soxId = $this->getEditObjectId();
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $oNewsletter = oxNew("oxnewsletter");
         $oNewsletter->load($soxId);
         $this->_aViewData["edit"] = $oNewsletter;
         // user
         $sUserID = oxSession::getVar("auth");
         // assign values to the newsletter and show it
         $oNewsletter->prepare($sUserID, $this->getConfig()->getConfigParam('bl_perfLoadAktion'));
         $this->_aViewData["previewhtml"] = $oNewsletter->getHtmlText();
         $this->_aViewData["previewtext"] = $oNewsletter->getPlainText();
     }
     return "newsletter_preview.tpl";
 }
开发者ID:JulianaSchuster,项目名称:oxid-frontend,代码行数:25,代码来源:newsletter_preview.php


注:本文中的oxSession::getVar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。