palette.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 palette Palette
  12. */
  13. /**
  14. * This sample shows default Dolphin palette colors.
  15. * Palette colors are defined as css classes.
  16. */
  17. require_once('./../inc/header.inc.php');
  18. require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
  19. bx_import('BxDolLanguages');
  20. bx_import('BxDolTemplate');
  21. $oTemplate = BxDolTemplate::getInstance();
  22. $oTemplate->setPageNameIndex (BX_PAGE_DEFAULT);
  23. $oTemplate->setPageHeader ("Palette");
  24. $oTemplate->setPageContent ('page_main_code', PageCompMainCode());
  25. $oTemplate->getPageCode();
  26. /**
  27. * page code function
  28. */
  29. function PageCompMainCode() {
  30. ob_start();
  31. $aColors = array ('red1', 'red1-dark', 'red2', 'red2-dark', 'red3', 'red3-dark', 'green1', 'green1-dark', 'green2', 'green2-dark', 'green3', 'green3-dark', 'blue1', 'blue1-dark', 'blue2', 'blue2-dark', 'blue3', 'blue3-dark', 'gray', 'gray-dark');
  32. $aDefBg = array ('bx-def-color-bg-page', 'bx-def-color-bg-block', 'bx-def-color-bg-box', 'bx-def-color-bg-sec', 'bx-def-color-bg-active', 'bx-def-color-bg-hl', 'bx-def-color-bg-hl-hover');
  33. $sStyle = 'width:300px; height:100px; line-height:100px; display:inline-block; font-size:20px; font-weight:bold; text-align:center;';
  34. foreach ($aColors as $sColor) {
  35. $sClass = 'bx-def-round-corners bx-def-margin-right bx-def-margin-bottom';
  36. $sClassFt = 'col-'.$sColor;
  37. $sClassBg = 'bg-col-'.$sColor;
  38. ?>
  39. <div>
  40. <div class="<?php echo $sClass;?> <?php echo $sClassBg;?>" style="<?php echo $sStyle;?> color:#fff;">.<?php echo $sClassBg;?></div>
  41. <div class="<?php echo $sClass;?> <?php echo $sClassFt;?>" style="<?php echo $sStyle;?> border:1px solid #ccc;">.<?php echo $sClassFt;?></div>
  42. </div>
  43. <?php
  44. }
  45. ?>
  46. <hr class="bx-def-hr bx-def-margin-top bx-def-margin-bottom" />
  47. <?php
  48. foreach ($aDefBg as $sClassBg) {
  49. $sClass = 'bx-def-round-corners bx-def-margin-right bx-def-margin-bottom';
  50. ?>
  51. <div>
  52. <div class="<?php echo $sClass;?> <?php echo $sClassBg;?> bx-def-border" style="<?php echo $sStyle;?>">.<?php echo $sClassBg;?></div>
  53. </div>
  54. <?php
  55. }
  56. $s = ob_get_clean();
  57. return DesignBoxContent("Palette", $s, BX_DB_PADDING_DEF);
  58. }
  59. /** @} */