category_seo.php

Go to the documentation of this file.
00001 <?php
00002 
00006 class Category_Seo extends Object_Seo
00007 {
00014     public function render()
00015     {
00016         $oCategory = $this->_getObject( oxConfig::getParameter( 'oxid' ) );
00017 
00018 
00019         $this->_aViewData["edit"] = $oCategory;
00020         $this->_aViewData['blShowSuffixEdit'] = true;
00021         $this->_aViewData['blShowSuffix'] = $oCategory ? $oCategory->oxcategories__oxshowsuffix->value : false;
00022 
00023         return parent::render();
00024     }
00025 
00035     protected function _getSeoDataSql( $oObject, $iShopId, $iLang )
00036     {
00037         return parent::_getSeoDataSql( $oObject, $iShopId, $iLang )." and oxparams = '' ";
00038     }
00039 
00047     protected function _getSeoUrl( $oCategory )
00048     {
00049         $this->_getEncoder()->getCategoryUrl( $oCategory );
00050         return parent::_getSeoUrl( $oCategory );
00051     }
00052 
00058     protected function _getType()
00059     {
00060         return 'oxcategory';
00061     }
00062 
00068     public function save()
00069     {
00070         if ( $sOxid = oxConfig::getParameter( 'oxid' ) ) {
00071             $oCategory = oxNew( 'oxbase' );
00072             $oCategory->init( 'oxcategories' );
00073             if ( $oCategory->load( $sOxid ) ) {
00074                 $oCategory->oxcategories__oxshowsuffix = new oxField( (int) oxConfig::getParameter( 'blShowSuffix' ) );
00075                 $oCategory->save();
00076 
00077                 $this->_getEncoder()->markRelatedAsExpired( $oCategory );
00078             }
00079         }
00080 
00081         return parent::save();
00082     }
00083 
00089     protected function _getEncoder()
00090     {
00091         return oxSeoEncoderCategory::getInstance();
00092     }
00093 }