/b2evolution/firebug/_skin.class.php

http://laibcomsthemes.googlecode.com/ · PHP · 94 lines · 50 code · 8 blank · 36 comment · 3 complexity · cae0823f22cf9c406d50cf54a8afb002 MD5 · raw file

  1. <?php
  2. /**
  3. * This file implements a class derived of the generic Skin class in order to provide custom code for
  4. * the skin in this folder.
  5. *
  6. * This file is part of the b2evolution project - {@link http://b2evolution.net/}
  7. *
  8. * @package skins
  9. * @subpackage firebug
  10. *
  11. * @version $Id: _skin.class.php,v 1.3 2009/05/24 21:14:38 fplanque Exp $
  12. */
  13. if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  14. /**
  15. * Specific code for this skin.
  16. *
  17. * ATTENTION: if you make a new skin you have to change the class name below accordingly
  18. */
  19. class firebug_Skin extends Skin
  20. {
  21. /**
  22. * Get default name for the skin.
  23. * Note: the admin can customize it.
  24. */
  25. function get_default_name()
  26. {
  27. return 'firebug';
  28. }
  29. /**
  30. * Get default type for the skin.
  31. */
  32. function get_default_type()
  33. {
  34. return 'normal';
  35. }
  36. /**
  37. * Get definitions for editable params
  38. *
  39. * @see Plugin::GetDefaultSettings()
  40. * @param local params like 'for_editing' => true
  41. */
  42. function get_param_definitions( $params )
  43. {
  44. $r = array_merge( array(
  45. 'html5_support' => array(
  46. 'label' => T_('HTML5'),
  47. 'defaultvalue' => '1',
  48. 'note' => 'activate HTML5 support across all browsers (as of 08/08/2009)',
  49. 'type' => 'checkbox'
  50. ),
  51. 'date_format' => array(
  52. 'label' => T_('Date Format'),
  53. 'defaultvalue' => '',
  54. 'note' => 'Date Format to the date field (leave empty to use default date format)',
  55. 'type' => 'text'
  56. ),
  57. ), parent::get_param_definitions( $params ) );
  58. return $r;
  59. }
  60. /**
  61. * Get ready for displaying the skin.
  62. *
  63. * This may register some CSS or JS...
  64. */
  65. function display_init()
  66. {
  67. // call parent:
  68. parent::display_init();
  69. // Add custom CSS:
  70. $custom_css = '';
  71. $html5support = '';
  72. if( $this->get_setting('html5_support') == '1' )
  73. { // HTML5 Support
  74. $html5support .= '
  75. <!--[if IE]>
  76. <script src="rsc/js/html5.js"></script>
  77. <![endif]-->
  78. <link rel="stylesheet" href="rsc/css/html5.css" type="text/css" />
  79. ';
  80. }
  81. $custom_css = ''.$html5support.'
  82. ';
  83. add_headline( $custom_css );
  84. }
  85. }
  86. ?>