Example #1
0
 /**
  * Returns string which must be edited by editor
  *
  * @param oxbase $oObject object whifh field will be used for editing
  * @param string $sField  name of editable field
  *
  * @return string
  */
 protected function _getEditValue($oObject, $sField)
 {
     $sEditObjectValue = '';
     if ($oObject) {
         $oDescField = $oObject->getLongDescription();
         $sEditObjectValue = $this->_processEditValue($oDescField->getRawValue());
         $oDescField = new oxField($sEditObjectValue, oxField::T_RAW);
     }
     return $sEditObjectValue;
 }
 /**
  * Loads if exists or prepares and saves new seo url for passed object
  *
  * @param oxbase $oObject object to prepare seo data
  * @param string $sType   type of object (oxvendor/oxcategory)
  * @param string $sStdUrl stanradr url
  * @param string $sSeoUrl seo uri
  * @param string $sParams additional params, liek page number etc. mostly used by mysql for indexes
  * @param int    $iLang   language
  * @param bool   $blFixed fixed url marker (default is false)
  *
  * @return string
  */
 protected function _getPageUri($oObject, $sType, $sStdUrl, $sSeoUrl, $sParams, $iLang = null, $blFixed = false)
 {
     if (!isset($iLang)) {
         $iLang = $oObject->getLanguage();
     }
     $iShopId = $this->getConfig()->getShopId();
     //load page link from DB
     $sOldSeoUrl = $this->_loadFromDb($sType, $oObject->getId(), $iLang, $iShopId, $sParams);
     if (!$sOldSeoUrl) {
         // generating new..
         $sSeoUrl = $this->_processSeoUrl($sSeoUrl, $oObject->getId(), $iLang);
         $this->_saveToDb($sType, $oObject->getId(), $sStdUrl, $sSeoUrl, $iLang, $iShopId, (int) $blFixed, $sParams);
     } else {
         // using old
         $sSeoUrl = $sOldSeoUrl;
     }
     return $sSeoUrl;
 }
Example #3
0
 public function testOxRecommListsGetSearchRecommListCount()
 {
     $sValue = 'agentūЛитовfür';
     $aFields = array('oxrecommlists__oxauthor', 'oxrecommlists__oxtitle', 'oxrecommlists__oxdesc');
     $oRecList = oxNew('oxrecommlist');
     $oRecList->setId('_testRecommlist');
     foreach ($aFields as $sFieldName) {
         $oRecList->{$sFieldName} = new oxField($sValue);
     }
     $oRecList->save();
     $oObj2List = new oxbase();
     $oObj2List->init("oxobject2list");
     $oObj2List->setId("_testRecom");
     $oObj2List->oxobject2list__oxobjectid = new oxField("2000");
     $oObj2List->oxobject2list__oxlistid = new oxField('_testRecommlist');
     $oObj2List->save();
     $oRecList = oxNew('oxrecommlist');
     $this->assertEquals(1, $oRecList->getSearchRecommListCount($sValue));
 }