Completed
Push — master ( 9866a1...02e5e5 )
by Daniel
08:18
created

admin   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 8.51%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 0
cbo 0
dl 0
loc 57
ccs 4
cts 47
cp 0.0851
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A save() 0 48 1
A remove() 0 5 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\forum;
11
12
class admin
13
{
14
	public static function save(&$forum_data)
15
	{
16
		$forum_data += array(
17
			'parent_id'				=> 0,
18
			'forum_type'			=> FORUM_POST,
19
			'type_action'			=> '',
20
			'forum_status'			=> ITEM_UNLOCKED,
21
			'forum_parents'			=> '',
22
			'forum_name'			=> '',
23
			'forum_link'			=> '',
24
			'forum_link_track'		=> false,
25
			'forum_desc'			=> '',
26
			'forum_desc_uid'		=> '',
27
			'forum_desc_options'	=> 7,
28
			'forum_desc_bitfield'	=> '',
29
			'forum_rules'			=> '',
30
			'forum_rules_uid'		=> '',
31
			'forum_rules_options'	=> 7,
32
			'forum_rules_bitfield'	=> '',
33
			'forum_rules_link'		=> '',
34
			'forum_image'			=> '',
35
			'forum_style'			=> 0,
36
			'display_subforum_list'	=> false,
37
			'display_on_index'		=> false,
38
			'forum_topics_per_page'	=> 0,
39
			'enable_indexing'		=> true,
40
			'enable_icons'			=> false,
41
			'enable_prune'			=> false,
42
			'enable_post_review'	=> true,
43
			'enable_quick_reply'	=> false,
44
			'prune_days'			=> 7,
45
			'prune_viewed'			=> 7,
46
			'prune_freq'			=> 1,
47
			'prune_old_polls'		=> false,
48
			'prune_announce'		=> false,
49
			'prune_sticky'			=> false,
50
			'show_active'			=> false,
51
			'forum_password'		=> '',
52
			'forum_password_confirm'=> '',
53
			'forum_password_unset'	=> false,
54
			'hidden_forum'			=> 1,
55
		);
56
57
		$forum = new \acp_forums();
58
		$errors = $forum->update_forum_data($forum_data);
59
60
		return $errors;
61
	}
62
63 1
	public static function remove($forum_id, $action_posts = 'delete', $action_subforums = 'delete', $posts_to_id = 0, $subforums_to_id = 0)
64
	{
65 1
		$forum = new \acp_forums();
66 1
		$forum->delete_forum($forum_id, $action_posts, $action_subforums, $posts_to_id, $subforums_to_id);
67 1
	}
68
}
69