76 $this->
init(
'oxcontents');
86 if (!isset($this->_blExpanded)) {
100 $this->oxcontents__oxcatid =
new oxField($sCategoryId);
110 return $this->oxcontents__oxcatid->value;
125 $aParams = array($sTable .
'.oxloadid' => $sLoadId, $sTable .
'.oxshopid' => $sShopId);
130 if ($sLoadId ==
'oxcredits') {
133 $sColQ =
"SHOW COLUMNS FROM oxcontents WHERE field LIKE 'oxcontent%'";
137 $sPattern =
"IF ( %s != '', %s, %s ) ";
138 $iCount = count($aCols) - 1;
140 $sContQ =
"SELECT {$sPattern}";
141 foreach ($aCols as $iKey => $aCol) {
142 $sContQ = sprintf($sContQ, $aCol[0], $aCol[0], $iCount != $iKey ? $sPattern :
"''");
144 $sContQ .=
" FROM oxcontents WHERE oxloadid = '{$sLoadId}' AND oxshopid = '{$sShopId}'";
147 $sSelect = str_replace(
"`{$sTable}`.`oxcontent`",
"( $sContQ ) as oxcontent", $sSelect);
184 return $this->oxcontents__oxloadid->value;
194 return $this->oxcontents__oxactive->value;
210 if ($this->oxcontents__oxcontent) {
211 $this->oxcontents__oxcontent->setValue(str_replace(
'&lang=',
'&lang=', $this->oxcontents__oxcontent->value),
oxField::T_RAW);
224 return oxRegistry::get(
"oxSeoEncoderContent")->getContentUrl($this, $iLang);
240 if ($iLang === null) {
244 if (!isset($this->_aSeoUrls[$iLang])) {
248 return $this->_aSeoUrls[$iLang];
265 $sUrl = $this->
getConfig()->getShopUrl($iLang,
false);
268 if ($this->oxcontents__oxloadid->value ===
'oxcredits') {
269 $sUrl .=
"index.php?cl=credits";
271 $sUrl .=
"index.php?cl=content";
273 $sUrl .=
'&oxloadid=' . $this->
getLoadId();
276 $sUrl .=
"&oxcid=" . $this->
getId();
278 if ($this->_sParentCatId !==
false && $this->oxcontents__oxcatid->value && $this->oxcontents__oxcatid->value !=
'oxrootid') {
280 if ($this->_sParentCatId === null) {
281 $this->_sParentCatId =
false;
283 $sParentId = $oDb->getOne(
"select oxparentid from oxcategories where oxid = " . $oDb->quote($this->oxcontents__oxcatid->value));
284 if ($sParentId &&
'oxrootid' != $sParentId) {
285 $this->_sParentCatId = $sParentId;
289 if ($this->_sParentCatId) {
307 public function getStdLink($iLang = null, $aParams = array())
309 if ($iLang === null) {
327 if (
'oxcontent' === strtolower($sFieldName) ||
'oxcontents__oxcontent' === strtolower($sFieldName)) {
343 return $this->{$sFieldName}->value;
353 public function delete($sOXID = null)
356 $sOXID = $this->
getId();
359 if (parent::delete($sOXID)) {
376 if ($blSaved && $this->oxcontents__oxloadid->value ===
'oxagb') {
377 $sShopId = $this->
getConfig()->getShopId();
378 $sVersion = $this->oxcontents__oxtermversion->value;
382 $oDb->execute(
"delete from oxacceptedterms where oxshopid='{$sShopId}' and oxtermversion != " . $oDb->quote($sVersion));
396 return $this->oxcontents__oxtermversion->value;