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


PHP Widgets::__Widgetdisplay方法代码示例

本文整理汇总了PHP中Widgets::__Widgetdisplay方法的典型用法代码示例。如果您正苦于以下问题:PHP Widgets::__Widgetdisplay方法的具体用法?PHP Widgets::__Widgetdisplay怎么用?PHP Widgets::__Widgetdisplay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Widgets的用法示例。


在下文中一共展示了Widgets::__Widgetdisplay方法的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);
     }
 }
开发者ID:vinoth4891,项目名称:clinique,代码行数:13,代码来源:services.php

示例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);
 }
开发者ID:vinoth4891,项目名称:clinique,代码行数:59,代码来源:clinique_complete_user_data.php


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