aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/views
diff options
context:
space:
mode:
Diffstat (limited to 'mod/groups/views')
-rw-r--r--mod/groups/views/default/forms/groups/invite.php29
-rw-r--r--mod/groups/views/default/groups/groupprofile.php1
-rw-r--r--mod/groups/views/default/groups/icon.php30
-rw-r--r--mod/groups/views/default/groups/menu/actions.php17
-rw-r--r--mod/groups/views/default/sharing/invite.php41
5 files changed, 79 insertions, 39 deletions
diff --git a/mod/groups/views/default/forms/groups/invite.php b/mod/groups/views/default/forms/groups/invite.php
new file mode 100644
index 000000000..055bb738b
--- /dev/null
+++ b/mod/groups/views/default/forms/groups/invite.php
@@ -0,0 +1,29 @@
+<?php
+ /**
+ * Elgg groups plugin
+ *
+ * @package ElggGroups
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+
+ $group = $vars['entity'];
+ $owner = get_entity($vars['entity']->owner_guid);
+ $forward_url = $group->getURL();
+
+
+?>
+<h2><?php echo sprintf(elgg_echo('groups:inviteto'), $group->title); ?></h2>
+<form action="<?php echo $vars['url']; ?>action/groups/addtogroup" method="post">
+
+ <?php
+
+ echo elgg_view('sharing/invite',array('shares' => $shares, 'owner' => $owner, 'group' => $group));
+
+ ?>
+ <input type="hidden" name="forward_url" value="<?php echo $forward_url; ?>" />
+ <input type="hidden" name="group_guid" value="<?php echo $group->guid; ?>" />
+ <input type="submit" value="<?php echo elgg_echo('invite'); ?>" />
+</form> \ No newline at end of file
diff --git a/mod/groups/views/default/groups/groupprofile.php b/mod/groups/views/default/groups/groupprofile.php
index 6eb403bb5..923c07b3e 100644
--- a/mod/groups/views/default/groups/groupprofile.php
+++ b/mod/groups/views/default/groups/groupprofile.php
@@ -113,6 +113,7 @@
?>
<a href="<?php echo $vars['url']; ?>mod/groups/edit.php?group_guid=<?php echo $vars['entity']->getGUID(); ?>"><?php echo elgg_echo("edit"); ?></a>
+
<?php
diff --git a/mod/groups/views/default/groups/icon.php b/mod/groups/views/default/groups/icon.php
index 0a3ce74a4..26c6b622d 100644
--- a/mod/groups/views/default/groups/icon.php
+++ b/mod/groups/views/default/groups/icon.php
@@ -32,37 +32,9 @@
$icontime = "default";
}
- $name = htmlentities($vars['entity']->title);
-
-
- $username = $vars['entity']->username; // TODO : How do i do an icon when we have no username?
?>
<div class="groupicon">
-<div class="avatar_menu_button"><img src="<?php echo $vars['url']; ?>_graphics/avatar_menu_arrow.gif" width="15" height="15" class="arrow" /></div>
-
- <div class="sub_menu">
- <a href="<?php echo $vars['entity']->getURL(); ?>"><h3><?php echo $vars['entity']->title; ?></h3></a>
- <?php
- if (isloggedin()) {
- $actions = elgg_view('groups/menu/actions',$vars);
- if (!empty($actions)) {
-
- echo "<div class=\"item_line\">{$actions}</div>";
-
- }
- if ($vars['entity']->owner_guid == $vars['user']->getGUID()) {
- echo elgg_view('groups/menu/ownerlinks',$vars);
- } else {
- echo elgg_view('groups/menu/links',$vars);
- }
- } else {
- echo elgg_view('groups/menu/links',$vars);
- }
-
- ?>
-
- </div>
- <a href="<?php echo $vars['entity']->getURL(); ?>" class="icon" ><img src="<?php echo $vars['url']; ?>pg/icon/<?php echo $username; ?>/<?php echo $vars['size']; ?>/<?php echo $icontime; ?>.jpg" border="0" <?php echo $align; ?> title="<?php echo $name; ?>" <?php echo $vars['js']; ?> /></a>
+<a href="<?php echo $vars['entity']->getURL(); ?>" class="icon" ><img src="<?php echo $vars['url']; ?>pg/icon/<?php echo $username; ?>/<?php echo $vars['size']; ?>/<?php echo $icontime; ?>.jpg" border="0" <?php echo $align; ?> title="<?php echo $name; ?>" <?php echo $vars['js']; ?> /></a>
</div> \ No newline at end of file
diff --git a/mod/groups/views/default/groups/menu/actions.php b/mod/groups/views/default/groups/menu/actions.php
index 2c686fd95..8e1130871 100644
--- a/mod/groups/views/default/groups/menu/actions.php
+++ b/mod/groups/views/default/groups/menu/actions.php
@@ -13,26 +13,23 @@
if ($vars['entity']->isMember($_SESSION['user']))
{
-?>
- <p><a href="<?php echo $vars['url']; ?>action/groups/leave?group_guid=<?php echo $vars['entity']->getGUID(); ?>"><?php echo elgg_echo("groups:leave"); ?></a></p>
-<?php
+ ?><p><a href="<?php echo $vars['url']; ?>action/groups/leave?group_guid=<?php echo $vars['entity']->getGUID(); ?>"><?php echo elgg_echo("groups:leave"); ?></a></p><?php
}
else
{
if ($vars['entity']->access_id == 2)
{
-?>
- <p><a href="<?php echo $vars['url']; ?>action/groups/join?group_guid=<?php echo $vars['entity']->getGUID(); ?>"><?php echo elgg_echo("groups:join"); ?></a></p>
-<?php
+ ?><p><a href="<?php echo $vars['url']; ?>action/groups/join?group_guid=<?php echo $vars['entity']->getGUID(); ?>"><?php echo elgg_echo("groups:join"); ?></a></p><?php
}
else
{
-?>
- <p><a href="<?php echo $vars['url']; ?>action/groups/joinrequest?group_guid=<?php echo $vars['entity']->getGUID(); ?>"><?php echo elgg_echo("groups:joinrequest"); ?></a></p>
-<?php
+ ?><p><a href="<?php echo $vars['url']; ?>action/groups/joinrequest?group_guid=<?php echo $vars['entity']->getGUID(); ?>"><?php echo elgg_echo("groups:joinrequest"); ?></a></p><?php
}
}
-
+ if ($vars['entity']->canEdit())
+ {
+ ?><p><a href="<?php echo $vars['url']; ?>mod/groups/invite.php?group_guid=<?php echo $vars['entity']->getGUID(); ?>"><?php echo elgg_echo("groups:invite"); ?></a></p><?php
+ }
}
?> \ No newline at end of file
diff --git a/mod/groups/views/default/sharing/invite.php b/mod/groups/views/default/sharing/invite.php
new file mode 100644
index 000000000..2194c80bc
--- /dev/null
+++ b/mod/groups/views/default/sharing/invite.php
@@ -0,0 +1,41 @@
+<?php
+ /**
+ * Elgg groups plugin
+ *
+ * @package ElggGroups
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+
+ $owner = $vars['owner'];
+ $group = $vars['group'];
+
+ if ($friends = get_entities_from_relationship('friend',$owner->getGUID(),false,'user','')) {
+
+ foreach($friends as $friend) {
+
+ if (!$group->isMember($friend))
+ {
+ $label = elgg_view("profile/icon",array('entity' => $friend, 'size' => 'tiny'));
+ $label .= "{$friend->name}";
+ $options[$label] = $friend->getGUID();
+ }
+ }
+
+ if ($options)
+ {
+ echo elgg_view('input/checkboxes',array(
+
+ 'internalname' => 'user_guid',
+ 'options' => $options,
+
+ ));
+ }
+ else
+ {
+ echo elgg_echo('groups:nofriends');
+ }
+ }
+?> \ No newline at end of file