BxBasePageAccount.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 DolphinCore Dolphin Core
  7. * @{
  8. */
  9. bx_import('BxTemplPage');
  10. /**
  11. * Account page.
  12. */
  13. class BxBasePageAccount extends BxTemplPage {
  14. protected $_aMapStatus2LangKey = array (
  15. BX_PROFILE_STATUS_PENDING => '_sys_txt_account_pending',
  16. BX_PROFILE_STATUS_SUSPENDED => '_sys_txt_account_suspended',
  17. );
  18. public function __construct($aObject, $oTemplate) {
  19. parent::__construct($aObject, $oTemplate);
  20. bx_import('BxDolProfile');
  21. $oProfile = BxDolProfile::getInstance();
  22. $aProfileInfo = $oProfile ? $oProfile->getInfo() : false;
  23. $this->addMarkers(array(
  24. 'account_id' => $aProfileInfo ? $aProfileInfo['account_id'] : 0,
  25. 'profile_id' => $aProfileInfo ? $aProfileInfo['id'] : 0,
  26. 'profile_type' => $aProfileInfo ? $aProfileInfo['type'] : 0,
  27. 'profile_content_id' => $aProfileInfo ? $aProfileInfo['content_id'] : 0,
  28. ));
  29. // display message if profile isn't active
  30. if ($oProfile) {
  31. $sStatus = $oProfile->getStatus();
  32. if (isset($this->_aMapStatus2LangKey[$sStatus])) {
  33. bx_import('BxDolInformer');
  34. $oInformer = BxDolInformer::getInstance($this->_oTemplate);
  35. if ($oInformer)
  36. $oInformer->add('sys-account-status-not-active', _t($this->_aMapStatus2LangKey[$sStatus]), BX_INFORMER_ALERT);
  37. }
  38. }
  39. }
  40. protected function _getPageCacheParams () {
  41. return getLoggedId(); // cache is different for every account
  42. }
  43. }
  44. /** @} */