00001 <?php 00002 00007 class oxwRating extends oxWidget 00008 { 00015 protected $_aComponentNames = array( 'oxcmp_user' => 1 ); 00016 00022 protected $_sThisTemplate = 'widget/reviews/rating.tpl'; 00023 00029 protected $_dRatingValue = null; 00030 00036 protected $_iRatingCnt = null; 00037 00038 00045 public function render() 00046 { 00047 parent::render(); 00048 return $this->_sThisTemplate; 00049 } 00050 00056 public function getRatingValue() 00057 { 00058 if ( $this->_dRatingValue === null ) { 00059 $this->_dRatingValue = (double)0; 00060 $dValue = $this->getViewParameter( "dRatingValue" ); 00061 if ( $dValue ) { 00062 $this->_dRatingValue = round( $dValue, 1); 00063 } 00064 } 00065 return (double) $this->_dRatingValue; 00066 } 00067 00073 public function getRatingCount() 00074 { 00075 return $dCount = $this->getViewParameter( "dRatingCount" ); 00076 } 00077 00083 public function getRateUrl() 00084 { 00085 return $this->getViewParameter( "sRateUrl" ); 00086 } 00087 00093 public function canRate() 00094 { 00095 return $this->getViewParameter( "blCanRate" ); 00096 } 00097 00103 public function getArticleNId() 00104 { 00105 return $this->getViewParameter( 'anid' ); 00106 } 00107 }