Completed
Push — master ( b8b30a...42cc55 )
by Daniel
10:21
created

style_switcher::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 *
4
 * @package sitemaker
5
 * @copyright (c) 2013 Daniel A. (blitze)
6
 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
7
 *
8
 */
9
10
namespace blitze\sitemaker\blocks;
11
12
/**
13
 * Style Switcher Block
14
 */
15
class style_switcher extends \blitze\sitemaker\services\blocks\driver\block
16
{
17
	/** @var \blitze\sitemaker\services\blocks\display */
18
	protected $blocks_display;
19
20
	/**
21
	 * Constructor
22
	 *
23
	 * @param \blitze\sitemaker\services\blocks\display $blocks_display
24
	 */
25 2
	public function __construct(\blitze\sitemaker\services\blocks\display $blocks_display)
26
	{
27 2
		$this->blocks_display = $blocks_display;
28 2
	}
29
30
	/**
31
	 * {@inheritdoc}
32
	 */
33 1
	public function display(array $settings, $edit_mode = false)
34
	{
35 1
		$this->ptemplate->assign_vars(array(
36 1
			'CURRENT_PAGE'		=> build_url(array('style')),
37 1
			'S_STYLE_OPTIONS'	=> style_select($this->blocks_display->get_style_id(), true),
38 1
		));
39
40
		return array(
41 1
			'title'		=> 'STYLE_SWITCHER',
42 1
			'content'	=> $this->ptemplate->render_view('blitze/sitemaker', 'blocks/style_switcher.html', 'style_switcher_block')
43 1
		);
44
	}
45
}
46