Completed
Push — develop ( a3ab64...524863 )
by Daniel
13:34
created

icon_picker   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 0 Features 1
Metric Value
wmc 2
c 4
b 0
f 1
lcom 1
cbo 1
dl 0
loc 53
rs 10
ccs 17
cts 17
cp 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
B picker() 0 24 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\services;
11
12
/**
13
 * Sitemaker icons
14
 */
15
class icon_picker
16
{
17
	/** @var \phpbb\language\language */
18
	protected $translator;
19
20
	/** @var \blitze\sitemaker\services\util */
21
	protected $util;
22
23
	/** @var \blitze\sitemaker\services\template */
24
	protected $ptemplate;
25
26
	/**
27
	 * Constructor
28
	 *
29
	 * @param \phpbb\language\language     			$translator     Language object
30
	 * @param \blitze\sitemaker\services\util		$util			Sitemaker utility object
31
	 * @param \blitze\sitemaker\services\ptemplate	$ptemplate		Sitemaker Template object
32
	 */
33 1
	public function __construct(\phpbb\language\language $translator, \blitze\sitemaker\services\util $util, \blitze\sitemaker\services\template $ptemplate)
34
	{
35 1
		$this->translator = $translator;
36 1
		$this->util = $util;
37 1
		$this->ptemplate = $ptemplate;
38 1
	}
39
40
	/**
41
	 * Load icon picker
42
	 */
43 1
	public function picker()
44
	{
45 1
		$this->translator->add_lang('icons', 'blitze/sitemaker');
46
47 1
		$this->util->add_assets(array(
48
			'js'	=> array(
49 1
				'@blitze_sitemaker/vendor/jquery-ui/jquery-ui.min.js',
50 1
				'@blitze_sitemaker/assets/icons/picker.min.js',
51
			),
52 1
			'css'	=> array(
53 1
				'@blitze_sitemaker/vendor/jquery-ui/themes/smoothness/jquery-ui.min.css',
54
				'@blitze_sitemaker/vendor/fontawesome/css/font-awesome.min.css',
55 1
				'@blitze_sitemaker/assets/icons/picker.min.css',
56
			)
57 1
		));
58
59 1
		$this->ptemplate->set_style(array('ext/blitze/sitemaker/styles', 'styles'));
60
61 1
		$this->ptemplate->set_filenames(array(
62
			'icons'	=> 'icon_picker.html'
63 1
		));
64
65
		return $this->ptemplate->assign_display('icons');
66
	}
67
}
68