当前位置: 首页>>代码示例>>PHP>>正文


PHP mod_forum_post_form::focus方法代码示例

本文整理汇总了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)) {
开发者ID:veritech,项目名称:pare-project,代码行数:31,代码来源:post.php

示例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!');
    }
开发者ID:laiello,项目名称:poodll,代码行数:31,代码来源:post.php


注:本文中的mod_forum_post_form::focus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。