Completed
Push — develop ( 1f2a5d...e6d06f )
by Daniel
21:42 queued 08:26
created

admin::save()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 48
Code Lines 43

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 42
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 48
ccs 42
cts 43
cp 0.9767
rs 9.125
cc 1
eloc 43
nc 1
nop 1
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 1
			'hidden_forum'			=> 1,
55
		);
56
57 1
		$forum = new \acp_forums();
58 1
		$errors = $forum->update_forum_data($forum_data);
59
60 1
		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