2 // Make sure all variables are defined
3 if (!isset($form->showreports
)) {
4 $form->showreports
= 0;
6 if (!isset($form->maxbytes
)) {
9 if (!isset($form->hiddensections
)) {
10 $form->hiddensections
= 0;
12 if (!isset($form->lang
)) {
15 if (!isset($form->theme
)) {
18 if (!isset($form->enrol
)) {
21 if (!isset($form->enrollable
)) {
22 $form->enrollable
= 1;
24 if (!isset($form->enrolstartdate
)) {
25 $form->enrolstartdate
= 0;
27 if (!$form->enrolstartdate
) {
28 $form->enrolstartdisabled
= 1;
30 if (!isset($form->enrolenddate
)) {
31 $form->enrolenddate
= 0;
33 if (!$form->enrolenddate
) {
34 $form->enrolenddisabled
= 1;
36 if (!isset($form->enrolperiod
)) {
37 $form->enrolperiod
= 0;
39 if (!isset($form->expirynotify
)) {
40 $form->expirynotify
= 0;
42 if (!isset($form->notifystudents
)) {
43 $form->notifystudents
= 0;
45 if (!isset($form->expirythreshold
)) {
46 $form->expirythreshold
= 10 * 86400;
48 if (!isset($form->metacourse
)) {
49 $form->metacourse
= 0;
51 if(!isset($form->restrictmodules
)) {
52 $form->restrictmodules
= 0;
55 <form method=
"post" action=
"edit.php" name=
"form">
56 <table cellpadding=
"9" cellspacing=
"0" >
57 <?php if (iscreator()) { ?>
59 <td align=
"right"><?php print_string("category") ?>:
</td>
61 $displaylist = array();
62 $parentlist = array();
63 make_categories_list($displaylist, $parentlist);
64 choose_from_menu($displaylist, "category", "$form->category", "");
65 helpbutton("coursecategory", get_string("category"));
71 <td align=
"right"><?php print_string("fullname") ?>:
</td>
72 <td><input type=
"text" name=
"fullname" maxlength=
"254" size=
"50" value=
"<?php p($form->fullname) ?>" alt
="<?php print_string("fullname
") ?>" />
73 <?php
helpbutton("coursefullname", get_string("fullname")) ?>
74 <?php if (isset($err["fullname"])) formerr($err["fullname"]); ?>
78 <td align=
"right"><?php print_string("shortname") ?>:
</td>
79 <td><input type=
"text" name=
"shortname" maxlength=
"15" size=
"10" value=
"<?php p($form->shortname) ?>" alt
="<?php print_string("shortname
") ?>" />
80 <?php
helpbutton("courseshortname", get_string("shortname")) ?>
81 <?php if (isset($err["shortname"])) formerr($err["shortname"]); ?>
85 <td align=
"right"><?php print_string("idnumber") ?>:
</td>
86 <td><input type=
"text" name=
"idnumber" maxlength=
"100" size=
"10" value=
"<?php p($form->idnumber) ?>" alt
="><?php print_string("idnumber
") ?>" />
87 <?php
helpbutton("courseidnumber", get_string("idnumber")) ?>
88 <?php if (isset($err["idnumber"])) formerr($err["idnumber"]); ?>
92 <td align=
"right"><?php print_string("summary") ?>:
</td>
94 print_textarea($usehtmleditor, 10, 50, 660, 200, "summary", $form->summary
);
95 helpbutton("text", get_string("helptext"));
96 if (isset($err["summary"])) formerr($err["summary"]);
101 <td align=
"right"><?php print_string("format") ?>:
</td>
103 choose_from_menu ($form->courseformats
, "format", "$form->format", "");
104 helpbutton("courseformats", get_string("courseformats"));
109 <td align=
"right"><?php print_string("startdate") ?>:
</td>
111 print_date_selector("startday", "startmonth", "startyear", $form->startdate
);
112 helpbutton("coursestartdate", get_string("startdate"));
116 <td align=
"right"><?php print_string("enrolmentplugins") ?>:
</td>
119 $modules = explode(',', $CFG->enrol_plugins_enabled
);
120 foreach ($modules as $module) {
121 $name = get_string("enrolname", "enrol_$module");
122 $plugin = enrolment_factory
::factory($module);
123 if (method_exists($plugin, 'print_entry')) {
124 $choices[$name] = $module;
128 $choices = array_flip($choices);
129 $choices = array_merge(array('' => get_string('sitedefault').' ('.get_string("enrolname", "enrol_$CFG->enrol").')'), $choices);
130 choose_from_menu ($choices, "enrol", "$form->enrol", "");
131 helpbutton("courseenrolmentplugins", get_string("enrolmentplugins"));
135 <td align=
"right"><?php print_string("enrollable") ?>:
</td>
138 $choices["0"] = get_string("no");
139 $choices["1"] = get_string("yes");
140 $choices["2"] = get_string("enroldate");
141 choose_from_radio ($choices, "enrollable", "$form->enrollable", "");
142 helpbutton("courseenrollable", get_string("enrollable"));
145 <tr valign=
"top" id=
"daterange">
146 <td align=
"right"><?php print_string("enroldate") ?>:
</td>
148 <table cellpadding=
"0" cellspacing=
"0">
150 <td align=
"right"><?php print_string('enrolstartdate') ?>:
</td>
152 print_date_selector("enrolstartday", "enrolstartmonth", "enrolstartyear", $form->enrolstartdate
);
153 print_string('disable');
155 print_checkbox('enrolstartdisabled', 1, "$form->enrolstartdisabled");
159 <td height=
"18" colspan=
"2"> </td>
162 <td align=
"right"><?php print_string('enrolenddate') ?>:
</td>
164 print_date_selector("enrolendday", "enrolendmonth", "enrolendyear", $form->enrolenddate
);
165 print_string('disable');
167 print_checkbox('enrolenddisabled', 1, "$form->enrolenddisabled");
168 if (isset($err["enroldate"])) formerr($err["enroldate"]);
175 <td align=
"right"><?php print_string("enrolperiod") ?>:
</td>
178 $periodmenu[0] = get_string('unlimited');
179 for ($i=1; $i<=365; $i++
) {
180 $seconds = $i * 86400;
181 $periodmenu[$seconds] = get_string('numdays', '', $i);
183 choose_from_menu ($periodmenu, "enrolperiod", "$form->enrolperiod", "");
184 helpbutton("enrolperiod", get_string("enrolperiod"));
187 </tr><tr valign=
"top">
188 <td align=
"right"><?php print_string("expirynotify") ?>:
</td>
192 $choices["0"] = get_string("no");
193 $choices["1"] = get_string("yes");
194 choose_from_menu ($choices, "expirynotify", "$form->expirynotify", "");
195 helpbutton("expirynotify", get_string("expirynotify"));
197 echo ' ';
198 print_string('expirynotifystudents');
200 choose_from_menu ($choices, "notifystudents", "$form->notifystudents", "");
201 helpbutton("expirynotifystudents", get_string("expirynotifystudents"));
203 echo ' ';
204 print_string('expirythreshold');
206 for ($i=1; $i<=30; $i++
) {
207 $seconds = $i * 86400;
208 $thresholdmenu[$seconds] = get_string('numdays', '', $i);
210 choose_from_menu ($thresholdmenu, "expirythreshold", "$form->expirythreshold", "");
211 helpbutton("expirythreshold", get_string("expirythreshold"));
216 <td align=
"right"><?php print_string("numberweeks") ?>:
</td>
218 for ($i=1; $i<=52; $i++
) {
219 $sectionmenu[$i] = "$i";
221 choose_from_menu ($sectionmenu, "numsections", "$form->numsections", "");
222 helpbutton("coursenumsections", get_string("numberweeks"));
226 <td align=
"right"><?php print_string("groupmode") ?>:
</td>
229 $choices[NOGROUPS
] = get_string("groupsnone");
230 $choices[SEPARATEGROUPS
] = get_string("groupsseparate");
231 $choices[VISIBLEGROUPS
] = get_string("groupsvisible");
232 choose_from_menu ($choices, "groupmode", $form->groupmode
, "");
233 helpbutton("groupmode", get_string("groupmode"));
235 echo ' ';
236 print_string('force');
239 $choices["0"] = get_string("no");
240 $choices["1"] = get_string("yes");
241 choose_from_menu ($choices, "groupmodeforce", $form->groupmodeforce
, "");
242 helpbutton("groupmodeforce", get_string("groupmodeforce")); ?>
246 <td align=
"right"><?php print_string("availability") ?>:
</td>
249 $choices["0"] = get_string("courseavailablenot");
250 $choices["1"] = get_string("courseavailable");
251 choose_from_menu ($choices, "visible", $form->visible
, "");
252 helpbutton("courseavailability", get_string("availability")); ?>
256 <td align=
"right"><?php print_string("enrolmentkey") ?>:
</td>
257 <td><input type=
"text" name=
"password" size=
"25" value=
"<?php p($form->password) ?>" alt
="<?php print_string("enrolmentkey
") ?>" />
258 <?php
helpbutton("enrolmentkey", get_string("enrolmentkey")) ?>
259 <?php if (isset($err["password"])) formerr($err["password"]); ?>
263 <td align=
"right"><?php print_string("opentoguests") ?>:
</td>
266 $choices["0"] = get_string("guestsno");
267 $choices["1"] = get_string("guestsyes");
268 $choices["2"] = get_string("guestskey");
269 choose_from_menu ($choices, "guest", $form->guest
, "");
270 helpbutton("guestaccess", get_string("opentoguests")); ?>
274 if (method_exists(enrolment_factory
::factory($course->enrol
), 'print_entry') && $course->enrol
!= 'manual') {
277 <td align=
"right"><?php print_string("cost") ?>:
</td>
278 <td><input type=
"text" name=
"cost" maxlength=
"6" size=
"6" value=
"<?php p($form->cost) ?>" alt
="<?php print_string("cost
") ?>" />
280 $currencies = get_list_of_currencies();
281 choose_from_menu($currencies, 'currency', $form->currency
, '');
282 helpbutton("cost", get_string("cost"));
290 <td align=
"right"><?php print_string("hiddensections") ?>:
</td>
293 $choices["0"] = get_string("hiddensectionscollapsed");
294 $choices["1"] = get_string("hiddensectionsinvisible");
295 choose_from_menu ($choices, "hiddensections", $form->hiddensections
, "");
296 helpbutton("coursehiddensections", get_string("hiddensections")); ?>
300 <td align=
"right"><?php print_string("newsitemsnumber") ?>:
</td>
302 $newsitem = get_string("newsitem");
303 $newsitems = get_string("newsitems");
305 $options = array("0" => "0 $newsitems",
306 "1" => "1 $newsitem",
307 "2" => "2 $newsitems",
308 "3" => "3 $newsitems",
309 "4" => "4 $newsitems",
310 "5" => "5 $newsitems",
311 "6" => "6 $newsitems",
312 "7" => "7 $newsitems",
313 "8" => "8 $newsitems",
314 "9" => "9 $newsitems",
315 "10" => "10 $newsitems");
316 choose_from_menu ($options, "newsitems", "$form->newsitems", "");
317 helpbutton("coursenewsitems", get_string("newsitemsnumber"));
322 <td align=
"right"><?php print_string("showgrades") ?>:
</td>
325 $choices["0"] = get_string("no");
326 $choices["1"] = get_string("yes");
327 choose_from_menu ($choices, "showgrades", $form->showgrades
, "");
328 helpbutton("coursegrades", get_string("grades")); ?>
332 <td align=
"right"><?php print_string("showreports") ?>:
</td>
335 $choices["0"] = get_string("no");
336 $choices["1"] = get_string("yes");
337 choose_from_menu ($choices, "showreports", $form->showreports
, "");
338 helpbutton("coursereports", get_string("activityreport")); ?>
342 <td align=
"right"><?php print_string("maximumupload") ?>:
</td>
344 $choices = get_max_upload_sizes($CFG->maxbytes
);
345 choose_from_menu ($choices, "maxbytes", $form->maxbytes
, "");
346 helpbutton("courseuploadsize", get_string("maximumupload")); ?>
350 <td align=
"right"><?php print_string("wordforteacher") ?>:
</td>
351 <td><input type=
"text" name=
"teacher" maxlength=
"100" size=
"25" value=
"<?php p($form->teacher) ?>" alt
="<?php print_string("wordforteacher
") ?>" />
352 (<?php
print_string("wordforteachereg") ?>)
353 <?php if (isset($err["teacher"])) formerr($err["teacher"]); ?>
357 <td align=
"right"><?php print_string("wordforteachers") ?>:
</td>
358 <td><input type=
"text" name=
"teachers" maxlength=
"100" size=
"25" value=
"<?php p($form->teachers) ?>" alt
="<?php print_string("wordforteachers
") ?>" />
359 (<?php
print_string("wordforteacherseg") ?>)
360 <?php if (isset($err["teachers"])) formerr($err["teachers"]); ?>
364 <td align=
"right"><?php print_string("wordforstudent") ?>:
</td>
365 <td><input type=
"text" name=
"student" maxlength=
"100" size=
"25" value=
"<?php p($form->student) ?>" alt
="<?php print_string("wordforstudent
") ?>" />
366 (<?php
print_string("wordforstudenteg") ?>)
367 <?php if (isset($err["student"])) formerr($err["student"]); ?>
371 <td align=
"right"><?php print_string("wordforstudents") ?>:
</td>
372 <td><input type=
"text" name=
"students" maxlength=
"100" size=
"25" value=
"<?php p($form->students) ?>" alt
="<?php print_string("wordforstudents
") ?>" />
373 (<?php
print_string("wordforstudentseg") ?>)
374 <?php if (isset($err["students"])) formerr($err["students"]); ?>
378 <td align=
"right"><?php print_string("forcelanguage") ?>:
</td>
381 $languages[''] = get_string("forceno");
382 $languages +
= get_list_of_languages();
383 choose_from_menu ($languages, "lang", $form->lang
, "", "", "");
387 <?php if (!empty($CFG->allowcoursethemes
)) { ?>
389 <td align=
"right"> <?php print_string("forcetheme") ?>:
</td>
392 $themes[''] = get_string("forceno");
393 $themes +
= get_list_of_themes();
394 choose_from_menu($themes, 'theme', $form->theme
, "", "", "");
400 <td align=
"right"><?php print_string("managemeta") ?>:
</td>
403 if (empty($disable_meta)) {
404 $meta[0] = get_string('no');
405 $meta[1] = get_string('yes');
406 choose_from_menu($meta,"metacourse",$form->metacourse
,"","","");
408 echo ((empty($form->metacourse
)) ?
get_string("no") : get_string("yes"));
409 echo " - $disable_meta ";
411 helpbutton("metacourse", get_string("metacourse"));?>
414 <?php if (isadmin() && ((!empty($course->requested
) && $CFG->restrictmodulesfor
== 'requested') ||
$CFG->restrictmodulesfor
== 'all')) { ?>
416 <td align=
"right"><?php print_string("restrictmodules") ?>:
</td>
417 <td valign=
"top"><table cellpadding=
"0" border=
"0"><tr valign=
"top"><td>
418 <script language=
"JavaScript">
419 function togglemodules(index
) {
421 document
.getElementById('allowedmods').disabled
=true;
424 document
.getElementById('allowedmods').disabled
=false;
430 $options[0] = get_string("no");
431 $options[1] = get_string("yes");
432 choose_from_menu($options,"restrictmodules",$form->restrictmodules
,"","togglemodules(this.selectedIndex);","");
433 ?> </td><td> <?php p(strtolower(get_string('to')));
?> </td><td>
434 <select name=
"allowedmods[]" id=
"allowedmods" multiple=
"multiple" size=
"10" <?php echo ((empty($form->restrictmodules
)) ?
"disabled=\"disabled\"" : ""); ?>>
436 $mods = get_records("modules");
437 $s = "selected=\"selected\"";
438 echo '<option value="0" '.((empty($allowedmods)) ?
$s : '').'>'.get_string('allownone').'</option>'."\n";
439 foreach ($mods as $mod) {
441 if (in_array($mod->id
,$allowedmods))
443 echo '<option '.$selected.' value="'.$mod->id
.'">'.$mod->name
.'</option>'."\n";
446 </select></td></tr></table></td>
449 <input type=
"hidden" name=
"restrictmodules" value=
"<?php p($form->restrictmodules); ?>" />
453 <td><input type=
"submit" value=
"<?php print_string("savechanges
") ?>" /></td
>
456 <?php
if(!iscreator()) { ?>
457 <input type=
"hidden" name=
"category" value=
"<?php echo $form->category ?>" />
459 <input type=
"hidden" name=
"id" value=
"<?php echo $form->id ?>" />
460 <input type
="hidden" name
="sesskey" value
="<?php echo $form->sesskey ?>" />