BxBaseConfig.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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' => '998px',
  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-color-page' => '#fff',
  27. 'bx-color-block' => '#fff',
  28. 'bx-color-box' => '#fff',
  29. 'bx-color-sec' => '#f2f2f2',
  30. 'bx-color-hl' => 'rgba(196, 248, 156, 0.2)',
  31. 'bx-color-active' => 'rgba(196, 248, 156, 0.4)',
  32. 'bx-border-width' => '1px',
  33. 'bx-border-type' => 'solid',
  34. 'bx-border-color' => '#d0d0d0',
  35. 'bx-font-size-default' => '16px',
  36. 'bx-font-size-small' => '12px',
  37. 'bx-font-size-middle' => '14px',
  38. 'bx-font-size-large' => '18px',
  39. 'bx-font-size-h1' => '24px',
  40. 'bx-font-size-h2' => '20px',
  41. 'bx-font-size-h3' => '16px',
  42. 'bx-font-color-default' => '#333',
  43. 'bx-font-color-grayed' => '#999',
  44. 'bx-font-color-contrasted' => '#fff',
  45. 'bx-round-corners-radius' => '3px',
  46. ),
  47. );
  48. function __construct()
  49. {
  50. parent::__construct();
  51. if (function_exists('getParam'))
  52. $this->_aConfig['aLessConfig']['bx-page-width'] = getParam('main_div_width');
  53. }
  54. public static function getInstance()
  55. {
  56. if(!isset($GLOBALS['bxDolClasses'][__CLASS__]))
  57. $GLOBALS['bxDolClasses'][__CLASS__] = new BxTemplConfig();
  58. return $GLOBALS['bxDolClasses'][__CLASS__];
  59. }
  60. public function __get($sName)
  61. {
  62. if (array_key_exists($sName, $this->_aConfig))
  63. return $this->_aConfig[$sName];
  64. trigger_error('Undefined property "' . $aName . '" in ' . get_class($this), E_USER_ERROR);
  65. return null;
  66. }
  67. public function __isset($sName)
  68. {
  69. return isset($this->_aConfig[$sName]);
  70. }
  71. }
  72. /** @} */