Merge branch 'w28_MDL-34175_m23_admin' of git://github.com/skodak/moodle into MOODLE_23_STABLE

This commit is contained in:
Sam Hemelryk 2012-07-10 12:43:42 +12:00
commit 3ca82ed605
10 changed files with 20 additions and 14 deletions

View file

@ -468,7 +468,7 @@ class core_renderer extends renderer_base {
$link= '<a title="' . $title . '" href="' . $url . '">' . $txt . '</a>';
$output .= '<div class="profilingfooter">' . $link . '</div>';
}
$output .= '<div class="purgecaches"><a href="'.$CFG->wwwroot.'/admin/purgecaches.php?confirm=1&amp;sesskey='.sesskey().'">'.get_string('purgecaches', 'admin').'</a></div>';
$output .= '<div class="purgecaches"><a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/purgecaches.php?confirm=1&amp;sesskey='.sesskey().'">'.get_string('purgecaches', 'admin').'</a></div>';
}
if (!empty($CFG->debugvalidators)) {
// NOTE: this is not a nice hack, $PAGE->url is not always accurate and $FULLME neither, it is not a bug if it fails. --skodak

View file

@ -399,6 +399,12 @@ class page_requirements_manager {
if ($url instanceof moodle_url) {
return $url;
} else if (strpos($url, '/') === 0) {
// Fix the admin links if needed.
if ($CFG->admin !== 'admin') {
if (strpos($url, "/admin/") === 0) {
$url = preg_replace("|^/admin/|", "/$CFG->admin/", $url);
}
}
if (debugging()) {
// check file existence only when in debug mode
if (!file_exists($CFG->dirroot . strtok($url, '?'))) {