75 $this->
init(
'oxcontents' );
85 if ( !isset( $this->_blExpanded ) ) {
98 $this->oxcontents__oxcatid =
new oxField( $sCategoryId );
108 return $this->oxcontents__oxcatid->value;
123 $aParams = array( $sTable .
'.oxloadid' => $sLoadId, $sTable .
'.oxshopid' => $sShopId );
128 if ( $sLoadId ==
'oxcredits' ) {
131 $sColQ =
"SHOW COLUMNS FROM oxcontents WHERE field LIKE 'oxcontent%'";
135 $sPattern =
"IF ( %s != '', %s, %s ) ";
136 $iCount = count( $aCols ) - 1;
138 $sContQ =
"SELECT {$sPattern}";
139 foreach ( $aCols as $iKey => $aCol ) {
140 $sContQ = sprintf( $sContQ, $aCol[0], $aCol[0], $iCount != $iKey ? $sPattern :
"''" );
142 $sContQ .=
" FROM oxcontents WHERE oxloadid = '{$sLoadId}' AND oxshopid = '{$sShopId}'";
145 $sSelect = str_replace(
"`{$sTable}`.`oxcontent`",
"( $sContQ ) as oxcontent", $sSelect );
181 return $this->oxcontents__oxloadid->value;
191 return $this->oxcontents__oxactive->value;
207 if ( $this->oxcontents__oxcontent ) {
208 $this->oxcontents__oxcontent->setValue( str_replace(
'&lang=',
'&lang=', $this->oxcontents__oxcontent->value ),
oxField::T_RAW );
221 return oxRegistry::get(
"oxSeoEncoderContent" )->getContentUrl( $this, $iLang );
237 if ( $iLang === null ) {
241 if ( !isset( $this->_aSeoUrls[$iLang] ) ) {
245 return $this->_aSeoUrls[$iLang];
262 $sUrl = $this->
getConfig()->getShopUrl( $iLang,
false );
265 if ( $this->oxcontents__oxloadid->value ===
'oxcredits' ) {
266 $sUrl .=
"index.php?cl=credits";
268 $sUrl .=
"index.php?cl=content";
270 $sUrl .=
'&oxloadid=' . $this->
getLoadId();
273 $sUrl .=
"&oxcid=" . $this->
getId();
275 if ( $this->_sParentCatId !==
false && $this->oxcontents__oxcatid->value && $this->oxcontents__oxcatid->value !=
'oxrootid' ) {
277 if ( $this->_sParentCatId === null ) {
278 $this->_sParentCatId =
false;
280 $sParentId = $oDb->getOne(
"select oxparentid from oxcategories where oxid = " . $oDb->quote( $this->oxcontents__oxcatid->value ) );
281 if ( $sParentId &&
'oxrootid' != $sParentId ) {
282 $this->_sParentCatId = $sParentId;
286 if ( $this->_sParentCatId ) {
304 public function getStdLink( $iLang = null, $aParams = array() )
306 if ( $iLang === null ) {
324 if (
'oxcontent' === strtolower( $sFieldName ) ||
'oxcontents__oxcontent' === strtolower( $sFieldName ) ) {
338 public function delete( $sOXID = null )
341 $sOXID = $this->
getId();
344 if ( parent::delete( $sOXID ) ) {
359 if ( $blSaved && $this->oxcontents__oxloadid->value ===
'oxagb' ) {
360 $sShopId = $this->
getConfig()->getShopId();
361 $sVersion = $this->oxcontents__oxtermversion->value;
365 $oDb->execute(
"delete from oxacceptedterms where oxshopid='{$sShopId}' and oxtermversion != " . $oDb->quote( $sVersion ) );
378 return $this->oxcontents__oxtermversion->value;
389 return $this->oxcontents__oxtype->value;