00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 class Mage_Adminhtml_Block_Review_Rating_Summary extends Mage_Adminhtml_Block_Template
00036 {
00037 public function __construct()
00038 {
00039 $this->setTemplate('rating/stars/summary.phtml');
00040 $this->setReviewId(Mage::registry('review_data')->getId());
00041 }
00042
00043 public function getRating()
00044 {
00045 if( !$this->getRatingCollection() ) {
00046 $ratingCollection = Mage::getModel('rating/rating_option_vote')
00047 ->getResourceCollection()
00048 ->setReviewFilter($this->getReviewId())
00049 ->addRatingInfo()
00050 ->load();
00051 $this->setRatingCollection( ( $ratingCollection->getSize() ) ? $ratingCollection : false );
00052 }
00053 return $this->getRatingCollection();
00054 }
00055
00056 public function getRatingSummary()
00057 {
00058 if( !$this->getRatingSummaryCache() ) {
00059 $this->setRatingSummaryCache(Mage::getModel('rating/rating')->getReviewSummary($this->getReviewId()));
00060 }
00061
00062 return $this->getRatingSummaryCache();
00063 }
00064 }