1 | <?php |
---|
2 | /** |
---|
3 | * @copyright 2005-2008 OpenPNE Project |
---|
4 | * @license http://www.php.net/license/3_01.txt PHP License 3.01 |
---|
5 | */ |
---|
6 | |
---|
7 | class pc_page_c_edit extends OpenPNE_Action |
---|
8 | { |
---|
9 | function execute($requests) |
---|
10 | { |
---|
11 | $u = $GLOBALS['AUTH']->uid(); |
---|
12 | |
---|
13 | // --- リクエスト変数 |
---|
14 | $target_c_commu_id = $requests['target_c_commu_id']; |
---|
15 | $name = $requests['name']; |
---|
16 | $c_commu_category_id = $requests['c_commu_category_id']; |
---|
17 | $info = $requests['info']; |
---|
18 | $is_admit = $requests['is_admit']; |
---|
19 | $is_open = $requests['is_open']; |
---|
20 | $is_topic = $requests['is_topic']; |
---|
21 | $is_comment = $requests['is_comment']; |
---|
22 | $err_msg = $requests['err_msg']; |
---|
23 | // ---------- |
---|
24 | |
---|
25 | //--- 権限チェック |
---|
26 | //コミュニティ管理者 |
---|
27 | if (!db_commu_is_c_commu_admin($target_c_commu_id, $u)) { |
---|
28 | handle_kengen_error(); |
---|
29 | } |
---|
30 | //--- |
---|
31 | |
---|
32 | |
---|
33 | $this->set('inc_navi', fetch_inc_navi('c', $target_c_commu_id)); |
---|
34 | //コミュニティデータ取得 |
---|
35 | $c_commu = array(); |
---|
36 | $c_commu = db_commu_c_commu4c_commu_id($target_c_commu_id); |
---|
37 | $c_commu_category_id_now = $c_commu['c_commu_category_id']; |
---|
38 | if ($name) { |
---|
39 | $c_commu['name'] = $name; |
---|
40 | } |
---|
41 | if ($c_commu_category_id) { |
---|
42 | $c_commu['c_commu_category_id'] = $c_commu_category_id; |
---|
43 | } |
---|
44 | if ($info) { |
---|
45 | $c_commu['info'] = $info; |
---|
46 | } |
---|
47 | if ($public_flag) { |
---|
48 | $c_commu['public_flag'] = $public_flag; |
---|
49 | } |
---|
50 | |
---|
51 | $this->set('target_c_commu_id', $target_c_commu_id); |
---|
52 | |
---|
53 | if ($err_msg) { |
---|
54 | $c_commu['name'] = $name; |
---|
55 | $c_commu['info'] = $info; |
---|
56 | } |
---|
57 | |
---|
58 | $this->set('c_commu', $c_commu); |
---|
59 | |
---|
60 | // カテゴリリスト |
---|
61 | $c_commu_category_list = array(); |
---|
62 | $c_commu_category_list = db_commu_c_commu_category4is_create_commu(); |
---|
63 | |
---|
64 | // 現在設定されているカテゴリが作成不可ならば、別途取得 |
---|
65 | if (!db_commu_c_commu_category_is_create_commu($c_commu_category_id_now)) { |
---|
66 | array_push($c_commu_category_list, db_commu_get_c_commu_category4id($c_commu_category_id_now)); |
---|
67 | asort($c_commu_category_list); |
---|
68 | } |
---|
69 | $this->set('c_commu_category_list', $c_commu_category_list); |
---|
70 | |
---|
71 | $this->set('is_topic', db_commu_is_topic4c_commu_id($target_c_commu_id)); |
---|
72 | $this->set('err_msg', $err_msg); |
---|
73 | |
---|
74 | $this->set('is_unused_join_commu', util_is_unused_mail('m_pc_join_commu')); |
---|
75 | |
---|
76 | return 'success'; |
---|
77 | } |
---|
78 | } |
---|
79 | ?> |
---|