aboutsummaryrefslogtreecommitdiff
path: root/views/default/forms/groups/edit.php
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-03-16 21:01:42 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-03-16 21:01:42 -0300
commit5f6dc365a8445a48156b45912827eac39fd64fc5 (patch)
tree0dc3326151072bb5d97592513e1af4b40be32e07 /views/default/forms/groups/edit.php
downloadelgg-5f6dc365a8445a48156b45912827eac39fd64fc5.tar.gz
elgg-5f6dc365a8445a48156b45912827eac39fd64fc5.tar.bz2
Squashed 'mod/subgroups/' content from commit 835015b
git-subtree-dir: mod/subgroups git-subtree-split: 835015b66b9de6dc6de91ab39f95e1f09b2dbf84
Diffstat (limited to 'views/default/forms/groups/edit.php')
-rw-r--r--views/default/forms/groups/edit.php142
1 files changed, 142 insertions, 0 deletions
diff --git a/views/default/forms/groups/edit.php b/views/default/forms/groups/edit.php
new file mode 100644
index 000000000..e2f9fb394
--- /dev/null
+++ b/views/default/forms/groups/edit.php
@@ -0,0 +1,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>