// Make sure cache dir is writable, throws exception if not.
make_cache_directory('');
- // Hack: this script may get called after the purifier was initialised,
- // but we do not want to verify repeatedly this exists in each call.
- make_cache_directory('htmlpurifier');
-
// This is the only place where we purge local caches, we are only adding files there.
// The $CFG->localcachedirpurged flag forces local directories to be purged on cluster nodes.
remove_dir($CFG->localcachedir, true);
}
}
-/**
- * Determines if the currently logged in user is in editing mode.
- *
- * Note: originally this function had $userid parameter - it was not usable anyway
- *
- * @deprecated since Moodle 2.0 - use $PAGE->user_is_editing() instead.
- * @todo Deprecated function remove when ready
- *
- * @return bool
- */
-function isediting() {
- global $PAGE;
- debugging('call to deprecated function isediting(). Please use $PAGE->user_is_editing() instead', DEBUG_DEVELOPER);
- return $PAGE->user_is_editing();
-}
-
/**
* Determines if the logged in user is currently moving an activity
*
}
/**
- * Will truncate userinfo as it comes from auth_get_userinfo (from external auth)
- * which may have large fields
- *
- * @todo Add vartype handling to ensure $info is an array
+ * Will truncate userinfo as it comes from auth_get_userinfo (from external auth) which may have large fields.
*
* @param array $info Array of user properties to truncate if needed
* @return array The now truncated information that was passed in
*/
- function truncate_userinfo($info) {
+ function truncate_userinfo(array $info) {
// Define the limits.
$limit = array(
'username' => 100,
$strgomessage = get_string('gotomessages', 'message');
$strstaymessage = get_string('ignore', 'admin');
+ $notificationsound = null;
+ $beep = get_user_preferences('message_beepnewmessage', '');
+ if (!empty($beep)) {
+ // Browsers will work down this list until they find something they support.
+ $sourcetags = html_writer::empty_tag('source', array('src' => $CFG->wwwroot.'/message/bell.wav', 'type' => 'audio/wav'));
+ $sourcetags .= html_writer::empty_tag('source', array('src' => $CFG->wwwroot.'/message/bell.ogg', 'type' => 'audio/ogg'));
+ $sourcetags .= html_writer::empty_tag('source', array('src' => $CFG->wwwroot.'/message/bell.mp3', 'type' => 'audio/mpeg'));
+ $sourcetags .= html_writer::empty_tag('embed', array('src' => $CFG->wwwroot.'/message/bell.wav', 'autostart' => 'true', 'hidden' => 'true'));
+
+ $notificationsound = html_writer::tag('audio', $sourcetags, array('preload' => 'auto', 'autoplay' => 'autoplay'));
+ }
+
$url = $CFG->wwwroot.'/message/index.php';
$content = html_writer::start_tag('div', array('id' => 'newmessageoverlay', 'class' => 'mdl-align')).
html_writer::start_tag('div', array('id' => 'newmessagetext')).
$strmessages.
html_writer::end_tag('div').
+ $notificationsound.
html_writer::start_tag('div', array('id' => 'newmessagelinks')).
- html_writer::link($url, $strgomessage, array('id' => 'notificationyes')).' '.
- html_writer::link('', $strstaymessage, array('id' => 'notificationno')).
+ html_writer::link($url, $strgomessage, array('id' => 'notificationyes')).' '.
+ html_writer::link('', $strstaymessage, array('id' => 'notificationno')).
html_writer::end_tag('div');
html_writer::end_tag('div');