本文整理汇总了PHP中ArtefactTypeComment::make_public_form方法的典型用法代码示例。如果您正苦于以下问题:PHP ArtefactTypeComment::make_public_form方法的具体用法?PHP ArtefactTypeComment::make_public_form怎么用?PHP ArtefactTypeComment::make_public_form使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArtefactTypeComment
的用法示例。
在下文中一共展示了ArtefactTypeComment::make_public_form方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render_instance
public static function render_instance(BlockInstance $instance, $editing = false)
{
global $USER;
if ($editing) {
$smarty = smarty_core();
$smarty->assign('editing', get_string('ineditordescription1', 'blocktype.comment/comment'));
$html = $smarty->fetch('blocktype:comment:comment.tpl');
return $html;
}
// Feedback list pagination requires limit/offset params
$limit = param_integer('limit', 10);
$offset = param_integer('offset', 0);
$showcomment = param_integer('showcomment', null);
// Create the "make feedback private form" now if it's been submitted
if (param_variable('make_public_submit', null)) {
pieform(ArtefactTypeComment::make_public_form(param_integer('comment')));
} else {
if (param_variable('delete_comment_submit_x', null)) {
pieform(ArtefactTypeComment::delete_comment_form(param_integer('comment')));
}
}
$view = new View($instance->get('view'));
$submittedgroup = (int) $view->get('submittedgroup');
if ($USER->is_logged_in() && $submittedgroup && group_user_can_assess_submitted_views($submittedgroup, $USER->get('id'))) {
$releaseform = true;
} else {
$releaseform = false;
}
// If the view has comments turned off, tutors can still leave
// comments if the view is submitted to their group.
if (!empty($releaseform) || $view->user_comments_allowed($USER)) {
$addfeedbackpopup = true;
}
safe_require('artefact', 'comment');
$commentoptions = ArtefactTypeComment::get_comment_options();
$commentoptions->limit = $limit;
$commentoptions->offset = $offset;
$commentoptions->showcomment = $showcomment;
$commentoptions->view = $instance->get_view();
$feedback = ArtefactTypeComment::get_comments($commentoptions);
$smarty = smarty_core();
$smarty->assign('feedback', $feedback);
if (isset($addfeedbackpopup)) {
$smarty->assign('enablecomments', 1);
$smarty->assign('addfeedbackpopup', $addfeedbackpopup);
}
$html = $smarty->fetch('blocktype:comment:comment.tpl');
return $html;
}
示例2: time
} else {
// To save the atime in the db - make it a millisecond in the past
// so it differs from the atime in the View constructor and so triggers
// the saving of the atime change. Can't use $view->set('dirty', true)
// as that will also get the view object to update the mtime which is not
// what we want.
$view->set('atime', time() - 1);
$view->commit();
}
// Feedback list pagination requires limit/offset params
$limit = param_integer('limit', 10);
$offset = param_integer('offset', 0);
$showcomment = param_integer('showcomment', null);
// Create the "make feedback private form" now if it's been submitted
if (param_variable('make_public_submit', null)) {
pieform(ArtefactTypeComment::make_public_form(param_integer('comment')));
} else {
if (param_variable('delete_comment_submit_x', null)) {
pieform(ArtefactTypeComment::delete_comment_form(param_integer('comment')));
}
}
$owner = $view->get('owner');
$viewtype = $view->get('type');
if ($viewtype == 'profile' || $viewtype == 'dashboard' || $viewtype == 'grouphomepage') {
redirect($view->get_url());
}
define('TITLE', $view->get('title'));
$collection = $view->get('collection');
$submittedgroup = (int) $view->get('submittedgroup');
if ($USER->is_logged_in() && $submittedgroup && group_user_can_assess_submitted_views($submittedgroup, $USER->get('id'))) {
// The user is a tutor of the group that this view has