grid.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 . "design.inc.php");
  20. bx_import('BxDolLanguages');
  21. bx_import('BxDolTemplate');
  22. $oTemplate = BxDolTemplate::getInstance();
  23. $oTemplate->setPageNameIndex (BX_PAGE_DEFAULT);
  24. $oTemplate->setPageHeader ("Sample grid");
  25. $oTemplate->setPageContent ('page_main_code', PageCompMainCode());
  26. $oTemplate->getPageCode();
  27. /**
  28. * page code function
  29. */
  30. function PageCompMainCode() {
  31. ob_start();
  32. bx_import('BxDolGrid');
  33. $oGrid = BxDolGrid::getObjectInstance('sample'); // it automatically creates instance of default or custom class by object name
  34. if ($oGrid)
  35. echo $oGrid->getCode(); // print grid object
  36. return DesignBoxContent("Sample grid", ob_get_clean(), BX_DB_PADDING_DEF);
  37. }
  38. /** @} */