From b6241ce2c8b1a00385db6e0f56ea8e53d6963786 Mon Sep 17 00:00:00 2001 From: jamiesensei Date: Tue, 17 Oct 2006 11:38:46 +0000 Subject: [PATCH] fixed some whitespace problems --- course/request.html | 69 ----------------------------------------- course/request.php | 35 ++++++++++----------- course/request_form.php | 9 +++--- 3 files changed, 21 insertions(+), 92 deletions(-) delete mode 100644 course/request.html diff --git a/course/request.html b/course/request.html deleted file mode 100644 index e41cf62868..0000000000 --- a/course/request.html +++ /dev/null @@ -1,69 +0,0 @@ -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 = ''; -} -?> -
- - - - - - - - - - - - - - - - - - - - - - - - - -
:" /> - - -
:" /> - - -
:summary); - helpbutton("text", get_string("helptext")); - if (isset($err["summary"])) formerr($err["summary"]); - ?> -
:reason); - helpbutton("text", get_string("helptext")); - if (isset($err["reason"])) formerr($err["reason"]); - ?> -
:" /> - - -
" />
- -
\ No newline at end of file diff --git a/course/request.php b/course/request.php index 009e4a7933..f2674a2c96 100644 --- a/course/request.php +++ b/course/request.php @@ -1,13 +1,13 @@ libdir.'/formslib.php'; - + require_login(); - - require_once('request_form.php'); + + require_once('request_form.php'); if (isguest()) { error("No guests here!"); @@ -16,38 +16,37 @@ 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; diff --git a/course/request_form.php b/course/request_form.php index 884481276c..0fec0af022 100644 --- a/course/request_form.php +++ b/course/request_form.php @@ -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; } } -- 2.39.5