Skip to content

Commit

Permalink
I have put a "Login as Student" link into the admin block.
Browse files Browse the repository at this point in the history
  • Loading branch information
gustav_delius committed Dec 26, 2004
1 parent c0b8ff1 commit 48d3ead
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions blocks/admin/block_admin.php
Expand Up @@ -89,6 +89,17 @@ function load_content_for_course() {
} else {
$this->content->items[]='<a href="view.php?id='.$this->instance->pageid.'&amp;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.'&amp;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="" />';

Expand Down

0 comments on commit 48d3ead

Please sign in to comment.