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


PHP scorm_view_display函数代码示例

本文整理汇总了PHP中scorm_view_display函数的典型用法代码示例。如果您正苦于以下问题:PHP scorm_view_display函数的具体用法?PHP scorm_view_display怎么用?PHP scorm_view_display使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了scorm_view_display函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: current

        $firstscorm = current($scorms);
        if (!($course->format == 'scorm' && $firstscorm->id == $scorm->id)) {
            $navlinks[] = array('name' => $strscorms, 'link' => "index.php?id={$course->id}", 'type' => 'activity');
        }
    }
}
$pagetitle = strip_tags($course->shortname . ': ' . format_string($scorm->name));
add_to_log($course->id, 'scorm', 'pre-view', 'view.php?id=' . $cm->id, "{$scorm->id}");
if (has_capability('mod/scorm:skipview', get_context_instance(CONTEXT_MODULE, $cm->id)) && scorm_simple_play($scorm, $USER)) {
    exit;
}
//
// Print the page header
//
$navlinks = array();
$navlinks[] = array('name' => format_string($scorm->name, true), 'link' => "view.php?id={$cm->id}", 'type' => 'activityinstance');
$navigation = build_navigation($navlinks);
print_header($pagetitle, $course->fullname, $navigation, '', '', true, update_module_button($cm->id, $course->id, $strscorm), navmenu($course, $cm));
if (has_capability('mod/scorm:viewreport', $context)) {
    $trackedusers = scorm_get_count_users($scorm->id, $cm->groupingid);
    if ($trackedusers > 0) {
        echo "<div class=\"reportlink\"><a {$CFG->frametarget} href=\"report.php?id={$cm->id}\"> " . get_string('viewalluserreports', 'scorm', $trackedusers) . '</a></div>';
    } else {
        echo '<div class="reportlink">' . get_string('noreports', 'scorm') . '</div>';
    }
}
// Print the main part of the page
print_heading(format_string($scorm->name));
print_box(format_text($scorm->summary), 'generalbox', 'intro');
scorm_view_display($USER, $scorm, 'view.php?id=' . $cm->id, $cm);
print_footer($course);
开发者ID:r007,项目名称:PMoodle,代码行数:31,代码来源:view.php

示例2: scorm_course_format_display

function scorm_course_format_display($user, $course)
{
    global $CFG;
    $strupdate = get_string('update');
    $strmodule = get_string('modulename', 'scorm');
    $context = get_context_instance(CONTEXT_COURSE, $course->id);
    echo '<div class="mod-scorm">';
    if ($scorms = get_all_instances_in_course('scorm', $course)) {
        // The module SCORM activity with the least id is the course
        $scorm = current($scorms);
        if (!($cm = get_coursemodule_from_instance('scorm', $scorm->id, $course->id))) {
            error('Course Module ID was incorrect');
        }
        $colspan = '';
        $headertext = '<table width="100%"><tr><td class="title">' . get_string('name') . ': <b>' . format_string($scorm->name) . '</b>';
        if (has_capability('moodle/course:manageactivities', $context)) {
            if (isediting($course->id)) {
                // Display update icon
                $path = $CFG->wwwroot . '/course';
                $headertext .= '<span class="commands">' . '<a title="' . $strupdate . '" href="' . $path . '/mod.php?update=' . $cm->id . '&amp;sesskey=' . sesskey() . '">' . '<img src="' . $CFG->pixpath . '/t/edit.gif" class="iconsmall" alt="' . $strupdate . '" /></a></span>';
            }
            $headertext .= '</td>';
            // Display report link
            $trackedusers = get_record('scorm_scoes_track', 'scormid', $scorm->id, '', '', '', '', 'count(distinct(userid)) as c');
            if ($trackedusers->c > 0) {
                $headertext .= '<td class="reportlink">' . '<a ' . $CFG->frametarget . '" href="' . $CFG->wwwroot . '/mod/scorm/report.php?id=' . $cm->id . '">' . get_string('viewallreports', 'scorm', $trackedusers->c) . '</a>';
            } else {
                $headertext .= '<td class="reportlink">' . get_string('noreports', 'scorm');
            }
            $colspan = ' colspan="2"';
        }
        $headertext .= '</td></tr><tr><td' . $colspan . '>' . format_text(get_string('summary') . ':<br />' . $scorm->summary) . '</td></tr></table>';
        print_simple_box($headertext, '', '100%');
        scorm_view_display($user, $scorm, 'view.php?id=' . $course->id, $cm, '100%');
    } else {
        if (has_capability('moodle/course:update', $context)) {
            // Create a new activity
            redirect($CFG->wwwroot . '/course/mod.php?id=' . $course->id . '&amp;section=0&sesskey=' . sesskey() . '&amp;add=scorm');
        } else {
            notify('Could not find a scorm course here');
        }
    }
    echo '</div>';
}
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:44,代码来源:locallib.php


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