Passed
Push — develop ( b3eda6...9f2d35 )
by Daniel
03:59 queued 40s
created

style_switcher   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 35
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A get_template() 0 3 1
A display() 0 7 1
1
<?php
2
3
/**
4
 *
5
 * @package sitemaker
6
 * @copyright (c) 2013 Daniel A. (blitze)
7
 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
8
 *
9
 */
10
11
namespace blitze\sitemaker\blocks;
12
13
use blitze\sitemaker\services\blocks\driver\block;
14
15
/**
16
 * Style Switcher Block
17
 */
18
class style_switcher extends block
19
{
20
	/** @var \blitze\sitemaker\services\blocks\display */
21
	protected $blocks_display;
22
23
	/**
24
	 * Constructor
25
	 *
26
	 * @param \blitze\sitemaker\services\blocks\display $blocks_display
27 2
	 */
28
	public function __construct(\blitze\sitemaker\services\blocks\display $blocks_display)
29 2
	{
30 2
		$this->blocks_display = $blocks_display;
31
	}
32
33
	/**
34
	 * {@inheritdoc}
35 1
	 */
36
	public function display(array $settings, $edit_mode = false)
37 1
	{
38 1
		return array(
39 1
			'title'	=> 'STYLE_SWITCHER',
40 1
			'data'	=> array(
41
				'CURRENT_PAGE'		=> build_url(array('style')),
42
				'S_STYLE_OPTIONS'	=> style_select($this->blocks_display->get_style_id(), true),
43 1
			)
44 1
		);
45 1
	}
46
47
	/**
48
	 * {@inheritdoc}
49
	 */
50
	public function get_template()
51
	{
52
		return '@blitze_sitemaker/blocks/style_switcher.html';
53
	}
54
}
55