format.php

来自「很棒的在线教学系统」· PHP 代码 · 共 348 行 · 第 1/2 页

PHP
348
字号
                '&'.$LAMSCONSTANTS->param_serverid.'='.$CFG->lams_serverid.                '&'.$LAMSCONSTANTS->param_hash.'='.$hash.                '&'.$LAMSCONSTANTS->param_courseid.'='.$course->id;            echo '<table width="100%" height="600" class="section">'.                '<tr>'.                '<td class="activity forum">'.                '<iframe name="iframe" id="iframe" src="'.$url.'"  width="100%" height="100%" frameborder="1">'.                '</iframe>'.                '</td>'.                '</tr>'.                '</table>';        }    }                                //print_section($course, $thissection, $mods, $modnamesused);    /*if (isediting($course->id)) {      print_section_add_menus($course, $section, $modnames);      }*/    echo '</td>';    echo '<td class="right side">&nbsp;</td>';    echo '</tr>';    echo '<tr class="section separator"><td colspan="3" class="spacer"></td></tr>';}/// Now all the normal modules by topic/// Everything below uses "section" terminology - each "section" is a topic.$timenow = time();$section = 1;$sectionmenu = array();while ($section <= $course->numsections) {    if (!empty($sections[$section])) {        $thissection = $sections[$section];    } else {        unset($thissection);        $thissection->course = $course->id;   // Create a new section structure        $thissection->section = $section;        $thissection->summary = '';        $thissection->visible = 1;        if (!$thissection->id = insert_record('course_sections', $thissection)) {            notify('Error inserting new topic!');        }    }    $showsection = (has_capability('moodle/course:viewhiddensections', $context) or $thissection->visible or !$course->hiddensections);    if (!empty($displaysection) and $displaysection != $section) {        if ($showsection) {            $strsummary = ' - '.strip_tags($thissection->summary);            if (strlen($strsummary) < 57) {                $strsummary = ' - '.$strsummary;            } else {                $strsummary = ' - '.substr($strsummary, 0, 60).'...';            }            $sectionmenu['topic='.$section] = s($section.$strsummary);        }        $section++;        continue;    }    if ($showsection) {        $currenttopic = ($course->marker == $section);        $currenttext = '';        if (!$thissection->visible) {            $sectionstyle = ' hidden';        } else if ($currenttopic) {            $sectionstyle = ' current';            $currenttext = get_accesshide(get_string('currenttopic','access'));        } else {            $sectionstyle = '';        }        echo '<tr id="section-'.$section.'" class="section main'.$sectionstyle.'">';        echo '<td class="left side">&nbsp;'.$currenttext.'</td>';        echo '<td class="content">';        if (!has_capability('moodle/course:viewhiddensections', $context) and !$thissection->visible) {   // Hidden for students            echo get_string('notavailable');        } else {            echo '<div class="summary">';            $summaryformatoptions->noclean = true;            echo format_text($thissection->summary, FORMAT_HTML, $summaryformatoptions);            if (isediting($course->id) && has_capability('moodle/course:update', $course->id)) {                echo ' <a title="'.$streditsummary.'" href="editsection.php?id='.$thissection->id.'">'.                    '<img src="'.$CFG->pixpath.'/t/edit.gif" class="iconsmall" alt="'.$streditsummary.'" /></a><br /><br />';            }            echo '</div>';            print_section($course, $thissection, $mods, $modnamesused);            if (isediting($course->id)) {                print_section_add_menus($course, $section, $modnames);            }        }        echo '</td>';        echo '<td class="right side">';        if ($displaysection == $section) {      // Show the zoom boxes            echo '<a href="view.php?id='.$course->id.'&amp;topic=0#section-'.$section.'" title="'.$strshowalltopics.'">'.                '<img src="'.$CFG->pixpath.'/i/all.gif" height="25" width="16" border="0" alt="'.$strshowalltopics.'" /></a><br />';        } else {            $strshowonlytopic = get_string('showonlytopic', '', $section);            echo '<a href="view.php?id='.$course->id.'&amp;topic='.$section.'" title="'.$strshowonlytopic.'">'.                '<img src="'.$CFG->pixpath.'/i/one.gif" height="16" width="16" border="0" alt="'.$strshowonlytopic.'" /></a><br />';        }            if (isediting($course->id) && has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $course->id))) {            if ($course->marker == $section) {  // Show the "light globe" on/off                echo '<a href="view.php?id='.$course->id.'&amp;marker=0&amp;sesskey='.$USER->sesskey.'#section-'.$section.'" title="'.$strmarkedthistopic.'">'.                    '<img src="'.$CFG->pixpath.'/i/marked.gif" height="16" width="16" border="0" alt="'.$strmarkedthistopic.'" /></a><br />';            } else {                echo '<a href="view.php?id='.$course->id.'&amp;marker='.$section.'&amp;sesskey='.$USER->sesskey.'#section-'.$section.'" title="'.$strmarkthistopic.'">'.                    '<img src="'.$CFG->pixpath.'/i/marker.gif" height="16" width="16" border="0" alt="'.$strmarkthistopic.'" /></a><br />';            }            if ($thissection->visible) {        // Show the hide/show eye                echo '<a href="view.php?id='.$course->id.'&amp;hide='.$section.'&amp;sesskey='.$USER->sesskey.'#section-'.$section.'" title="'.$strtopichide.'">'.                    '<img src="'.$CFG->pixpath.'/i/hide.gif" height="16" width="16" border="0" alt="'.$strtopichide.'" /></a><br />';            } else {                echo '<a href="view.php?id='.$course->id.'&amp;show='.$section.'&amp;sesskey='.$USER->sesskey.'#section-'.$section.'" title="'.$strtopicshow.'">'.                    '<img src="'.$CFG->pixpath.'/i/show.gif" height="16" width="16" border="0" alt="'.$strtopicshow.'" /></a><br />';            }            if ($section > 1) {                       // Add a arrow to move section up                echo '<a href="view.php?id='.$course->id.'&amp;random='.rand(1,10000).'&amp;section='.$section.'&amp;move=-1&amp;sesskey='.$USER->sesskey.'#section-'.($section-1).'" title="'.$strmoveup.'">'.                    '<img src="'.$CFG->pixpath.'/t/up.gif" class="iconsmall" alt="'.$strmoveup.'" /></a><br />';            }            if ($section < $course->numsections) {    // Add a arrow to move section down                echo '<a href="view.php?id='.$course->id.'&amp;random='.rand(1,10000).'&amp;section='.$section.'&amp;move=1&amp;sesskey='.$USER->sesskey.'#section-'.($section+1).'" title="'.$strmovedown.'">'.                    '<img src="'.$CFG->pixpath.'/t/down.gif" class="iconsmall" alt="'.$strmovedown.'" /></a><br />';            }        }        echo '</td></tr>';        echo '<tr class="section separator"><td colspan="3" class="spacer"></td></tr>';    }    $section++;}echo '</table>';if (!empty($sectionmenu)) {    echo '<div class="jumpmenu">';    echo popup_form($CFG->wwwroot.'/course/view.php?id='.$course->id.'&', $sectionmenu,            'sectionmenu', '', get_string('jumpto'), '', '', true);    echo '</div>';}echo '</td>';// The right columnif (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) {    echo '<td style="width:'.$preferred_width_right.'px" id="right-column">';    blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);    echo '</td>';}echo '</tr></table>';?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?