| [ Index ] |
PHP Cross Reference of Moodle 1.9.3 [Build 15-Oct-2008] |
[Summary view] [Print] [Text view]
1 <?php // $Id: info.php,v 1.17.2.7 2008/09/01 09:30:07 mudrd8mz Exp $ 2 3 /// Displays external information about a course 4 5 require_once("../config.php"); 6 require_once ("lib.php"); 7 8 $id = optional_param('id', false, PARAM_INT); // Course id 9 $name = optional_param('name', false, PARAM_RAW); // Course short name 10 11 if (!$id and !$name) { 12 error("Must specify course id or short name"); 13 } 14 15 if ($name) { 16 if (! $course = get_record("course", "shortname", $name) ) { 17 error("That's an invalid short course name"); 18 } 19 } else { 20 if (! $course = get_record("course", "id", $id) ) { 21 error("That's an invalid course id"); 22 } 23 } 24 25 $site = get_site(); 26 27 if ($CFG->forcelogin) { 28 require_login(); 29 } 30 31 $context = get_context_instance(CONTEXT_COURSE, $course->id); 32 if ((!course_parent_visible($course) || (! $course->visible)) && !has_capability('moodle/course:viewhiddencourses', $context)) { 33 print_error('coursehidden', '', $CFG->wwwroot .'/'); 34 } 35 36 print_header(get_string("summaryof", "", $course->fullname)); 37 38 print_heading(format_string($course->fullname) . '<br />(' . format_string($course->shortname) . ')'); 39 40 if ($course->guest || $course->password) { 41 print_box_start('generalbox icons'); 42 if ($course->guest) { 43 $strallowguests = get_string('allowguests'); 44 echo "<div><img alt=\"\" class=\"icon guest\" src=\"$CFG->pixpath/i/guest.gif\" /> $strallowguests</div>"; 45 } 46 if ($course->password) { 47 $strrequireskey = get_string('requireskey'); 48 echo "<div><img alt=\"\" class=\"icon key\" src=\"$CFG->pixpath/i/key.gif\" /> $strrequireskey</div>"; 49 } 50 print_box_end(); 51 } 52 53 54 print_box_start('generalbox info'); 55 56 echo filter_text(text_to_html($course->summary),$course->id); 57 58 59 if ($managerroles = get_config('', 'coursemanager')) { 60 $coursemanagerroles = split(',', $managerroles); 61 foreach ($coursemanagerroles as $roleid) { 62 $role = get_record('role','id',$roleid); 63 $canseehidden = has_capability('moodle/role:viewhiddenassigns', $context); 64 $roleid = (int) $roleid; 65 if ($users = get_role_users($roleid, $context, true, '', 'u.lastname ASC', $canseehidden)) { 66 foreach ($users as $teacher) { 67 $fullname = fullname($teacher, has_capability('moodle/site:viewfullnames', $context)); 68 $namesarray[] = format_string(role_get_name($role, $context)).': <a href="'.$CFG->wwwroot.'/user/view.php?id='. 69 $teacher->id.'&course='.SITEID.'">'.$fullname.'</a>'; 70 } 71 } 72 } 73 74 if (!empty($namesarray)) { 75 echo "<ul class=\"teachers\">\n<li>"; 76 echo implode('</li><li>', $namesarray); 77 echo "</li></ul>"; 78 } 79 } 80 81 require_once("$CFG->dirroot/enrol/enrol.class.php"); 82 $enrol = enrolment_factory::factory($course->enrol); 83 echo $enrol->get_access_icons($course); 84 85 print_box_end(); 86 87 echo "<br />"; 88 89 close_window_button(); 90 91 print_footer(); 92 93 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Wed Jan 14 11:33:29 2009 | Cross-referenced by PHPXref 0.7 |