本文整理汇总了PHP中oxSession::setVar方法的典型用法代码示例。如果您正苦于以下问题:PHP oxSession::setVar方法的具体用法?PHP oxSession::setVar怎么用?PHP oxSession::setVar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oxSession
的用法示例。
在下文中一共展示了oxSession::setVar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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());
}
示例2: 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;
}
示例3: displayExceptionError
/**
* Sets exception errros to template
*
* @return null
*/
public function displayExceptionError()
{
$aViewData = $this->getViewData();
//add all exceptions to display
$aErrors = $this->_getErrors();
if (is_array($aErrors) && count($aErrors)) {
oxUtilsView::getInstance()->passAllErrorsToView($aViewData, $aErrors);
}
$oSmarty = oxUtilsView::getInstance()->getSmarty();
$oSmarty->assign_by_ref("Errors", $aViewData["Errors"]);
// resetting errors from session
oxSession::setVar('Errors', array());
}
示例4: 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";
}
示例5: getHash
/**
* Returns text hash
*
* @param string $sText User supplie text
*
* @return string
*/
public function getHash($sText = null)
{
// inserting captcha record
$iTime = time() + $this->_iTimeout;
$sTextHash = $this->getTextHash($sText);
// if session is started - storing captcha info here
if ($this->getSession()->isSessionStarted()) {
$sHash = oxUtilsObject::getInstance()->generateUID();
oxSession::setVar("aCaptchaHash", array($sHash => array($sTextHash => $iTime)));
} else {
$sQ = "insert into oxcaptcha ( oxhash, oxtime ) values ( '{$sTextHash}', '{$iTime}' )";
oxDb::getDb()->execute($sQ);
$sHash = oxDb::getDb()->getOne("select LAST_INSERT_ID()");
}
return $sHash;
}
示例6: render
/**
* Executes parent method parent::render(), cretes oxstatistic object,
* passes it's data to Smarty engine and returns name of template file
* "statistic_main.tpl".
*
* @return string
*/
public function render()
{
$myConfig = $this->getConfig();
$oLang = oxLang::getInstance();
parent::render();
$soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
$aReports = array();
if ($soxId != "-1" && isset($soxId)) {
// load object
$oStat = oxNew("oxstatistic");
$oStat->load($soxId);
$aReports = $oStat->getReports();
$this->_aViewData["edit"] = $oStat;
}
// setting all reports data: check for reports and load them
$sPath = getShopBasePath() . $myConfig->getConfigParam('sAdminDir') . "/reports";
$iLanguage = (int) oxConfig::getParameter("editlanguage");
$aAllreports = array();
$aReportFiles = glob($sPath . "/*.php");
foreach ($aReportFiles as $sFile) {
if (is_file($sFile) && !is_dir($sFile)) {
$sConst = strtoupper(str_replace('.php', '', basename($sFile)));
// skipping base report class
if ($sConst == 'REPORT_BASE') {
continue;
}
include $sFile;
$oItem = new oxStdClass();
$oItem->filename = basename($sFile);
$oItem->name = $oLang->translateString($sConst, $iLanguage);
$aAllreports[] = $oItem;
}
}
// setting reports data
oxSession::setVar("allstat_reports", $aAllreports);
oxSession::setVar("stat_reports_{$soxId}", $aReports);
// passing assigned reports count
$this->_aViewData['ireports'] = count($aReports);
if (oxConfig::getParameter("aoc")) {
$aColumns = array();
include_once 'inc/' . strtolower(__CLASS__) . '.inc.php';
$this->_aViewData['oxajax'] = $aColumns;
return "popups/statistic_main.tpl";
}
return "statistic_main.tpl";
}
示例7: 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;
}
示例8: render
public function render()
{
parent::render();
$this->_aViewData['edit'] = $oCategory = oxNew('oxcategory');
// resetting
oxSession::setVar('neworder_sess', null);
$soxId = $this->getEditObjectId();
if ($soxId != "-1" && isset($soxId)) {
// load object
$oCategory->load($soxId);
$oArticleList = oxnew('oxarticlelist');
$oArticleList->loadCategoryArticles($soxId, array());
$this->_aViewData['oArticleList'] = $oArticleList;
//Disable editing for derived items
if ($oCategory->isDerived()) {
$this->_aViewData['readonly'] = true;
}
}
if (oxConfig::getParameter("aoc")) {
return "marm_category_order_popup.tpl";
}
return "marm_category_order.tpl";
}
示例9: render
/**
* Loads article category ordering info, passes it to Smarty
* engine and returns name of template file "category_order.tpl".
*
* @return string
*/
public function render()
{
parent::render();
$this->_aViewData['edit'] = $oCategory = oxNew('oxcategory');
// resetting
oxSession::setVar('neworder_sess', null);
$soxId = $this->getEditObjectId();
if ($soxId != "-1" && isset($soxId)) {
// load object
$oCategory->load($soxId);
//Disable editing for derived items
if ($oCategory->isDerived()) {
$this->_aViewData['readonly'] = true;
}
}
if (oxConfig::getParameter("aoc")) {
$aColumns = array();
include_once 'inc/' . strtolower(__CLASS__) . '.inc.php';
$this->_aViewData['oxajax'] = $aColumns;
return "popups/category_order.tpl";
}
return "category_order.tpl";
}
示例10: getUserCount
/**
* Returns count of users assigned to active newsletter receiver group
*
* @return int
*/
public function getUserCount()
{
$iCnt = oxSession::getVar("iUserCount");
if ($iCnt === null) {
$iCnt = parent::getUserCount();
oxSession::setVar("iUserCount", $iCnt);
}
return $iCnt;
}
示例11: _addedNewItem
/**
* Is called when new basket item is successfully added
*
* @param string $sProductID id of product
* @param double $dAmount product amount
* @param array $aSel product select lists (default null)
* @param array $aPersParam product persistent parameters (default null)
* @param bool $blOverride marker to acumulate passed amount or renew (default false)
* @param bool $blBundle marker if product is bundle or not (default false)
* @param string $sOldBasketItemId id if old basket item if to change it
*
* @return null
*/
protected function _addedNewItem($sProductID, $dAmount, $aSel, $aPersParam, $blOverride, $blBundle, $sOldBasketItemId)
{
if (!$blOverride) {
$this->_blNewITemAdded = null;
oxSession::setVar("blAddedNewItem", true);
}
}
示例12: _getUploadedCsvFilePath
/**
* Checks if CSV file was uploaded. If uploaded - moves it to temp dir
* and stores path to file in session. Return path to uploaded file.
*
* @return string
*/
protected function _getUploadedCsvFilePath()
{
//try to get uploaded csv file path
if ($this->_sCsvFilePath !== null) {
return $this->_sCsvFilePath;
} elseif ($this->_sCsvFilePath = oxSession::getVar('sCsvFilePath')) {
return $this->_sCsvFilePath;
}
$oConfig = $this->getConfig();
$aFile = $oConfig->getUploadedFile('csvfile');
if (isset($aFile['name']) && $aFile['name']) {
$this->_sCsvFilePath = $oConfig->getConfigParam('sCompileDir') . basename($aFile['tmp_name']);
move_uploaded_file($aFile['tmp_name'], $this->_sCsvFilePath);
oxSession::setVar('sCsvFilePath', $this->_sCsvFilePath);
return $this->_sCsvFilePath;
}
}
示例13: remneworder
/**
* Removes category articles ordering set by saveneworder() method.
*
* @return null
*/
public function remneworder()
{
$oCategory = oxNew("oxcategory");
if ($oCategory->load(oxConfig::getParameter("oxid"))) {
$oDb = oxDb::getDb();
$sSelect = "update oxobject2category set oxpos = '0' where oxobject2category.oxcatnid=" . $oDb->quote($oCategory->getId());
$oDb->execute($sSelect);
oxSession::setVar('neworder_sess', null);
}
}
示例14: validatePayment
/**
* @overload
*/
public function validatePayment()
{
if (oxConfig::getParameter('paymentid') === "paymill_cc" || oxConfig::getParameter('paymentid') === "paymill_elv") {
oxSession::deleteVar('paymill_token');
// set paymill token to session to be available in next step
if (oxConfig::getParameter('paymillToken')) {
oxSession::setVar('paymill_token', oxConfig::getParameter('paymillToken'));
}
}
return parent::validatePayment();
}
示例15: _getNextStep
/**
* Returns next order step. If ordering was sucessfull - returns string "thankyou" (possible
* additional parameters), otherwise - returns string "payment" with additional
* error parameters.
*
* @param integer $iSuccess status code
*
* @return string $sNextStep partial parameter url for next step
*/
protected function _getNextStep($iSuccess)
{
$sNextStep = 'thankyou';
//little trick with switch for multiple cases
switch (true) {
case $iSuccess === oxOrder::ORDER_STATE_MAILINGERROR:
$sNextStep = 'thankyou?mailerror=1';
break;
case $iSuccess === oxOrder::ORDER_STATE_PAYMENTERROR:
// no authentication, kick back to payment methods
oxSession::setVar('payerror', 2);
$sNextStep = 'payment?payerror=2';
break;
case $iSuccess === oxOrder::ORDER_STATE_ORDEREXISTS:
break;
// reload blocker activ
// reload blocker activ
case is_numeric($iSuccess) && $iSuccess > 3:
oxSession::setVar('payerror', $iSuccess);
$sNextStep = 'payment?payerror=' . $iSuccess;
break;
case !is_numeric($iSuccess) && $iSuccess:
//instead of error code getting error text and setting payerror to -1
oxSession::setVar('payerror', -1);
$iSuccess = urlencode($iSuccess);
$sNextStep = 'payment?payerror=-1&payerrortext=' . $iSuccess;
break;
default:
break;
}
return $sNextStep;
}