1
0

BxBaseCmtsPageView.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. $sSystem = bx_get('sys');
  15. $sSystem = $sSystem !== false ? $sSystem = bx_process_input($sSystem) : '';
  16. $iObjectId = bx_get('id');
  17. $iObjectId = $iObjectId !== false ? bx_process_input($iObjectId, BX_DATA_INT) : 0;
  18. $iCommentId = bx_get('cmt_id');
  19. $iCommentId = $iCommentId !== false ? bx_process_input($iCommentId, BX_DATA_INT) : 0;
  20. if(!$sSystem || !$iObjectId)
  21. return;
  22. $oCmts = BxDolCmts::getObjectInstance($sSystem, $iObjectId, true);
  23. if(!$oCmts)
  24. return;
  25. $sObjectTitle = bx_process_output(strip_tags($oCmts->getObjectTitle($iObjectId)));
  26. $sObjectUrl = $oCmts->getBaseUrl();
  27. $this->addMarkers(array(
  28. 'system' => $sSystem,
  29. 'object_id' => $iObjectId,
  30. 'object_title' => $sObjectTitle,
  31. 'object_url' => $sObjectUrl,
  32. 'comment_id' => $iCommentId
  33. ));
  34. }
  35. }
  36. /** @} */