comments.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  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 Samples
  7. * @{
  8. */
  9. /**
  10. * @page samples
  11. * @section comments Comments
  12. */
  13. /**
  14. * Please refer to the following file for custom class and SQL dump data for this example:
  15. * @see BxCmtsMy.php
  16. */
  17. $aPathInfo = pathinfo(__FILE__);
  18. require_once ($aPathInfo['dirname'] . '/../inc/header.inc.php');
  19. require_once(BX_DIRECTORY_PATH_INC . "params.inc.php");
  20. require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
  21. bx_import('BxDolAcl');
  22. bx_import('BxDolLanguages');
  23. bx_import('BxTemplFunctions');
  24. $oTemplate = BxDolTemplate::getInstance();
  25. $oTemplate->setPageNameIndex (BX_PAGE_DEFAULT);
  26. $oTemplate->setPageHeader ('Comments');
  27. $oTemplate->setPageContent ('page_main_code', PageCompMainCode());
  28. $oTemplate->getPageCode();
  29. /**
  30. * page code function
  31. */
  32. function PageCompMainCode() {
  33. $iObjectId = 1;
  34. bx_import('BxDolCmts');
  35. $oCmts = BxDolCmts::getObjectInstance('sample', $iObjectId);
  36. if(!$oCmts->isEnabled())
  37. return '';
  38. return $oCmts->getCommentsBlock();
  39. }
  40. /** @} */