1
0

BxBaseMenuWiki.php 896 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 UnaBaseView UNA Base Representation Classes
  7. * @{
  8. */
  9. /**
  10. * Wiki block menu
  11. */
  12. class BxBaseMenuWiki extends BxTemplMenu
  13. {
  14. protected $_oWikiObject;
  15. public function __construct ($aObject, $oTemplate)
  16. {
  17. parent::__construct ($aObject, $oTemplate);
  18. }
  19. public function setMenuObject($o)
  20. {
  21. $this->_oWikiObject = $o;
  22. }
  23. /**
  24. * Check if menu items is visible with extended checking for friends notifications
  25. * @param $a menu item array
  26. * @return boolean
  27. */
  28. protected function _isVisible ($a)
  29. {
  30. if(!$this->_oWikiObject || !parent::_isVisible($a))
  31. return false;
  32. return $this->_oWikiObject->isAllowed($a['name']);
  33. }
  34. }
  35. /** @} */