本文整理汇总了PHP中mod_forum_post_form::focus方法的典型用法代码示例。如果您正苦于以下问题:PHP mod_forum_post_form::focus方法的具体用法?PHP mod_forum_post_form::focus怎么用?PHP mod_forum_post_form::focus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mod_forum_post_form
的用法示例。
在下文中一共展示了mod_forum_post_form::focus方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: empty
}
$discussion->name = $forum->name;
}
if ($forum->type == 'single') {
// There is only one discussion thread for this forum type. We should
// not show the discussion name (same as forum name in this case) in
// the breadcrumbs.
$strdiscussionname = '';
$navtail = '';
} else {
// Show the discussion name in the breadcrumbs.
$strdiscussionname = format_string($discussion->name) . ':';
}
$forcefocus = empty($reply) ? NULL : 'message';
if ($course->id != SITEID) {
print_header("{$course->shortname}: {$strdiscussionname} " . format_string($toppost->subject), $course->fullname, "<a href=\"../../course/view.php?id={$course->id}\">{$course->shortname}</a> ->\n {$navmiddle} {$navtail}", $mform_post->focus($forcefocus), "", true, "", navmenu($course, $cm));
} else {
print_header("{$course->shortname}: {$strdiscussionname} " . format_string($toppost->subject), $course->fullname, "{$navmiddle} {$navtail}", $mform_post->focus($forcefocus), "", true, "", navmenu($course, $cm));
}
// checkup
if (!empty($parent) && !forum_user_can_see_post($forum, $discussion, $post)) {
error("You cannot reply to this post");
}
if (empty($parent) && empty($edit) && !forum_user_can_post_discussion($forum)) {
error("You cannot start a new discussion in this forum");
}
if ($forum->type == 'qanda' && !has_capability('mod/forum:viewqandawithoutposting', $modcontext) && !empty($discussion->id) && !forum_user_has_posted($forum->id, $discussion->id, $USER->id)) {
notify(get_string('qandanotify', 'forum'));
}
forum_check_throttling($forum);
if (!empty($parent)) {
示例2: empty
// the breadcrumbs.
$strdiscussionname = '';
} else {
// Show the discussion name in the breadcrumbs.
$strdiscussionname = format_string($discussion->name) . ':';
}
$forcefocus = empty($reply) ? NULL : 'message';
$navlinks = array();
if ($post->parent) {
$navlinks[] = array('name' => format_string($toppost->subject, true), 'link' => "discuss.php?d={$discussion->id}", 'type' => 'title');
$navlinks[] = array('name' => get_string('editing', 'forum'), 'link' => '', 'type' => 'title');
} else {
$navlinks[] = array('name' => format_string($toppost->subject), 'link' => '', 'type' => 'title');
}
$navigation = build_navigation($navlinks, $cm);
print_header("{$course->shortname}: {$strdiscussionname} " . format_string($toppost->subject), $course->fullname, $navigation, $mform_post->focus($forcefocus), "", true, "", navmenu($course, $cm));
// checkup
if (!empty($parent) && !forum_user_can_see_post($forum, $discussion, $post, null, $cm)) {
error("You cannot reply to this post");
}
if (empty($parent) && empty($edit) && !forum_user_can_post_discussion($forum, $groupid, -1, $cm, $modcontext)) {
error("You cannot start a new discussion in this forum");
}
if ($forum->type == 'qanda' && !has_capability('mod/forum:viewqandawithoutposting', $modcontext) && !empty($discussion->id) && !forum_user_has_posted($forum->id, $discussion->id, $USER->id)) {
notify(get_string('qandanotify', 'forum'));
}
forum_check_throttling($forum, $cm);
if (!empty($parent)) {
if (!($discussion = get_record('forum_discussions', 'id', $parent->discussion))) {
error('This post is not part of a discussion!');
}