Skip to content

Commit

Permalink
MDL-19124 Continued misc user profile cleanups
Browse files Browse the repository at this point in the history
    - 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)
  • Loading branch information
moodler committed May 16, 2010
1 parent db1a1c0 commit 99cca84
Show file tree
Hide file tree
Showing 19 changed files with 104 additions and 538 deletions.
8 changes: 5 additions & 3 deletions admin/roles/assign.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@
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);
Expand Down Expand Up @@ -259,9 +259,11 @@
break;
}

$currenttab = 'assign';
echo $OUTPUT->header();
include($tabfile);
if ($tabfile) {
$currenttab = 'assign';
include($tabfile);
}

// Print heading.
echo $OUTPUT->heading_with_help($title, 'assignroles', 'role');
Expand Down
8 changes: 5 additions & 3 deletions admin/roles/check.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
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);
Expand Down Expand Up @@ -108,12 +108,14 @@
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');
Expand Down
8 changes: 5 additions & 3 deletions admin/roles/override.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

$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);

Expand All @@ -86,7 +86,7 @@
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);
Expand Down Expand Up @@ -135,7 +135,9 @@

// 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.
Expand Down
14 changes: 10 additions & 4 deletions admin/roles/permissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
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);
Expand Down Expand Up @@ -143,7 +143,9 @@
}
// 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();
Expand Down Expand Up @@ -182,7 +184,9 @@
}
}
echo $OUTPUT->header();
include($tabfile);
if ($tabfile) {
include($tabfile);
}
echo $OUTPUT->heading($title);
echo $OUTPUT->box($message);
$mform->display();
Expand All @@ -192,7 +196,9 @@
}

echo $OUTPUT->header();
include($tabfile);
if ($tabfile) {
include($tabfile);
}
echo $OUTPUT->heading($title);

$table = new permissions_table($context, $contextname, $allowoverrides, $allowsafeoverrides, $overridableroles);
Expand Down
8 changes: 1 addition & 7 deletions admin/roles/usersroles.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,10 @@
$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);
Expand All @@ -128,11 +127,6 @@
$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');

Expand Down
6 changes: 0 additions & 6 deletions blog/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
}

$sitecontext = get_context_instance(CONTEXT_SYSTEM);
$tabsfile = null;

if (!$userid && has_capability('moodle/blog:view', $sitecontext) && $CFG->bloglevel > BLOG_USER_LEVEL) {
if ($entryid) {
Expand Down Expand Up @@ -173,7 +172,6 @@
print_error('cannotviewcourseblog', 'blog');
}
}
$tabsfile = $CFG->dirroot . '/user/tabs.php';
}

$courseid = (empty($courseid)) ? SITEID : $courseid;
Expand All @@ -195,10 +193,6 @@

echo $OUTPUT->header();

if (!empty($tabsfile)) {
require_once($tabsfile);
}

echo $OUTPUT->heading($blogheaders['heading'], 2);

$bloglisting = new blog_listing($blogheaders['filters']);
Expand Down
9 changes: 0 additions & 9 deletions course/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,6 @@
$PAGE->set_heading($course->fullname);
echo $OUTPUT->header();

/// Print tabs at top
/// This same call is made in:
/// /user/view.php
/// /user/edit.php
/// /course/user.php
$currenttab = $mode;
$showroles = 1;
include($CFG->dirroot.'/user/tabs.php');

switch ($mode) {
case "grade":
if (empty($CFG->grade_profilereport) or !file_exists($CFG->dirroot.'/grade/report/'.$CFG->grade_profilereport.'/lib.php')) {
Expand Down
5 changes: 0 additions & 5 deletions message/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,6 @@
}
echo $OUTPUT->header();

/// Print tabs at the top
$showroles = 1;
$currenttab = 'editmessage';
require('../user/tabs.php');

/// Start the form. We're not using mform here because of our special formatting needs ...
echo '<form class="mform" method="post" action="'.$CFG->wwwroot.'/message/edit.php">';

Expand Down
Binary file modified pix/u/f1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pix/u/f2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pix/u/user100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pix/u/user35.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions repository/manage_instances.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@
if ( !$course = $DB->get_record('course', array('id'=>$usercourseid))) {
print_error('invalidcourseid');
}
$currenttab = 'repositories';
include($CFG->dirroot.'/user/tabs.php');
}

echo $OUTPUT->heading($pagename);
Expand Down
37 changes: 18 additions & 19 deletions theme/base/style/user.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
/*$$$$$$$$$$$$$$$$$ User $$$$$$$$$$$$$$$$$$$$*/

