2 <?php global $languageManager, $_config, $MaxCourseSize, $MaxFileSize;
5 <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" name="course_form" enctype="multipart/form-data">
6 <input type="hidden" name="form_course" value="true" />
7 <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_config['prof_pic_max_file_size']; ?>" />
8 <input type="hidden" name="course" value="<?php echo $this->course; ?>" />
9 <input type="hidden" name="old_access" value="<?php echo $this->row['access']; ?>" />
10 <input type="hidden" name="created_date" value="<?php echo $this->row['created_date']; ?>" />
11 <input type="hidden" name="show_courses" value="<?php echo $_GET['show_courses']; ?>" />
12 <input type="hidden" name="current_cat" value="<?php echo $_GET['current_cat']; ?>" />
13 <input type="submit" name="submit" style="display:none;"/>
15 <div class="input-form">
16 <fieldset class="group_form"><legend class="group_form"><?php echo _AT('properties'); ?></legend>
17 <?php if ($this->isadmin): ?>
19 <span class="required" title="<?php echo _AT('required_field'); ?>">*</span><label for="inst"><?php echo _AT('instructor'); ?></label><br />
22 if ($instructor_row = mysql_fetch_assoc($this->result)) {
23 echo '<select name="instructor" id="inst">';
25 if ($instructor_row['member_id'] == $this->row['member_id']) {
26 echo '<option value="'.$instructor_row['member_id'].'" selected="selected">'.$instructor_row['login'].'</option>';
28 echo '<option value="'.$instructor_row['member_id'].'">'.$instructor_row['login'].'</option>';
30 } while($instructor_row = mysql_fetch_assoc($this->result));
33 echo '<span id="inst">'._AT('none_found').'</span>';
40 <span class="required" title="<?php echo _AT('required_field'); ?>">*</span><label for="title"><?php echo _AT('title'); ?></label><br />
41 <input type="text" id="title" name="title" size="40" value="<?php echo htmlspecialchars($this->row['title']); ?>" />
45 <label for="pri_lang"><?php echo _AT('primary_language'); ?></label><br />
46 <?php $languageManager->printDropdown($this->row['primary_language'], 'pri_lang', 'pri_lang'); ?>
50 <label for="description"><?php echo _AT('description'); ?></label><br />
51 <textarea id="description" cols="45" rows="2" name="description"><?php echo $this->row['description']; ?></textarea>
54 <?php if ($_config['course_dir_name']): ?>
56 <label for="course_dir_name"><?php echo _AT('course_dir_name'); ?></label><br />
57 <input type="text" id="course_dir_name" name="course_dir_name" size="40" value="<?php echo htmlspecialchars($this->row['course_dir_name']); ?>" />
61 <?php $categories = get_categories(); ?>
62 <?php if (is_array($categories)): ?>
64 <label for="cat"><?php echo _AT('category'); ?></label><br />
65 <select name="category_parent" id="cat">
66 <option value="0"> [ <?php echo _AT('cats_uncategorized'); ?> ] </option>
67 <?php select_categories($categories, 0, $this->row['cat_id'], false); ?>
74 <?php echo _AT('export_content'); ?><br />
76 switch ($this->row['content_packaging']) {
78 $none = ' checked="checked"';
82 $top = ' checked="checked"';
86 $all = ' checked="checked"';
90 <label><input type="radio" name="content_packaging" value="none" id="none" <?php echo $none; ?> /><?php echo _AT('content_packaging_none'); ?></label><br />
91 <label><input type="radio" name="content_packaging" value="top" id="ctop" <?php echo $top; ?> /><?php echo _AT('content_packaging_top'); ?></label><br />
92 <label><input type="radio" name="content_packaging" value="all" id="all" <?php echo $all; ?> /><?php echo _AT('content_packaging_all'); ?></label>
96 <?php echo _AT('syndicate_announcements'); ?><br />
98 $rss_no = $rss_yes = '';
100 if ($this->row['rss']) {
101 $rss_yes = ' checked="checked"';
103 $rss_no = ' checked="checked"';
106 <label><input type="radio" name="rss" value="1" id="rss_y" <?php echo $rss_yes; ?> /><?php echo _AT('enable_syndicate'); ?></label><br />
107 <label><input type="radio" name="rss" value="0" id="rss_n" <?php echo $rss_no; ?> /><?php echo _AT('disable_syndicate'); ?></label>
111 <?php echo _AT('access'); ?><br />
113 switch ($this->row['access']) {
115 $pub = ' checked="checked"';
116 $disable = 'disabled="disabled"'; // disable the nofity box
120 $prot = ' checked="checked"';
121 $disable = 'disabled="disabled"'; // disable the nofity box
125 $priv = ' checked="checked"';
129 if ($this->row['notify']) {
130 $notify = ' checked="checked"';
133 if ($this->row['hide']) {
134 $hide = ' checked="checked"';
137 <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 />
139 <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 />
141 <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 />
142 <input type="checkbox" name="notify" id="notify" value="1" <?php
144 echo $notify; ?> /><label for="notify"><?php echo _AT('email_approvals'); ?></label>
146 <input type="checkbox" name="hide" id="hide" value="1" <?php
148 echo $hide; ?> /><label for="hide"><?php echo _AT('hide_course'); ?></label>.
152 <?php echo _AT('release_date'); ?><br />
154 $rel_no = $rel_yes = '';
156 if (intval($this->row['release_date'])) {
157 $rel_yes = ' checked="checked"';
159 $today_day = substr($this->row['release_date'], 8, 2);
160 $today_mon = substr($this->row['release_date'], 5, 2);
161 $today_year = substr($this->row['release_date'], 0, 4);
163 $today_hour = substr($this->row['release_date'], 11, 2);
164 $today_min = substr($this->row['release_date'], 14, 2);
166 $rel_no = ' checked="checked"';
167 $today_year = date('Y');
172 <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 />
175 <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>
178 require(AT_INCLUDE_PATH.'html/release_date.inc.php');
183 <?php echo _AT('end_date'); ?><br />
185 $end_no = $end_yes = '';
187 if (intval($this->row['end_date'])) {
188 $end_yes = ' checked="checked"';
190 $today_day = substr($this->row['end_date'], 8, 2);
191 $today_mon = substr($this->row['end_date'], 5, 2);
192 $today_year = substr($this->row['end_date'], 0, 4);
194 $today_hour = substr($this->row['end_date'], 11, 2);
195 $today_min = substr($this->row['end_date'], 14, 2);
197 $end_no = ' checked="checked"';
198 $today_year = date('Y')+1;
203 <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 />
205 <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>
208 require(AT_INCLUDE_PATH.'html/release_date.inc.php');
214 if (($_POST['setvisual'] && !$_POST['settext']) || $_GET['setvisual']){
215 echo '<input type="hidden" name="setvisual" value="'.$_POST['setvisual'].'" />';
216 echo '<input type="submit" name="settext" value="'._AT('switch_text').'" class="button"/>';
218 echo '<input type="submit" name="setvisual" value="'._AT('switch_visual').'" class="button"/>';
224 <label for="banner"><?php echo _AT('banner'); ?></label><br />
225 <textarea id="banner" cols="45" rows="15" name="banner"><?php echo $this->row['banner']; ?></textarea>
228 <?php if (!$this->course) : ?>
230 <label for="initial_content"><?php echo _AT('initial_content'); ?></label><br />
231 <select name="initial_content" id="initial_content" size="5">
232 <option value="0"><?php echo _AT('empty'); ?></option>
233 <option value="1" selected="selected"><?php echo _AT('create_basic'); ?></option>
235 $Backup = new Backup($db);
238 $sql = "SELECT course_id, title FROM ".TABLE_PREFIX."courses ORDER BY title";
240 $sql = "SELECT course_id, title FROM ".TABLE_PREFIX."courses WHERE member_id=$_SESSION[member_id] ORDER BY title";
243 $result = mysql_query($sql, $db);
245 if ($course_row = mysql_fetch_assoc($result)) {
247 $Backup->setCourseID($course_row['course_id']);
248 $list = $Backup->getAvailableList();
251 echo '<optgroup label="'. _AT('restore').': '.$course_row['title'].'">';
252 foreach ($list as $list_item) {
253 echo '<option value="'.$list_item['backup_id'].'_'.$list_item['course_id'].'">'.$list_item['file_name'].' - '.get_human_size($list_item['file_size']).'</option>';
257 } while ($course_row = mysql_fetch_assoc($result));
262 <?php endif; // !$course_id ?>
264 <?php if ($this->isadmin) : ?>
266 <?php echo _AT('course_quota'); ?><br />
268 if ($this->row['max_quota'] == AT_COURSESIZE_UNLIMITED) {
269 $c_unlim = ' checked="checked" ';
270 $c_oth2 = ' disabled="disabled" ';
271 } elseif ($this->row['max_quota'] == AT_COURSESIZE_DEFAULT) {
272 $c_def = ' checked="checked" ';
273 $c_oth2 = ' disabled="disabled" ';
275 $c_oth = ' checked="checked" ';
279 if ($this->course > 0) {
280 $course_size = dirsize(AT_CONTENT_DIR . $this->course.'/');
286 echo _AT('current_course_size') .': '.get_human_size($course_size).'<br />';
290 <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 />
291 <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 />
292 <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> -
293 <input type="text" id="quota_entered" name="quota_entered" <?php echo $c_oth2?> value="<?php if ($this->row['max_quota']!=AT_COURSESIZE_UNLIMITED && $this->row['max_quota']!=AT_COURSESIZE_DEFAULT) { echo bytes_to_megabytes($this->row['max_quota']); } ?>" size="4" /> <?php echo _AT('mb'); ?>
297 <?php echo _AT('max_file_size'); ?><br />
299 $max_allowed = megabytes_to_bytes(substr(ini_get('upload_max_filesize'), 0, -1));
301 if ($this->row['max_file_size'] == AT_FILESIZE_DEFAULT) {
302 $f_def = ' checked="checked" ';
303 $f_oth2 = ' disabled="disabled" ';
304 } elseif ($this->row['max_file_size'] == AT_FILESIZE_SYSTEM_MAX) {
305 $f_max = ' checked="checked" ';
306 $f_oth2 = ' disabled="disabled" ';
308 $f_oth = ' checked="checked" ';
312 <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 />
313 <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 />
314 <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> -
315 <input type="text" id="filesize_entered" name="filesize_entered" <?php echo $f_oth2?> value="<?php if ($this->row['max_file_size']!=AT_FILESIZE_DEFAULT && $this->row['max_file_size']!=AT_FILESIZE_SYSTEM_MAX) { echo bytes_to_megabytes($this->row['max_file_size']); } ?>" size="4" /> <?php echo _AT('mb'); ?>
319 <input type="hidden" name="quota" value="<?php echo $this->row['max_quota']; ?>" />
320 <input type="hidden" name="filesize" value="<?php echo $this->row['max_file_size']; ?>" />
321 <input type="hidden" name="tracking" value="<?php echo $this->row['tracking']; ?>" />
325 <label for="copyright"><?php echo _AT('course_copyright'); ?></label><br />
326 <textarea name="copyright" rows="2" cols="65" id="copyright"><?php echo $this->row['copyright']; ?></textarea>
330 if ($this->row['icon'] != ''):
331 $path = AT_CONTENT_DIR.$this->row['course_id']."/custom_icons/";
332 if (file_exists($path.$this->row['icon'])) {
333 if (defined('AT_FORCE_GET_FILE') && AT_FORCE_GET_FILE) {
334 $custom_icon_path = 'get_course_icon.php/?id='.$this->row['course_id'];
336 $_base_href = 'content/' . $this->row['course_id'] . '/';
339 $_base_href = "images/courses/"; //$_base_href = 'get_course_icon.php/?id='.$row['course_id'];
342 $force_get = (defined('AT_FORCE_GET_FILE') && AT_FORCE_GET_FILE) ? true : false;
343 echo "<input type='hidden' name='boolForce' id='boolForce' value='$force_get' />";
345 //include(AT_INCLUDE_PATH.'html/course_icon.inc.php');
347 <img id="i0" src="<?php echo ($custom_icon_path=='')?$_base_href.$this->row['icon']:$custom_icon_path; ?>" alt="<?php echo $this->row['icon']; ?>" border="1" height="79" width="79" style="float: left; margin: 2px;" />
350 <img id="i0" src="images/clr.gif" alt="" style="float: left; margin: 2px;" border="1" height="79" width="79" />
351 <input type='hidden' name='boolForce' id='boolForce' value='' />
353 <div style="width:40%; float:left;">
354 <label for="icons"><?php echo _AT('icon'); ?></label><br />
355 <select name="icon" id="icons" onchange="SelectImg()">
356 <option value=""><?php echo _AT('no_icon'); ?></option>
357 <?php // ------------- custom course icons
358 $path = AT_CONTENT_DIR.$this->row['course_id']."/custom_icons/";
363 $boolCustom = true; // true if custom icons are uploaded, otherwise false
365 /*$files = scandir($path); //SCANDIR STOPS ATUTOR WHEN RUN AS INSTRUCTOR, BUT NOT AS ADMIN. WHY? -Gorzan */
367 /* PHP 4 REPLACEMENT FOR SCANDIR */
368 $dh = opendir($path);
369 while (false !== ($filename = readdir($dh))) {
370 $files[] = $filename;
373 /*END PHP 4 REPLACEMENT FOR SCANDIR*/
374 echo "<optgroup label='"._AT('custom_icons')."'>";
375 foreach($files as $val) {
376 $file_ext = substr(strtolower($val), -3);
377 if ($file_ext == "jpg" || $file_ext == "png" || $file_ext == "gif") {
379 echo "<option value='".$val."'";
380 if ($val == $this->row['icon']) {
381 echo 'selected="selected"';
383 echo ">".$val."</option>";
390 <?php // ------------- other icons
392 $course_imgs = array();
393 if ($dir = opendir(AT_INCLUDE_PATH.'../images/courses/')) {
394 while (false !== ($file = readdir($dir)) ) {
395 if( ($file == '.') || ($file == '..')) {
398 $course_imgs[] = $file;
403 if ($boolCustom == true) {
404 echo "<optgroup label='"._AT('builtin_icons')."'>";
406 foreach ($course_imgs as $file) {
407 echo '<option value="' . $file . '" ';
408 if ($file == $this->row['icon']) {
409 echo 'selected="selected"';
411 echo ' >' . $file . '</option>';
413 if ($boolCustom == true) {
417 </select><?php echo " "._AT('or'); ?>
419 <!-- div class="row" style="float:right;width:40%;">
420 <?php echo _AT('upload_icon'); ?><br />
421 <input type="file" name="customicon" id="customicon" value="<?php echo $_POST['customicon']; ?>"/><br />
422 <small><?php echo _AT('upload_icon_text'); ?></small>
425 <?php require_once(AT_INCLUDE_PATH.'../mods/_core/courses/html/course_icon.inc.php'); ?>
427 <br style="clear: left;" />
431 <div style="clear: both;"></div>
435 <div class="buttons">
437 echo "<input type='hidden' name='custOptCount' id='custOptCount' value='".$optCount."' />";
438 echo "<input type='hidden' name='courseId' id='courseId' value='".$this->row['course_id']."' />";
441 <input type="submit" name="submit" value="<?php echo _AT('save'); ?>" accesskey="s" />
442 <input type="submit" name="cancel" value="<?php echo _AT('cancel');?>" />