Completed
Push — develop ( 273208...5b590b )
by Daniel
09:31
created

options   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 90%

Importance

Changes 4
Bugs 1 Features 1
Metric Value
wmc 4
c 4
b 1
f 1
lcom 0
cbo 0
dl 0
loc 40
ccs 9
cts 10
cp 0.9
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 2
A get_all() 0 12 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\sitemaker\services\forum;
11
12
class options
13
{
14
	/**
15
	 * Constructor
16
	 *
17
	 * @param string		$phpbb_root_path	Path to the phpbb includes directory.
18
	 * @param string		$php_ext			php file extension
19
	 */
20 1
	public function __construct($phpbb_root_path, $php_ext)
21
	{
22
		// @codeCoverageIgnoreStart
23
		if (!function_exists('make_forum_select'))
24
		{
25
			include($phpbb_root_path . 'includes/functions_admin.' . $php_ext); // @codeCoverageIgnore
26
		}
27
		// @codeCoverageIgnoreEnd
28 1
	}
29
30
	/**
31
	 * @param bool $select_id
32
	 * @param bool $ignore_id
33
	 * @param bool $ignore_acl
34
	 * @param bool $ignore_nonpost
35
	 * @param bool $ignore_emptycat
36
	 * @param bool $only_acl_post
37
	 * @return array
38
	 */
39 1
	public function get_all($select_id = false, $ignore_id = false, $ignore_acl = true, $ignore_nonpost = false, $ignore_emptycat = true, $only_acl_post = false)
40
	{
41 1
		$forumlist = make_forum_select($select_id, $ignore_id, $ignore_acl, $ignore_nonpost, $ignore_emptycat, $only_acl_post, true);
42
43 1
		$forum_options = array('' => 'ALL');
44 1
		foreach ($forumlist as $row)
45
		{
46 1
			$forum_options[$row['forum_id']] = $row['padding'] . $row['forum_name'];
47 1
		}
48
49 1
		return $forum_options;
50
	}
51
}
52