Completed
Push — master ( 799b0c...788440 )
by Daniel
08:11
created

admin::remove()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4286
cc 1
eloc 3
nc 1
nop 5
crap 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 1
	public static function save(&$forum_data)
15
	{
16
		$forum_data += array(
17 1
			'parent_id'				=> 0,
18 1
			'forum_type'			=> FORUM_POST,
19 1
			'type_action'			=> '',
20 1
			'forum_status'			=> ITEM_UNLOCKED,
21 1
			'forum_parents'			=> '',
22 1
			'forum_name'			=> '',
23 1
			'forum_link'			=> '',
24 1
			'forum_link_track'		=> false,
25 1
			'forum_desc'			=> '',
26 1
			'forum_desc_uid'		=> '',
27 1
			'forum_desc_options'	=> 7,
28 1
			'forum_desc_bitfield'	=> '',
29 1
			'forum_rules'			=> '',
30 1
			'forum_rules_uid'		=> '',
31 1
			'forum_rules_options'	=> 7,
32 1
			'forum_rules_bitfield'	=> '',
33 1
			'forum_rules_link'		=> '',
34 1
			'forum_image'			=> '',
35 1
			'forum_style'			=> 0,
36 1
			'display_subforum_list'	=> false,
37 1
			'display_on_index'		=> false,
38 1
			'forum_topics_per_page'	=> 0,
39 1
			'enable_indexing'		=> true,
40 1
			'enable_icons'			=> false,
41 1
			'enable_prune'			=> false,
42 1
			'enable_post_review'	=> true,
43 1
			'enable_quick_reply'	=> false,
44 1
			'prune_days'			=> 7,
45 1
			'prune_viewed'			=> 7,
46 1
			'prune_freq'			=> 1,
47 1
			'prune_old_polls'		=> false,
48 1
			'prune_announce'		=> false,
49 1
			'prune_sticky'			=> false,
50 1
			'show_active'			=> false,
51 1
			'forum_password'		=> '',
52 1
			'forum_password_confirm'=> '',
53 1
			'forum_password_unset'	=> false,
54
		);
55
56 1
		$forum = new \acp_forums();
57 1
		$errors = $forum->update_forum_data($forum_data);
58
59 1
		return $errors;
60
	}
61
62 1
	public static function remove($forum_id, $action_posts = 'delete', $action_subforums = 'delete', $posts_to_id = 0, $subforums_to_id = 0)
63
	{
64 1
		$forum = new \acp_forums();
65 1
		$forum->delete_forum($forum_id, $action_posts, $action_subforums, $posts_to_id, $subforums_to_id);
66 1
	}
67
}
68