diff --git a/blocks/private_files/edit.php b/blocks/private_files/edit.php index 687f92750e2..7eb56f70783 100644 --- a/blocks/private_files/edit.php +++ b/blocks/private_files/edit.php @@ -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); diff --git a/lib/navigationlib.php b/lib/navigationlib.php index 22e37965ce5..efc7bdaab15 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -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)) {