aboutsummaryrefslogtreecommitdiff
path: root/mod/subgroups/views/default/forms
diff options
context:
space:
mode:
Diffstat (limited to 'mod/subgroups/views/default/forms')
-rw-r--r--mod/subgroups/views/default/forms/groups/edit.php142
-rw-r--r--mod/subgroups/views/default/forms/subgroups/add.php37
2 files changed, 179 insertions, 0 deletions
diff --git a/mod/subgroups/views/default/forms/groups/edit.php b/mod/subgroups/views/default/forms/groups/edit.php
new file mode 100644
index 000000000..e2f9fb394
--- /dev/null
+++ b/mod/subgroups/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>
diff --git a/mod/subgroups/views/default/forms/subgroups/add.php b/mod/subgroups/views/default/forms/subgroups/add.php
new file mode 100644
index 000000000..f0349a728
--- /dev/null
+++ b/mod/subgroups/views/default/forms/subgroups/add.php
@@ -0,0 +1,37 @@
+<label class="subgroups-add-autocomplete" style="display:none">
+<?php
+ echo elgg_echo('subgroups:add:label'); echo '<br />';
+ echo elgg_view('input/autocomplete', array(
+ 'name' => 'othergroup',
+ 'livesearch_url' => elgg_get_site_url().'ajax/view/subgroups/groups_i_can_edit',
+ 'class' => 'mvm',
+ ));
+?>
+</label>
+<label class="subgroups-add-url">
+<?php
+ echo elgg_echo('subgroups:addurl:label'); echo '<br />';
+ echo elgg_view('input/url', array('name' => 'othergroup_url', 'class' => 'mvm'));
+?>
+</label>
+<?php
+ echo elgg_view('input/hidden', array(
+ 'name' => 'group',
+ 'value' => $vars['group']->guid));
+ echo elgg_view('input/submit', array(
+ 'value' => elgg_echo('subgroups:add:button')));
+?>
+<a href="" class="subgroups-dontwork-link mlm" style="display:none">(<?php echo elgg_echo('subgroups:dontwork'); ?>)</a>
+
+<script type="text/javascript">
+$(function(){
+ $('.subgroups-add-autocomplete').show();
+ $('.subgroups-add-url').hide();
+ $('.subgroups-dontwork-link').show().click(function(){
+ $('.subgroups-add-autocomplete').hide();
+ $('.subgroups-add-url').show();
+ $(this).hide();
+ return false;
+ });
+});
+</script>