PageRenderTime 747ms CodeModel.GetById 101ms app.highlight 3ms RepoModel.GetById 170ms app.codeStats 1ms

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