mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MNet: Fixed remote user profile display
Fixed SQL, strings usage, CSS class. In the future, we can distinguish information displayed for the owner and for the others, as well as what to display in the course profile (user/view.php) and public profile (user/profile.php).
This commit is contained in:
parent
d992f53d8c
commit
5db29f49f2
5 changed files with 21 additions and 35 deletions
|
@ -210,6 +210,7 @@ $string['remoteenrolhosts_desc'] = 'Enrol and unenrol users from your Moodle ins
|
||||||
$string['remotehost'] = 'Remote Hub';
|
$string['remotehost'] = 'Remote Hub';
|
||||||
$string['remotehosts'] = 'Remote hosts';
|
$string['remotehosts'] = 'Remote hosts';
|
||||||
$string['remotemoodles'] = 'Remote Moodles';
|
$string['remotemoodles'] = 'Remote Moodles';
|
||||||
|
$string['remoteuserinfo'] = 'Remote {$a->remotetype} user - profile fetched from <a href="{$a->remoteurl}">{$a->remotename}</a>';
|
||||||
$string['requiresopenssl'] = 'Networking requires the OpenSSL extension';
|
$string['requiresopenssl'] = 'Networking requires the OpenSSL extension';
|
||||||
$string['restore'] = 'Restore';
|
$string['restore'] = 'Restore';
|
||||||
$string['returnvalue'] = 'Return value';
|
$string['returnvalue'] = 'Return value';
|
||||||
|
|
|
@ -491,7 +491,6 @@ $string['editorfontsize'] = 'Default font-size';
|
||||||
$string['editorresettodefaults'] = 'Reset to default values';
|
$string['editorresettodefaults'] = 'Reset to default values';
|
||||||
$string['editorsettings'] = 'Editor settings';
|
$string['editorsettings'] = 'Editor settings';
|
||||||
$string['editorshortcutkeys'] = 'Editor shortcut keys';
|
$string['editorshortcutkeys'] = 'Editor shortcut keys';
|
||||||
$string['editremoteprofile'] = 'Edit remote profile';
|
|
||||||
$string['editsummary'] = 'Edit summary';
|
$string['editsummary'] = 'Edit summary';
|
||||||
$string['editthisactivity'] = 'Edit this activity';
|
$string['editthisactivity'] = 'Edit this activity';
|
||||||
$string['editthiscategory'] = 'Edit this category';
|
$string['editthiscategory'] = 'Edit this category';
|
||||||
|
@ -723,7 +722,6 @@ $string['general'] = 'General';
|
||||||
$string['geolocation'] = 'latitude - longitude';
|
$string['geolocation'] = 'latitude - longitude';
|
||||||
$string['gettheselogs'] = 'Get these logs';
|
$string['gettheselogs'] = 'Get these logs';
|
||||||
$string['go'] = 'Go';
|
$string['go'] = 'Go';
|
||||||
$string['gotoyourserver'] = '(Links back to your server)';
|
|
||||||
$string['gpl'] = 'Copyright (C) 1999 onwards Martin Dougiamas (http://moodle.com)
|
$string['gpl'] = 'Copyright (C) 1999 onwards Martin Dougiamas (http://moodle.com)
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
|
|
@ -200,6 +200,7 @@ form.popupform label {margin-right: 0.5em;}
|
||||||
#page-user-index h2 {text-align: center;}
|
#page-user-index h2 {text-align: center;}
|
||||||
#page-user-index #longtimenosee,
|
#page-user-index #longtimenosee,
|
||||||
#page-user-index #showall {text-align: center;}
|
#page-user-index #showall {text-align: center;}
|
||||||
|
#page-user-profile .remoteuserinfo, #page-user-view .remoteuserinfo{background-color:#D2EBFF;text-align:center;padding:3px;}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Moodle Forms
|
* Moodle Forms
|
||||||
|
|
|
@ -184,25 +184,18 @@ echo '<div class="userprofile">';
|
||||||
echo $OUTPUT->heading(fullname($user));
|
echo $OUTPUT->heading(fullname($user));
|
||||||
|
|
||||||
if (is_mnet_remote_user($user)) {
|
if (is_mnet_remote_user($user)) {
|
||||||
$sql = "
|
$sql = "SELECT h.id, h.name, h.wwwroot,
|
||||||
SELECT DISTINCT h.id, h.name, h.wwwroot,
|
|
||||||
a.name as application, a.display_name
|
a.name as application, a.display_name
|
||||||
FROM {mnet_host} h, {mnet_application} a
|
FROM {mnet_host} h, {mnet_application} a
|
||||||
WHERE h.id = ? AND h.applicationid = a.id
|
WHERE h.id = ? AND h.applicationid = a.id";
|
||||||
ORDER BY a.display_name, h.name";
|
|
||||||
|
|
||||||
$remotehost = $DB->get_record_sql($sql, array($user->mnethostid));
|
$remotehost = $DB->get_record_sql($sql, array($user->mnethostid));
|
||||||
|
$a = new stdclass();
|
||||||
|
$a->remotetype = $remotehost->display_name;
|
||||||
|
$a->remotename = $remotehost->name;
|
||||||
|
$a->remoteurl = $remotehost->wwwroot;
|
||||||
|
|
||||||
echo '<p class="errorboxcontent">'.get_string('remoteappuser', $remotehost->application)." <br />\n";
|
echo $OUTPUT->box(get_string('remoteuserinfo', 'mnet', $a), 'remoteuserinfo');
|
||||||
if ($currentuser) {
|
|
||||||
if ($remotehost->application =='moodle') {
|
|
||||||
echo "Remote {$remotehost->display_name}: <a href=\"{$remotehost->wwwroot}/user/edit.php\">{$remotehost->name}</a> ".get_string('editremoteprofile')." </p>\n";
|
|
||||||
} else {
|
|
||||||
echo "Remote {$remotehost->display_name}: <a href=\"{$remotehost->wwwroot}/\">{$remotehost->name}</a> ".get_string('gotoyourserver')." </p>\n";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
echo "Remote {$remotehost->display_name}: <a href=\"{$remotehost->wwwroot}/\">{$remotehost->name}</a></p>\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<div class="userprofilebox clearfix"><div class="profilepicture">';
|
echo '<div class="userprofilebox clearfix"><div class="profilepicture">';
|
||||||
|
|
|
@ -190,25 +190,18 @@ if (has_capability('moodle/user:viewhiddendetails', $coursecontext)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_mnet_remote_user($user)) {
|
if (is_mnet_remote_user($user)) {
|
||||||
$sql = "
|
$sql = "SELECT h.id, h.name, h.wwwroot,
|
||||||
SELECT DISTINCT h.id, h.name, h.wwwroot,
|
|
||||||
a.name as application, a.display_name
|
a.name as application, a.display_name
|
||||||
FROM {mnet_host} h, {mnet_application} a
|
FROM {mnet_host} h, {mnet_application} a
|
||||||
WHERE h.id = ? AND h.applicationid = a.id
|
WHERE h.id = ? AND h.applicationid = a.id";
|
||||||
ORDER BY a.display_name, h.name";
|
|
||||||
|
|
||||||
$remotehost = $DB->get_record_sql($sql, array($user->mnethostid));
|
$remotehost = $DB->get_record_sql($sql, array($user->mnethostid));
|
||||||
|
$a = new stdclass();
|
||||||
|
$a->remotetype = $remotehost->display_name;
|
||||||
|
$a->remotename = $remotehost->name;
|
||||||
|
$a->remoteurl = $remotehost->wwwroot;
|
||||||
|
|
||||||
echo '<p class="errorboxcontent">'.get_string('remoteappuser', $remotehost->application)." <br />\n";
|
echo $OUTPUT->box(get_string('remoteuserinfo', 'mnet', $a), 'remoteuserinfo');
|
||||||
if ($currentuser) {
|
|
||||||
if ($remotehost->application =='moodle') {
|
|
||||||
echo "Remote {$remotehost->display_name}: <a href=\"{$remotehost->wwwroot}/user/edit.php\">{$remotehost->name}</a> ".get_string('editremoteprofile')." </p>\n";
|
|
||||||
} else {
|
|
||||||
echo "Remote {$remotehost->display_name}: <a href=\"{$remotehost->wwwroot}/\">{$remotehost->name}</a> ".get_string('gotoyourserver')." </p>\n";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
echo "Remote {$remotehost->display_name}: <a href=\"{$remotehost->wwwroot}/\">{$remotehost->name}</a></p>\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<div class="userprofilebox clearfix"><div class="profilepicture">';
|
echo '<div class="userprofilebox clearfix"><div class="profilepicture">';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue