Bläddra i källkod

#2842 Reviews: "Featured" menu item appearance fix.

Alexander 6 år sedan
förälder
incheckning
b14c8982fb
1 ändrade filer med 13 tillägg och 0 borttagningar
  1. 13 0
      modules/boonex/reviews/classes/BxReviewsMenuViewActions.php

+ 13 - 0
modules/boonex/reviews/classes/BxReviewsMenuViewActions.php

@@ -30,6 +30,19 @@ class BxReviewsMenuViewActions extends BxBaseModTextMenuViewActions
     {
         return $this->_getMenuItemByNameActions($aItem);
     }
+
+    protected function _isContentPublic($iContentId) {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        if(empty($CNF['FIELD_ALLOW_VIEW_TO']))
+            return true;
+
+        $aContentInfo = $iContentId == $this->_iContentId ? $this->_aContentInfo : $this->_oModule->_oDb->getContentInfoById($iContentId);
+        if(!isset($aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']]))
+            return true;
+
+        return $aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']] < 0 || in_array($aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']], array(BX_DOL_PG_ALL, BX_DOL_PG_MEMBERS));
+    }
 }
 
 /** @} */