From: tjhunt Date: Tue, 28 Jul 2009 04:16:59 +0000 (+0000) Subject: course MDL-19794: Fix more initialisation order problems X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=680a65a0ccc573830110f10f3490946b2923550c;p=moodle.git course MDL-19794: Fix more initialisation order problems --- diff --git a/course/category.php b/course/category.php index 3b49668a31..606654e7b5 100644 --- a/course/category.php +++ b/course/category.php @@ -440,10 +440,5 @@ print_course_search(); - if ($editingon && update_category_button()) { - admin_externalpage_print_footer(); - } else { - print_footer(); - } + print_footer(); -?> diff --git a/course/search.php b/course/search.php index 76f14a0dfc..3089a06bf2 100644 --- a/course/search.php +++ b/course/search.php @@ -29,11 +29,23 @@ $site = get_site(); + $urlparams = array(); + foreach (array('search', 'page', 'blocklist', 'modulelist') as $param) { + if (!empty($$param)) { + $urlparams[$param] = $$param; + } + } + if ($perpage != 10) { + $urlparams['perpage'] = $perpage; + } + $PAGE->set_url('course/search.php', $urlparams); + $PAGE->set_context(get_context_instance(CONTEXT_SYSTEM)); + if ($CFG->forcelogin) { require_login(); } - if (update_category_button()) { + if (can_edit_in_category()) { if ($edit !== -1) { $USER->editing = $edit; }