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         oxSeoEncoderCategory::getInstance()->getCategoryUrl( $oCategory );
00050 
00051         return parent::_getSeoUrl( $oCategory );
00052     }
00053 
00059     protected function _getObject( $sOxid )
00060     {
00061         // load object
00062         $oCategory = oxNew( 'oxcategory' );
00063         if ( $oCategory->loadInLang( $this->_iEditLang, $sOxid ) ) {
00064             return $oCategory;
00065         }
00066     }
00067 
00073     protected function _getType()
00074     {
00075         return 'oxcategory';
00076     }
00077 
00083     protected function _getStdUrl( $sOxid )
00084     {
00085         $oCategory = oxNew( 'oxcategory' );
00086         $oCategory->loadInLang( $this->_iEditLang, $sOxid );
00087         return $oCategory->getLink();
00088     }
00089 
00095     public function save()
00096     {
00097         if ( $sOxid = oxConfig::getParameter( 'oxid' ) ) {
00098             $oCategory = oxNew( 'oxbase' );
00099             $oCategory->init( 'oxcategories' );
00100             if ( $oCategory->load( $sOxid ) ) {
00101                 $oCategory->oxcategories__oxshowsuffix = new oxField( (int) oxConfig::getParameter( 'blShowSuffix' ) );
00102                 $oCategory->save();
00103 
00104                 // marking page links as expired
00105                 oxSeoEncoderCategory::getInstance()->markAsExpired( $sOxid, oxConfig::getInstance()->getShopId(), $this->_iEditLang, "oxparams != '' " );
00106             }
00107         }
00108 
00109         return parent::save();
00110     }
00111 }

Generated on Thu Dec 4 12:04:55 2008 for OXID eShop CE by  doxygen 1.5.5