24 $this->_aViewData[
"edit"] = $oArticle =
oxNew(
"oxarticle");
28 if ($soxId !=
"-1" && isset($soxId)) {
31 $oArticle->load($soxId);
36 foreach ($oRevs as $oRev) {
37 if ($oRev->oxreviews__oxid->value == $sRevoxId) {
42 $this->_aViewData[
"allreviews"] = $oRevs;
45 if (isset($sRevoxId)) {
46 $oReview =
oxNew(
"oxreview");
47 $oReview->load($sRevoxId);
48 $this->_aViewData[
"editreview"] = $oReview;
50 $oUser =
oxNew(
"oxuser");
51 $oUser->load($oReview->oxreviews__oxuserid->value);
52 $this->_aViewData[
"user"] = $oUser;
55 $this->_aViewData[
"blShowActBox"] =
$myConfig->getConfigParam(
'blGBModerate');
59 return "article_review.tpl";
72 $sSelect =
"select oxreviews.* from oxreviews
73 where oxreviews.OXOBJECTID = " . $oDb->quote($oArticle->oxarticles__oxid->value) .
"
74 and oxreviews.oxtype = 'oxarticle'";
76 $aVariantList = $oArticle->getVariants();
78 if ($this->
getConfig()->getConfigParam(
'blShowVariantReviews') && count($aVariantList)) {
81 foreach ($aVariantList as $oVariant) {
82 $sSelect .=
"or oxreviews.oxobjectid = " . $oDb->quote($oVariant->oxarticles__oxid->value) .
" ";
88 $sSelect .=
"and oxreviews.oxlang = '" . $this->_iEditLang .
"'";
89 $sSelect .=
"and oxreviews.oxtext != '' ";
92 $oRevs =
oxNew(
"oxlist");
93 $oRevs->init(
"oxreview");
94 $oRevs->selectString($sSelect);
108 if ($this->
getConfig()->getConfigParam(
'blGBModerate') && !isset($aParams[
'oxreviews__oxactive'])) {
109 $aParams[
'oxreviews__oxactive'] = 0;
112 $oReview =
oxNew(
"oxreview");
114 $oReview->assign($aParams);
121 public function delete()
126 $oReview =
oxNew(
"oxreview");
127 $oReview->load($sRevoxId);
131 $oRating =
oxNew(
"oxRating");
134 $oArticle =
oxNew(
'oxArticle');
135 $oArticle->load($sArticleId);
137 $oArticle->setRatingAverage($oRating->getRatingAverage($sArticleId,
'oxarticle'));
138 $oArticle->setRatingCount($oRating->getRatingCount($sArticleId,
'oxarticle'));