• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP oxSession类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: 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


示例2: 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


示例3: 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


示例4: _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


示例5: log

 /**
  * log the given message
  *
  * @param string $message
  * @param string $debuginfo
  */
 public function log($message, $debuginfo)
 {
     if (oxConfig::getInstance()->getShopConfVar('PAYMILL_ACTIVATE_LOGGING')) {
         $logging = oxNew('paymill_logging');
         $logging->assign(array('identifier' => oxSession::getInstance()->getVar('paymill_identifier'), 'debug' => $debuginfo, 'message' => $message, 'date' => date('Y-m-d H:i:s', oxUtilsDate::getInstance()->getTime())));
         $logging->save();
     }
 }
开发者ID:SiWe0401,项目名称:paymill-oxid-4.6,代码行数:14,代码来源:paymill_logger.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: 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


示例9: testInit

 /**
  * Testing initiation of the received payment information.
  */
 public function testInit()
 {
     $oView = new bz_barzahlen_thankyou();
     $oView->init();
     $this->assertEquals('', $oView->getInfotextOne());
     oxSession::setVar('barzahlenInfotextOne', 'Hallo <b>Welt</b>! <a href="http://www.barzahlen.de">Bar zahlen</a> Infütöxt Äinß');
     $oView->init();
     $this->assertEquals('Hallo <b>Welt</b>! <a href="http://www.barzahlen.de">Bar zahlen</a> Infütöxt Äinß', $oView->getInfotextOne());
 }
开发者ID:alexschwarz89,项目名称:Barzahlen-OXID-4.7,代码行数:12,代码来源:BarzahlenThankyouTest.php


示例10: _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


示例11: 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


示例12: 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


示例13: 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


示例14: 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


示例15: 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


示例16: 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


示例17: 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


示例18: save

 /**
  * Saves newsletter HTML format text.
  *
  * @return string
  */
 public function save()
 {
     $myConfig = $this->getConfig();
     $soxId = $this->getEditObjectId();
     $aParams = oxConfig::getParameter("editval");
     // shopid
     $sShopID = oxSession::getVar("actshop");
     $aParams['oxnewsletter__oxshopid'] = $sShopID;
     $oNewsletter = oxNew("oxnewsletter");
     if ($soxId != "-1") {
         $oNewsletter->load($soxId);
     } else {
         $aParams['oxnewsletter__oxid'] = null;
     }
     $oNewsletter->assign($aParams);
     $oNewsletter->save();
     // set oxid if inserted
     $this->setEditObjectId($oNewsletter->getId());
 }
开发者ID:JulianaSchuster,项目名称:oxid-frontend,代码行数:24,代码来源:newsletter_main.php


示例19: smarty_insert_oxid_fblogin

/**
 * 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_fblogin($params, &$smarty)
{
    $myConfig = oxConfig::getInstance();
    $oView = $myConfig->getActiveView();
    if (!$myConfig->getConfigParam("bl_showFbConnect")) {
        return;
    }
    // user logged in using facebook account so showing additional
    // popup about connecting facebook user id to existing shop account
    $oFb = oxFb::getInstance();
    if ($oFb->isConnected() && $oFb->getUser()) {
        //name of template
        $sTemplate = 'inc/popup_fblogin.tpl';
        // checking, if Facebeook User Id was successfully added
        if (oxSession::getVar('_blFbUserIdUpdated')) {
            $sTemplate = 'inc/popup_fblogin_msg.tpl';
            oxSession::deleteVar('_blFbUserIdUpdated');
        }
        return $smarty->fetch($sTemplate);
    }
}
开发者ID:JulianaSchuster,项目名称:oxid-frontend,代码行数:35,代码来源:insert.oxid_fblogin.php


示例20: render

 /**
  * Calls parent::render, sets admin help url
  *
  * @return string
  */
 public function render()
 {
     $sReturn = parent::render();
     $oLang = oxLang::getInstance();
     // generate help link
     $myConfig = $this->getConfig();
     $sDir = $myConfig->getConfigParam('sShopDir') . '/documentation/admin';
     $iLang = 1;
     $sAbbr = $oLang->getLanguageAbbr($oLang->getTplLanguage());
     if ($sAbbr == "de") {
         $iLang = 0;
     }
     if (is_dir($sDir)) {
         $sDir = $myConfig->getConfigParam('sShopURL') . 'documentation/admin';
     } else {
         $oShop = $this->_getEditShop(oxSession::getVar('actshop'));
         //$sDir = "http://docu.oxid-esales.com/PE/{$oShop->oxshops__oxversion->value}/" . $myConfig->getConfigParam( 'iAdminLanguage' ) . '/admin';
         $sDir = "http://docu.oxid-esales.com/PE/{$oShop->oxshops__oxversion->value}/" . $iLang . '/admin';
     }
     $this->_aViewData['sHelpURL'] = $sDir;
     return $sReturn;
 }
开发者ID:JulianaSchuster,项目名称:oxid-frontend,代码行数:27,代码来源:oxadmindetails.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP oxTestModules类代码示例发布时间:2022-05-23
下一篇:
PHP oxRegistry类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap