/**
  * 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());
 }
 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();
 }
 /**
  * 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());
 }
 /**
  * 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';
 }
 /**
  * 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";
 }
 /**
  * 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;
 }
 /**
  * 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();
 }
 /**
  * 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";
 }
 /**
  * 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";
 }
 /**
  * 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";
 }
 /**
  * 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;
     }
 }
 /**
  * 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();
 }
 /**
  * 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);
 }
/**
 * 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;
}
 /**
  * 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();
             }
         }
     }
 }
 /**
  * Saves service attributes.
  *
  * @return null
  */
 public function save()
 {
     $oShop = oxNew("oxshop");
     if ($oShop->load($this->getEditObjectId())) {
         $oShop->assign(oxConfig::getParameter("editval"));
         $oShop->save();
     }
 }
 /**
  * Performs cleanup of statistic data for selected period.
  *
  * @return null
  */
 public function cleanup()
 {
     $iTimeFrame = oxConfig::getParameter("timeframe");
     $dNow = time();
     $sDeleteFrom = date("Y-m-d H:i:s", mktime(date("H", $dNow), date("i", $dNow), date("s", $dNow), date("m", $dNow), date("d", $dNow) - $iTimeFrame, date("Y", $dNow)));
     $oDb = oxDb::getDb();
     $oDb->Execute("delete from oxlogs where oxtime < " . $oDb->quote($sDeleteFrom));
 }
 public function init()
 {
     parent::init();
     if (!oxConfig::getParameter('fnc')) {
         $oViewConf = $this->getViewConfig();
         oxRegistry::get('oxUtils')->redirect($oViewConf->getHomeLink(), false);
     }
 }
Beispiel #19
0
 /**
  * Returns a request parameter.
  *
  * @param string $sName         Name of the request parameter.
  * @param mixed  $mDefaultValue Return value if $sName isn't set.
  * @param bool   $blRaw         return raw value.
  *
  * @return mixed
  */
 public function getRequestParam($sName, $mDefaultValue = null, $blRaw = false)
 {
     $mReturnValue = oxConfig::getParameter($sName, $blRaw);
     if ($mReturnValue === null) {
         $mReturnValue = $mDefaultValue;
     }
     return $mReturnValue;
 }
 /**
  * Saves service attributes.
  *
  * @return null
  */
 public function save()
 {
     $soxId = $this->getEditObjectId();
     $aParams = oxConfig::getParameter("editval");
     $oShop = oxNew("oxshop");
     $oShop->load($soxId);
     //$aParams = $oShop->ConvertNameArray2Idx( $aParams);
     $oShop->assign($aParams);
     $oShop->save();
 }
 /**
  * Updating showsuffix field
  *
  * @return null
  */
 public function save()
 {
     $oManufacturer = oxNew('oxbase');
     $oManufacturer->init('oxmanufacturers');
     if ($oManufacturer->load($this->getEditObjectId())) {
         $oManufacturer->oxmanufacturers__oxshowsuffix = new oxField((int) oxConfig::getParameter('blShowSuffix'));
         $oManufacturer->save();
     }
     return parent::save();
 }
 /**
  * Adding article to corssselling list
  *
  * @return null
  */
 public function assignCat()
 {
     $sChosenCat = oxConfig::getParameter('oxcatid');
     $sShopId = oxConfig::getParameter('oxid');
     $oShop = oxNew('oxshop');
     if ($oShop->load($sShopId)) {
         $oShop->oxshops__oxdefcat = new oxField($sChosenCat);
         $oShop->save();
     }
 }
 public function render()
 {
     parent::render();
     $this->_page = oxConfig::getParameter('seite');
     $this->_searchKey = oxConfig::getParameter('search_key');
     $this->addTplParam('list', $this->_getData());
     $this->addTplParam('editUrl', $this->_getAdminUrl() . '&cl=paymill_log_entry');
     $this->addTplParam('pageCount', $this->_pageCount);
     return 'paymill_log_list.tpl';
 }
 /**
  * Returns sorting fields array
  *
  * @return array
  */
 public function getListSorting()
 {
     $aSort = oxConfig::getParameter('sort');
     if ($this->_aCurrSorting === null && isset($aSort[0]['oxorderdate'])) {
         $this->_aCurrSorting[]["max(oxorder.oxorderdate)"] = "desc";
         return $this->_aCurrSorting;
     } else {
         return parent::getListSorting();
     }
 }
 /**
  *
  *
  * @author Rafal Wesolowski
  * @access public
  * @return void
  */
 public function stopPerformTest()
 {
     $this->_getTestPerformance()->setComment(oxConfig::getParameter("comment"));
     if ($this->_getTestPerformance()->checkPerformance()) {
         $this->_aViewData["bPerformTestResult"] = true;
         $aResult = $this->_getTestPerformance()->getLastPerformTestResult();
         unset($aResult['date']);
         $this->_aViewData["aUrls"] = array_change_key_case($aResult, CASE_UPPER);
     }
     $this->_aViewData["bBackupResult"] = $this->_getTestPerformance()->getMysqlDriverBackup();
 }
 /**
  * @return string
  */
 public function getLoginLink()
 {
     $params = array('cl' => 'account');
     if (oxRegistry::getConfig()->getRequestParameter('destination')) {
         $params['destination'] = urldecode(oxConfig::getParameter('destination'));
     }
     if (oxRegistry::getConfig()->getRequestParameter('anchor')) {
         $params['anchor'] = urldecode(oxRegistry::getConfig()->getRequestParameter('anchor'));
     }
     return $this->getSelfLink() . http_build_query($params);
 }
 /**
  * Returns sorting fields array
  *
  * @return array
  */
 public function getListSorting()
 {
     if ($this->_aCurrSorting === null && !oxConfig::getParameter('sort') && ($oBaseObject = $this->getItemListBaseObject())) {
         $sCatView = $oBaseObject->getCoreTableName();
         $this->_aCurrSorting[$sCatView]["oxrootid"] = "desc";
         $this->_aCurrSorting[$sCatView]["oxleft"] = "asc";
         return $this->_aCurrSorting;
     } else {
         return parent::getListSorting();
     }
 }
 /**
  * Updating showsuffix field
  *
  * @return null
  */
 public function save()
 {
     $sOxid = $this->getEditObjectId();
     $oCategory = oxNew('oxbase');
     $oCategory->init('oxcategories');
     if ($oCategory->load($sOxid)) {
         $oCategory->oxcategories__oxshowsuffix = new oxField((int) oxConfig::getParameter('blShowSuffix'));
         $oCategory->save();
         $this->_getEncoder()->markRelatedAsExpired($oCategory);
     }
     return parent::save();
 }
 public function deletePicture()
 {
     $blDeleted = false;
     $_sThisTemplate = $this->_sThisTemplate;
     $MarkerPicture = oxConfig::getParameter("MarkerPicture");
     $Path = $this->getConfig()->getModulesDir() . 'shoplocator/marker/';
     $sFile = $Path . $MarkerPicture;
     if (file_exists($sFile)) {
         $blDeleted = unlink($sFile);
     }
     return $this->{$_sThisTemplate};
 }
Beispiel #30
0
 /**
  * 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;
 }