]> git.mjollnir.org Git - moodle.git/commitdiff
fixed some whitespace problems
authorjamiesensei <jamiesensei>
Tue, 17 Oct 2006 11:38:46 +0000 (11:38 +0000)
committerjamiesensei <jamiesensei>
Tue, 17 Oct 2006 11:38:46 +0000 (11:38 +0000)
course/request.html [deleted file]
course/request.php
course/request_form.php

diff --git a/course/request.html b/course/request.html
deleted file mode 100644 (file)
index e41cf62..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-<?php
-// make sure all variables are defined
-if (empty($form->shortname)) {
-    $form->shortname = '';
-}
-if (empty($form->fullname)) {
-    $form->fullname = '';
-}
-if (empty($form->summary)) {
-    $form->summary = '';
-}
-if (empty($form->reason)) {
-    $form->reason = '';
-}
-if (empty($usehtmleditor)) {
-    $usehtmleditor = 0;
-}
-if (empty($form->password)) {
-    $form->password = '';
-}
-?>
-<form method="post" action="request.php" name="request">
-<table cellpadding="9" cellspacing="0" >
-<tr valign="top">
-    <td align="right"><?php  print_string("fullname") ?>:</td>
-    <td><input type="text" name="fullname" maxlength="254" size="50" value="<?php  p($form->fullname) ?>" alt="<?php  print_string("fullname") ?>" />
-    <?php  helpbutton("coursefullname", get_string("fullname")) ?>
-    <?php  if (isset($err["fullname"])) formerr($err["fullname"]); ?>
-    </td>
-</tr>
-<tr valign="top">
-    <td align="right"><?php  print_string("shortname") ?>:</td>
-    <td><input type="text" name="shortname" maxlength="15"  size="10" value="<?php  p($form->shortname) ?>" alt="<?php  print_string("shortname") ?>" />
-    <?php  helpbutton("courseshortname", get_string("shortname")) ?>
-    <?php  if (isset($err["shortname"])) formerr($err["shortname"]); ?>
-    </td>
-</tr>
-<tr valign="top">
-    <td align="right"><?php  print_string("summary") ?>:</td>
-    <td><?php
-        print_textarea($usehtmleditor, 10, 50, 660, 200, "summary", $form->summary);
-        helpbutton("text", get_string("helptext"));
-        if (isset($err["summary"])) formerr($err["summary"]);
-    ?>
-    </td>
-</tr>
-<tr valign="top">
-    <td align="right"><?php  print_string("courserequestreason") ?>:</td>
-    <td><?php
-        print_textarea($usehtmleditor, 10, 50, 660, 200, "reason", $form->reason);
-        helpbutton("text", get_string("helptext"));
-        if (isset($err["reason"])) formerr($err["reason"]);
-    ?>
-    </td>
-</tr>
-<tr valign="top">
-    <td align="right"><?php  print_string("enrolmentkey") ?>:</td>
-    <td><input type="text" name="password" size="25" value="<?php  p($form->password) ?>" alt="<?php  print_string("enrolmentkey") ?>" />
-    <?php  helpbutton("enrolmentkey", get_string("enrolmentkey")) ?>
-    <?php  if (isset($err["password"])) formerr($err["password"]); ?>
-    </td>
-</tr>
-<tr>
-    <td></td>
-    <td><input type="submit" value="<?php  print_string("savechanges") ?>" /></td>
-</tr>
-</table>
-<input type="hidden" name="sesskey" value="<?php echo sesskey() ?>" />
-</form>
\ No newline at end of file
index 009e4a7933f5c1cbed68607d7837c072ff1ef45f..f2674a2c96e054fbc6537c9349a2b7ca78366aaf 100644 (file)
@@ -1,13 +1,13 @@
 <?php  // $Id$
+
     /// this allows a student to request a course be created for them.
 
     require_once('../config.php');
     include_once $CFG->libdir.'/formslib.php';
-    
+
     require_login();
-      
-    require_once('request_form.php');   
+
+    require_once('request_form.php');
 
     if (isguest()) {
         error("No guests here!");
     if (empty($CFG->enablecourserequests)) {
         error(get_string('courserequestdisabled'));
     }
-   
+
 
     $strtitle = get_string('courserequest');
     print_header($strtitle,$strtitle,$strtitle);
 
     print_simple_box_start("center");
-    print_string('courserequestintro'); 
+    print_string('courserequestintro');
     print_simple_box_end();
-    
+
     $requestform = new course_request_form('request.php');
-    
-    if (($data = $requestform->data_submitted())) {        
-       
+
+    if (($data = $requestform->data_submitted())) {
+
         $data->requester = $USER->id;
 
         if (insert_record('course_request',$data)) {
             notice(get_string('courserequestsuccess'));
-        }
-        else {
+        } else {
             notice(get_string('courserequestfailed'));
         }
         print_footer();
         exit;
-        
-        
-    } 
-    
-    
+
+
+    }
+
+
     $requestform->display();
 
     print_footer();
-    
+
     exit;
 
 
index 884481276cd8c2cfd82d3f5d469e9a110655da55..0fec0af022e59f4924a0fb1f50fca7b2463a2363 100644 (file)
@@ -11,7 +11,7 @@ class course_request_form extends moodleform {
         $mform->addRule('shortname',get_string('missingfullname'),'required', null, 'client');
         $mform->setType('shortname', PARAM_TEXT);
 
-        $mform->addElement('textarea','summary',get_string("summary"),array('rows'=>'15','cols'=>'50'));
+        $mform->addElement('htmleditor','summary',get_string("summary"),array('rows'=>'15','cols'=>'50'));
         $mform->addRule('summary',get_string('missingsummary'),'required', null, 'client');
         $mform->setType('summary', PARAM_TEXT);
 
@@ -22,7 +22,7 @@ class course_request_form extends moodleform {
         $mform->addElement('text','password',get_string("enrolmentkey"),'size="25"');
         $mform->setType('password', PARAM_RAW);
 
-        
+
         $mform->addElement('submit','',get_string("savechanges"));
     }
 
@@ -44,14 +44,13 @@ class course_request_form extends moodleform {
         }
 
         if (!empty($foundcourses)) {
-            
+
             if (!empty($foundcourses)) {
                 foreach ($foundcourses as $foundcourse) {
                     if (isset($foundcourse->requester) && $foundcourse->requester) {
                         $pending = 1;
                         $foundcoursenames[] = $foundcourse->fullname.' [*]';
-                    }
-                    else {
+                    } else {
                         $foundcoursenames[] = $foundcourse->fullname;
                     }
                 }