Completed
Push — master ( c96b51...1deced )
by Daniel
08:48
created

options::get_all()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 12
ccs 7
cts 7
cp 1
rs 9.4286
cc 2
eloc 6
nc 2
nop 6
crap 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 1
		if (!function_exists('make_forum_select'))
23 1
		{
24
			include($phpbb_root_path . 'includes/functions_admin.' . $php_ext);
25
		}
26 1
	}
27
28
	/**
29
	 * @return array
30
	 */
31 1
	public function get_all($select_id = false, $ignore_id = false, $ignore_acl = true, $ignore_nonpost = false, $ignore_emptycat = true, $only_acl_post = false)
32
	{
33 1
		$forumlist = make_forum_select($select_id, $ignore_id, $ignore_acl, $ignore_nonpost, $ignore_emptycat, $only_acl_post, true);
34
35 1
		$forum_options = array('' => 'ALL');
36 1
		foreach ($forumlist as $row)
37
		{
38 1
			$forum_options[$row['forum_id']] = $row['padding'] . $row['forum_name'];
39 1
		}
40
41 1
		return $forum_options;
42
	}
43
}