Completed
Push — develop ( 755a17...843010 )
by Daniel
07:33
created

tiles   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 1
dl 0
loc 64
ccs 0
cts 25
cp 0
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A get_name() 0 4 1
A get_langname() 0 4 1
A get_index_template() 0 4 1
A render_index() 0 9 2
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\content\services\views\driver;
11
12
class tiles extends base_view
13
{
14
	/** @var \phpbb\request\request_interface */
15
	protected $request;
16
17
	/**
18
	 * Constructor
19
	 *
20
	 * @param \phpbb\event\dispatcher_interface			$phpbb_dispatcher	Event dispatcher object
21
	 * @param \phpbb\language\language					$language			Language Object
22
	 * @param \phpbb\pagination							$pagination			Pagination object
23
	 * @param \phpbb\template\template					$template			Template object
24
	 * @param \blitze\content\services\fields			$fields				Content fields object
25
	 * @param \blitze\sitemaker\services\forum\data		$forum				Forum Data object
26
	 * @param \blitze\content\services\helper			$helper				Content helper object
27
	 * @param \blitze\content\services\quickmod			$quickmod			Quick moderator tools
28
	 * @param string									$phpbb_root_path	Path to the phpbb includes directory.
29
	 * @param string									$php_ext			php file extension
30
	 * @param \phpbb\request\request_interface			$request			Request object
31
	*/
32
	public function __construct(\phpbb\event\dispatcher_interface $phpbb_dispatcher, \phpbb\language\language $language, \phpbb\pagination $pagination, \phpbb\template\template $template, \blitze\content\services\fields $fields, \blitze\sitemaker\services\forum\data $forum, \blitze\content\services\helper $helper, \blitze\content\services\quickmod $quickmod, $phpbb_root_path, $php_ext, \phpbb\request\request_interface $request)
33
	{
34
		parent::__construct($phpbb_dispatcher, $language, $pagination, $template, $fields, $forum, $helper, $quickmod, $phpbb_root_path, $php_ext);
35
36
		$this->request = $request;
37
	}
38
39
	/**
40
	 * @inheritdoc
41
	 */
42
	public function get_name()
43
	{
44
		return 'tiles';
45
	}
46
47
	/**
48
	 * @inheritdoc
49
	 */
50
	public function get_langname()
51
	{
52
		return 'CONTENT_DISPLAY_TILES';
53
	}
54
55
	/**
56
	 * @inheritdoc
57
	 */
58
	public function get_index_template()
59
	{
60
		return 'views/tiles.html';
61
	}
62
63
	/**
64
	 * @inheritdoc
65
	 */
66
	public function render_index(\blitze\content\model\entity\type $entity, $page, $filter_type, $filter_value)
67
	{
68
		parent::render_index($entity, $page, $filter_type, $filter_value);
69
70
		if ($this->request->is_ajax())
71
		{
72
			$this->template->assign_var('S_HIDE_HEADERS', true);
73
		}
74
	}
75
}
76