mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
I have put a "Login as Student" link into the admin block.
This commit is contained in:
parent
c0b8ff1ef4
commit
48d3eadabc
1 changed files with 11 additions and 0 deletions
|
@ -89,6 +89,17 @@ class block_admin extends block_base {
|
|||
} else {
|
||||
$this->content->items[]='<a href="view.php?id='.$this->instance->pageid.'&edit=on">'.get_string('turneditingon').'</a>';
|
||||
}
|
||||
|
||||
if (!$course->student) {
|
||||
$course->student = get_string('defaultcoursestudent');
|
||||
}
|
||||
|
||||
if (!isset($USER->realuser) and
|
||||
$student = get_field_sql('SELECT userid FROM '.$CFG->prefix.'user_students WHERE course = '.$course->id.' LIMIT 1')) {
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" height="16" width="16" alt="" />';
|
||||
$this->content->items[]='<a href="loginas.php?id='.$course->id.'&user='.$student.'">'.get_string('loginas').' '.$course->student.'</a>';
|
||||
}
|
||||
|
||||
$this->content->items[]='<a href="edit.php?id='.$this->instance->pageid.'">'.get_string('settings').'...</a>';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/settings.gif" height="16" width="16" alt="" />';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue