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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
<?php
/**
* Group edit form
*
* @package ElggGroups
*/
// only extract these elements.
$name = $membership = $vis = $entity = null;
extract($vars, EXTR_IF_EXISTS);
?>
<div>
<label><?php echo elgg_echo("groups:icon"); ?></label><br />
<?php echo elgg_view("input/file", array('name' => 'icon')); ?>
</div>
<div>
<label><?php echo elgg_echo("groups:name"); ?></label><br />
<?php echo elgg_view("input/text", array(
'name' => 'name',
'value' => $name
));
?>
</div>
<?php
$group_profile_fields = elgg_get_config('group');
unset($group_profile_fields['container_guid']);
if ($group_profile_fields > 0) {
foreach ($group_profile_fields as $shortname => $valtype) {
$line_break = '<br />';
if ($valtype == 'longtext') {
$line_break = '';
}
echo '<div><label>';
echo elgg_echo("groups:{$shortname}");
echo "</label>$line_break";
echo elgg_view("input/{$valtype}", array(
'name' => $shortname,
'value' => elgg_extract($shortname, $vars)
));
echo '</div>';
}
}
?>
<div>
<label>
<?php echo elgg_echo('groups:membership'); ?><br />
<?php echo elgg_view('input/dropdown', array(
'name' => 'membership',
'value' => $membership,
'options_values' => array(
ACCESS_PRIVATE => elgg_echo('groups:access:private'),
ACCESS_PUBLIC => elgg_echo('groups:access:public')
)
));
?>
</label>
</div>
<?php
if (elgg_get_plugin_setting('hidden_groups', 'groups') == 'yes') {
$access_options = array(
ACCESS_PRIVATE => elgg_echo('groups:access:group'),
ACCESS_LOGGED_IN => elgg_echo("LOGGED_IN"),
ACCESS_PUBLIC => elgg_echo("PUBLIC")
);
?>
<div>
<label>
<?php echo elgg_echo('groups:visibility'); ?><br />
<?php echo elgg_view('input/access', array(
'name' => 'vis',
'value' => $vis,
'options_values' => $access_options,
));
?>
</label>
</div>
<?php
}
$tools = elgg_get_config('group_tool_options');
if ($tools) {
usort($tools, create_function('$a,$b', 'return strcmp($a->label,$b->label);'));
foreach ($tools as $group_option) {
$group_option_toggle_name = $group_option->name . "_enable";
$value = elgg_extract($group_option_toggle_name, $vars);
?>
<div>
<label>
<?php echo $group_option->label; ?><br />
</label>
<?php echo elgg_view("input/radio", array(
"name" => $group_option_toggle_name,
"value" => $value,
'options' => array(
elgg_echo('groups:yes') => 'yes',
elgg_echo('groups:no') => 'no',
),
));
?>
</div>
<?php
}
}
?>
<div class="elgg-foot">
<?php
if (isset($entity)) {
echo elgg_view('input/hidden', array(
'name' => 'group_guid',
'value' => $entity->getGUID(),
));
}
echo elgg_view('input/hidden', array(
'name' => 'container_guid',
'value' => isset($vars['entity']) ?
$entity->getContainerGUID() :
get_input('container_guid'),
));
echo elgg_view('input/submit', array('value' => elgg_echo('save')));
if (isset($entity)) {
$delete_url = 'action/groups/delete?guid=' . $entity->getGUID();
echo elgg_view('output/confirmlink', array(
'text' => elgg_echo('groups:delete'),
'href' => $delete_url,
'confirm' => elgg_echo('groups:deletewarning'),
'class' => 'elgg-button elgg-button-delete float-alt',
));
}
?>
</div>
|