Permalink
Browse files

Presents login as guest button if course allows guests.

  • Loading branch information...
fiedorow
fiedorow committed Feb 5, 2005
1 parent cb4501f commit c43cb5ad4f939000797410f8ec816cdd88816bd9
Showing with 27 additions and 3 deletions.
  1. +27 −3 enrol/internal/enrol.html
View
@@ -17,7 +17,7 @@
</tr>
<tr valign="top">
- <td class="generalbox" bgcolor="<?php p($THEME->cellcontent) ?>">
+ <td class=<?php echo ($course->guest==1 ?'"noticebox"':'"generalbox"'); ?> bgcolor="<?php p($THEME->cellcontent) ?>">
<center><?php if (! empty($this->errormsg)) {formerr($this->errormsg);} ?></center>
<form name="form" method="post" action="enrol.php">
<table>
@@ -41,5 +41,29 @@
</table>
</td>
</tr>
-
-</table>
+<?php if ($course->guest==1) {
+$strallowguests = get_string("allowguests");
+$strloginguest = get_string("loginguest");
+$bgcolor = $THEME->cellcontent;
+$viewasguest = <<<view_as_guest
+ <tr>
+ <td class="generalbox" bgcolor="$bgcolor">
+ <form name="form" method="post" action="enrol.php">
+ <table align="center" cellpadding="20">
+ <tbody>
+ <tr>
+ <td>$strallowguests:&nbsp; </td>
+ <td>
+ <input name="id" value="$course->id" type="hidden">
+ <input name="loginasguest" value="yes" type="hidden">
+ <input value="$strloginguest" type="submit">&nbsp;&nbsp;
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </form>
+ </td>
+ </tr>
+view_as_guest;
+echo $viewasguest;} ?>
+</table>

0 comments on commit c43cb5a

Please sign in to comment.