本文整理汇总了PHP中quiz_access_manager::securewindow_required方法的典型用法代码示例。如果您正苦于以下问题:PHP quiz_access_manager::securewindow_required方法的具体用法?PHP quiz_access_manager::securewindow_required怎么用?PHP quiz_access_manager::securewindow_required使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类quiz_access_manager
的用法示例。
在下文中一共展示了quiz_access_manager::securewindow_required方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: quiz
$accessmanager = new quiz_access_manager(new quiz($quiz, $cm, $course), $timenow, has_capability('mod/quiz:ignoretimelimits', $context, NULL, false));
/// If no questions have been set up yet redirect to edit.php
if (!$quiz->questions && has_capability('mod/quiz:manage', $context)) {
redirect($CFG->wwwroot . '/mod/quiz/edit.php?cmid=' . $cm->id);
}
/// Log this request.
add_to_log($course->id, "quiz", "view", "view.php?id={$cm->id}", $quiz->id, $cm->id);
/// Initialize $PAGE, compute blocks
$PAGE->set_url('mod/quiz/view.php', array('id' => $cm->id));
$edit = optional_param('edit', -1, PARAM_BOOL);
if ($edit != -1 && $PAGE->user_allowed_editing()) {
$USER->editing = $edit;
}
/// Print the page header
$bodytags = '';
if ($accessmanager->securewindow_required($canpreview)) {
$bodytags = 'onload="popupchecker(\'' . get_string('popupblockerwarning', 'quiz') . '\');"';
}
$PAGE->requires->yui_lib('event');
// Note: MDL-19010 there will be further changes to printing header and blocks.
// The code will be much nicer than this eventually.
$title = $course->shortname . ': ' . format_string($quiz->name);
$buttons = '<table><tr><td>' . update_module_button($cm->id, $course->id, get_string('modulename', 'quiz')) . '</td>';
if ($PAGE->user_allowed_editing() && !empty($CFG->showblocksonmodpages)) {
$buttons .= '<td><form ' . $CFG->frametarget . ' method="get" action="view.php"><div>' . '<input type="hidden" name="id" value="' . $cm->id . '" />' . '<input type="hidden" name="edit" value="' . ($PAGE->user_is_editing() ? 'off' : 'on') . '" />' . '<input type="submit" value="' . get_string($PAGE->user_is_editing() ? 'blockseditoff' : 'blocksediton') . '" /></div></form></td>';
}
$buttons .= '</tr></table>';
$navigation = build_navigation(array(), $cm);
print_header($title, $course->fullname, $navigation, '', '', true, $buttons, navmenu($course, $cm), false, $bodytags);
/// Print heading and tabs (if there is more than one).
$currenttab = 'info';