mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-19773 - Cannot have code like $SESSION->feedback = new object(); in mod/feedback/lib.php
This commit is contained in:
parent
3a5c7d825c
commit
f1b9e2df43
@ -12,6 +12,8 @@
|
|||||||
require_once("lib.php");
|
require_once("lib.php");
|
||||||
require_once($CFG->libdir . '/completionlib.php');
|
require_once($CFG->libdir . '/completionlib.php');
|
||||||
|
|
||||||
|
feedback_init_feedback_session();
|
||||||
|
|
||||||
$id = required_param('id', PARAM_INT);
|
$id = required_param('id', PARAM_INT);
|
||||||
$completedid = optional_param('completedid', false, PARAM_INT);
|
$completedid = optional_param('completedid', false, PARAM_INT);
|
||||||
$preservevalues = optional_param('preservevalues', 0, PARAM_INT);
|
$preservevalues = optional_param('preservevalues', 0, PARAM_INT);
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
require_once("../../config.php");
|
require_once("../../config.php");
|
||||||
require_once("lib.php");
|
require_once("lib.php");
|
||||||
|
|
||||||
|
feedback_init_feedback_session();
|
||||||
|
|
||||||
$id = required_param('id', PARAM_INT);
|
$id = required_param('id', PARAM_INT);
|
||||||
$completedid = optional_param('completedid', false, PARAM_INT);
|
$completedid = optional_param('completedid', false, PARAM_INT);
|
||||||
$preservevalues = optional_param('preservevalues', 0, PARAM_INT);
|
$preservevalues = optional_param('preservevalues', 0, PARAM_INT);
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
require_once("lib.php");
|
require_once("lib.php");
|
||||||
require_once('edit_form.php');
|
require_once('edit_form.php');
|
||||||
|
|
||||||
|
feedback_init_feedback_session();
|
||||||
|
|
||||||
$id = required_param('id', PARAM_INT);
|
$id = required_param('id', PARAM_INT);
|
||||||
|
|
||||||
if(($formdata = data_submitted()) AND !confirm_sesskey()) {
|
if(($formdata = data_submitted()) AND !confirm_sesskey()) {
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
require_once("../../config.php");
|
require_once("../../config.php");
|
||||||
require_once("lib.php");
|
require_once("lib.php");
|
||||||
|
|
||||||
|
feedback_init_feedback_session();
|
||||||
|
|
||||||
$id = optional_param('id', NULL, PARAM_INT);
|
$id = optional_param('id', NULL, PARAM_INT);
|
||||||
$typ = optional_param('typ', false, PARAM_ALPHA);
|
$typ = optional_param('typ', false, PARAM_ALPHA);
|
||||||
$itemid = optional_param('itemid', false, PARAM_INT);
|
$itemid = optional_param('itemid', false, PARAM_INT);
|
||||||
|
@ -38,14 +38,6 @@ define('FEEDBACK_RESETFORM_RESET', 'feedback_reset_data_');
|
|||||||
define('FEEDBACK_RESETFORM_DROP', 'feedback_drop_feedback_');
|
define('FEEDBACK_RESETFORM_DROP', 'feedback_drop_feedback_');
|
||||||
define('FEEDBACK_MAX_PIX_LENGTH', '400'); //max. Breite des grafischen Balkens in der Auswertung
|
define('FEEDBACK_MAX_PIX_LENGTH', '400'); //max. Breite des grafischen Balkens in der Auswertung
|
||||||
|
|
||||||
//initialize the feedback-Session - not nice at all!!
|
|
||||||
global $SESSION;
|
|
||||||
if (!empty($SESSION)) {
|
|
||||||
if (!isset($SESSION->feedback) OR !is_object($SESSION->feedback)) {
|
|
||||||
$SESSION->feedback = new object();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @uses FEATURE_GROUPS
|
* @uses FEATURE_GROUPS
|
||||||
* @uses FEATURE_GROUPINGS
|
* @uses FEATURE_GROUPINGS
|
||||||
@ -2299,6 +2291,8 @@ function feedback_print_errors() {
|
|||||||
|
|
||||||
global $SESSION, $OUTPUT;
|
global $SESSION, $OUTPUT;
|
||||||
|
|
||||||
|
feedback_init_feedback_session();
|
||||||
|
|
||||||
if(empty($SESSION->feedback->errors)) {
|
if(empty($SESSION->feedback->errors)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2361,4 +2355,14 @@ function feedback_extend_settings_navigation($settings, $module) {
|
|||||||
if (has_capability('moodle/course:manageactivities', $PAGE->cm->context)) {
|
if (has_capability('moodle/course:manageactivities', $PAGE->cm->context)) {
|
||||||
$feedbacknav->add(get_string('updatethis', '', get_string('modulename', 'feedback')), new moodle_url($CFG->wwwroot.'/course/mod.php', array('update' => $PAGE->cm->id, 'return' => true, 'sesskey' => sesskey())));
|
$feedbacknav->add(get_string('updatethis', '', get_string('modulename', 'feedback')), new moodle_url($CFG->wwwroot.'/course/mod.php', array('update' => $PAGE->cm->id, 'return' => true, 'sesskey' => sesskey())));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function feedback_init_feedback_session() {
|
||||||
|
//initialize the feedback-Session - not nice at all!!
|
||||||
|
global $SESSION;
|
||||||
|
if (!empty($SESSION)) {
|
||||||
|
if (!isset($SESSION->feedback) OR !is_object($SESSION->feedback)) {
|
||||||
|
$SESSION->feedback = new object();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user