BxWorkspacesTemplate.php 1.4 KB

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 Workspaces Workspaces
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. /*
  12. * Workspaces module representation.
  13. */
  14. class BxWorkspacesTemplate extends BxBaseModProfileTemplate
  15. {
  16. function __construct(&$oConfig, &$oDb)
  17. {
  18. $this->MODULE = 'bx_workspaces';
  19. parent::__construct($oConfig, $oDb);
  20. }
  21. function unitVars ($aData, $isCheckPrivateContent = true, $mixedTemplate = false, $aParams = [])
  22. {
  23. $a = ['bx_if:show_thumb_image', 'bx_if:show_thumb_letter', 'bx_if:show_thumbnail', 'bx_if:show_cover', 'thumb_url', 'cover_url', 'cover_settings', 'text', 'summary'];
  24. $aVars = parent::unitVars ($aData, $isCheckPrivateContent, $mixedTemplate, $aParams);
  25. $oProfileParent = BxDolProfile::getInstance($aData['author']);
  26. if ($oProfileParent && $oModuleParent = BxDolModule::getInstance($oProfileParent->getModule())) {
  27. $aDataParent = $oModuleParent->_oDb->getContentInfoById($oProfileParent->getContentId());
  28. $aVarsParent = $oModuleParent->_oTemplate->unitVars ($aDataParent, $isCheckPrivateContent, $mixedTemplate, $aParams);
  29. foreach ($a as $k)
  30. $aVars[$k] = $aVarsParent[$k];
  31. }
  32. return $aVars;
  33. }
  34. }
  35. /** @} */