本文整理汇总了PHP中ArtefactTypeComment::add_comment_form方法的典型用法代码示例。如果您正苦于以下问题:PHP ArtefactTypeComment::add_comment_form方法的具体用法?PHP ArtefactTypeComment::add_comment_form怎么用?PHP ArtefactTypeComment::add_comment_form使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArtefactTypeComment
的用法示例。
在下文中一共展示了ArtefactTypeComment::add_comment_form方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: redirect
// The tutor might not have access to the view any more; send
// them back to the group page.
redirect(group_homepage_url($submittedgroup));
}
redirect($view->get_url());
}
$javascript = array('paginator', 'viewmenu', 'author');
$blocktype_js = $view->get_all_blocktype_javascript();
$javascript = array_merge($javascript, $blocktype_js['jsfiles']);
$inlinejs = "addLoadEvent( function() {\n" . join("\n", $blocktype_js['initjs']) . "\n});";
// If the view has comments turned off, tutors can still leave
// comments if the view is submitted to their group.
if (!empty($releaseform) || ($commenttype = $view->user_comments_allowed($USER))) {
$defaultprivate = !empty($releaseform);
$moderate = isset($commenttype) && $commenttype === 'private';
$addfeedbackform = pieform(ArtefactTypeComment::add_comment_form($defaultprivate, $moderate));
}
if ($USER->is_logged_in()) {
$objectionform = pieform(objection_form());
if ($notrudeform = notrude_form()) {
$notrudeform = pieform($notrudeform);
}
}
$viewbeingwatched = (int) record_exists('usr_watchlist_view', 'usr', $USER->get('id'), 'view', $viewid);
$commentoptions = ArtefactTypeComment::get_comment_options();
$commentoptions->limit = $limit;
$commentoptions->offset = $offset;
$commentoptions->showcomment = $showcomment;
$commentoptions->view = $view;
$feedback = ArtefactTypeComment::get_comments($commentoptions);
// Set up theme
示例2: array_unshift
array_unshift($artefactpath, array('url' => get_config('wwwroot') . 'view/artefact.php?artefact=' . $parent . '&view=' . $viewid, 'title' => $parentobj->display_title()));
}
$parent = $parentobj->get('parent');
}
$artefactpath[] = array('url' => '', 'title' => $artefact->display_title());
// Feedback
$feedback = ArtefactTypeComment::get_comments($limit, $offset, $showcomment, $view, $artefact);
$javascript = <<<EOF
var viewid = {$viewid};
addLoadEvent(function () {
paginator = {$feedback->pagination_js}
});
EOF;
if ($artefact->get('allowcomments')) {
$anonfeedback = !$USER->is_logged_in() && view_has_token($viewid, get_cookie('viewaccess:' . $viewid));
$addfeedbackform = pieform(ArtefactTypeComment::add_comment_form(false, $artefact->get('approvecomments')));
}
$objectionform = pieform(objection_form());
if ($notrudeform = $view->notrude_form()) {
$notrudeform = pieform($notrudeform);
}
$viewbeingwatched = (int) record_exists('usr_watchlist_view', 'usr', $USER->get('id'), 'view', $viewid);
$headers = array('<link rel="stylesheet" type="text/css" href="' . get_config('wwwroot') . 'theme/views.css">');
$hasfeed = false;
$feedlink = '';
// add a link to the ATOM feed in the header if the view is public
if ($artefact->get('artefacttype') == 'blog' && $view->is_public()) {
$hasfeed = true;
$feedlink = get_config('wwwroot') . 'artefact/blog/atom.php?artefact=' . $artefactid . '&view=' . $viewid;
$headers[] = '<link rel="alternate" type="application/atom+xml" href="' . $feedlink . '" />';
}