BxBaseModProfileMenuViewActions.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  4. * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  5. *
  6. * @defgroup BaseProfile Base classes for profile modules
  7. * @ingroup TridentModules
  8. *
  9. * @{
  10. */
  11. /**
  12. * View profile entry actions menu n popup
  13. */
  14. class BxBaseModProfileMenuViewActions extends BxBaseModProfileMenuView
  15. {
  16. protected function getMenuItemsRaw ()
  17. {
  18. // combile values from ACTIONS_VIEW_ENTRY and ACTIONS_VIEW_ENTRY_MORE menus
  19. $CNF = $this->_oModule->_oConfig->CNF;
  20. if (empty($CNF['OBJECT_MENU_ACTIONS_VIEW_ENTRY']))
  21. return array();
  22. $aItems = $this->_oQuery->getMenuItemsFromSet($CNF['OBJECT_MENU_ACTIONS_VIEW_ENTRY']);
  23. if (empty($CNF['OBJECT_MENU_ACTIONS_VIEW_ENTRY_MORE']))
  24. return $aItems;
  25. $aItemsMore = $this->_oQuery->getMenuItemsFromSet($CNF['OBJECT_MENU_ACTIONS_VIEW_ENTRY_MORE']);
  26. // remove "more" item from ACTIONS_VIEW_ENTRY
  27. $aItems = array_filter ($aItems, function ($aItem) {
  28. return $aItem['order'] != BX_MENU_LAST_ITEM_ORDER;
  29. });
  30. // return combined array
  31. return array_merge($aItems, $aItemsMore);
  32. }
  33. }
  34. /** @} */