當前位置: 首頁>>代碼示例>>PHP>>正文


PHP quiz_access_manager::securewindow_required方法代碼示例

本文整理匯總了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';
開發者ID:ajv,項目名稱:Offline-Caching,代碼行數:31,代碼來源:view.php


注:本文中的quiz_access_manager::securewindow_required方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。