BxBaseModTextPageAuthor.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 BaseText Base classes for text modules
  7. * @ingroup TridentModules
  8. *
  9. * @{
  10. */
  11. /**
  12. * Profile's entries page.
  13. */
  14. class BxBaseModTextPageAuthor extends BxTemplPage
  15. {
  16. protected $_aProfileInfo;
  17. protected $_oProfile;
  18. public function __construct($aObject, $oTemplate = false)
  19. {
  20. parent::__construct($aObject, $oTemplate);
  21. // get profile info
  22. $iProfileId = bx_process_input(bx_get('profile_id'), BX_DATA_INT);
  23. if ($iProfileId) {
  24. $this->_oProfile = BxDolProfile::getInstance($iProfileId);
  25. $this->_aProfileInfo = $this->_oProfile ? $this->_oProfile->getInfo() : false;
  26. }
  27. if (!$this->_aProfileInfo || !$this->_oProfile)
  28. return;
  29. // select view profile submenu
  30. $oMenuSubmenu = BxDolMenu::getObjectInstance('sys_site_submenu');
  31. if ($oMenuSubmenu) {
  32. $oMenuSubmenu->setObjectSubmenu('bx_persons_view_submenu', array (
  33. 'title' => $this->_oProfile->getDisplayName(),
  34. 'link' => $this->_oProfile->getUrl(),
  35. 'icon' => $this->_oProfile->getIcon(),
  36. ));
  37. }
  38. // add replaceable markers
  39. $this->addMarkers($this->_aProfileInfo); // every profile field can be used as marker
  40. $this->addMarkers(array('profile_id' => $this->_oProfile->id())); // profile id
  41. $this->addMarkers(array('display_name' => $this->_oProfile->getDisplayName())); // profile display name
  42. $this->addMarkers(array('profile_link' => $this->_oProfile->getUrl())); // profile link
  43. }
  44. }
  45. /** @} */