BxBaseConfig.php 3.0 KB

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