BxBaseCmtsPageView.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 UnaBaseView UNA Base Representation Classes
  7. * @{
  8. */
  9. class BxBaseCmtsPageView extends BxTemplPage
  10. {
  11. public function __construct($aObject, $oTemplate)
  12. {
  13. parent::__construct($aObject, $oTemplate);
  14. if(empty($sSystem) && ($sSystem = bx_get('sys')) !== false)
  15. $sSystem = bx_process_input($sSystem);
  16. if(empty($iObjectId) && ($iObjectId = bx_get('id')) !== false)
  17. $iObjectId = bx_process_input($iObjectId, BX_DATA_INT);
  18. if(empty($iCommentId) && ($iCommentId = bx_get('cmt_id')) !== false)
  19. $iCommentId = bx_process_input($iCommentId, BX_DATA_INT);
  20. $oCmts = BxDolCmts::getObjectInstance($sSystem, $iObjectId, true);
  21. $sObjectTitle = bx_process_output(strip_tags($oCmts->getObjectTitle($iObjectId)));
  22. $sObjectUrl = $oCmts->getBaseUrl();
  23. $this->addMarkers(array(
  24. 'system' => $sSystem,
  25. 'object_id' => $iObjectId,
  26. 'object_title' => $sObjectTitle,
  27. 'object_url' => $sObjectUrl,
  28. 'comment_id' => $iCommentId
  29. ));
  30. }
  31. }
  32. /** @} */