$itemid = optional_param('itemid', '', PARAM_INT);
$page = optional_param('page', 0, PARAM_INT);
+echo $OUTPUT->header(); // send headers
+
// initilising comment object
if (!empty($client_id)) {
$args = new stdclass;
require_capability('moodle/course:enrolreview', $context);
require_sesskey();
+echo $OUTPUT->header(); // send headers
+
$manager = new course_enrolment_manager($course);
$outcome = new stdClass;
require_login();
+echo $OUTPUT->header(); // send headers
+
$err = new stdclass;
if (isguestuser()) {
$err->error = get_string('noguest');
$e->stacktrace = format_backtrace($backtrace, true);
}
}
- @header('Content-type: application/json');
+ $this->header();
return json_encode($e);
}
public function notification($message, $classes = 'notifyproblem') {
}
+
public function redirect_message($encodedurl, $message, $delay, $debugdisableredirect) {
}
+
public function header() {
+ // unfortunately YUI iframe upload does not support application/json
+ if (!empty($_FILES)) {
+ @header('Content-type: text/plain');
+ } else {
+ @header('Content-type: application/json');
+ }
+
+ /// Headers to make it not cacheable and json
+ @header('Cache-Control: no-store, no-cache, must-revalidate');
+ @header('Cache-Control: post-check=0, pre-check=0', false);
+ @header('Pragma: no-cache');
+ @header('Expires: Mon, 20 Aug 1969 09:23:00 GMT');
+ @header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
+ @header('Accept-Ranges: none');
}
+
public function footer() {
}
+
public function heading($text, $level = 2, $classes = 'main', $id = null) {
}
}
$popup = optional_param('popup',0, PARAM_INT);
$ajax = optional_param('ajax',0, PARAM_INT);
+//TODO: do not make combined ajax+normal scripts (skodak)
+
if ($ajax && !defined('AJAX_SCRIPT')) {
define('AJAX_SCRIPT', true);
}
}
if ($ajax) {
+ echo $OUTPUT->header(); // send headers
$result = new stdClass;
$result->success = true;
$result->entries = $entries;
$user_context = get_context_instance(CONTEXT_USER, $USER->id);
+echo $OUTPUT->header(); // send headers
+
//
//NOTE TO ALL DEVELOPERS: this script must deal only with draft area of current user, it has to use only file_storage and no file_browser!!
//
require_login($course, false, $cm);
$PAGE->set_context($context);
-/// Headers to make it not cacheable
-header('Cache-Control: no-cache, must-revalidate');
-header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
+echo $OUTPUT->header(); // send headers
if (!confirm_sesskey()) {
$err->error = get_string('invalidsesskey');