-
Notifications
You must be signed in to change notification settings - Fork 672
/
edit.php
60 lines (49 loc) · 1.23 KB
/
edit.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
<?php
/**
* Group edit form
*
* @uses $vars['entity'] The group being edited (empty during creation)
*/
/* @var ElggGroup $entity */
$entity = elgg_extract('entity', $vars, false);
// context needed for input/access view
elgg_push_context('group-edit');
// build group edit tabs
$tabs = [];
// build the group profile fields
$tabs[] = [
'name' => 'profile',
'text' => elgg_echo('groups:edit:profile'),
'content' => elgg_view('groups/edit/profile', $vars),
];
// build the group access options
$tabs[] = [
'name' => 'access',
'text' => elgg_echo('groups:edit:access'),
'content' => elgg_view('groups/edit/access', $vars),
];
// build the group tools options
$tabs[] = [
'name' => 'tools',
'text' => elgg_echo('groups:edit:tools'),
'content' => elgg_view('groups/edit/tools', $vars),
];
// show tabs
echo elgg_view('page/components/tabs', [
'id' => 'groups-edit',
'tabs' => $tabs,
]);
// display the save button and some additional form data
if ($entity instanceof \ElggGroup) {
echo elgg_view('input/hidden', [
'name' => 'group_guid',
'value' => $entity->guid,
]);
}
// build form footer
$footer = elgg_view_field([
'#type' => 'submit',
'value' => elgg_echo('save'),
]);
elgg_set_form_footer($footer);
elgg_pop_context();