BxOrgsModule.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 Organizations Organizations
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. /**
  12. * Organizations profiles module.
  13. */
  14. class BxOrgsModule extends BxBaseModGroupsModule
  15. {
  16. function __construct(&$aModule)
  17. {
  18. parent::__construct($aModule);
  19. $CNF = &$this->_oConfig->CNF;
  20. $this->_aSearchableNamesExcept[] = $CNF['FIELD_AUTHOR'];
  21. $this->_aSearchableNamesExcept[] = $CNF['FIELD_JOIN_CONFIRMATION'];
  22. }
  23. /**
  24. * Check if this module entry can be used as profile
  25. */
  26. public function serviceActAsProfile ()
  27. {
  28. return true;
  29. }
  30. public function servicePrepareFields ($aFieldsProfile)
  31. {
  32. return parent::_servicePrepareFields($aFieldsProfile, array('org_cat' => 35), array(
  33. 'org_name' => 'name',
  34. 'org_desc' => 'description',
  35. ));
  36. }
  37. public function serviceGetTimelineData()
  38. {
  39. return array();
  40. }
  41. public function onFanRemovedFromAdmins($iGroupProfileId, $iProfileId)
  42. {
  43. if (!($oProfile = BxDolProfile::getInstance($iProfileId)))
  44. return false;
  45. $oAccount = $oProfile->getAccountObject();
  46. $oAccount->updateProfileContextAuto();
  47. }
  48. }
  49. /** @} */