aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/views
diff options
context:
space:
mode:
authorSteve Clay <steve@mrclay.org>2012-11-19 08:11:27 -0500
committerSteve Clay <steve@mrclay.org>2012-11-19 08:11:27 -0500
commit19c6da97ed0178592b9041946f3463f9008dd7ea (patch)
tree6fd6356eb083ba6713689c362c31f5beb56d2654 /mod/groups/views
parentd857c68fd91b1bcf586a30d86108b1898c2bb2d3 (diff)
parentf189ceb861d8456844f9d588f1582a5a5c49a9dc (diff)
downloadelgg-19c6da97ed0178592b9041946f3463f9008dd7ea.tar.gz
elgg-19c6da97ed0178592b9041946f3463f9008dd7ea.tar.bz2
Merge branch '1854-18-groupowner' into 1.8
Diffstat (limited to 'mod/groups/views')
-rw-r--r--mod/groups/views/default/forms/groups/edit.php36
-rw-r--r--mod/groups/views/default/groups/js.php7
2 files changed, 43 insertions, 0 deletions
diff --git a/mod/groups/views/default/forms/groups/edit.php b/mod/groups/views/default/forms/groups/edit.php
index 532e89c35..7a740b878 100644
--- a/mod/groups/views/default/forms/groups/edit.php
+++ b/mod/groups/views/default/forms/groups/edit.php
@@ -83,6 +83,42 @@ if (elgg_get_plugin_setting('hidden_groups', 'groups') == 'yes') {
<?php
}
+if (isset($vars['entity'])) {
+ $entity = $vars['entity'];
+ $owner_guid = $vars['entity']->owner_guid;
+} else {
+ $entity = false;
+}
+
+if ($entity && ($owner_guid == elgg_get_logged_in_user_guid() || elgg_is_admin_logged_in())) {
+ $owner_guid = $vars['entity']->owner_guid;
+ $members = array();
+ foreach ($vars['entity']->getMembers(0) as $member) {
+ $members[$member->guid] = "$member->name (@$member->username)";
+ }
+?>
+
+<div>
+ <label>
+ <?php echo elgg_echo('groups:owner'); ?><br />
+ <?php echo elgg_view('input/dropdown', array(
+ 'name' => 'owner_guid',
+ 'value' => $owner_guid,
+ 'options_values' => $members,
+ 'class' => 'groups-owner-input',
+ ));
+ ?>
+ </label>
+ <?php
+ if ($owner_guid == elgg_get_logged_in_user_guid()) {
+ echo '<span class="elgg-text-help">' . elgg_echo('groups:owner:warning') . '</span>';
+ }
+ ?>
+</div>
+
+<?php
+}
+
$tools = elgg_get_config('group_tool_options');
if ($tools) {
usort($tools, create_function('$a,$b', 'return strcmp($a->label,$b->label);'));
diff --git a/mod/groups/views/default/groups/js.php b/mod/groups/views/default/groups/js.php
index 1b4d33f32..0319be14a 100644
--- a/mod/groups/views/default/groups/js.php
+++ b/mod/groups/views/default/groups/js.php
@@ -1,3 +1,10 @@
+<?php
+/**
+ * Javascript for Groups forms
+ *
+ * @package ElggGroups
+ */
+?>
// this adds a class to support IE8 and older
elgg.register_hook_handler('init', 'system', function() {