MDL-23174 Private files editing page needs headings, navbar etc like a normal page

This commit is contained in:
Dongsheng Cai
2010-07-12 09:39:47 +00:00
parent 23cee7a4cf
commit 78765507c4
2 changed files with 15 additions and 1 deletions
+8 -1
View File
@@ -34,8 +34,15 @@ if (isguestuser()) {
//TODO: add capability check here!
$context = get_context_instance(CONTEXT_USER, $USER->id);
$title = get_string('privatefiles', 'block_private_files');
$struser = get_string('user');
$PAGE->set_url('/blocks/private/edit.php');
$PAGE->set_url('/blocks/private_files/edit.php');
$PAGE->set_context($context);
$PAGE->set_title($title);
$PAGE->set_heading($title);
$PAGE->set_pagelayout('mydashboard');
$PAGE->set_pagetype('user-private-files');
$data = new object();
$options = array('subdirs'=>1, 'maxbytes'=>$CFG->userquota, 'maxfiles'=>-1, 'accepted_types'=>'*', 'return_types'=>FILE_INTERNAL);
+7
View File
@@ -1528,6 +1528,12 @@ class global_navigation extends navigation_node {
$url = new moodle_url('/message/index.php',$messageargs);
$usernode->add(get_string('messages', 'message'), $url, self::TYPE_SETTING, null, 'messages');
// TODO: Private file capability check
if ($iscurrentuser) {
$url = new moodle_url('/blocks/private_files/edit.php');
$usernode->add(get_string('privatefiles', 'block_private_files'), $url, self::TYPE_SETTING);
}
// Add a node to view the users notes if permitted
if (!empty($CFG->enablenotes) && has_any_capability(array('moodle/notes:manage', 'moodle/notes:view'), $coursecontext)) {
$url = new moodle_url('/notes/index.php',array('user'=>$user->id));
@@ -1597,6 +1603,7 @@ class global_navigation extends navigation_node {
// If the user is the current user add the repositories for the current user
if ($iscurrentuser) {
require_once($CFG->dirroot . '/repository/lib.php');
$editabletypes = repository::get_editable_types($usercontext);
if (!empty($editabletypes)) {