.userprofile .fullprofilelink {text-align:center; margin:10px;}
.userprofile .profilepicture {float:left; margin-right:20px;}
.userprofile .description {margin-bottom:20px;}

.user-box {margin:8px;width:115px;height:160px;text-align:center;float:left;clear: none;}

.userlist #showall {margin: 10px 0px;}
.userlist .buttons {text-align: center;}
.userlist table#participants {text-align:center;}
.userlist table#participants td,
.userlist table#participants th {vertical-align: middle;text-align: left;padding: 4px;}
.userlist table.controls {width: 100%;}
.userlist table.controls tr {vertical-align: top;}
.userlist table.controls td.right,
.userlist table.controls td.left {padding: 4px;}
.userlist table.controls .right {text-align: right;}

.userinfobox {width:100%;border:1px solid;border-collapse: separate;padding:10px;}
.userinfobox .left,
.userinfobox .side {width: 100px;vertical-align: top;}
Expand All @@ -14,24 +30,7 @@
.groupinfobox {border:1px solid;}
.groupinfobox .left {padding: 10px;width: 100px;vertical-align: top;}

.iplookup #note,
#course-participation h2,
#user-index .rolesform,
#user-view .buttons,
#user-index .buttons {text-align: center;}
#user-view .buttons form,
#user-view .buttons form div {display:inline;}

#user-index #showall {margin: 10px 0px;}
#user-index table#participants,
#user-index table#participants td,
#user-index table#participants th {vertical-align: middle;text-align: left;padding: 4px;}
#user-index table.controls {width: 100%;}
#user-index table.controls tr {vertical-align: top;}
#user-index table.controls td.right,
#user-index table.controls td.left {padding: 4px;}
#user-index table.controls .right {text-align: right;}
#course-participation #showall {text-align:center;margin: 10px 0px;}
.course-participation #showall {text-align:center;margin: 10px 0px;}
#user-policy .noticebox {text-align:center;margin-left:auto;margin-right:auto;margin-bottom:10px;width:80%;height:250px;}
#user-policy #policyframe {width:100%;height:100%;}
.iplookup #map {margin:auto;}
Expand All @@ -40,4 +39,4 @@
.userselector div {margin-top: 0.2em;}
.userselector div label {margin-right: 0.3em;}
#userselector_options .collapsibleregioncaption {font-weight: bold;}
#userselector_options p {margin:0.2em 0;text-align:left;}
#userselector_options p {margin:0.2em 0;text-align:left;}
3 changes: 2 additions & 1 deletion theme/standard/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
'blocks',
'calendar',
'course',
'user',
'dock',
'grade',
'message',
Expand All @@ -16,4 +17,4 @@
'css3' /** Sets up CSS 3 + browser specific styles **/
);
$THEME->enable_dock = true;
$THEME->javascripts_footer = array('navigation');
$THEME->javascripts_footer = array('navigation');
5 changes: 5 additions & 0 deletions user/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,13 @@
$PAGE->set_title("$course->shortname: ".get_string('participants'));
$PAGE->set_heading($course->fullname);
$PAGE->set_pagetype('course-view-' . $course->format);
$PAGE->add_body_class('path-user'); // So we can style it independently
$PAGE->set_other_editing_capability('moodle/course:manageactivities');

echo $OUTPUT->header();

echo '<div class="userlist">';

if ($isseparategroups and (!$currentgroup) ) {
// The user is not in the group so show message and exit
echo $OUTPUT->heading(get_string("notingroup"));
Expand Down Expand Up @@ -884,6 +887,8 @@
echo $OUTPUT->container(html_writer::link($perpageurl, get_string('showall', '', $matchcount)), array(), 'showall');
}

echo '</div>'; // userlist

echo $OUTPUT->footer();

if ($userlist) {
Expand Down
9 changes: 9 additions & 0 deletions user/profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@
}

// TODO WORK OUT WHERE THE NAV BAR IS!

echo $OUTPUT->header();
echo '<div class="userprofile">';


// Print the standard content of this page, the basic profile info
Expand Down Expand Up @@ -370,6 +372,13 @@

echo $OUTPUT->blocks_for_region('content');

if ($CFG->debugdisplay && debugging('', DEBUG_DEVELOPER) && $currentuser) { // Show user object
echo '<br /><br /><hr />';
echo $OUTPUT->heading('DEBUG MODE: User session variables');
print_object($USER);
}

echo '</div>'; // userprofile class
echo $OUTPUT->footer();


Expand Down
Loading

0 comments on commit 99cca84

Please sign in to comment.