PageRenderTime 52ms CodeModel.GetById 30ms app.highlight 3ms RepoModel.GetById 18ms app.codeStats 0ms

/b2evolution/emerald/_skin.class.php

http://laibcomsthemes.googlecode.com/
PHP | 87 lines | 44 code | 7 blank | 36 comment | 3 complexity | 28af55b73bbdf4e125c34ddb9915b045 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 emerald
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 emerald_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 'emerald';
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		), parent::get_param_definitions( $params ) );
55		return $r;
56	}
57
58	/**
59	* Get ready for displaying the skin.
60	*
61	* This may register some CSS or JS...
62	*/
63	function display_init()
64	{
65		// call parent:
66		parent::display_init();
67
68		// Add custom CSS:
69		$custom_css	=	'';
70		$html5support	=	'';
71
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
82		$custom_css = ''.$html5support.'
83		';
84		add_headline( $custom_css );
85	}
86}
87?>