3 require_once(dirname(dirname(__FILE__)) . '/config.php');
4 require_once($CFG->dirroot . '/repository/lib.php');
6 $config = optional_param('config', 0, PARAM_INT);
8 $course = optional_param('course', SITEID, PARAM_INT);
10 if (! $course = $DB->get_record("course", array("id"=>$course))) {
11 print_error('invalidcourseid');
15 $baseurl = $CFG->wwwroot . '/user/repository.php';
16 $namestr = get_string('name');
17 $fullname = fullname($user);
18 $strrepos = get_string('repositories', 'repository');
19 $configstr = get_string('manageuserrepository', 'repository');
20 $pluginstr = get_string('plugin', 'repository');
22 require_login($course, false);
24 $navlinks[] = array('name' => $fullname, 'link' => $CFG->wwwroot . '/user/view.php?id=' . $user->id, 'type' => 'misc');
25 $navlinks[] = array('name' => $strrepos, 'link' => null, 'type' => 'misc');
27 $navigation = build_navigation($navlinks);
29 print_header("$course->fullname: $fullname: $strrepos", $course->fullname,
30 $navigation, "", "", true, " ", navmenu($course));
32 $currenttab = 'repositories';
35 print_heading($configstr);
36 print_simple_box_start();
38 if (!$instances = repository_instances(true, false)) {
39 print_error('noinstances', 'repository', $CFG->wwwroot . '/user/view.php');
42 $table = new StdClass;
43 $table->head = array($namestr, $pluginstr, '');
44 $table->data = array();
46 foreach ($instances as $i) {
47 $path = '/repository/'.$i->repositorytype.'/settings.php';
48 $settings = file_exists($CFG->dirroot.$path);
49 $table->data[] = array($i->repositoryname, $i->repositorytype,
50 $settings ? '<a href="'.$CFG->wwwroot.$path.'">'
51 .get_string('settings', 'repository').'</a>' : '');