aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/views
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-04 01:26:36 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-04 01:26:36 +0000
commit1bcc2d793704bf43f6ecf9a01259e9cd6f6f8b2a (patch)
tree21bbc06d2e8dec46c6396cfbfd8d1e499f2733d8 /mod/groups/views
parent1b9a059d96265ddb058be4f73c6989c318181f8d (diff)
downloadelgg-1bcc2d793704bf43f6ecf9a01259e9cd6f6f8b2a.tar.gz
elgg-1bcc2d793704bf43f6ecf9a01259e9cd6f6f8b2a.tar.bz2
updated the group actions - edit group needs more work
git-svn-id: http://code.elgg.org/elgg/trunk@8573 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/views')
-rw-r--r--mod/groups/views/default/groups/invitationrequests.php55
-rw-r--r--mod/groups/views/default/groups/profile/buttons.php6
2 files changed, 33 insertions, 28 deletions
diff --git a/mod/groups/views/default/groups/invitationrequests.php b/mod/groups/views/default/groups/invitationrequests.php
index 60a0ec853..11cac52de 100644
--- a/mod/groups/views/default/groups/invitationrequests.php
+++ b/mod/groups/views/default/groups/invitationrequests.php
@@ -1,37 +1,44 @@
<?php
+/**
+ * A user's group invitations
+ *
+ * @uses $vars['invitations']
+ */
if (!empty($vars['invitations']) && is_array($vars['invitations'])) {
$user = elgg_get_logged_in_user_entity();
- foreach($vars['invitations'] as $group)
+ foreach ($vars['invitations'] as $group) {
if ($group instanceof ElggGroup) {
-
- ?>
- <div class="elgg-image-block group_invitations clearfix">
- <?php
- echo "<div class='elgg-image'>";
- echo elgg_view_entity_icon($group, 'tiny', array('override' => 'true'));
- echo "</div>";
+ $icon = elgg_view_entity_icon($group, 'tiny', array('override' => 'true'));
+
+ $group_title = elgg_view('output/url', array(
+ 'href' => $group->getURL(),
+ 'text' => $group->name,
+ ));
$url = elgg_add_action_tokens_to_url(elgg_get_site_url()."action/groups/join?user_guid={$user->guid}&group_guid={$group->guid}");
- ?>
- <div class="elgg-body">
- <a href="<?php echo $url; ?>" class="elgg-button elgg-button-submit"><?php echo elgg_echo('accept'); ?></a>
- <?php
- echo str_replace('<a', '<a class="elgg-button elgg-button-action elgg-state-disabled" ', elgg_view('output/confirmlink',array(
- 'href' => "action/groups/killinvitation?user_guid={$user->getGUID()}&group_guid={$group->getGUID()}",
+ $accept_button = elgg_view('output/url', array(
+ 'href' => $url,
+ 'text' => elgg_echo('accept'),
+ 'class' => 'elgg-button elgg-button-submit',
+ ));
+
+ $url = "action/groups/killinvitation?user_guid={$user->getGUID()}&group_guid={$group->getGUID()}";
+ $delete_button = elgg_view('output/confirmlink', array(
+ 'href' => $url,
'confirm' => elgg_echo('groups:invite:remove:check'),
'text' => elgg_echo('delete'),
- )));
-
- echo "<p class='entity-title'><a href=\"" . $group->getUrl() . "\">" . $group->name . "</a></p>";
- echo "<p class='entity-subtext'>" . $group->briefdescription . "</p>";
+ 'class' => 'elgg-button elgg-button-action elgg-state-disabled',
+ ));
- ?>
- </div></div>
- <?php
+ $body = <<<HTML
+<p class="entity-title">$group_title</p>
+<p class="entity-subtext">$group->briefdescription</p>
+$accept_button $delete_button
+HTML;
+ echo elgg_view_image_block($icon, $body);
}
-
- } else {
+ }
+} else {
echo "<p class='default_string mtm'>" . elgg_echo('groups:invitations:none') . "</p>";
}
-?> \ No newline at end of file
diff --git a/mod/groups/views/default/groups/profile/buttons.php b/mod/groups/views/default/groups/profile/buttons.php
index 0aef3920b..32d9867ab 100644
--- a/mod/groups/views/default/groups/profile/buttons.php
+++ b/mod/groups/views/default/groups/profile/buttons.php
@@ -31,14 +31,12 @@ if ($vars['entity']->isMember($user)) {
$actions[$url] = elgg_echo('groups:leave');
} else {
// join - admins can always join.
+ $url = elgg_get_site_url() . "action/groups/join?group_guid={$vars['entity']->getGUID()}";
+ $url = elgg_add_action_tokens_to_url($url);
if ($vars['entity']->isPublicMembership() || $vars['entity']->canEdit()) {
- $url = elgg_get_site_url() . "action/groups/join?group_guid={$vars['entity']->getGUID()}";
- $url = elgg_add_action_tokens_to_url($url);
$actions[$url] = elgg_echo('groups:join');
} else {
// request membership
- $url = elgg_get_site_url() . "action/groups/joinrequest?group_guid={$vars['entity']->getGUID()}";
- $url = elgg_add_action_tokens_to_url($url);
$actions[$url] = elgg_echo('groups:joinrequest');
}
}