本文整理汇总了PHP中completion_info::display_help_icon方法的典型用法代码示例。如果您正苦于以下问题:PHP completion_info::display_help_icon方法的具体用法?PHP completion_info::display_help_icon怎么用?PHP completion_info::display_help_icon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类completion_info
的用法示例。
在下文中一共展示了completion_info::display_help_icon方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: print_multiple_section_page
/**
* Output the html for a multiple section page
*
* @param stdClass $course The course entry from DB
* @param array $sections (argument not used)
* @param array $mods (argument not used)
* @param array $modnames (argument not used)
* @param array $modnamesused (argument not used)
*/
public function print_multiple_section_page($course, $sections, $mods, $modnames, $modnamesused)
{
global $PAGE;
$modinfo = get_fast_modinfo($course);
$course = course_get_format($course)->get_course();
$context = context_course::instance($course->id);
// Title with completion help icon.
$completioninfo = new completion_info($course);
echo $completioninfo->display_help_icon();
echo $this->output->heading($this->page_title(), 2, 'accesshide');
// Copy activity clipboard..
echo $this->course_activity_clipboard($course, 0);
// Now the list of sections..
echo $this->start_section_list();
foreach ($modinfo->get_section_info_all() as $section => $thissection) {
if ($section == 0) {
// 0-section is displayed a little different then the others
if ($thissection->summary or !empty($modinfo->sections[0]) or $PAGE->user_is_editing()) {
echo $this->section_header($thissection, $course, false, 0);
print_section($course, $thissection, null, null, true, "100%", false, 0);
if ($PAGE->user_is_editing()) {
print_section_add_menus($course, 0, null, false, false, 0);
}
echo $this->section_footer();
}
continue;
}
if ($section > $course->numsections) {
// activities inside this section are 'orphaned', this section will be printed as 'stealth' below
continue;
}
// Show the section if the user is permitted to access it, OR if it's not available
// but showavailability is turned on
$showsection = $thissection->uservisible || $thissection->visible && !$thissection->available && $thissection->showavailability;
if (!$showsection) {
// Hidden section message is overridden by 'unavailable' control
// (showavailability option).
if (!$course->hiddensections && $thissection->available) {
if ($course->coursedisplay == COURSE_DISPLAY_MULTIPAGE) {
echo $this->section_summary($thissection, $course, $mods);
} else {
echo $this->section_hidden($section);
}
}
continue;
}
if (!$PAGE->user_is_editing() && $course->coursedisplay == COURSE_DISPLAY_MULTIPAGE) {
// Display section summary only.
echo $this->section_summary($thissection, $course, null);
} else {
echo $this->section_header($thissection, $course, false, 0);
if ($thissection->uservisible) {
print_section($course, $thissection, null, null, true, "100%", false, 0);
if ($PAGE->user_is_editing()) {
print_section_add_menus($course, $section, null, false, false, 0);
}
}
echo $this->section_footer();
}
}
if ($PAGE->user_is_editing() and has_capability('moodle/course:update', $context)) {
// Print stealth sections if present.
foreach ($modinfo->get_section_info_all() as $section => $thissection) {
if ($section <= $course->numsections or empty($modinfo->sections[$section])) {
// this is not stealth section or it is empty
continue;
}
echo $this->stealth_section_header($section);
print_section($course, $thissection, null, null, true, "100%", false, 0);
echo $this->stealth_section_footer();
}
echo $this->end_section_list();
echo html_writer::start_tag('div', array('id' => 'changenumsections', 'class' => 'mdl-right'));
// Increase number of sections.
$straddsection = get_string('increasesections', 'moodle');
$url = new moodle_url('/course/changenumsections.php', array('courseid' => $course->id, 'increase' => true, 'sesskey' => sesskey()));
$icon = $this->output->pix_icon('t/switch_plus', $straddsection);
echo html_writer::link($url, $icon . get_accesshide($straddsection), array('class' => 'increase-sections'));
if ($course->numsections > 0) {
// Reduce number of sections sections.
$strremovesection = get_string('reducesections', 'moodle');
$url = new moodle_url('/course/changenumsections.php', array('courseid' => $course->id, 'increase' => false, 'sesskey' => sesskey()));
$icon = $this->output->pix_icon('t/switch_minus', $strremovesection);
echo html_writer::link($url, $icon . get_accesshide($strremovesection), array('class' => 'reduce-sections'));
}
echo html_writer::end_tag('div');
} else {
echo $this->end_section_list();
}
}
示例2: print_multiple_section_page
/**
* Output the html for a multiple section page
*
* @param stdClass $course The course entry from DB
* @param array $sections (argument not used)
* @param array $mods (argument not used)
* @param array $modnames (argument not used)
* @param array $modnamesused (argument not used)
*/
public function print_multiple_section_page($course, $sections, $mods, $modnames, $modnamesused)
{
$modinfo = get_fast_modinfo($course);
$course = $this->courseformat->get_course();
if (empty($this->tcsettings)) {
$this->tcsettings = $this->courseformat->get_settings();
}
$context = context_course::instance($course->id);
// Title with completion help icon.
$completioninfo = new completion_info($course);
echo $completioninfo->display_help_icon();
echo $this->output->heading($this->page_title(), 2, 'accesshide');
// Copy activity clipboard..
echo $this->course_activity_clipboard($course, 0);
// Now the list of sections..
$this->tccolumnwidth = 100;
// Reset to default.
echo $this->start_section_list();
$sections = $modinfo->get_section_info_all();
// General section if non-empty.
$thissection = $sections[0];
unset($sections[0]);
if ($thissection->summary or !empty($modinfo->sections[0]) or $this->userisediting) {
echo $this->section_header($thissection, $course, false, 0);
echo $this->courserenderer->course_section_cm_list($course, $thissection, 0);
echo $this->courserenderer->course_section_add_cm_control($course, $thissection->section, 0, 0);
echo $this->section_footer();
}
if ($course->numsections > 0) {
if ($course->numsections > 1) {
if ($this->userisediting || $course->coursedisplay != COURSE_DISPLAY_MULTIPAGE) {
// Collapsed Topics all toggles.
echo $this->toggle_all();
if ($this->tcsettings['displayinstructions'] == 2) {
// Collapsed Topics instructions.
echo $this->display_instructions();
}
}
}
$currentsectionfirst = false;
if ($this->tcsettings['layoutstructure'] == 4) {
$currentsectionfirst = true;
}
if ($this->tcsettings['layoutstructure'] != 3 || $this->userisediting) {
$section = 1;
} else {
$timenow = time();
$weekofseconds = 604800;
$course->enddate = $course->startdate + $weekofseconds * $course->numsections;
$section = $course->numsections;
$weekdate = $course->enddate;
// This should be 0:00 Monday of that week.
$weekdate -= 7200;
// Subtract two hours to avoid possible DST problems.
}
$numsections = $course->numsections;
// Because we want to manipulate this for column breakpoints.
if ($this->tcsettings['layoutstructure'] == 3 && $this->userisediting == false) {
$loopsection = 1;
$numsections = 0;
while ($loopsection <= $course->numsections) {
$nextweekdate = $weekdate - $weekofseconds;
if ((($thissection->uservisible || $thissection->visible && !$thissection->available && !empty($thissection->availableinfo)) && $nextweekdate <= $timenow) == true) {
$numsections++;
// Section not shown so do not count in columns calculation.
}
$weekdate = $nextweekdate;
$section--;
$loopsection++;
}
// Reset.
$section = $course->numsections;
$weekdate = $course->enddate;
// This should be 0:00 Monday of that week.
$weekdate -= 7200;
// Subtract two hours to avoid possible DST problems.
}
if ($numsections < $this->tcsettings['layoutcolumns']) {
$this->tcsettings['layoutcolumns'] = $numsections;
// Help to ensure a reasonable display.
}
if ($this->tcsettings['layoutcolumns'] > 1 && $this->mobiletheme === false) {
if ($this->tcsettings['layoutcolumns'] > 4) {
// Default in config.php (and reset in database) or database has been changed incorrectly.
$this->tcsettings['layoutcolumns'] = 4;
// Update....
$this->courseformat->update_topcoll_columns_setting($this->tcsettings['layoutcolumns']);
}
if ($this->tablettheme === true && $this->tcsettings['layoutcolumns'] > 2) {
// Use a maximum of 2 for tablets.
$this->tcsettings['layoutcolumns'] = 2;
//.........这里部分代码省略.........
示例3: print_single_section_page_content
protected function print_single_section_page_content($course, $sections, $mods, $modnames, $modnamesused, $displaysection, $showsectionzero = 1)
{
global $PAGE;
$modinfo = \get_fast_modinfo($course);
$course = \course_get_format($course)->get_course();
// Can we view the section in question?
if (!($sectioninfo = $modinfo->get_section_info($displaysection))) {
// This section doesn't exist.
print_error('unknowncoursesection', 'error', null, $course->fullname);
return false;
}
if (!$sectioninfo->uservisible) {
if (!$course->hiddensections) {
echo $this->start_section_list();
echo $this->section_hidden($displaysection);
echo $this->end_section_list();
}
// Can't view this section.
return false;
}
// Copy activity clipboard..
echo $this->course_activity_clipboard($course, $displaysection);
if ($showsectionzero) {
$thissection = $modinfo->get_section_info(0);
if ($thissection->summary or !empty($modinfo->sections[0]) or $PAGE->user_is_editing()) {
echo $this->start_section_list();
echo $this->section_header($thissection, $course, true, $displaysection);
echo $this->courserenderer->course_section_cm_list($course, $thissection, $displaysection);
echo $this->courserenderer->course_section_add_cm_control($course, 0, $displaysection);
echo $this->section_footer();
echo $this->end_section_list();
}
}
// Start single-section div.
echo \html_writer::start_tag('div', array('class' => 'single-section'));
// The requested section page.
$thissection = $modinfo->get_section_info($displaysection);
// Title with section navigation links.
$sectionnavlinks = $this->get_nav_links($course, $modinfo->get_section_info_all(), $displaysection);
// Construct navigation links.
$sectionnav = \html_writer::start_tag('nav', array('class' => 'section-navigation'));
$sectionnav .= $sectionnavlinks['previous'];
$sectionnav .= $sectionnavlinks['next'];
$sectionnav .= \html_writer::empty_tag('br', array('style' => 'clear:both'));
$sectionnav .= \html_writer::end_tag('nav');
$sectionnav .= \html_writer::tag('div', '', array('class' => 'bor'));
// Output Section Navigation.
echo $sectionnav;
// Define the Section Title.
$sectiontitle = '';
$sectiontitle .= \html_writer::start_tag('div', array('class' => 'section-title'));
// Title attributes.
$titleattr = 'title';
if (!$thissection->visible) {
$titleattr .= ' dimmed_text';
}
$sectiontitle .= \html_writer::start_tag('h3', array('class' => $titleattr));
$sectiontitle .= \get_section_name($course, $displaysection);
$sectiontitle .= \html_writer::end_tag('h3');
$sectiontitle .= \html_writer::end_tag('div');
// Output the Section Title.
echo $sectiontitle;
// Now the list of sections.
echo $this->start_section_list();
echo $this->section_header($thissection, $course, true, $displaysection);
// Show completion help icon.
$completioninfo = new \completion_info($course);
echo $completioninfo->display_help_icon();
echo $this->courserenderer->course_section_cm_list($course, $thissection, $displaysection);
echo $this->courserenderer->course_section_add_cm_control($course, $displaysection, $displaysection);
echo $this->section_footer();
echo $this->end_section_list();
// Close single-section div.
echo \html_writer::end_tag('div');
}
示例4: print_multiple_section_page
/**
* Output the html for a multiple section page
*
* @param stdClass $course The course entry from DB
* @param array $sections (argument not used)
* @param array $mods (argument not used)
* @param array $modnames (argument not used)
* @param array $modnamesused (argument not used)
*/
public function print_multiple_section_page($course, $sections, $mods, $modnames, $modnamesused)
{
global $PAGE;
$modinfo = get_fast_modinfo($course);
$course = course_get_format($course)->get_course();
$context = context_course::instance($course->id);
// Title with completion help icon.
$completioninfo = new completion_info($course);
echo $completioninfo->display_help_icon();
echo $this->output->heading($this->page_title(), 2, 'accesshide');
// Copy activity clipboard..
echo $this->course_activity_clipboard($course, 0);
//We want to save the last section, for adding a new one
$lastsection = 0;
// Now the list of sections..
echo $this->start_section_list();
foreach ($modinfo->get_section_info_all() as $section => $thissection) {
if ($section == 0) {
// 0-section is displayed a little different then the others
if ($thissection->summary or !empty($modinfo->sections[0]) or $PAGE->user_is_editing()) {
echo $this->section_header($thissection, $course, false, 0);
echo $this->courserenderer->course_section_cm_list($course, $thissection, 0);
echo $this->courserenderer->course_section_add_cm_control($course, 0, 0);
echo $this->section_footer();
}
continue;
}
// Show the section if the user is permitted to access it, OR if it's not available
// but showavailability is turned on (and there is some available info text).
$showsection = $thissection->uservisible || $thissection->visible && !$thissection->available && $thissection->showavailability && !empty($thissection->availableinfo);
if (!$showsection) {
// Hidden section message is overridden by 'unavailable' control
// (showavailability option).
if (!$course->hiddensections && $thissection->available) {
echo $this->section_hidden($section);
}
continue;
}
if (!$PAGE->user_is_editing() && $course->coursedisplay == COURSE_DISPLAY_MULTIPAGE) {
// Display section summary only.
echo $this->section_summary($thissection, $course, null);
} else {
echo $this->section_header($thissection, $course, false, 0);
if ($thissection->uservisible) {
echo $this->courserenderer->course_section_cm_list($course, $thissection, 0);
echo $this->courserenderer->course_section_add_cm_control($course, $section, 0);
}
echo $this->section_footer();
}
$lastsection = $section;
}
if ($PAGE->user_is_editing() and has_capability('moodle/course:update', $context)) {
// Print stealth sections if present.
foreach ($modinfo->get_section_info_all() as $section => $thissection) {
if ($section <= $course->numsections or empty($modinfo->sections[$section])) {
// this is not stealth section or it is empty
continue;
}
echo $this->stealth_section_header($section);
echo $this->courserenderer->course_section_cm_list($course, $thissection, 0);
echo $this->stealth_section_footer();
}
echo $this->end_section_list();
echo html_writer::start_tag('div', array('id' => 'changenumsections', 'class' => 'mdl-right'));
// Increase number of sections.
$straddsection = 'Ajouter une section';
$icon = $this->output->pix_icon('t/switch_plus', $straddsection);
$url = new moodle_url('changenumsections.php', array('courseid' => $course->id, 'increase' => true, 'sesskey' => sesskey(), 'sectionid' => $lastsection + 1));
echo html_writer::span($straddsection . " ");
echo html_writer::link($url, $icon . get_accesshide($straddsection), array('class' => 'increase-sections'));
echo '<br/>';
// Add an activity (section with name activity, not visible)
/*$url = new moodle_url('changenumsections.php',
array('courseid' => $course->id,
'increase' => true,
'sesskey' => sesskey(),
'sectionid' => $lastsection+1,
'activity' => true ));
$straddactivity = 'Ajouter une évaluation';
$icon = $this->output->pix_icon('t/switch_plus', $straddactivity);
echo html_writer::span($straddactivity." ");
echo html_writer::link($url, $icon.get_accesshide($straddactivity), array('class' => 'increase-sections'));
*/
echo html_writer::end_tag('div');
} else {
echo $this->end_section_list();
}
}
示例5: print_multiple_section_page
/**
* Output the html for a multiple section page
*
* @param stdClass $course The course entry from DB
* @param array $sections (argument not used)
* @param array $mods (argument not used)
* @param array $modnames (argument not used)
* @param array $modnamesused (argument not used)
*/
public function print_multiple_section_page($course, $sections, $mods, $modnames, $modnamesused)
{
$modinfo = get_fast_modinfo($course);
$course = course_get_format($course)->get_course();
$context = context_course::instance($course->id);
// Title with completion help icon.
$completioninfo = new completion_info($course);
echo $completioninfo->display_help_icon();
echo $this->output->heading($this->page_title(), 2, 'accesshide');
// Copy activity clipboard..
echo $this->course_activity_clipboard($course, 0);
$sections = $modinfo->get_section_info_all();
// Remove general section.
unset($sections[0]);
// Now the list of sections..
echo $this->start_section_list();
$sections = $modinfo->get_section_info_all();
$thissection = $sections[0];
unset($sections[0]);
if ($this->userisediting) {
echo $this->start_section_list();
// General section when editing or YUI D&D gets confused!
echo $this->section_header($thissection, $course, false, 0);
echo $this->section_footer();
}
// Tabs.
if (!$this->userisediting) {
echo html_writer::start_tag('ul', array('class' => 'nav nav-pills nav-wizard', 'role' => 'tablist'));
foreach ($sections as $section => $thissection) {
$first = false;
$last = false;
if ($section > $course->numsections) {
// Activities inside this section are 'orphaned', this section will be printed as 'stealth' below.
continue;
}
if ($section == $course->numsections) {
$last = true;
}
if ($section == 1) {
$first = true;
}
/* Show the section if the user is permitted to access it, OR if it's not available
but there is some available info text which explains the reason & should display. */
$showsection = $thissection->uservisible || $thissection->visible && !$thissection->available && !empty($thissection->availableinfo);
if (!$showsection) {
continue;
}
$tabattributes = array('role' => 'presentation', 'id' => 'navtab' . $section, 'class' => 'tabbednavtab');
if (!$this->activesection) {
$this->activesection = $thissection->section;
$tabattributes['class'] = 'tabbednavtab active';
}
echo html_writer::start_tag('li', $tabattributes);
if (!$first) {
echo html_writer::tag('div', '', array('class' => 'nav-wedge'));
}
echo html_writer::tag('a', $this->courseformat->get_section_name($thissection), array('href' => '#section-' . $thissection->section, 'data-toggle' => 'tab', 'role' => 'tab', 'aria-controls' => 'section-' . $thissection->section));
if (!$last) {
echo html_writer::tag('div', '', array('class' => 'nav-arrow'));
}
echo html_writer::end_tag('li');
}
echo html_writer::end_tag('ul');
echo html_writer::start_tag('div', array('id' => 'tabbedcontent', 'class' => 'tab-content'));
}
// Tabbed.
foreach ($sections as $section => $thissection) {
if ($section > $course->numsections) {
// Activities inside this section are 'orphaned', this section will be printed as 'stealth' below.
continue;
}
/* Show the section if the user is permitted to access it, OR if it's not available
but there is some available info text which explains the reason & should display. */
$showsection = $thissection->uservisible || $thissection->visible && !$thissection->available && !empty($thissection->availableinfo);
if (!$showsection) {
/* If the hiddensections option is set to 'show hidden sections in collapsed
form', then display the hidden section message - UNLESS the section is
hidden by the availability system, which is set to hide the reason. */
if (!$course->hiddensections && $thissection->available) {
echo $this->section_hidden($section, $course->id);
}
continue;
}
echo $this->section_header($thissection, $course, false, 0);
if ($thissection->uservisible) {
echo $this->courserenderer->course_section_cm_list($course, $thissection, 0);
echo $this->courserenderer->course_section_add_cm_control($course, $section, 0);
$sectionnavlinks = $this->get_nav_links($course, $modinfo->get_section_info_all(), $section);
$navlinks = html_writer::start_tag('div', array('class' => 'section-navigation navigationtitle'));
$navlinks .= html_writer::tag('span', $sectionnavlinks['previous'], array('class' => 'pull-left'));
$navlinks .= html_writer::tag('span', $sectionnavlinks['next'], array('class' => 'pull-right'));
//.........这里部分代码省略.........
示例6: print_multiple_section_page
/**
* Output the html for a multiple section page
*
* @param stdClass $course The course entry from DB
* @param array $sections (argument not used)
* @param array $mods (argument not used)
* @param array $modnames (argument not used)
* @param array $modnamesused (argument not used)
*/
public function print_multiple_section_page($course, $sections, $mods, $modnames, $modnamesused)
{
global $PAGE, $SESSION, $DB, $USER;
$updateposition = get_string('updateposition', 'format_gps');
$loadinggps = html_writer::div(get_string('loadinggps', 'format_gps'), 'loadinggps');
echo $loadinggps;
$modaldiv = html_writer::div($updateposition, 'updateposition hide', array('id' => 'updatepositionclick'));
echo $modaldiv;
// Module form with map.
$viewcourse = new moodle_url('/course/view.php', array('id' => $course->id));
$link = html_writer::link($viewcourse, get_string('update'), array('class' => 'gps-continue'));
$innerdiv = html_writer::div($link, 'innerdiv', array('id' => 'innerdiv'));
$updatecourseviewlink = html_writer::div($innerdiv, 'buttonbubble', array('id' => 'outerdiv'));
$map = html_writer::div('', 'googlemap', array('id' => 'map'));
$mapcontainer = html_writer::div($map . $updatecourseviewlink, 'mapcontainer', array('id' => 'mapcontainer'));
$modalform = html_writer::div($mapcontainer, 'popupgeo', array('id' => 'popupgeo'));
echo $modalform;
$modinfo = get_fast_modinfo($course);
$course = course_get_format($course)->get_course();
$context = context_course::instance($course->id);
// Title with completion help icon.
$completioninfo = new completion_info($course);
echo $completioninfo->display_help_icon();
echo $this->output->heading($this->page_title(), 2, 'accesshide');
// Copy activity clipboard..
echo $this->course_activity_clipboard($course, 0);
// Now the list of sections..
echo $this->start_section_list();
$location = $this->gps_get_user_location($USER->id);
foreach ($modinfo->get_section_info_all() as $section => $thissection) {
if ($section == 0) {
// 0-section is displayed a little different then the others.
if ($thissection->summary or !empty($modinfo->sections[0]) or $PAGE->user_is_editing()) {
echo $this->section_header($thissection, $course, false, 0);
$courserenderer = $PAGE->get_renderer('core', 'course');
echo $courserenderer->course_section_cm_list($course, $thissection, 0);
if ($PAGE->user_is_editing()) {
echo $courserenderer->course_section_add_cm_control($course, 0, 0);
}
echo $this->section_footer();
}
continue;
}
if ($section > $course->numsections) {
// Activities inside this section are 'orphaned', this section will be printed as 'stealth' below.
continue;
}
// Show the section if the user is permitted to access it, OR if it's not available.
// but showavailability is turned on (and there is some available info text).
$proximity = new stdClass();
if ($thissection->format_gps_restricted == FORMAT_GPS_RESTRICTED) {
if ($location) {
$proximity = format_gps_check_proximity($thissection, $location);
} else {
$proximity->status = 'notallowed';
}
} else {
$proximity->status = 'ok';
}
$showsection = $thissection->uservisible || $thissection->visible && !$thissection->available && $thissection->showavailability && !empty($thissection->availableinfo);
if (!$showsection || $proximity->status == 'toofar' || $proximity->status == 'notallowed') {
if ($PAGE->user_is_editing() && has_capability('moodle/course:update', $context)) {
// Do nothing.
} else {
$thissection->visible = false;
// Hidden section message is overridden by 'unavailable' control
// (showavailability option).
if ($proximity->status == 'toofar') {
if (!$course->hiddensections && $thissection->available) {
echo $this->gps_section_hidden($section);
}
} else {
if ($proximity->status == 'notallowed') {
if (!$course->hiddensections && $thissection->available) {
echo $this->gps_section_notallowed($section);
}
} else {
if (!$course->hiddensections && $thissection->available) {
echo $this->section_hidden($section);
}
}
}
continue;
}
}
if (!$PAGE->user_is_editing() && $course->coursedisplay == COURSE_DISPLAY_MULTIPAGE) {
// Display section summary only.
echo $this->section_summary($thissection, $course, null);
} else {
echo $this->section_header($thissection, $course, false, 0);
if ($thissection->uservisible) {
//.........这里部分代码省略.........
示例7: sesskey
$strshowalltopics = get_string('showalltopics', 'format_bootstraptabs');
$strtopic = get_string('topic');
$strgroups = get_string('groups');
$strgroupmy = get_string('groupmy');
$editing = $PAGE->user_is_editing();
if ($editing) {
$strtopichide = get_string('hidetopicfromothers');
$strtopicshow = get_string('showtopicfromothers');
$strmarkthistopic = get_string('markthistopic');
$strmarkedthistopic = get_string('markedthistopic');
$strmoveup = get_string('moveup');
$strmovedown = get_string('movedown');
}
// Print the Your progress icon if the track completion is enabled
$completioninfo = new completion_info($course);
echo $completioninfo->display_help_icon();
/// If currently moving a file then show the current clipboard
//not too sure what this does
if (ismoving($course->id)) {
// Note, an ordered list would confuse - "1" could be the clipboard or summary.
echo "<ul class='topicstabs'>\n";
$stractivityclipboard = strip_tags(get_string('activityclipboard', '', $USER->activitycopyname));
$strcancel = get_string('cancel');
echo '<li class="clipboard">';
echo $stractivityclipboard . ' (<a href="mod.php?cancelcopy=true&sesskey=' . sesskey() . '">' . $strcancel . '</a>)';
echo "</li>\n";
echo '</ul>';
}
//Insert the section 0
$section = 0;
$thissection = $sections[$section];
示例8: print_multiple_section_page
/**
* Output the html for a multiple section page
*
* @param stdClass $course The course entry from DB
* @param array $sections (argument not used)
* @param array $mods (argument not used)
* @param array $modnames (argument not used)
* @param array $modnamesused (argument not used)
*/
public function print_multiple_section_page($course, $sections, $mods, $modnames, $modnamesused)
{
global $PAGE;
$modinfo = get_fast_modinfo($course);
$course = course_get_format($course)->get_course();
$context = context_course::instance($course->id);
// Title with completion help icon.
$completioninfo = new completion_info($course);
echo $completioninfo->display_help_icon();
echo $this->output->heading($this->page_title(), 2, 'accesshide');
echo "<style>\n .left {display:none;} \n h3 {line-height:none;} \n .right {float:right;}\n .section-modchooser {\n width: 20px;\n height: 20px;\n background-color: red;\n border-radius: 50%;\n text-align: center;\n float: right;\n }\n .section-modchooser-link img.smallicon {\n padding-bottom: 3px;\n }\n .block, #page #page-content #region-main, #page #page-content div[role=\"main\"], .pagelayout-redirect #page-content #region-main, .pagelayout-redirect #page-content div[role=\"main\"] {\n border: none;\n border-radius: none;\n padding: 0px;\n }\n .coursetitle {text-transform: uppercase; padding-bottom: 5px;}\n .bor {display:none;}\n </style>";
// Copy activity clipboard..
echo $this->course_activity_clipboard($course, 0);
echo html_writer::start_div("tabbable tabs-left");
echo html_writer::start_tag("ul", array("class" => "nav nav-tabs", "role" => "tablist"));
// Show navigation tabs (bootstrap like)
$tabshtml = "";
$section0html = "";
$currentfound = false;
foreach ($modinfo->get_section_info_all() as $section => $thissection) {
$a = html_writer::tag("a", get_section_name($course, $thissection), array("href" => "#section-" . $section, "aria-controls" => "profile", "role" => "tab", "data-toggle" => "tab"));
$style = "";
if (course_get_format($course)->is_section_current($section)) {
$style = "active";
$currentfound = true;
}
if ($section == 0) {
$section0html = $a;
} else {
$tabshtml .= html_writer::tag("li", $a, array("role" => "presentation", "class" => $style));
}
}
$style = $currentfound ? "" : "active";
echo html_writer::tag("li", $section0html, array("role" => "presentation", "class" => $style)) . $tabshtml;
echo html_writer::end_tag("ul");
// Now the list of sections..
echo $this->start_section_list();
$cmlist = "";
$firstsection = "";
$firstsectionhead = "";
$firstsectionheadactive = "";
$currentfound = false;
foreach ($modinfo->get_section_info_all() as $section => $thissection) {
if (course_get_format($course)->is_section_current($section)) {
$currentfound = true;
}
if ($section == 0) {
// 0-section is displayed a little different then the others
if ($thissection->summary or !empty($modinfo->sections[0]) or $PAGE->user_is_editing()) {
$firstsectionhead = $this->section_header($thissection, $course, false, 0, false);
$firstsectionheadactive = $this->section_header($thissection, $course, false, 0, true);
$firstsection .= $this->courserenderer->course_section_cm_list($course, $thissection, 0);
$firstsection .= $this->courserenderer->course_section_add_cm_control($course, 0, 0);
$firstsection .= $this->section_footer();
}
continue;
}
if ($section > $course->numsections) {
// activities inside this section are 'orphaned', this section will be printed as 'stealth' below
continue;
}
// Show the section if the user is permitted to access it, OR if it's not available
// but there is some available info text which explains the reason & should display.
$showsection = $thissection->uservisible || $thissection->visible && !$thissection->available && !empty($thissection->availableinfo);
if (!$showsection) {
// If the hiddensections option is set to 'show hidden sections in collapsed
// form', then display the hidden section message - UNLESS the section is
// hidden by the availability system, which is set to hide the reason.
if (!$course->hiddensections && $thissection->available) {
$cmlist .= $this->section_hidden($section, $course->id);
}
continue;
}
if (!$PAGE->user_is_editing() && $course->coursedisplay == COURSE_DISPLAY_MULTIPAGE) {
// Display section summary only.
$cmlist .= $this->section_summary($thissection, $course, null);
} else {
$cmlist .= $this->section_header($thissection, $course, false, 0);
if ($thissection->uservisible) {
$cmlist .= $this->courserenderer->course_section_cm_list($course, $thissection, 0);
$cmlist .= $this->courserenderer->course_section_add_cm_control($course, $section, 0);
}
$cmlist .= $this->section_footer();
}
}
if (!$currentfound) {
$firstsection = $firstsectionheadactive . $firstsection;
} else {
$firstsection = $firstsectionhead . $firstsection;
}
echo $firstsection . $cmlist;
//.........这里部分代码省略.........
示例9: print_multiple_section_page
/**
* Output the html for a multiple section page
*
* @param stdClass $course The course entry from DB
* @param array $sections The course_sections entries from the DB
* @param array $mods used for print_section()
* @param array $modnames used for print_section()
* @param array $modnamesused used for print_section()
*/
public function print_multiple_section_page($course, $sections, $mods, $modnames, $modnamesused)
{
global $PAGE;
$context = context_course::instance($course->id);
// Title with completion help icon.
$completioninfo = new completion_info($course);
echo $completioninfo->display_help_icon();
echo $this->output->heading($this->page_title(), 2, 'accesshide');
// Copy activity clipboard..
echo $this->course_activity_clipboard($course);
// Now the list of sections..
echo $this->start_section_list();
// General section if non-empty.
$thissection = $sections[0];
unset($sections[0]);
if ($thissection->summary or $thissection->sequence or $PAGE->user_is_editing()) {
echo $this->section_header($thissection, $course, true);
print_section($course, $thissection, $mods, $modnamesused, true);
if ($PAGE->user_is_editing()) {
print_section_add_menus($course, 0, $modnames);
}
echo $this->section_footer();
}
$canviewhidden = has_capability('moodle/course:viewhiddensections', $context);
for ($section = 1; $section <= $course->numsections; $section++) {
if (!empty($sections[$section])) {
$thissection = $sections[$section];
} else {
// This will create a course section if it doesn't exist..
$thissection = get_course_section($section, $course->id);
// The returned section is only a bare database object rather than
// a section_info object - we will need at least the uservisible
// field in it.
$thissection->uservisible = true;
$thissection->availableinfo = null;
$thissection->showavailability = 0;
}
// Show the section if the user is permitted to access it, OR if it's not available
// but showavailability is turned on
$showsection = $thissection->uservisible || $thissection->visible && !$thissection->available && $thissection->showavailability;
if (!$showsection) {
// Hidden section message is overridden by 'unavailable' control
// (showavailability option).
if (!$course->hiddensections && $thissection->available) {
echo $this->section_hidden($section);
}
unset($sections[$section]);
continue;
}
if (!$PAGE->user_is_editing() && $course->coursedisplay == COURSE_DISPLAY_MULTIPAGE) {
// Display section summary only.
echo $this->section_summary($thissection, $course);
} else {
echo $this->section_header($thissection, $course, false);
if ($thissection->uservisible) {
print_section($course, $thissection, $mods, $modnamesused);
if ($PAGE->user_is_editing()) {
print_section_add_menus($course, $section, $modnames);
}
}
echo $this->section_footer();
}
unset($sections[$section]);
}
if ($PAGE->user_is_editing() and has_capability('moodle/course:update', $context)) {
// Print stealth sections if present.
$modinfo = get_fast_modinfo($course);
foreach ($sections as $section => $thissection) {
if (empty($modinfo->sections[$section])) {
continue;
}
echo $this->stealth_section_header($section);
print_section($course, $thissection, $mods, $modnamesused);
echo $this->stealth_section_footer();
}
echo $this->end_section_list();
echo html_writer::start_tag('div', array('id' => 'changenumsections', 'class' => 'mdl-right'));
// Increase number of sections.
$straddsection = get_string('increasesections', 'moodle');
$url = new moodle_url('/course/changenumsections.php', array('courseid' => $course->id, 'increase' => true, 'sesskey' => sesskey()));
$icon = $this->output->pix_icon('t/switch_plus', $straddsection);
echo html_writer::link($url, $icon . get_accesshide($straddsection), array('class' => 'increase-sections'));
if ($course->numsections > 0) {
// Reduce number of sections sections.
$strremovesection = get_string('reducesections', 'moodle');
$url = new moodle_url('/course/changenumsections.php', array('courseid' => $course->id, 'increase' => false, 'sesskey' => sesskey()));
$icon = $this->output->pix_icon('t/switch_minus', $strremovesection);
echo html_writer::link($url, $icon . get_accesshide($strremovesection), array('class' => 'reduce-sections'));
}
echo html_writer::end_tag('div');
} else {
//.........这里部分代码省略.........
示例10: print_single_section_page
public function print_single_section_page($course, $sections, $mods, $modnames, $modnamesused, $displaysection)
{
global $PAGE;
$modinfo = get_fast_modinfo($course);
$course = course_get_format($course)->get_course();
// Can we view the section in question?
if (!($sectioninfo = $modinfo->get_section_info($displaysection))) {
// This section doesn't exist
print_error('unknowncoursesection', 'error', null, $course->fullname);
return;
}
if (!$sectioninfo->uservisible) {
if (!$course->hiddensections) {
echo $this->start_section_list();
echo $this->section_hidden($displaysection);
echo $this->end_section_list();
}
// Can't view this section.
return;
}
// Copy activity clipboard..
echo $this->course_activity_clipboard($course, $displaysection);
$thissection = $modinfo->get_section_info(0);
if ($thissection->summary or !empty($modinfo->sections[0]) or $PAGE->user_is_editing()) {
echo $this->start_section_list();
echo $this->section_header($thissection, $course, true, $displaysection);
echo $this->courserenderer->course_section_cm_list($course, $thissection, $displaysection);
echo $this->courserenderer->course_section_add_cm_control($course, 0, $displaysection);
echo $this->section_footer();
echo $this->end_section_list();
}
// Start single-section div
echo html_writer::start_tag('div', array('class' => 'single-section'));
// The requested section page.
$thissection = $modinfo->get_section_info($displaysection);
// Title with section navigation links.
$sectionnavlinks = $this->get_nav_links($course, $modinfo->get_section_info_all(), $displaysection);
$sectiontitle = '';
$sectiontitle .= html_writer::start_tag('div', array('class' => 'section-navigation header headingblock'));
// Title attributes
$titleattr = 'title';
if (!$thissection->visible) {
$titleattr .= ' dimmed_text';
}
$sectiontitle .= html_writer::tag('div', get_section_name($course, $displaysection), array('class' => $titleattr));
$sectiontitle .= html_writer::end_tag('div');
echo $sectiontitle;
// Now the list of sections..
echo $this->start_section_list();
echo $this->section_header($thissection, $course, true, $displaysection);
// Show completion help icon.
$completioninfo = new completion_info($course);
echo $completioninfo->display_help_icon();
echo $this->courserenderer->course_section_cm_list($course, $thissection, $displaysection);
echo $this->courserenderer->course_section_add_cm_control($course, $displaysection, $displaysection);
echo $this->section_footer();
echo $this->end_section_list();
// Display section bottom navigation.
$sectionbottomnav = '';
$sectionbottomnav .= html_writer::start_tag('nav', array('id' => 'section_footer', 'class' => 'clearfix'));
$sectionbottomnav .= $sectionnavlinks['previous'];
$sectionbottomnav .= $sectionnavlinks['next'];
// $sectionbottomnav .= html_writer::tag('div', $this->section_nav_selection($course, $sections, $displaysection), array('class' => 'mdl-align'));
$sectionbottomnav .= html_writer::end_tag('nav');
echo $sectionbottomnav;
// Close single-section div.
echo html_writer::end_tag('div');
}
示例11: print_single_section_page
//.........这里部分代码省略.........
if (!$course->hidetabsbar && count($tabs[0]) > 0) {
if ($PAGE->user_is_editing() && has_capability('moodle/course:update', $context)) {
// Increase number of sections.
$straddsection = get_string('increasesections', 'moodle');
$url = new moodle_url('/course/changenumsections.php', array('courseid' => $course->id, 'increase' => true, 'sesskey' => sesskey()));
$icon = $this->output->pix_icon('t/switch_plus', $straddsection);
$tabs[] = new tabobject("tab_topic_add", $url, $icon, s($straddsection));
if ($course->numsections > 0) {
// Reduce number of sections.
$strremovesection = get_string('reducesections', 'moodle');
$url = new moodle_url('/course/changenumsections.php', array('courseid' => $course->id, 'increase' => false, 'sesskey' => sesskey()));
$icon = $this->output->pix_icon('t/switch_minus', $strremovesection);
$tabs[] = new tabobject("tab_topic_remove", $url, $icon, s($strremovesection));
}
}
$sectiontitle .= $OUTPUT->tabtree($tabs, "tab_topic_" . $displaysection, $inactive_tabs);
//print_tabs($tabs, "tab_topic_" . $displaysection, $inactive_tabs, $active_tabs, true);
}
echo $sectiontitle;
if (!$sections[$displaysection]->uservisible && !$canviewhidden) {
if (!$course->hiddensections) {
//Not used more, is controled in /course/view.php
}
// Can't view this section.
} else {
if ($course->realcoursedisplay != COURSE_DISPLAY_MULTIPAGE || $displaysection !== 0) {
// Now the list of sections..
echo $this->start_section_list();
// The requested section page.
$thissection = $sections[$displaysection];
echo $this->section_header($thissection, $course, true);
// Show completion help icon.
$completioninfo = new completion_info($course);
echo $completioninfo->display_help_icon();
echo $this->courserenderer->course_section_cm_list($course, $thissection, $displaysection);
echo $this->courserenderer->course_section_add_cm_control($course, $displaysection, $displaysection);
echo $this->section_footer();
echo $this->end_section_list();
}
}
// Display section bottom navigation.
$sectionbottomnav = '';
$sectionbottomnav .= html_writer::start_tag('div', array('class' => 'section-navigation mdl-bottom'));
$sectionbottomnav .= html_writer::tag('span', $sectionnavlinks['previous'], array('class' => 'mdl-left'));
$sectionbottomnav .= html_writer::tag('span', $sectionnavlinks['next'], array('class' => 'mdl-right'));
$sectionbottomnav .= html_writer::end_tag('div');
echo $sectionbottomnav;
// close single-section div.
echo html_writer::end_tag('div');
if ($PAGE->user_is_editing() && has_capability('moodle/course:update', $context)) {
echo '<br class="utilities-separator" />';
print_collapsible_region_start('move-list-box clearfix collapsible mform', 'course_format_onetopic_config_movesection', get_string('utilities', 'format_onetopic'), '', true);
//Move controls
if ($can_move && !empty($move_list_html)) {
echo html_writer::start_div("form-item clearfix");
echo html_writer::start_div("form-label");
echo html_writer::tag('label', get_string('movesectionto', 'format_onetopic'));
echo html_writer::end_div();
echo html_writer::start_div("form-setting");
echo html_writer::tag('ul', $move_list_html, array('class' => 'move-list'));
echo html_writer::end_div();
echo html_writer::start_div("form-description");
echo html_writer::tag('p', get_string('movesectionto_help', 'format_onetopic'));
echo html_writer::end_div();
echo html_writer::end_div();
}
示例12: print_single_section_page
//.........这里部分代码省略.........
$courserenderer = $PAGE->get_renderer('core', 'course');
echo $courserenderer->course_section_add_cm_control($course, 0, $displaysection, array('inblock' => false));
}
echo $this->section_footer();
echo $this->end_section_list();
}
}
// Start single-section div
echo html_writer::start_tag('div', array('class' => 'single-section'));
//Init custom tabs
$section = 0;
$sectionmenu = array();
$tabs = array();
$default_topic = -1;
while ($section <= $course->numsections) {
if ($course->realcoursedisplay == COURSE_DISPLAY_MULTIPAGE && $section == 0) {
$section++;
continue;
}
$thissection = $sections[$section];
$showsection = true;
if (!$thissection->visible) {
$showsection = false;
} else {
if ($section == 0 && !($thissection->summary or $thissection->sequence or $PAGE->user_is_editing())) {
$showsection = false;
}
}
if (!$showsection) {
$showsection = (has_capability('moodle/course:viewhiddensections', $context) or !$course->hiddensections);
}
if (isset($displaysection)) {
if ($showsection) {
if ($default_topic < 0) {
$default_topic = $section;
if ($displaysection == 0) {
$displaysection = $default_topic;
}
}
$sectionname = get_section_name($course, $thissection);
$sectionname = htmlspecialchars_decode($sectionname);
// CTL addition to remove ampersand from title &
if ($displaysection != $section) {
$sectionmenu[$section] = $sectionname;
}
if ($section == 0) {
$url = new moodle_url('/course/view.php', array('id' => $course->id, 'section' => 0));
} else {
$url = course_get_url($course, $section);
}
$tabs[] = new tabobject("tab_topic_" . $section, $url, '<font style="white-space:nowrap">' . s($sectionname) . "</font>", s($sectionname));
}
}
$section++;
}
// Title with section navigation links.
$sectionnavlinks = $this->get_nav_links($course, $sections, $displaysection);
$sectiontitle = '';
if (!$course->hidetabsbar && count($tabs) > 0) {
$sectiontitle .= print_tabs(array($tabs), "tab_topic_" . $displaysection, NULL, NULL, true);
}
echo $sectiontitle;
if (!$sections[$displaysection]->visible && !$canviewhidden) {
if (!$course->hiddensections) {
echo $this->start_section_list();
echo $this->section_hidden($displaysection);
echo $this->end_section_list();
}
// Can't view this section.
} else {
// Now the list of sections..
echo $this->start_section_list();
// The requested section page.
$thissection = $sections[$displaysection];
echo $this->section_header($thissection, $course, true);
// Show completion help icon.
$completioninfo = new completion_info($course);
echo $completioninfo->display_help_icon();
//print_section($course, $thissection, $mods, $modnamesused, true, '100%', false, $displaysection);
$displayoptions = array('hidecompletion' => false);
$courserenderer = $PAGE->get_renderer('core', 'course');
echo $courserenderer->course_section_cm_list($course, $thissection, null, $displayoptions);
if ($PAGE->user_is_editing()) {
//print_section_add_menus($course, $displaysection, $modnames, false, false, $displaysection);
$courserenderer = $PAGE->get_renderer('core', 'course');
echo $courserenderer->course_section_add_cm_control($course, $displaysection, $displaysection, array('inblock' => false));
}
echo $this->section_footer();
echo $this->end_section_list();
}
// Display section bottom navigation.
$sectionbottomnav = '';
$sectionbottomnav .= html_writer::start_tag('div', array('class' => 'section-navigation mdl-bottom'));
$sectionbottomnav .= html_writer::tag('span', $sectionnavlinks['previous'], array('class' => 'mdl-left'));
$sectionbottomnav .= html_writer::tag('span', $sectionnavlinks['next'], array('class' => 'mdl-right'));
$sectionbottomnav .= html_writer::end_tag('div');
echo $sectionbottomnav;
// close single-section div.
echo html_writer::end_tag('div');
}
示例13: print_page
/**
* Print out the course page
*
* @param object $course
* @param completion_info $completioninfo
*/
public function print_page($course, $completioninfo)
{
$this->commentsformshow = optional_param('commentsformshow', 0, PARAM_ALPHANUMEXT);
$posts = \format_socialwall\local\posts::instance($course->id);
$postdata = $posts->get_timeline_posts($course);
$postform = $posts->get_post_form($postdata);
$course = course_get_format($course)->get_course();
// Title with completion help icon.
echo $completioninfo->display_help_icon();
echo $this->output->heading($this->page_title(), 2, 'accesshide');
// Copy activity clipboard..
echo $this->course_activity_clipboard($course, 0);
// Now the list of sections..
echo $this->start_section_list();
$modinfo = get_fast_modinfo($course);
$sectioninfo = $modinfo->get_section_info_all();
// ...Section 0.
$this->print_first_section($course, $sectioninfo);
// ...Section 2.
$postid = $postdata->filteroptions->postid;
$this->print_postform_section($course, $sectioninfo, $postform, $postid);
// ...Section 1.
$this->print_timeline_section($course, $postdata, $completioninfo);
echo $this->end_section_list();
$args = array('courseid' => $course->id, 'poststotal' => $postdata->poststotal, 'postsloaded' => $postdata->postsloaded, 'userallowedediting' => $this->page->user_allowed_editing());
$this->page->requires->strings_for_js(array('counttotalpost', 'like', 'likenomore', 'countlikes', 'countcomments', 'textrequired', 'confirmdeletecomment'), 'format_socialwall');
$this->page->requires->yui_module('moodle-format_socialwall-postform', 'M.format_socialwall.postforminit', array($args), null, true);
}
示例14: print_multiple_section_page
/**
* Output the html for a multiple section page
*
* @param stdClass $course The course entry from DB
* @param array $sections (argument not used)
* @param array $mods (argument not used)
* @param array $modnames (argument not used)
* @param array $modnamesused (argument not used)
*/
public function print_multiple_section_page($course, $sections, $mods, $modnames, $modnamesused)
{
global $PAGE;
$modinfo = get_fast_modinfo($course);
$course = course_get_format($course)->get_course();
$context = context_course::instance($course->id);
// Title with completion help icon.
$completioninfo = new completion_info($course);
echo $completioninfo->display_help_icon();
echo $this->output->heading($this->page_title(), 2, 'accesshide');
// Copy activity clipboard..
echo $this->course_activity_clipboard($course, 0);
// Now the list of sections..
echo $this->start_section_list();
foreach ($modinfo->get_section_info_all() as $section => $thissection) {
if ($section == 0) {
// 0-section is displayed a little different then the others.
if ($thissection->summary or !empty($modinfo->sections[0]) or $PAGE->user_is_editing()) {
echo $this->section_header($thissection, $course, false, 0);
echo $this->courserenderer->course_section_cm_list($course, $thissection, 0);
echo $this->courserenderer->course_section_add_cm_control($course, 0, 0);
echo $this->section_footer();
}
continue;
}
if ($section > $course->numsections) {
// Activities inside this section are 'orphaned', this section will be printed as 'stealth' below.
continue;
}
// Do not display sections in the past/future that must be hidden by course settings.
$displaymode = course_get_format($course)->get_section_display_mode($thissection);
if (!has_capability('moodle/course:viewhiddenactivities', $context)) {
if ($displaymode == FORMAT_PERIODS_NOTAVAILABLE) {
echo $this->section_hidden($section, $course->id);
continue;
}
if ($displaymode == FORMAT_PERIODS_NOTDISPLAYED || $displaymode == FORMAT_PERIODS_HIDDEN) {
continue;
}
}
// Show the section if the user is permitted to access it, OR if it's not available
// but there is some available info text which explains the reason & should display.
$showsection = $thissection->uservisible || $thissection->visible && !$thissection->available && !empty($thissection->availableinfo);
if (!$showsection) {
// If the hiddensections option is set to 'show hidden sections in collapsed
// form', then display the hidden section message - UNLESS the section is
// hidden by the availability system, which is set to hide the reason.
if (!$course->hiddensections && $thissection->available) {
echo $this->section_hidden($section, $course->id);
}
continue;
}
if (!$PAGE->user_is_editing() && $displaymode == FORMAT_PERIODS_COLLAPSED) {
// Display section summary only.
echo $this->section_summary($thissection, $course, null);
} else {
echo $this->section_header($thissection, $course, false, 0);
if ($thissection->uservisible) {
echo $this->courserenderer->course_section_cm_list($course, $thissection, 0);
echo $this->courserenderer->course_section_add_cm_control($course, $section, 0);
}
echo $this->section_footer();
}
}
if ($PAGE->user_is_editing() and has_capability('moodle/course:update', $context)) {
// Print stealth sections if present.
foreach ($modinfo->get_section_info_all() as $section => $thissection) {
if ($section <= $course->numsections or empty($modinfo->sections[$section])) {
// This is not stealth section or it is empty.
continue;
}
echo $this->stealth_section_header($section);
echo $this->courserenderer->course_section_cm_list($course, $thissection, 0);
echo $this->stealth_section_footer();
}
echo $this->end_section_list();
echo html_writer::start_tag('div', array('id' => 'changenumsections', 'class' => 'mdl-right'));
// Increase number of sections.
$straddsection = get_string('increasesections', 'moodle');
$url = new moodle_url('/course/changenumsections.php', array('courseid' => $course->id, 'increase' => true, 'sesskey' => sesskey()));
$icon = $this->output->pix_icon('t/switch_plus', $straddsection);
echo html_writer::link($url, $icon . get_accesshide($straddsection), array('class' => 'increase-sections'));
if ($course->numsections > 0) {
// Reduce number of sections sections.
$strremovesection = get_string('reducesections', 'moodle');
$url = new moodle_url('/course/changenumsections.php', array('courseid' => $course->id, 'increase' => false, 'sesskey' => sesskey()));
$icon = $this->output->pix_icon('t/switch_minus', $strremovesection);
echo html_writer::link($url, $icon . get_accesshide($strremovesection), array('class' => 'reduce-sections'));
}
echo html_writer::end_tag('div');
} else {
//.........这里部分代码省略.........
示例15: print_single_section_page
public function print_single_section_page($course, $sections, $mods, $modnames, $modnamesused, $displaysection)
{
global $PAGE;
$modinfo = get_fast_modinfo($course);
$course = course_get_format($course)->get_course();
if (!($sectioninfo = $modinfo->get_section_info($displaysection))) {
print_error('unknowncoursesection', 'error', null, $course->fullname);
return;
}
if (!$sectioninfo->uservisible) {
if (!$course->hiddensections) {
echo $this->start_section_list();
echo $this->section_hidden($displaysection);
echo $this->end_section_list();
}
return;
}
echo $this->course_activity_clipboard($course, $displaysection);
$thissection = $modinfo->get_section_info(0);
if ($thissection->summary or !empty($modinfo->sections[0]) or $PAGE->user_is_editing()) {
echo $this->start_section_list();
echo $this->section_header($thissection, $course, true, $displaysection);
echo $this->courserenderer->course_section_cm_list($course, $thissection, $displaysection);
echo $this->courserenderer->course_section_add_cm_control($course, 0, $displaysection);
echo $this->section_footer();
echo $this->end_section_list();
}
echo html_writer::start_tag('div', array('class' => 'single-section'));
$thissection = $modinfo->get_section_info($displaysection);
$sectionnavlinks = $this->get_nav_links($course, $modinfo->get_section_info_all(), $displaysection);
$sectiontitle = '';
$sectiontitle .= html_writer::start_tag('div', array('class' => 'section-navigation header headingblock'));
$titleattr = 'mdl-align title';
if (!$thissection->visible) {
$titleattr .= ' dimmed_text';
}
$sectiontitle .= html_writer::tag('div', get_section_name($course, $displaysection), array('class' => $titleattr));
$sectiontitle .= html_writer::end_tag('div');
echo $sectiontitle;
echo $this->start_section_list();
echo $this->section_header($thissection, $course, true, $displaysection);
$completioninfo = new completion_info($course);
echo $completioninfo->display_help_icon();
echo $this->courserenderer->course_section_cm_list($course, $thissection, $displaysection);
echo $this->courserenderer->course_section_add_cm_control($course, $displaysection, $displaysection);
echo $this->section_footer();
echo $this->end_section_list();
$sectionbottomnav = '';
$sectionbottomnav .= html_writer::start_tag('nav', array('id' => 'section_footer'));
$sectionbottomnav .= $sectionnavlinks['previous'];
$sectionbottomnav .= $sectionnavlinks['next'];
$sectionbottomnav .= html_writer::empty_tag('br', array('style' => 'clear:both'));
$sectionbottomnav .= html_writer::end_tag('nav');
echo $sectionbottomnav;
echo html_writer::end_tag('div');
}