Skip to content

Commit

Permalink
MDL-49849 profile: Split site access information into it's own section
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Cooper committed Apr 22, 2015
1 parent d0704fd commit f13a911
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions lang/en/moodle.php
Expand Up @@ -1048,6 +1048,7 @@
$string['loggedinasguest'] = 'You are currently using guest access';
$string['loggedinnot'] = 'You are not logged in.';
$string['login'] = 'Log in';
$string['loginactivity'] = 'Login activity';
$string['loginalready'] = 'You are already logged in';
$string['loginas'] = 'Log in as';
$string['loginaspasswordexplain'] = '<p>You must enter the special "loginas password" to use this feature.<br />If you do not know it, ask your server administrator.</p>';
Expand Down
16 changes: 9 additions & 7 deletions lib/myprofilelib.php
Expand Up @@ -43,17 +43,19 @@ function core_myprofile_navigation(core_user\output\myprofile\tree $tree, $user,
$courseid = !empty($course) ? $course->id : SITEID;

$contactcategory = new core_user\output\myprofile\category('contact', get_string('userdetails'));
$miscategory = new core_user\output\myprofile\category('miscellaneous', get_string('miscellaneous'));
$reportcategory = new core_user\output\myprofile\category('reports', get_string('reports'), 'miscellaneous');
$admincategory = new core_user\output\myprofile\category('administration', get_string('administration'), 'miscellaneous');
$coursedetailscategory = new core_user\output\myprofile\category('coursedetails', get_string('coursedetails'), 'contact');
$miscategory = new core_user\output\myprofile\category('miscellaneous', get_string('miscellaneous'), 'coursedetails');
$reportcategory = new core_user\output\myprofile\category('reports', get_string('reports'), 'miscellaneous');
$admincategory = new core_user\output\myprofile\category('administration', get_string('administration'), 'reports');
$loginactivitycategory = new core_user\output\myprofile\category('loginactivity', get_string('loginactivity'), 'administration');

// Add categories.
$tree->add_category($contactcategory);
$tree->add_category($coursedetailscategory);
$tree->add_category($miscategory);
$tree->add_category($reportcategory);
$tree->add_category($admincategory);
$tree->add_category($coursedetailscategory);
$tree->add_category($loginactivitycategory);

// Add core nodes.
// Full profile node.
Expand Down Expand Up @@ -386,7 +388,7 @@ function core_myprofile_navigation(core_user\output\myprofile\tree $tree, $user,
} else {
$datestring = get_string("never");
}
$node = new core_user\output\myprofile\node('miscellaneous', 'firstaccess', get_string('firstsiteaccess'), null, null,
$node = new core_user\output\myprofile\node('loginactivity', 'firstaccess', get_string('firstsiteaccess'), null, null,
$datestring);
$tree->add_node($node);
}
Expand All @@ -409,7 +411,7 @@ function core_myprofile_navigation(core_user\output\myprofile\tree $tree, $user,
}
}

$node = new core_user\output\myprofile\node('miscellaneous', 'lastaccess', $string, null, null,
$node = new core_user\output\myprofile\node('loginactivity', 'lastaccess', $string, null, null,
$datestring);
$tree->add_node($node);
}
Expand All @@ -422,7 +424,7 @@ function core_myprofile_navigation(core_user\output\myprofile\tree $tree, $user,
} else {
$ipstring = get_string("none");
}
$node = new core_user\output\myprofile\node('miscellaneous', 'lastip', get_string('lastip'), null, null,
$node = new core_user\output\myprofile\node('loginactivity', 'lastip', get_string('lastip'), null, null,
$ipstring);
$tree->add_node($node);
}
Expand Down

0 comments on commit f13a911

Please sign in to comment.