grid.php 1.2 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 grid Grid
  12. */
  13. /**
  14. * Please refer to the following file for custom class and SQL dump data for this example:
  15. * @see BxGridMy.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('BxDolLanguages');
  22. bx_import('BxDolTemplate');
  23. $oTemplate = BxDolTemplate::getInstance();
  24. $oTemplate->setPageNameIndex (BX_PAGE_DEFAULT);
  25. $oTemplate->setPageHeader ("Sample grid");
  26. $oTemplate->setPageContent ('page_main_code', PageCompMainCode());
  27. $oTemplate->getPageCode();
  28. /**
  29. * page code function
  30. */
  31. function PageCompMainCode() {
  32. ob_start();
  33. bx_import('BxDolGrid');
  34. $oGrid = BxDolGrid::getObjectInstance('sample'); // it automatically creates instance of default or custom class by object name
  35. if ($oGrid)
  36. echo $oGrid->getCode(); // print grid object
  37. return DesignBoxContent("Sample grid", ob_get_clean(), BX_DB_PADDING_DEF);
  38. }
  39. /** @} */