-
Notifications
You must be signed in to change notification settings - Fork 4
/
tiki-admin_contribution.php
68 lines (65 loc) · 3.28 KB
/
tiki-admin_contribution.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
// (c) Copyright 2002-2012 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id: tiki-admin_contribution.php 39467 2012-01-12 19:47:28Z changi67 $
require_once ('tiki-setup.php');
$access->check_feature('feature_contribution');
include_once ('lib/contribution/contributionlib.php');
$access->check_permission(array('tiki_p_admin_contribution'));
if (isset($_REQUEST['setting'])) {
check_ticket('admin_contribution');
if (isset($_REQUEST['feature_contribution_mandatory']) && $_REQUEST['feature_contribution_mandatory'] == "on") {
$tikilib->set_preference('feature_contribution_mandatory', 'y');
} else {
$tikilib->set_preference('feature_contribution_mandatory', 'n');
}
if (isset($_REQUEST['feature_contribution_mandatory_forum']) && $_REQUEST['feature_contribution_mandatory_forum'] == "on") {
$tikilib->set_preference('feature_contribution_mandatory_forum', 'y');
} else {
$tikilib->set_preference('feature_contribution_mandatory_forum', 'n');
}
if (isset($_REQUEST['feature_contribution_mandatory_comment']) && $_REQUEST['feature_contribution_mandatory_comment'] == "on") {
$tikilib->set_preference('feature_contribution_mandatory_comment', 'y');
} else {
$tikilib->set_preference('feature_contribution_mandatory_comment', 'n');
}
if (isset($_REQUEST['feature_contribution_mandatory_blog']) && $_REQUEST['feature_contribution_mandatory_blog'] == "on") {
$tikilib->set_preference('feature_contribution_mandatory_blog', 'y');
} else {
$tikilib->set_preference('feature_contribution_mandatory_blog', 'n');
}
if (isset($_REQUEST['feature_contribution_display_in_comment']) && $_REQUEST['feature_contribution_display_in_comment'] == "on") {
$tikilib->set_preference('feature_contribution_display_in_comment', 'y');
} else {
$tikilib->set_preference('feature_contribution_display_in_comment', 'n');
}
if (isset($_REQUEST['feature_contributor_wiki']) && $_REQUEST['feature_contributor_wiki'] == "on") {
$tikilib->set_preference('feature_contributor_wiki', 'y');
} else {
$tikilib->set_preference('feature_contributor_wiki', 'n');
}
}
if (isset($_REQUEST['add']) && isset($_REQUEST['name'])) {
check_ticket('admin_contribution');
$contributionlib->add_contribution($_REQUEST['name'], isset($_REQUEST['description']) ? $_REQUEST['description'] : '');
}
if (isset($_REQUEST['replace']) && isset($_REQUEST['name']) && isset($_REQUEST['contributionId'])) {
check_ticket('admin_contribution');
$contributionlib->replace_contribution($_REQUEST['contributionId'], $_REQUEST['name'], isset($_REQUEST['description']) ? $_REQUEST['description'] : '');
unset($_REQUEST['contributionId']);
}
if (isset($_REQUEST['remove'])) {
check_ticket('admin_contribution');
$contributionlib->remove_contribution($_REQUEST['remove']);
}
if (isset($_REQUEST['contributionId'])) {
$contribution = $contributionlib->get_contribution($_REQUEST['contributionId']);
$smarty->assign('contribution', $contribution);
}
$contributions = $contributionlib->list_contributions();
$smarty->assign_by_ref('contributions', $contributions['data']);
ask_ticket('admin_contribution');
$smarty->assign('mid', 'tiki-admin_contribution.tpl');
$smarty->display("tiki.tpl");