diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-24 19:42:25 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-24 19:42:25 +0000 |
commit | 1a0c039a493f1af8090c58bb7209c92c01bf716e (patch) | |
tree | 4f88e4644036fed0150e71bdbb8efd60cddf229c /mod/groups/views/default | |
parent | 1b64251263c6621c58467f8a8f3dba4637a3e3e0 (diff) | |
download | elgg-1a0c039a493f1af8090c58bb7209c92c01bf716e.tar.gz elgg-1a0c039a493f1af8090c58bb7209c92c01bf716e.tar.bz2 |
Removing an infinite loop in groups.
git-svn-id: https://code.elgg.org/elgg/trunk@2937 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/views/default')
-rw-r--r-- | mod/groups/views/default/groups/groupprofile.php | 124 |
1 files changed, 80 insertions, 44 deletions
diff --git a/mod/groups/views/default/groups/groupprofile.php b/mod/groups/views/default/groups/groupprofile.php index e26ecf1fd..f1fc9823d 100644 --- a/mod/groups/views/default/groups/groupprofile.php +++ b/mod/groups/views/default/groups/groupprofile.php @@ -1,58 +1,94 @@ <?php
/**
- * Full group profile
+ * Elgg groups plugin full profile view.
*
* @package ElggGroups
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd
+ * @author Curverider
* @copyright Curverider Ltd 2008-2009
* @link http://elgg.com/
*/
- $group_guid = get_input('group_guid');
- set_context('groups');
-
+ if ($vars['full'] == true) {
+ $iconsize = "large";
+ } else {
+ $iconsize = "medium";
+ }
- $group = get_entity($group_guid);
- if ($group) {
- set_page_owner($group_guid);
-
- $title = $group->name;
-
- // Hide some items from closed groups when the user is not logged in.
- $view_all = true;
-
- $groupaccess = group_gatekeeper(false);
- if (!$groupaccess)
- $view_all = false;
-
-
- $area2 = elgg_view_title($title);
- $area2 .= elgg_view('group/group', array('entity' => $group, 'user' => $_SESSION['user'], 'full' => true));
-
- if ($view_all) {
- //group profile 'items' - these are not real widgets, just contents to display
- $area2 .= elgg_view('groups/profileitems',array('entity' => $group));
-
- //group members
- $area3 = elgg_view('groups/members',array('entity' => $group));
- }
- else
- {
- $area2 .= elgg_view('groups/closedmembership', array('entity' => $group, 'user' => $_SESSION['user'], 'full' => true));
+?>
+<div id="groups_info_column_right"><!-- start of groups_info_column_right -->
+ <div id="groups_icon_wrapper"><!-- start of groups_icon_wrapper -->
+
+ <?php
+ echo elgg_view(
+ "groups/icon", array(
+ 'entity' => $vars['entity'],
+ //'align' => "left",
+ 'size' => $iconsize,
+ )
+ );
+ ?>
+
+ </div><!-- end of groups_icon_wrapper -->
+ <div id="group_stats"><!-- start of group_stats -->
+ <?php
+
+ echo "<p><b>" . elgg_echo("groups:owner") . ": </b><a href=\"" . get_user($vars['entity']->owner_guid)->getURL() . "\">" . get_user($vars['entity']->owner_guid)->name . "</a></p>";
+
+ ?>
+ <p><?php echo elgg_echo('groups:members') . ": " . get_entities_from_relationship('member', $vars['entity']->guid, true, 'user', '', 0, '', 9999, 0, true); ?></p>
+ </div><!-- end of group_stats -->
+</div><!-- end of groups_info_column_right -->
+
+<div id="groups_info_column_left"><!-- start of groups_info_column_left -->
+ <?php
+ if ($vars['full'] == true) {
+ if (is_array($vars['config']->group) && sizeof($vars['config']->group) > 0){
+
+ foreach($vars['config']->group as $shortname => $valtype) {
+ if ($shortname != "name") {
+ $value = $vars['entity']->$shortname;
+
+ if (!empty($value)) {
+ //This function controls the alternating class
+ $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even';
+ }
+
+ echo "<p class=\"{$even_odd}\">";
+ echo "<b>";
+ echo elgg_echo("groups:{$shortname}");
+ echo ": </b>";
+
+ echo elgg_view("output/{$valtype}",array('value' => $vars['entity']->$shortname));
+
+ echo "</p>";
+ }
+ }
+ }
}
+ ?>
+</div><!-- end of groups_info_column_left -->
+
+<div id="groups_info_wide">
+
+ <p class="groups_info_edit_buttons">
+
+<?php
+ if ($vars['entity']->canEdit())
+ {
+
+?>
+
+ <a href="<?php echo $vars['url']; ?>mod/groups/edit.php?group_guid=<?php echo $vars['entity']->getGUID(); ?>"><?php echo elgg_echo("edit"); ?></a>
- $body = elgg_view_layout('two_column_left_sidebar', $area1, $area2, $area3);
- } else {
- $title = elgg_echo('groups:notfound');
-
- $area2 = elgg_view_title($title);
- $area2 .= "<div class='contentWrapper'>" . elgg_echo('groups:notfound:details') . "</div>";
-
- $body = elgg_view_layout('two_column_left_sidebar', "", $area2,"");
+
+<?php
+
}
-
- // Finally draw the page
- page_draw($title, $body);
-?>
\ No newline at end of file +
+?>
+
+ </p>
+</div>
+<div class="clearfloat"></div>
\ No newline at end of file |