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

style_switcher::get_template()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 0
cp 0
crap 2
rs 10
c 0
b 0
f 0
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