diff options
Diffstat (limited to 'mod/groups/views')
-rw-r--r-- | mod/groups/views/default/groups/featured.php | 21 | ||||
-rw-r--r-- | mod/groups/views/default/groups/grouplisting.php | 15 |
2 files changed, 34 insertions, 2 deletions
diff --git a/mod/groups/views/default/groups/featured.php b/mod/groups/views/default/groups/featured.php index ab7691a0b..381e01a4d 100644 --- a/mod/groups/views/default/groups/featured.php +++ b/mod/groups/views/default/groups/featured.php @@ -4,6 +4,25 @@ * This view will display featured groups - these are set by admin
**/
+
?>
-<h3>Featured groups</h3>
\ No newline at end of file +<h3><?php echo elgg_echo("groups:featured"); ?></h3>
+
+<?php
+ if($vars['featured']){
+
+ foreach($vars['featured'] as $group){
+ $icon = elgg_view(
+ "groups/icon", array(
+ 'entity' => $group,
+ 'size' => 'small',
+ )
+ );
+
+ echo "<div class=\"featured_group\">" . $icon . " " . $group->name . "<br />";
+ echo $group->briefdescription . "</div>";
+
+ }
+ }
+?>
\ No newline at end of file diff --git a/mod/groups/views/default/groups/grouplisting.php b/mod/groups/views/default/groups/grouplisting.php index 8d7e3c6d8..418a3d16f 100644 --- a/mod/groups/views/default/groups/grouplisting.php +++ b/mod/groups/views/default/groups/grouplisting.php @@ -25,7 +25,20 @@ else $mem = elgg_echo("groups:closed"); - $info .= "<div style=\"float:right;\">" . $mem . " / " . elgg_echo("groups:member") . " (" . get_group_members($vars['entity']->guid, 10, 0, 0, true) . ")</div>"; + //for admins display the feature or unfeature option + if($vars['entity']->featured_group == "yes"){ + $url = $vars['url'] . "action/groups/featured?group_guid=" . $vars['entity']->guid . "&action=unfeature"; + $wording = "Unfeature"; + }else{ + $url = $vars['url'] . "action/groups/featured?group_guid=" . $vars['entity']->guid . "&action=feature"; + $wording = "Make featured"; + } + + $info .= "<div style=\"float:right;\">" . $mem . " / " . elgg_echo("groups:member") . " (" . get_group_members($vars['entity']->guid, 10, 0, 0, true) . ")<br />"; + //if admin, show make featured option + if(isadminloggedin()) + $info .= "<a href=\"{$url}\">{$wording}</a>"; + $info .= "</div>"; $info .= "<p><b><a href=\"" . $vars['entity']->getUrl() . "\">" . $vars['entity']->name . "</a></b></p>"; $info .= "<p class=\"owner_timestamp\">" . $vars['entity']->description . "</p>"; |