Skip to content

Commit

Permalink
MDL-19124 Removed the my_syspage_block_manager hacks from sys pages a…
Browse files Browse the repository at this point in the history
…nd completed the 0->null migration in userid
  • Loading branch information
moodler committed May 5, 2010
1 parent ad33622 commit b8fa182
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
10 changes: 2 additions & 8 deletions my/indexsys.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
$PAGE->set_heading($header);
$PAGE->blocks->add_region('content');

// TODO: Make the page be selected properly in the Settings block
admin_externalpage_setup('mypage');

// Get the My Moodle page info. Should always return something unless the database is broken.
if (!$currentpage = my_get_page(0, MY_PAGE_PRIVATE)) {
if (!$currentpage = my_get_page(null, MY_PAGE_PRIVATE)) {
print_error('mymoodlesetup');
}
$PAGE->set_subpage($currentpage->id);
Expand Down Expand Up @@ -98,12 +98,6 @@
$USER->editing = $edit = 0;
}

// HACK WARNING! This loads up all this page's blocks in the system context
if ($currentpage->userid == 0) {
$CFG->blockmanagerclass = 'my_syspage_block_manager';
}


echo $OUTPUT->header();

echo $OUTPUT->blocks_for_region('content');
Expand Down
2 changes: 1 addition & 1 deletion my/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
function my_get_page($userid, $private=MY_PAGE_PRIVATE) {
global $DB, $CFG;

if (empty($CFG->forcedefaultmymoodle)) { // We ignore custom My Moodle pages if admin has forced them
if (empty($CFG->forcedefaultmymoodle) && $userid) { // Ignore custom My Moodle pages if admin has forced them
// Does the user have their own page defined? If so, return it.
if ($customised = $DB->get_record('my_pages', array('userid' => $userid, 'private' => $private))) {
return $customised;
Expand Down
8 changes: 1 addition & 7 deletions user/profilesys.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
// TODO: Make the page be selected properly in the Settings block

// Get the Public Profile page info. Should always return something unless the database is broken.
if (!$currentpage = my_get_page(0, MY_PAGE_PUBLIC)) {
if (!$currentpage = my_get_page(null, MY_PAGE_PUBLIC)) {
print_error('publicprofilesetup');
}
$PAGE->set_subpage($currentpage->id);
Expand Down Expand Up @@ -92,12 +92,6 @@
$USER->editing = $edit = 0;
}

// HACK WARNING! This loads up all this page's blocks in the system context
if ($currentpage->userid == 0) {
$CFG->blockmanagerclass = 'my_syspage_block_manager';
}


echo $OUTPUT->header();

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

0 comments on commit b8fa182

Please sign in to comment.