MDL-19124 Continued misc user profile cleanups

- fixed user styles in base theme
    - added new divs for better control on user profile and user index pages
    - reduced data on course user profiles down to minimum
    - removed user/tabs.php completely and all uses of it
    - changed default user icon pix to something very bland (bye bye smiley cake)
This commit is contained in:
Martin Dougiamas 2010-05-16 08:21:12 +00:00
parent db1a1c0d9e
commit 99cca8470e
19 changed files with 106 additions and 540 deletions

View file

@ -231,7 +231,7 @@ switch ($context->contextlevel) {
admin_externalpage_setup('assignroles', '', array('contextid' => $contextid, 'roleid' => $roleid));
break;
case CONTEXT_USER:
$tabfile = $CFG->dirroot.'/user/tabs.php';
$tabfile = null;
if ($isfrontpage) {
$fullname = fullname($user, has_capability('moodle/site:viewfullnames', $context));
$PAGE->set_heading($fullname);
@ -259,9 +259,11 @@ switch ($context->contextlevel) {
break;
}
$currenttab = 'assign';
echo $OUTPUT->header();
include($tabfile);
if ($tabfile) {
$currenttab = 'assign';
include($tabfile);
}
// Print heading.
echo $OUTPUT->heading_with_help($title, 'assignroles', 'role');

View file

@ -80,7 +80,7 @@ switch ($context->contextlevel) {
admin_externalpage_setup('assignroles', '', array('contextid' => $contextid, 'roleid' => $roleid));
break;
case CONTEXT_USER:
$tabfile = $CFG->dirroot.'/user/tabs.php';
$tabfile = null;
if ($isfrontpage) {
$fullname = fullname($user, has_capability('moodle/site:viewfullnames', $context));
$PAGE->set_heading($fullname);
@ -108,12 +108,14 @@ switch ($context->contextlevel) {
break;
}
$currenttab = 'check';
echo $OUTPUT->header();
// These are needed early because of tabs.php
$assignableroles = get_assignable_roles($context, ROLENAME_BOTH);
$overridableroles = get_overridable_roles($context, ROLENAME_BOTH);
include($tabfile);
if ($tabfile) {
$currenttab = 'check';
include($tabfile);
}
// Print heading.
echo $OUTPUT->heading_with_help($title, 'checkpermissions', 'role');

View file

@ -65,7 +65,7 @@ if (optional_param('cancel', false, PARAM_BOOL)) {
$role = $DB->get_record('role', array('id'=>$roleid), '*', MUST_EXIST);
// These are needed early because of tabs.php
// These are needed early
$assignableroles = get_assignable_roles($context, ROLENAME_BOTH);
list($overridableroles, $overridecounts, $nameswithcounts) = get_overridable_roles($context, ROLENAME_BOTH, true);
@ -86,7 +86,7 @@ switch ($context->contextlevel) {
print_error('cannotoverridebaserole', 'error');
break;
case CONTEXT_USER:
$tabfile = $CFG->dirroot.'/user/tabs.php';
$tabfile = null;
if ($isfrontpage) {
$fullname = fullname($user, has_capability('moodle/site:viewfullnames', $context));
$PAGE->set_heading($fullname);
@ -135,7 +135,9 @@ if (optional_param('savechanges', false, PARAM_BOOL) && confirm_sesskey()) {
// Finally start page output
echo $OUTPUT->header();
include($tabfile);
if ($tabfile) {
include($tabfile);
}
echo $OUTPUT->heading_with_help($title, 'overrides', 'role');
// Show UI for overriding roles.

View file

@ -85,7 +85,7 @@ switch ($context->contextlevel) {
print_error('cannotoverridebaserole', 'error');
break;
case CONTEXT_USER:
$tabfile = $CFG->dirroot.'/user/tabs.php';
$tabfile = null;
if ($isfrontpage) {
$fullname = fullname($user, has_capability('moodle/site:viewfullnames', $context));
$PAGE->set_heading($fullname);
@ -143,7 +143,9 @@ if ($capability && ($allowoverrides || ($allowsafeoverrides && is_safe_capabilit
}
// Display and print
echo $OUTPUT->header();
include($tabfile);
if ($tabfile) {
include($tabfile);
}
echo $OUTPUT->heading($title);
echo $OUTPUT->confirm($message, $continueurl, $PAGE->url);
echo $OUTPUT->footer();
@ -182,7 +184,9 @@ if ($capability && ($allowoverrides || ($allowsafeoverrides && is_safe_capabilit
}
}
echo $OUTPUT->header();
include($tabfile);
if ($tabfile) {
include($tabfile);
}
echo $OUTPUT->heading($title);
echo $OUTPUT->box($message);
$mform->display();
@ -192,7 +196,9 @@ if ($capability && ($allowoverrides || ($allowsafeoverrides && is_safe_capabilit
}
echo $OUTPUT->header();
include($tabfile);
if ($tabfile) {
include($tabfile);
}
echo $OUTPUT->heading($title);
$table = new permissions_table($context, $contextname, $allowoverrides, $allowsafeoverrides, $overridableroles);

View file

@ -106,11 +106,10 @@ foreach ($roleassignments as $ra) {
$contexts[$ra->contextid]->roleassignments[$ra->roleid] = $ra;
}
/// These are needed to determine which tabs tabs.php should show.
$assignableroles = get_assignable_roles($usercontext, ROLENAME_BOTH);
$overridableroles = get_overridable_roles($usercontext, ROLENAME_BOTH);
/// Print the header and tabs
/// Print the header
$fullname = fullname($user, has_capability('moodle/site:viewfullnames', $coursecontext));
$straction = get_string('thisusersroles', 'role');
$title = get_string('xroleassignments', 'role', $fullname);
@ -128,11 +127,6 @@ if ($courseid != SITEID) {
$PAGE->navbar->add($fullname, new moodle_url("$CFG->wwwroot/user/view.php", array('id'=>$userid,'course'=>$courseid)));
$PAGE->navbar->add($straction);
echo $OUTPUT->header();
$showroles = 1;
$currenttab = 'usersroles';
include($CFG->dirroot.'/user/tabs.php');
echo $OUTPUT->heading($title, 3);
echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthnormal');