diff --git a/admin/stickyblocks.php b/admin/stickyblocks.php
index 644f13f1e41..15b7e4637be 100644
--- a/admin/stickyblocks.php
+++ b/admin/stickyblocks.php
@@ -1,13 +1,12 @@
dirroot.'/my/pagelib.php');
require_once($CFG->dirroot.'/lib/pagelib.php');
$pt = optional_param('pt', null, PARAM_SAFEDIR); //alhanumeric and -
- $pagetypes = array(PAGE_MY_MOODLE => array('id' => PAGE_MY_MOODLE,
- 'lib' => '/my/pagelib.php',
+ $pagetypes = array('my-index' => array('id' => 'my-index',
+ 'lib' => '/lib/pagelib.php',
'name' => get_string('mymoodle','admin')),
PAGE_COURSE_VIEW => array('id' => PAGE_COURSE_VIEW,
'lib' => '/lib/pagelib.php',
diff --git a/lib/blocklib.php b/lib/blocklib.php
index 814eecec9ab..de6dcd51632 100644
--- a/lib/blocklib.php
+++ b/lib/blocklib.php
@@ -718,26 +718,8 @@ function blocks_print_group($page, $blockmanager, $position) {
}
} // End foreach
- // Check if
- // we are on the default position/side AND
- // we're editing the page AND
- // (
- // we have the capability to manage blocks OR
- // we are in myMoodle page AND have the capibility to manage myMoodle blocks
- // )
-
- // for constant PAGE_MY_MOODLE
- include_once($CFG->dirroot.'/my/pagelib.php');
-
- $coursecontext = get_context_instance(CONTEXT_COURSE, $COURSE->id);
- $myownblogpage = (isset($page->filtertype) && isset($page->filterselect) && $page->pagetype=='blog-view' && $page->filtertype=='user' && $page->filterselect == $USER->id);
-
- $managecourseblocks = has_capability('moodle/site:manageblocks', $coursecontext);
- $editmymoodle = $page->pagetype == PAGE_MY_MOODLE && has_capability('moodle/my:manageblocks', $coursecontext);
-
- if ($page->blocks->get_default_region() == $position && $page->user_is_editing() &&
- ($managecourseblocks || $editmymoodle || $myownblogpage || defined('ADMIN_STICKYBLOCKS'))) {
-
+ if ($page->blocks->get_default_region() == $position &&
+ $page->user_is_editing() && $page->user_can_edit_blocks()) {
blocks_print_adminblock($page, $blockmanager);
}
}
diff --git a/my/index.php b/my/index.php
index 788063219c5..ddd6cfdd20c 100644
--- a/my/index.php
+++ b/my/index.php
@@ -2,27 +2,25 @@
// this is the 'my moodle' page
- require_once('../config.php');
+ require_once(dirname(__FILE__) . '/../config.php');
require_once($CFG->dirroot.'/course/lib.php');
- require_once('pagelib.php');
require_login();
- $mymoodlestr = get_string('mymoodle','my');
+ $strmymoodle = get_string('mymoodle','my');
if (isguest()) {
- print_header($mymoodlestr);
- notice_yesno(get_string('noguest', 'my').'
'.get_string('liketologin'),
- get_login_url(), $CFG->wwwroot);
+ print_header($strmymoodle);
+ notice_yesno(get_string('noguest', 'my') . '
' .
+ get_string('liketologin'), get_login_url(), $CFG->wwwroot);
print_footer();
- die();
+ die;
}
-
- $edit = optional_param('edit', -1, PARAM_BOOL);
+ $edit = optional_param('edit', -1, PARAM_BOOL);
$blockaction = optional_param('blockaction', '', PARAM_ALPHA);
- $PAGE = page_create_instance($USER->id);
+ $PAGE->set_context(get_context_instance(CONTEXT_USER, $USER->id));
$PAGE->set_url('my/index.php');
$PAGE->set_blocks_editing_capability('moodle/my:manageblocks');
@@ -32,7 +30,22 @@
$USER->editing = $edit;
}
- $PAGE->print_header($mymoodlestr);
+ $button = update_mymoodle_icon($USER->id);
+ $header = $SITE->shortname . ': ' . $strmymoodle;
+ $navigation = build_navigation($strmymoodle);
+ $loggedinas = user_login_string();
+
+ if (empty($CFG->langmenu)) {
+ $langmenu = '';
+ } else {
+ $currlang = current_language();
+ $langs = get_list_of_languages();
+ $langlabel = get_accesshide(get_string('language'));
+ $langmenu = popup_form($CFG->wwwroot . '/my/index.php?lang=', $langs,
+ 'chooselang', $currlang, '', '', '', true, 'self', $langlabel);
+ }
+
+ print_header($strmymoodle, $header, $navigation, '', '', true, $button, $loggedinas . $langmenu);
echo '