BxBaseModTextMenuViewActions.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup BaseText Base classes for text modules
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. /**
  12. * View entry all actions menu
  13. */
  14. class BxBaseModTextMenuViewActions extends BxBaseModGeneralMenuViewActions
  15. {
  16. public function __construct($aObject, $oTemplate = false)
  17. {
  18. parent::__construct($aObject, $oTemplate);
  19. }
  20. protected function _getMenuItemApprove($aItem, $aParams = array())
  21. {
  22. $CNF = &$this->_oModule->_oConfig->CNF;
  23. if(!isset($CNF['FIELD_STATUS_ADMIN']))
  24. return false;
  25. $iContentId = $this->_iContentId;
  26. $aContentInfo = $this->_aContentInfo;
  27. if(!empty($aParams['id'])) {
  28. $iContentId = (int)$aParams['id'];
  29. $aContentInfo = $this->_oModule->_oDb->getContentInforById($iContentId);
  30. }
  31. if($aContentInfo[$CNF['FIELD_STATUS_ADMIN']] != BX_BASE_MOD_TEXT_STATUS_PENDING)
  32. return false;
  33. if(!$this->_oModule->_isModerator())
  34. return false;
  35. $this->addMarkers(array(
  36. 'content_id' => $iContentId
  37. ));
  38. return true;
  39. }
  40. }
  41. /** @} */