message MDL-25148 using method on $PAGE to allow or disallow popup notifications
This commit is contained in:
+3
-3
@@ -111,7 +111,7 @@ $CFG->xmlstrictheaders = false;
|
||||
|
||||
if (!core_tables_exist()) {
|
||||
$PAGE->set_pagelayout('maintenance');
|
||||
define('MESSAGE_WINDOW', true);
|
||||
$PAGE->set_popup_notification_allowed(false);
|
||||
|
||||
// fake some settings
|
||||
$CFG->docroot = 'http://docs.moodle.org';
|
||||
@@ -194,7 +194,7 @@ if (empty($CFG->version)) {
|
||||
|
||||
if ($version > $CFG->version) { // upgrade
|
||||
$PAGE->set_pagelayout('maintenance');
|
||||
define('MESSAGE_WINDOW', true);
|
||||
$PAGE->set_popup_notification_allowed(false);
|
||||
|
||||
$a->oldversion = "$CFG->release ($CFG->version)";
|
||||
$a->newversion = "$release ($version)";
|
||||
@@ -278,7 +278,7 @@ if (moodle_needs_upgrading()) {
|
||||
// means core upgrade or installation was not already done
|
||||
if (!$confirmplugins) {
|
||||
$PAGE->set_pagelayout('maintenance');
|
||||
define('MESSAGE_WINDOW', true);
|
||||
$PAGE->set_popup_notification_allowed(false);
|
||||
$strplugincheck = get_string('plugincheck');
|
||||
$PAGE->navbar->add($strplugincheck);
|
||||
$PAGE->set_title($strplugincheck);
|
||||
|
||||
+2
-2
@@ -9107,8 +9107,8 @@ function moodle_request_shutdown() {
|
||||
*/
|
||||
function message_popup_window() {
|
||||
global $USER, $DB, $PAGE, $CFG, $SITE;
|
||||
|
||||
if (defined('MESSAGE_WINDOW') || empty($CFG->messaging)) {
|
||||
|
||||
if (!$PAGE->get_popup_notification_allowed() || empty($CFG->messaging)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -27,7 +27,8 @@ require_once($CFG->libdir.'/eventslib.php');
|
||||
|
||||
|
||||
define ('MESSAGE_SHORTLENGTH', 300);
|
||||
define ('MESSAGE_WINDOW', true); // We are in a message window (so don't pop up a new one!)
|
||||
|
||||
$PAGE->set_popup_notification_allowed(false); // We are in a message window (so don't pop up a new one)
|
||||
|
||||
define ('MESSAGE_DISCUSSION_WIDTH',600);
|
||||
define ('MESSAGE_DISCUSSION_HEIGHT',500);
|
||||
|
||||
@@ -775,8 +775,7 @@ class securewindow_access_rule extends quiz_access_rule_base {
|
||||
*/
|
||||
public function setup_secure_page($title, $headtags=null) {
|
||||
global $OUTPUT, $PAGE;
|
||||
/// This prevents the message window coming up.
|
||||
define('MESSAGE_WINDOW', true);
|
||||
$PAGE->set_popup_notification_allowed(false);//prevent message notifications
|
||||
$PAGE->set_title($title);
|
||||
$PAGE->set_cacheable(false);
|
||||
$PAGE->set_pagelayout('popup');
|
||||
|
||||
+1
-2
@@ -30,8 +30,7 @@ require_once($CFG->libdir.'/resourcelib.php');
|
||||
$agree = optional_param('agree', 0, PARAM_BOOL);
|
||||
|
||||
$PAGE->set_url('/user/policy.php');
|
||||
|
||||
define('MESSAGE_WINDOW', true); // This prevents the message window coming up - TODO: this is a hack! (skodak)
|
||||
$PAGE->set_popup_notification_allowed(false);
|
||||
|
||||
if (!isloggedin()) {
|
||||
require_login();
|
||||
|
||||
Reference in New Issue
Block a user