2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2002-2008 by Greg Gay, Joel Kronenberg & Heidi Hazelton*/
6 /* Adaptive Technology Resource Centre / University of Toronto */
9 /* This program is free software. You can redistribute it and/or */
10 /* modify it under the terms of the GNU General Public License */
11 /* as published by the Free Software Foundation. */
12 /************************************************************************/
14 if (!defined('AT_INCLUDE_PATH')) { exit; }
16 require_once(AT_INCLUDE_PATH.'lib/filemanager.inc.php');
17 require_once(AT_INCLUDE_PATH.'lib/admin_categories.inc.php');
18 require_once(AT_INCLUDE_PATH.'lib/tinymce.inc.php');
19 //require_once(AT_INCLUDE_PATH.'lib/course_icon.inc.php');
21 $_GET['show_courses'] = $addslashes(intval($_GET['show_courses']));
22 $_GET['current_cat'] = $addslashes(intval($_GET['current_cat']));
24 if (!isset($_REQUEST['setvisual']) && !isset($_REQUEST['settext'])) {
25 if ($_SESSION['prefs']['PREF_CONTENT_EDITOR'] == 1) {
26 $_POST['formatting'] = 1;
27 $_REQUEST['settext'] = 0;
28 $_REQUEST['setvisual'] = 0;
30 } else if ($_SESSION['prefs']['PREF_CONTENT_EDITOR'] == 2) {
31 $_POST['formatting'] = 1;
32 $_POST['settext'] = 0;
33 $_POST['setvisual'] = 1;
35 } else { // else if == 0
36 $_POST['formatting'] = 0;
37 $_REQUEST['settext'] = 0;
38 $_REQUEST['setvisual'] = 0;
42 if (($_POST['setvisual'] && !$_POST['settext']) || $_GET['setvisual']) {
43 load_editor('banner');
46 if (!isset($isadmin, $course, $db)) {
50 if (isset($_POST['form_course'])) {
52 $row['course_id'] = $_POST['course'];
53 $row['title'] = $_POST['title'];
54 $row['primary_language'] = $_POST['primary_language'];
55 $row['member_id'] = $_POST['member_id'];
56 $row['description'] = $_POST['description'];
57 $row['course_dir_name'] = $_POST['course_dir_name'];
58 $row['cat_id'] = $_POST['cat_id'];
59 $row['content_packaging'] = $_POST['content_packaging'];
61 $row['access'] = $_POST['access'];
62 $row['notify'] = $_POST['notify'];
64 $row['max_quota'] = $_POST['max_quota'];
65 $row['max_file_size'] = $_POST['max_file_size'];
67 $row['created_date'] = date('Y-m-d H:i:s');
68 $row['primary_language'] = $_POST['pri_lang'];
69 $row['rss'] = $_POST['rss'];
71 $row['copyright'] = $_POST['copyright'];
72 $row['icon'] = $_POST['icon'];
73 $row['banner'] = stripcslashes($_POST['banner']);
75 if (intval($_POST['release_date'])) {
76 $day_release = intval($_POST['day_release']);
77 $month_release = intval($_POST['month_release']);
78 $year_release = intval($_POST['year_release']);
79 $hour_release = intval($_POST['hour_release']);
80 $min_release = intval($_POST['min_release']);
82 if (strlen($month_release) == 1){
83 $month_release = "0$month_release";
85 if (strlen($day_release) == 1){
86 $day_release = "0$day_release";
88 if (strlen($hour_release) == 1){
89 $hour_release = "0$hour_release";
91 if (strlen($min_release) == 1){
92 $min_release = "0$min_release";
94 $row['release_date'] = "$year_release-$month_release-$day_release $hour_release:$min_release:00";
96 $row['release_date'] = 0;
99 if (intval($_POST['end_date'])) {
100 $day_end = intval($_POST['day_end']);
101 $month_end = intval($_POST['month_end']);
102 $year_end = intval($_POST['year_end']);
103 $hour_end = intval($_POST['hour_end']);
104 $min_end = intval($_POST['min_end']);
106 if (strlen($month_end) == 1){
107 $month_end = "0$month_end";
109 if (strlen($day_end) == 1){
110 $day_end = "0$day_end";
112 if (strlen($hour_end) == 1){
113 $hour_end = "0$hour_end";
115 if (strlen($min_end) == 1){
116 $min_end = "0$min_end";
118 $row['end_date'] = "$year_end-$month_end-$day_end $hour_end:$min_end:00";
120 $row['end_date'] = 0;
123 } else if ($course) {
124 $sql = "SELECT *, DATE_FORMAT(release_date, '%Y-%m-%d %H:%i:00') AS release_date, DATE_FORMAT(end_date, '%Y-%m-%d %H:%i:00') AS end_date FROM ".TABLE_PREFIX."courses WHERE course_id=$course";
125 $result = mysql_query($sql, $db);
126 if (!($row = mysql_fetch_assoc($result))) {
127 echo _AT('no_course_found');
132 //new course defaults
133 $row['content_packaging'] = 'top';
134 $row['access'] = 'protected';
138 $row['max_quota'] = AT_COURSESIZE_DEFAULT;
139 $row['max_file_size'] = AT_FILESIZE_DEFAULT;
141 $row['primary_language'] = $_SESSION['lang'];
142 $row['created_date'] = date('Y-m-d H:i:s');
143 $row['rss'] = 0; // default to off
144 $row['release_date'] = '0';
145 $row['end_date'] = '0';
148 if (($_POST['setvisual'] || $_POST['settext']) && !$_POST['submit']){
154 <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" name="course_form" enctype="multipart/form-data">
155 <input type="hidden" name="form_course" value="true" />
156 <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_config['prof_pic_max_file_size']; ?>" />
157 <input type="hidden" name="course" value="<?php echo $course; ?>" />
158 <input type="hidden" name="old_access" value="<?php echo $row['access']; ?>" />
159 <input type="hidden" name="created_date" value="<?php echo $row['created_date']; ?>" />
160 <input type="hidden" name="show_courses" value="<?php echo $_GET['show_courses']; ?>" />
161 <input type="hidden" name="current_cat" value="<?php echo $_GET['current_cat']; ?>" />
162 <input type="submit" name="submit" style="display:none;"/>
164 <div class="input-form">
165 <fieldset class="group_form"><legend class="group_form"><?php echo _AT('properties'); ?></legend>
166 <?php if ($isadmin): ?>
168 <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="inst"><?php echo _AT('instructor'); ?></label><br />
170 $sql = "SELECT member_id, login FROM ".TABLE_PREFIX."members WHERE status=".AT_STATUS_INSTRUCTOR;
171 $result = mysql_query($sql, $db);
173 if ($instructor_row = mysql_fetch_assoc($result)) {
174 echo '<select name="instructor" id="inst">';
176 if ($instructor_row['member_id'] == $row['member_id']) {
177 echo '<option value="'.$instructor_row['member_id'].'" selected="selected">'.$instructor_row['login'].'</option>';
179 echo '<option value="'.$instructor_row['member_id'].'">'.$instructor_row['login'].'</option>';
181 } while($instructor_row = mysql_fetch_assoc($result));
184 echo '<span id="inst">'._AT('none_found').'</span>';
191 <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="title"><?php echo _AT('title'); ?></label><br />
192 <input type="text" id="title" name="title" size="40" value="<?php echo htmlspecialchars($row['title']); ?>" />
196 <label for="pri_lang"><?php echo _AT('primary_language'); ?></label><br />
197 <?php $languageManager->printDropdown($row['primary_language'], 'pri_lang', 'pri_lang'); ?>
201 <label for="description"><?php echo _AT('description'); ?></label><br />
202 <textarea id="description" cols="45" rows="2" name="description"><?php echo $row['description']; ?></textarea>
205 <?php if ($_config['course_dir_name']): ?>
207 <label for="course_dir_name"><?php echo _AT('course_dir_name'); ?></label><br />
208 <input type="text" id="course_dir_name" name="course_dir_name" size="40" value="<?php echo htmlspecialchars($row['course_dir_name']); ?>" />
212 <?php $categories = get_categories(); ?>
213 <?php if (is_array($categories)): ?>
215 <label for="cat"><?php echo _AT('category'); ?></label><br />
216 <select name="category_parent" id="cat">
217 <option value="0"> [ <?php echo _AT('cats_uncategorized'); ?> ] </option>
218 <?php select_categories($categories, 0, $row['cat_id'], false); ?>
225 <?php echo _AT('export_content'); ?><br />
227 switch ($row['content_packaging']) {
229 $none = ' checked="checked"';
233 $top = ' checked="checked"';
237 $all = ' checked="checked"';
241 <label><input type="radio" name="content_packaging" value="none" id="none" <?php echo $none; ?> /><?php echo _AT('content_packaging_none'); ?></label><br />
242 <label><input type="radio" name="content_packaging" value="top" id="ctop" <?php echo $top; ?> /><?php echo _AT('content_packaging_top'); ?></label><br />
243 <label><input type="radio" name="content_packaging" value="all" id="all" <?php echo $all; ?> /><?php echo _AT('content_packaging_all'); ?></label>
247 <?php echo _AT('syndicate_announcements'); ?><br />
249 $rss_no = $rss_yes = '';
252 $rss_yes = ' checked="checked"';
254 $rss_no = ' checked="checked"';
257 <label><input type="radio" name="rss" value="1" id="rss_y" <?php echo $rss_yes; ?> /><?php echo _AT('enable_syndicate'); ?></label><br />
258 <label><input type="radio" name="rss" value="0" id="rss_n" <?php echo $rss_no; ?> /><?php echo _AT('disable_syndicate'); ?></label>
262 <?php echo _AT('access'); ?><br />
264 switch ($row['access']) {
266 $pub = ' checked="checked"';
267 $disable = 'disabled="disabled"'; // disable the nofity box
271 $prot = ' checked="checked"';
272 $disable = 'disabled="disabled"'; // disable the nofity box
276 $priv = ' checked="checked"';
280 if ($row['notify']) {
281 $notify = ' checked="checked"';
285 $hide = ' checked="checked"';
288 <input type="radio" name="access" value="public" id="pub" onclick="disableNotify();" <?php echo $pub; ?> /><label for="pub"><strong> <?php echo _AT('public'); ?>: </strong></label><?php echo _AT('about_public'); ?><br /><br />
290 <input type="radio" name="access" value="protected" id="prot" onclick="disableNotify();" <?php echo $prot; ?> /><label for="prot"><strong><?php echo _AT('protected'); ?>:</strong></label> <?php echo _AT('about_protected'); ?><br /><br />
292 <input type="radio" name="access" value="private" id="priv" onclick="enableNotify();" <?php echo $priv; ?> /><label for="priv"><strong><?php echo _AT('private'); ?>:</strong></label> <?php echo _AT('about_private'); ?><br />
293 <input type="checkbox" name="notify" id="notify" value="1" <?php
295 echo $notify; ?> /><label for="notify"><?php echo _AT('email_approvals'); ?></label>
297 <input type="checkbox" name="hide" id="hide" value="1" <?php
299 echo $hide; ?> /><label for="hide"><?php echo _AT('hide_course'); ?></label>.
303 <?php echo _AT('release_date'); ?><br />
305 $rel_no = $rel_yes = '';
307 if (intval($row['release_date'])) {
308 $rel_yes = ' checked="checked"';
310 $today_day = substr($row['release_date'], 8, 2);
311 $today_mon = substr($row['release_date'], 5, 2);
312 $today_year = substr($row['release_date'], 0, 4);
314 $today_hour = substr($row['release_date'], 11, 2);
315 $today_min = substr($row['release_date'], 14, 2);
317 $rel_no = ' checked="checked"';
318 $today_year = date('Y');
323 <input type="radio" name="release_date" value="0" id="release_now" <?php echo $rel_no; ?> /> <label for="release_now"><?php echo _AT('available_immediately'); ?></label><br />
326 <input type="radio" name="release_date" value="1" id="release_later" <?php echo $rel_yes; ?> /> <label for="release_later"><?php echo _AT('release_on'); ?></label>
329 require(AT_INCLUDE_PATH.'html/release_date.inc.php');
334 <?php echo _AT('end_date'); ?><br />
336 $end_no = $end_yes = '';
338 if (intval($row['end_date'])) {
339 $end_yes = ' checked="checked"';
341 $today_day = substr($row['end_date'], 8, 2);
342 $today_mon = substr($row['end_date'], 5, 2);
343 $today_year = substr($row['end_date'], 0, 4);
345 $today_hour = substr($row['end_date'], 11, 2);
346 $today_min = substr($row['end_date'], 14, 2);
348 $end_no = ' checked="checked"';
349 $today_year = date('Y')+1;
354 <input type="radio" name="end_date" value="0" id="end_now" <?php echo $end_no; ?> /> <label for="end_now"><?php echo _AT('no_end_date'); ?></label><br />
356 <input type="radio" name="end_date" value="1" id="end_later" <?php echo $end_yes; ?> /> <label for="end_later"><?php echo _AT('end_on'); ?></label>
359 require(AT_INCLUDE_PATH.'html/release_date.inc.php');
365 if (($_POST['setvisual'] && !$_POST['settext']) || $_GET['setvisual']){
366 echo '<input type="hidden" name="setvisual" value="'.$_POST['setvisual'].'" />';
367 echo '<input type="submit" name="settext" value="'._AT('switch_text').'" />';
369 echo '<input type="submit" name="setvisual" value="'._AT('switch_visual').'" />';
375 <label for="banner"><?php echo _AT('banner'); ?></label><br />
376 <textarea id="banner" cols="45" rows="15" name="banner"><?php echo $row['banner']; ?></textarea>
379 <?php if (!$course) : ?>
381 <label for="initial_content"><?php echo _AT('initial_content'); ?></label><br />
382 <select name="initial_content" id="initial_content" size="5">
383 <option value="0"><?php echo _AT('empty'); ?></option>
384 <option value="1" selected="selected"><?php echo _AT('create_basic'); ?></option>
386 $Backup = new Backup($db);
389 $sql = "SELECT course_id, title FROM ".TABLE_PREFIX."courses ORDER BY title";
391 $sql = "SELECT course_id, title FROM ".TABLE_PREFIX."courses WHERE member_id=$_SESSION[member_id] ORDER BY title";
394 $result = mysql_query($sql, $db);
396 if ($course_row = mysql_fetch_assoc($result)) {
398 $Backup->setCourseID($course_row['course_id']);
399 $list = $Backup->getAvailableList();
402 echo '<optgroup label="'. _AT('restore').': '.$course_row['title'].'">';
403 foreach ($list as $list_item) {
404 echo '<option value="'.$list_item['backup_id'].'_'.$list_item['course_id'].'">'.$list_item['file_name'].' - '.get_human_size($list_item['file_size']).'</option>';
408 } while ($course_row = mysql_fetch_assoc($result));
413 <?php endif; // !$course_id ?>
415 <?php if ($isadmin) : ?>
417 <?php echo _AT('course_quota'); ?><br />
419 if ($row['max_quota'] == AT_COURSESIZE_UNLIMITED) {
420 $c_unlim = ' checked="checked" ';
421 $c_oth2 = ' disabled="disabled" ';
422 } elseif ($row['max_quota'] == AT_COURSESIZE_DEFAULT) {
423 $c_def = ' checked="checked" ';
424 $c_oth2 = ' disabled="disabled" ';
426 $c_oth = ' checked="checked" ';
431 $course_size = dirsize(AT_CONTENT_DIR . $course.'/');
437 echo _AT('current_course_size') .': '.get_human_size($course_size).'<br />';
441 <input type="radio" id="c_default" name="quota" value="<?php echo AT_COURSESIZE_DEFAULT; ?>" onclick="disableOther();" <?php echo $c_def;?> /><label for="c_default"> <?php echo _AT('default') . ' ('.get_human_size($MaxCourseSize).')'; ?></label> <br />
442 <input type="radio" id="c_unlim" name="quota" value="<?php echo AT_COURSESIZE_UNLIMITED; ?>" onclick="disableOther();" <?php echo $c_unlim;?>/><label for="c_unlim"> <?php echo _AT('unlimited'); ?></label> <br />
443 <input type="radio" id="c_other" name="quota" value="2" onclick="enableOther();" <?php echo $c_oth;?>/><label for="c_other"> <?php echo _AT('other'); ?> </label> -
444 <input type="text" id="quota_entered" name="quota_entered" <?php echo $c_oth2?> value="<?php if ($row['max_quota']!=AT_COURSESIZE_UNLIMITED && $row['max_quota']!=AT_COURSESIZE_DEFAULT) { echo bytes_to_megabytes($row['max_quota']); } ?>" size="4" /> <?php echo _AT('mb'); ?>
448 <?php echo _AT('max_file_size'); ?><br />
450 $max_allowed = megabytes_to_bytes(substr(ini_get('upload_max_filesize'), 0, -1));
452 if ($row['max_file_size'] == AT_FILESIZE_DEFAULT) {
453 $f_def = ' checked="checked" ';
454 $f_oth2 = ' disabled="disabled" ';
455 } elseif ($row['max_file_size'] == AT_FILESIZE_SYSTEM_MAX) {
456 $f_max = ' checked="checked" ';
457 $f_oth2 = ' disabled="disabled" ';
459 $f_oth = ' checked="checked" ';
463 <input type="radio" id="f_default" name="filesize" value="<?php echo AT_FILESIZE_DEFAULT; ?>" onclick="disableOther2();" <?php echo $f_def;?> /><label for="f_default"> <?php echo _AT('default') . ' ('.get_human_size($MaxFileSize).')'; ?></label> <br />
464 <input type="radio" id="f_maxallowed" name="filesize" value="<?php echo AT_FILESIZE_SYSTEM_MAX; ?>" onclick="disableOther2();" <?php echo $f_max;?>/><label for="f_maxallowed"> <?php echo _AT('max_file_size_system') . ' ('.get_human_size($max_allowed).')'; ?></label> <br />
465 <input type="radio" id="f_other" name="filesize" value="2" onclick="enableOther2();" <?php echo $f_oth;?>/><label for="f_other"> <?php echo _AT('other'); ?> </label> -
466 <input type="text" id="filesize_entered" name="filesize_entered" <?php echo $f_oth2?> value="<?php if ($row['max_file_size']!=AT_FILESIZE_DEFAULT && $row['max_file_size']!=AT_FILESIZE_SYSTEM_MAX) { echo bytes_to_megabytes($row['max_file_size']); } ?>" size="4" /> <?php echo _AT('mb'); ?>
470 <input type="hidden" name="quota" value="<?php echo $row['max_quota']; ?>" />
471 <input type="hidden" name="filesize" value="<?php echo $row['max_file_size']; ?>" />
472 <input type="hidden" name="tracking" value="<?php echo $row['tracking']; ?>" />
476 <label for="copyright"><?php echo _AT('course_copyright'); ?></label><br />
477 <textarea name="copyright" rows="2" cols="65" id="copyright"><?php echo $row['copyright']; ?></textarea>
481 if ($row['icon'] != ''):
482 $path = AT_CONTENT_DIR.$row['course_id']."/custom_icons/";
483 if (file_exists($path.$row['icon'])) {
484 if (defined('AT_FORCE_GET_FILE') && AT_FORCE_GET_FILE) {
485 $_base_href = 'get_course_icon.php/?id='.$row['course_id'];
487 $_base_href = 'content/' . $row['course_id'] . '/';
490 $_base_href = "images/courses/";
491 //$_base_href = 'get_course_icon.php/?id='.$row['course_id'];
494 $force_get = (defined('AT_FORCE_GET_FILE') && AT_FORCE_GET_FILE) ? true : false;
495 echo "<input type='hidden' name='boolForce' id='boolForce' value='$force_get' />";
497 //include(AT_INCLUDE_PATH.'html/course_icon.inc.php');
501 <img id="i0" src="<?php echo $_base_href.$row['icon']; ?>" alt="<?php echo $row['icon']; ?>" border="1" height="79" width="79" style="float: left; margin: 2px;" />
504 <img id="i0" src="images/clr.gif" alt="" style="float: left; margin: 2px;" border="1" height="79" width="79" />
505 <input type='hidden' name='boolForce' id='boolForce' value='' />
507 <div style="width:40%; float:left;">
508 <label for="icons"><?php echo _AT('icon'); ?></label><br />
509 <select name="icon" id="icons" onchange="SelectImg()">
510 <option value=""><?php echo _AT('no_icon'); ?></option>
511 <?php // ------------- custom course icons
512 $path = AT_CONTENT_DIR.$row['course_id']."/custom_icons/";
517 $boolCustom = true; // true if custom icons are uploaded, otherwise false
519 /*$files = scandir($path); //SCANDIR STOPS ATUTOR WHEN RUN AS INSTRUCTOR, BUT NOT AS ADMIN. WHY? -Gorzan */
521 /* PHP 4 REPLACEMENT FOR SCANDIR */
522 $dh = opendir($path);
523 while (false !== ($filename = readdir($dh))) {
524 $files[] = $filename;
527 /*END PHP 4 REPLACEMENT FOR SCANDIR*/
528 echo "<optgroup label='"._AT('custom_icons')."'>";
529 foreach($files as $val) {
530 $file_ext = substr(strtolower($val), -3);
531 if ($file_ext == "jpg" || $file_ext == "png" || $file_ext == "gif") {
533 echo "<option value='".$val."'";
534 if ($val == $row['icon']) {
535 echo 'selected="selected"';
537 echo ">".$val."</option>";
544 <?php // ------------- other icons
546 $course_imgs = array();
547 if ($dir = opendir('../images/courses/')) {
548 while (false !== ($file = readdir($dir)) ) {
549 if( ($file == '.') || ($file == '..')) {
552 $course_imgs[] = $file;
557 if ($boolCustom == true) {
558 echo "<optgroup label='"._AT('builtin_icons')."'>";
560 foreach ($course_imgs as $file) {
561 echo '<option value="' . $file . '" ';
562 if ($file == $row['icon']) {
563 echo 'selected="selected"';
565 echo ' >' . $file . '</option>';
567 if ($boolCustom == true) {
571 </select><?php echo " "._AT('or'); ?>
573 <!-- div class="row" style="float:right;width:40%;">
574 <?php echo _AT('upload_icon'); ?><br />
575 <input type="file" name="customicon" id="customicon" value="<?php echo $_POST['customicon']; ?>"/><br />
576 <small><?php echo _AT('upload_icon_text'); ?></small>
579 <?php require_once(AT_INCLUDE_PATH.'html/course_icon.inc.php'); ?>
581 <br style="clear: left;" />
585 <div style="clear: both;"></div>
589 <div class="buttons">
591 echo "<input type='hidden' name='custOptCount' id='custOptCount' value='".$optCount."' />";
592 echo "<input type='hidden' name='courseId' id='courseId' value='".$row['course_id']."' />";
595 <input type="submit" name="submit" value="<?php echo _AT('save'); ?>" accesskey="s" />
596 <input type="submit" name="cancel" value="<?php echo _AT('cancel');?>" />
604 if ($_POST['customicon']) {
605 echo "<script language='javascript' type='text/javascript'>document.getElementById('uploadform').focus();</script>";
609 <script language="javascript" type="text/javascript">
611 function enableNotify() {
612 document.course_form.notify.disabled = false;
613 document.course_form.hide.disabled = false;
616 function disableNotify() {
617 document.course_form.notify.disabled = true;
618 document.course_form.hide.disabled = true;
621 function enableOther() { document.course_form.quota_entered.disabled = false; }
622 function disableOther() { document.course_form.quota_entered.disabled = true; }
623 function enableOther2() { document.course_form.filesize_entered.disabled = false; }
624 function disableOther2() { document.course_form.filesize_entered.disabled = true; }
626 function enableRelease() {
627 document.course_form.day_release.disabled = false;
628 document.course_form.month_release.disabled = false;
629 document.course_form.year_release.disabled = false;
630 document.course_form.hour_release.disabled = false;
631 document.course_form.min_release.disabled = false;
633 function disableRelease() {
634 document.course_form.day_release.disabled = true;
635 document.course_form.month_release.disabled = true;
636 document.course_form.year_release.disabled = true;
637 document.course_form.hour_release.disabled = true;
638 document.course_form.min_release.disabled = true;
641 function SelectImg() {
642 // UPDATED by Martin Turlej - for custom course icon
644 var boolForce = document.getElementById('boolForce').value;
645 if (document.course_form.icon.options[document.course_form.icon.selectedIndex].value == "") {
646 document.getElementById('i0').src = "images/clr.gif";
647 document.getElementById('i0').alt = "";
649 var iconIndx = document.course_form.icon.selectedIndex;
650 var custIndx = document.getElementById('custOptCount').value;
651 var courseId = document.getElementById('courseId').value;
653 // if icon is part of custom icons choose corresponding directory
654 if (iconIndx <= custIndx && boolForce != '') {
655 var dir = (boolForce == 1) ? "get_course_icon.php/?id="+courseId : "/content/"+courseId+"/custom_icons/";
657 var dir = "images/courses/";
660 document.getElementById('i0').src = dir + document.course_form.icon.options[iconIndx].value;
661 document.getElementById('i0').alt = document.course_form.icon.options[iconIndx].value;
665 function toggleFrm(id) {
666 if (document.getElementById(id).style.display == "none") {
668 document.getElementById(id).style.display='';
670 if (id == "c_folder") {
671 document.form0.new_folder_name.focus();
672 } else if (id == "upload") {
673 document.form0.file.focus();
678 document.getElementById(id).style.display='none';