/b2evolution/nonzero/_skin.class.php
http://laibcomsthemes.googlecode.com/ · PHP · 139 lines · 94 code · 9 blank · 36 comment · 7 complexity · 07c346da26f6bfe2515cfa1c3416540d MD5 · raw file
- <?php
- /**
- * This file implements a class derived of the generic Skin class in order to provide custom code for
- * the skin in this folder.
- *
- * This file is part of the b2evolution project - {@link http://b2evolution.net/}
- *
- * @package skins
- * @subpackage nonzero
- *
- * @version $Id: _skin.class.php,v 1.3 2009/05/24 21:14:38 fplanque Exp $
- */
- if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
-
- /**
- * Specific code for this skin.
- *
- * ATTENTION: if you make a new skin you have to change the class name below accordingly
- */
- class nonzero_Skin extends Skin
- {
- /**
- * Get default name for the skin.
- * Note: the admin can customize it.
- */
- function get_default_name()
- {
- return 'nonzero';
- }
-
- /**
- * Get default type for the skin.
- */
- function get_default_type()
- {
- return 'normal';
- }
-
- /**
- * Get definitions for editable params
- *
- * @see Plugin::GetDefaultSettings()
- * @param local params like 'for_editing' => true
- */
- function get_param_definitions( $params )
- {
- $r = array_merge( array(
- 'skin_color' => array(
- 'label' => T_('Skin Color'),
- 'defaultvalue' => 'red',
- 'note' => '',
- 'type' => 'select',
- 'options' => array(
- 'blue' => 'blue',
- 'brown' => 'brown',
- 'green' => 'green',
- 'magenta' => 'magenta',
- 'red' => 'red',
- ),
- ),
- 'width_style' => array(
- 'label' => T_('Width Style'),
- 'defaultvalue' => 'fluid',
- 'note' => '',
- 'type' => 'select',
- 'options' => array(
- 'fixed' => 'fixed',
- 'fluid' => 'fluid',
- ),
- ),
- 'column_count' => array(
- 'label' => T_('No. of Columns'),
- 'defaultvalue' => '3',
- 'note' => '',
- 'type' => 'select',
- 'options' => array(
- '3' => '3',
- '2' => '2',
- '1' => '1',
- ),
- ),
- 'html5_support' => array(
- 'label' => T_('HTML5'),
- 'defaultvalue' => '1',
- 'note' => 'activate HTML5 support across all browsers (as of 08/08/2009)',
- 'type' => 'checkbox'
- ),
- ), parent::get_param_definitions( $params ) );
- return $r;
- }
-
- /**
- * Get ready for displaying the skin.
- *
- * This may register some CSS or JS...
- */
- function display_init()
- {
- // call parent:
- parent::display_init();
-
- // Add custom CSS:
- $custom_css = '';
- $skincolor = $this->get_setting('skin_color');
- $widthstyle = '';
- $html5support = '';
-
- if( $this->get_setting('width_style') == 'fixed' )
- { // Fixed Layout
- $widthstyle .= 'width: 950px !important; /* fixed */';
- }
-
- if( $this->get_setting('width_style') == 'fluid' )
- { // Fluid Layout
- $widthstyle .= 'width: 90% !important; /* fluid */';
- }
-
- if( $this->get_setting('html5_support') == '1' )
- { // HTML5 Support
- $html5support .= '
- <!--[if IE]>
- <script src="rsc/js/html5.js"></script>
- <![endif]-->
- <link rel="stylesheet" href="rsc/css/html5.css" type="text/css" />
- ';
- }
-
- $custom_css = ''.$html5support.'
- <link rel="stylesheet" href="rsc/css/'.$skincolor.'.css" type="text/css" title="'.$skincolor.'" />
- <style type="text/css">
- div.widthstyle {
- '.$widthstyle.'
- }
- </style>
- ';
- add_headline( $custom_css );
- }
- }
- ?>