本文整理汇总了PHP中Widgets::__WidgetMultidisplay方法的典型用法代码示例。如果您正苦于以下问题:PHP Widgets::__WidgetMultidisplay方法的具体用法?PHP Widgets::__WidgetMultidisplay怎么用?PHP Widgets::__WidgetMultidisplay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Widgets
的用法示例。
在下文中一共展示了Widgets::__WidgetMultidisplay方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __widget
private function __widget()
{
global $CFG;
require_once 'widgets.php';
$cousreId = required_param('courseid', PARAM_RAW_TRIMMED);
$widgetType = required_param('widgettype', PARAM_RAW_TRIMMED);
if ($widgetType == "Multi") {
$modId = required_param('modId', PARAM_RAW_TRIMMED);
Widgets::__WidgetMultidisplay($cousreId, $widgetType, $modId);
} else {
Widgets::__Widgetdisplay($cousreId, $widgetType);
}
}
示例2: extractModules
private static function extractModules($couseid, $topicid, array $modules, $userid, $from)
{
global $DB;
foreach ($modules as $i => &$module) {
$content = !empty($module['contents'][0]) ? $module['contents'][0] : null;
unset($module['contents']);
$module['contents'] = $content;
if ($module['modname'] == "resource") {
$mid = $module['id'];
$sql = "SELECT r.timemodified FROM mdl_course_modules cm \n JOIN mdl_resource r ON cm.instance = r.id WHERE cm.id = {$mid}";
$res_latest = $DB->get_record_sql($sql);
$module['contents']['timemodified'] = $res_latest->timemodified;
}
if ($module['modname'] == "game") {
$mid = $module['id'];
$sql = "SELECT g.timemodified FROM mdl_course_modules cm \n JOIN mdl_game g ON cm.instance = g.id WHERE cm.id = {$mid}";
$res_latest = $DB->get_record_sql($sql);
$module['contents']['timemodified'] = $res_latest->timemodified;
}
if ($module['modname'] == "scorm" && !empty($from)) {
$mid = $module['id'];
$sql = "SELECT g.timemodified FROM mdl_course_modules cm \n JOIN mdl_scorm g ON cm.instance = g.id WHERE cm.id = {$mid}";
$res_latest = $DB->get_record_sql($sql);
if (!empty($res_latest)) {
if (!empty($res_latest->timemodified)) {
$module['scorm']['timemodified'] = $res_latest->timemodified;
} else {
unset($modules[$i]);
continue;
}
}
}
$widgetType = self::getWidgetType($module['name']);
if (!empty($widgetType)) {
if ($widgetType === 'Multi') {
$module['widget'] = Widgets::__WidgetMultidisplay($couseid, $widgetType, $module['id'], true);
} else {
$module['widget'] = Widgets::__Widgetdisplay($couseid, $widgetType, $module['id'], true);
}
} else {
// Could be quiz
if ($module['modname'] === 'quiz') {
$module['quiz'] = QuizInfo::__QuizInfo($couseid, $userid, $module['id'], $from);
if (empty($module['quiz'])) {
unset($modules[$i]);
continue;
}
}
}
if (!self::isModuleModifiedAfterTime($module, $from) || !empty($from) && $module['modname'] === 'forum') {
unset($modules[$i]);
continue;
}
//Insert courseid in the topic id for readibility
$module = array_slice($module, 0, 2, true) + array('courseid' => $couseid, 'topicid' => $topicid) + array_slice($module, 2, null, true);
}
unset($module);
return array_values($modules);
}