23 $this->_aViewData[
"edit"] = $oArticle =
oxNew(
"oxarticle" );
27 if ( $soxId !=
"-1" && isset( $soxId)) {
30 $oArticle->load( $soxId);
35 foreach ( $oRevs as $oRev ) {
36 if ( $oRev->oxreviews__oxid->value == $sRevoxId ) {
41 $this->_aViewData[
"allreviews"] = $oRevs;
44 if ( isset( $sRevoxId ) ) {
45 $oReview =
oxNew(
"oxreview" );
46 $oReview->load( $sRevoxId );
47 $this->_aViewData[
"editreview"] = $oReview;
49 $oUser =
oxNew(
"oxuser" );
50 $oUser->load( $oReview->oxreviews__oxuserid->value);
51 $this->_aViewData[
"user"] = $oUser;
54 $this->_aViewData[
"blShowActBox"] =
$myConfig->getConfigParam(
'blGBModerate' );
58 return "article_review.tpl";
71 $sSelect =
"select oxreviews.* from oxreviews
72 where oxreviews.OXOBJECTID = ".$oDb->quote( $oArticle->oxarticles__oxid->value ) .
"
73 and oxreviews.oxtype = 'oxarticle'";
75 $aVariantList = $oArticle->getVariants();
77 if ( $this->
getConfig()->getConfigParam(
'blShowVariantReviews' ) && count( $aVariantList )) {
80 foreach ( $aVariantList as $oVariant ) {
81 $sSelect .=
"or oxreviews.oxobjectid = ".$oDb->quote( $oVariant->oxarticles__oxid->value ).
" ";
87 $sSelect .=
"and oxreviews.oxlang = '" . $this->_iEditLang .
"'";
88 $sSelect .=
"and oxreviews.oxtext != '' ";
91 $oRevs =
oxNew(
"oxlist" );
92 $oRevs->init(
"oxreview" );
93 $oRevs->selectString( $sSelect );
109 if ( $this->
getConfig()->getConfigParam(
'blGBModerate' ) && !isset( $aParams[
'oxreviews__oxactive'] ) ) {
110 $aParams[
'oxreviews__oxactive'] = 0;
113 $oReview =
oxNew(
"oxreview" );
115 $oReview->assign( $aParams );
124 public function delete()
128 $oReview =
oxNew(
"oxreview" );
129 $oReview->load( $sRevoxId );
133 $oRating =
oxNew(
"oxRating" );
136 $oArticle =
oxNew(
'oxArticle' );
137 $oArticle->load( $sArticleId );
139 $oArticle->setRatingAverage( $oRating->getRatingAverage( $sArticleId,
'oxarticle' ) );
140 $oArticle->setRatingCount( $oRating->getRatingCount( $sArticleId,
'oxarticle' ) );