2008-07-28 08:24:55 +00:00
|
|
|
<?php //$Id$
|
|
|
|
|
|
|
|
require_once(dirname(dirname(__FILE__)) . '/config.php');
|
|
|
|
require_once($CFG->dirroot . '/repository/lib.php');
|
|
|
|
|
|
|
|
$config = optional_param('config', 0, PARAM_INT);
|
|
|
|
|
|
|
|
$course = optional_param('course', SITEID, PARAM_INT);
|
|
|
|
|
|
|
|
if (! $course = $DB->get_record("course", array("id"=>$course))) {
|
|
|
|
print_error('invalidcourseid');
|
|
|
|
}
|
|
|
|
|
|
|
|
$user = $USER;
|
|
|
|
$baseurl = $CFG->wwwroot . '/user/repository.php';
|
|
|
|
$namestr = get_string('name');
|
|
|
|
$fullname = fullname($user);
|
|
|
|
$strrepos = get_string('repositories', 'repository');
|
|
|
|
$configstr = get_string('manageuserrepository', 'repository');
|
|
|
|
$pluginstr = get_string('plugin', 'repository');
|
|
|
|
|
|
|
|
require_login($course, false);
|
|
|
|
|
2009-09-02 08:36:16 +00:00
|
|
|
$link = new moodle_url($CFG->wwwroot . '/user/view.php', array('id'=>$user->id));
|
|
|
|
$PAGE->navbar->add($fullname, null, null, navigation_node::TYPE_SETTING, $link);
|
|
|
|
$PAGE->navbar->add($strrepos);
|
|
|
|
$PAGE->set_title("$course->fullname: $fullname: $strrepos");
|
|
|
|
$PAGE->set_heading($course->fullname);
|
2008-07-28 08:24:55 +00:00
|
|
|
|
2009-09-02 08:36:16 +00:00
|
|
|
echo $OUTPUT->header();
|
2008-07-28 08:24:55 +00:00
|
|
|
|
|
|
|
$currenttab = 'repositories';
|
|
|
|
include('tabs.php');
|
|
|
|
|
2009-08-06 08:15:05 +00:00
|
|
|
echo $OUTPUT->heading($configstr);
|
2009-08-18 05:19:25 +00:00
|
|
|
echo $OUTPUT->box_start();
|
2008-07-28 08:24:55 +00:00
|
|
|
|
2008-11-26 07:03:10 +00:00
|
|
|
if (!$instances = repository::get_instances($COURSE->context, $USER->id)) {
|
2008-07-28 08:24:55 +00:00
|
|
|
print_error('noinstances', 'repository', $CFG->wwwroot . '/user/view.php');
|
|
|
|
}
|
|
|
|
|
2009-08-20 08:50:22 +00:00
|
|
|
$table = new html_table();
|
2008-07-28 08:24:55 +00:00
|
|
|
$table->head = array($namestr, $pluginstr, '');
|
|
|
|
$table->data = array();
|
|
|
|
|
|
|
|
foreach ($instances as $i) {
|
2008-08-13 04:09:13 +00:00
|
|
|
$path = '/repository/'.$i->type.'/settings.php';
|
2008-07-28 08:24:55 +00:00
|
|
|
$settings = file_exists($CFG->dirroot.$path);
|
2008-11-26 07:03:10 +00:00
|
|
|
$table->data[] = array($i->name, $i->type,
|
2008-07-28 08:24:55 +00:00
|
|
|
$settings ? '<a href="'.$CFG->wwwroot.$path.'">'
|
|
|
|
.get_string('settings', 'repository').'</a>' : '');
|
|
|
|
}
|
|
|
|
|
2009-08-20 08:50:22 +00:00
|
|
|
echo $OUTPUT->table($table);
|
2009-08-06 14:08:20 +00:00
|
|
|
echo $OUTPUT->footer();
|
2008-07-28 08:24:55 +00:00
|
|
|
|
|
|
|
?>
|