1
0

BxBaseConfig.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?php defined('BX_DOL') or defined('BX_DOL_INSTALL') or die('hack attempt');
  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 Dolphin Core
  7. * @{
  8. */
  9. class BxBaseConfig extends BxDol implements iBxDolSingleton
  10. {
  11. protected $_aConfig = array (
  12. 'bAllowUnicodeInPreg' => false, ///< allow unicode in regular expressions
  13. 'aLessConfig' => array (
  14. 'bx-page-width' => '1000px',
  15. 'bx-margin' => '20px',
  16. 'bx-margin-sec' => '10px',
  17. 'bx-margin-thd' => '5px',
  18. 'bx-padding' => '20px',
  19. 'bx-padding-sec' => '10px',
  20. 'bx-padding-thd' => '5px',
  21. 'bx-font-family' => '"Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif',
  22. 'bx-size-avatar' => '96px',
  23. 'bx-size-thumb' => '48px',
  24. 'bx-size-icon' => '32px',
  25. 'bx-size-gallery-img-width' => '300px',
  26. 'bx-size-gallery-img-height' => '200px',
  27. 'bx-size-gallery-unit-width' => '300px',
  28. 'bx-size-gallery-unit-height' => '320px',
  29. 'bx-color-page' => '#fff',
  30. 'bx-color-block' => '#fff',
  31. 'bx-color-box' => '#f2f2f2',
  32. 'bx-color-sec' => '#f2f2f2',
  33. 'bx-color-hl' => 'rgba(196, 248, 156, 0.2)',
  34. 'bx-color-active' => 'rgba(196, 248, 156, 0.4)',
  35. 'bx-border-width' => '1px',
  36. 'bx-border-type' => 'solid',
  37. 'bx-border-color' => '#d0d0d0',
  38. 'bx-font-size-default' => '18px',
  39. 'bx-font-size-small' => '14px',
  40. 'bx-font-size-middle' => '16px',
  41. 'bx-font-size-large' => '22px',
  42. 'bx-font-size-h1' => '28px',
  43. 'bx-font-size-h2' => '24px',
  44. 'bx-font-size-h3' => '18px',
  45. 'bx-font-color-default' => '#333',
  46. 'bx-font-color-grayed' => '#999',
  47. 'bx-font-color-contrasted' => '#fff',
  48. 'bx-round-corners-radius' => '3px',
  49. ),
  50. );
  51. function __construct()
  52. {
  53. parent::__construct();
  54. if (class_exists('BxDolDb') && BxDolDb::getInstance())
  55. $this->_aConfig['aLessConfig']['bx-page-width'] = getParam('main_div_width');
  56. }
  57. public static function getInstance()
  58. {
  59. if(!isset($GLOBALS['bxDolClasses'][__CLASS__]))
  60. $GLOBALS['bxDolClasses'][__CLASS__] = new BxTemplConfig();
  61. return $GLOBALS['bxDolClasses'][__CLASS__];
  62. }
  63. public function __get($sName)
  64. {
  65. if (array_key_exists($sName, $this->_aConfig))
  66. return $this->_aConfig[$sName];
  67. trigger_error('Undefined property "' . $sName . '" in ' . get_class($this), E_USER_ERROR);
  68. return null;
  69. }
  70. public function __isset($sName)
  71. {
  72. return isset($this->_aConfig[$sName]);
  73. }
  74. }
  75. /** @} */