]> git.mjollnir.org Git - moodle.git/commitdiff
Some more work on the groups pages (not finished yet)
authormoodler <moodler>
Sat, 7 Feb 2004 12:51:22 +0000 (12:51 +0000)
committermoodler <moodler>
Sat, 7 Feb 2004 12:51:22 +0000 (12:51 +0000)
course/groups-summary.html
course/groups.php

index 6ea2ba218eb6b485a6a5119d21bc720791c108ca..1b801b50c4320399ecd57135491284bdc64269ba 100644 (file)
@@ -2,21 +2,49 @@
  <tr>
    <th colspan="2"><?php echo $t->name ?></th>
  </tr>
- <tr>
-   <td valign="top">
-   <p><?php echo $t->picture ?></p>
-   <p><?php echo $t->description ?></p>
-   </td>
-   <td align="right">
-   <p style="font-size: x-small"><?php 
-      if ($t->users) {
-          foreach ($t->users as $user) {
-              echo "<a href=\"$CFG->wwwroot/user/view.php?id=$user->id&course=$t->courseid\">$user->fullname</a><br />";
+ <tr><td class="generalboxcontent" bgcolor="<?php echo $THEME->cellcontent ?>">
+   <table>
+     <tr>
+      <td valign="top" width="120">
+        <p><?php echo $t->picture ?></p>
+      </td>
+      <td>
+        <p><?php echo $t->description ?></p>
+        <?php
+          if (!empty($t->linkeditprofile)) {
+              echo '<p style="font-size: small" align="right"><a href="'.$t->linkeditprofile->url.'">'.$t->linkeditprofile->text.'</a>...</p>';
+          }
+        ?>
+      </td>
+    </tr>
+    <tr bgcolor="<?php echo $THEME->cellcontent ?>">
+      <td colspan="2" align="left">
+        <p style="font-size: x-small"><?php 
+          if ($t->users) {
+              $countusers = count($t->users);
+              foreach ($t->users as $user) {
+                  echo "<a href=\"$CFG->wwwroot/user/view.php?id=$user->id&course=$t->courseid\">$user->fullname</a>";
+                  $countusers--;
+                  if ($countusers) {
+                      echo ', ';
+                  }
+              }
           }
-      }
-      ?>
-   </ul></p>
+          ?>
+        </p>
+      </td>
+    </tr>
+    <tr bgcolor="<?php echo $THEME->cellcontent ?>">
+      <td colspan="2" align="right">
+        <?php 
+          if (!empty($t->linkfullprofile)) {
+              echo '<p style="font-size: small" align="right"><a href="'.$t->linkfullprofile->url.'">'.$t->linkfullprofile->text.'</a>...</p>';
+          }
+        ?>
+      </td>
+    </tr>
+   </table>
    </td>
- </tr>
-</table>
  </tr>
+  </table>
 <br />
index fb72fb707f630f8946297f6a0c5250cd50c3f630..ba847a0ff6812333567ca4ec3d12edef28c45a07 100644 (file)
@@ -20,7 +20,7 @@
     }
 
     if (isteacheredit($course->id)) {
-        if (isset($edit)) {
+        if (isset($_GET['edit'])) {
             if ($edit == "on") {
                 $USER->groupsediting = true;
             } else if ($edit == "off") {
@@ -36,6 +36,8 @@
 
     $strgroup = get_string('group');
     $strgroups = get_string('groups');
+    $streditgroupprofile = get_string('editgroupprofile');
+    $strgroupmemberssee = get_string('groupmemberssee');
     $loggedinas = "<p class=\"logininfo\">".user_login_string($course, $USER)."</p>";
 
     print_header("$course->shortname: $strgroups", "$course->fullname", 
@@ -53,6 +55,7 @@
 
         } else {  
             $isteacher = isteacher($course->id);
+            $isteacheredit = isteacheredit($course->id);
             foreach ($groups as $group) {
                 $t = $group;
                 $t->picture = print_group_picture($group, $course->id, true, true, true);
                         $t->users[$key]->fullname = fullname($user, $isteacher);
                     }
                 }
+                if ($isteacheredit or ($isteacher and ismember($group->id))) {
+                    $t->linkeditprofile->url = "group.php?id=$course->id&group=$group->id&edit=on";
+                    $t->linkeditprofile->text = $streditgroupprofile;
+                }
+                $t->linkfullprofile->url = "group.php?id=$course->id&group=$group->id&edit=off";
+                $t->linkfullprofile->text = $strgroupmemberssee;
+
                 include('groups-summary.html');
             }
         }