本文整理匯總了PHP中assign_plugin::view_summary方法的典型用法代碼示例。如果您正苦於以下問題:PHP assign_plugin::view_summary方法的具體用法?PHP assign_plugin::view_summary怎麽用?PHP assign_plugin::view_summary使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類assign_plugin
的用法示例。
在下文中一共展示了assign_plugin::view_summary方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: format_plugin_summary_with_link
/**
* Write the plugin summary with an optional link to view the full feedback/submission.
*
* @param assign_plugin $plugin Submission plugin or feedback plugin
* @param stdClass $item Submission or grade
* @param string $returnaction The return action to pass to the
* view_submission page (the current page)
* @param string $returnparams The return params to pass to the view_submission
* page (the current page)
* @return string The summary with an optional link
*/
private function format_plugin_summary_with_link(assign_plugin $plugin, stdClass $item, $returnaction, $returnparams)
{
$link = '';
$showviewlink = false;
$summary = $plugin->view_summary($item, $showviewlink);
$separator = '';
if ($showviewlink) {
$viewstr = get_string('view' . substr($plugin->get_subtype(), strlen('assign')), 'assign');
$icon = $this->output->pix_icon('t/preview', $viewstr);
$urlparams = array('id' => $this->assignment->get_course_module()->id, 'sid' => $item->id, 'gid' => $item->id, 'plugin' => $plugin->get_type(), 'action' => 'viewplugin' . $plugin->get_subtype(), 'returnaction' => $returnaction, 'returnparams' => http_build_query($returnparams));
$url = new moodle_url('/mod/assign/view.php', $urlparams);
$link = $this->output->action_link($url, $icon);
$separator = $this->output->spacer(array(), true);
}
return $link . $separator . $summary;
}