BxBaseConfig.php 2.7 KB

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