mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
core MDL-19791 Replaced deprecated functions, added set_url calls
This commit is contained in:
parent
d9cb06dc0e
commit
1a198dde7d
@ -1,5 +1,8 @@
|
||||
<?php
|
||||
require_once('../../config.php');
|
||||
|
||||
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/lib/form/editorhelp.php'));
|
||||
|
||||
$topics = array();
|
||||
$titles = array();
|
||||
for ($i=1; ; $i++){
|
||||
|
@ -5010,7 +5010,12 @@ function email_welcome_message_to_user($course, $user=NULL) {
|
||||
if (!empty($message)) {
|
||||
$subject = get_string('welcometocourse', '', format_string($course->fullname));
|
||||
|
||||
if (! $teacher = get_teacher($course->id)) {
|
||||
$context = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
// Pass $view=true to filter hidden caps if the user cannot see them
|
||||
if ($users = get_users_by_capability($context, 'moodle/course:update', 'u.*', 'u.id ASC','', '', '', '', false, true)) {
|
||||
$users = sort_by_roleassignment_authority($users, $context);
|
||||
$teacher = array_shift($users);
|
||||
} else {
|
||||
$teacher = get_admin();
|
||||
}
|
||||
email_to_user($user, $teacher, $subject, $message);
|
||||
|
@ -32,8 +32,12 @@
|
||||
/** Include config {@see config.php} */
|
||||
require '../config.php';
|
||||
|
||||
error('session test not reimplemented yet');
|
||||
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/lib/session-test.php'));
|
||||
$PAGE->set_generaltype('form');
|
||||
|
||||
list($message, $moreinfourl, $link) = prepare_error_message('notlocalisederrormessage', 'error', '', 'session test not reimplemented yet');
|
||||
echo $OUTPUT->fatal_error($message, $moreinfourl, $link, debug_backtrace());
|
||||
//
|
||||
//TODO: add code that actually tests moodle sessions, the old one only tested PHP sessions used from installer, not the real moodle sessions
|
||||
|
||||
?>
|
||||
?>
|
@ -41,6 +41,7 @@ require_capability('moodle/site:config', $syscontext);
|
||||
$baseurl = $CFG->wwwroot . '/lib/simpletest/filtersettingsperformancetester.php';
|
||||
|
||||
$title = 'filter_get_active_in_context performance test';
|
||||
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/lib/simpletest/filtersettingsperformancetester.php'));
|
||||
$PAGE->navbar->add($title);
|
||||
$PAGE->set_title($title);
|
||||
$PAGE->set_heading($title);
|
||||
|
@ -145,7 +145,7 @@ function stats_cron_daily($maxdays=1) {
|
||||
$viewactions = implode(',', stats_get_action_names('view'));
|
||||
$postactions = implode(',', stats_get_action_names('post'));
|
||||
|
||||
$guest = get_guest();
|
||||
$guest = get_complete_user_data('username', 'guest');
|
||||
$guestrole = get_guest_role();
|
||||
|
||||
list($enroljoin, $enrolwhere, $enrolparams) = stats_get_enrolled_sql($CFG->statscatdepth, true);
|
||||
|
@ -2164,11 +2164,11 @@ function open_containers() {
|
||||
* @return mixed string or void
|
||||
*/
|
||||
function print_container_end_all($return=false, $keep=0) {
|
||||
global $OUTPUT;
|
||||
$output = '';
|
||||
while (open_containers() > $keep) {
|
||||
$output .= print_container_end($return);
|
||||
$output .= $OUTPUT->container_end();
|
||||
}
|
||||
|
||||
if ($return) {
|
||||
return $output;
|
||||
} else {
|
||||
|
@ -22,6 +22,8 @@
|
||||
*/
|
||||
|
||||
/** Include config.pgp */
|
||||
include('../config.php');
|
||||
redirect('http://en.wikipedia.org/wiki/Women%27s_liberation');
|
||||
?>
|
||||
include('../config.php');
|
||||
|
||||
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/lib/womenslib.php'));
|
||||
|
||||
redirect('http://en.wikipedia.org/wiki/Women%27s_liberation');
|
@ -9,7 +9,7 @@
|
||||
|
||||
$strmymoodle = get_string('mymoodle','my');
|
||||
|
||||
if (isguest()) {
|
||||
if (has_capability('moodle/legacy:guest', get_context_instance(CONTEXT_SYSTEM), 0, false)) {
|
||||
$PAGE->set_title($strmymoodle);
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->confirm(get_string('noguest', 'my') . '<br /><br />' . get_string('liketologin'), get_login_url(), $CFG->wwwroot);
|
||||
|
Loading…
x
Reference in New Issue
Block a user