diff --git a/course/format/topics/format.php b/course/format/topics/format.php index c6c1001580e..4757b6125c4 100644 --- a/course/format/topics/format.php +++ b/course/format/topics/format.php @@ -6,7 +6,7 @@ // courses that aren't so rigidly defined by time. // Included from "view.php" - require_once("$CFG->dirroot/mod/forum/lib.php"); + require_once($CFG->dirroot.'/mod/forum/lib.php'); // Bounds for block widths define('BLOCK_L_MIN_WIDTH', 100); @@ -49,12 +49,12 @@ if ($editing) { $strstudents = moodle_strtolower($course->students); - $strtopichide = get_string("topichide", "", $strstudents); - $strtopicshow = get_string("topicshow", "", $strstudents); - $strmarkthistopic = get_string("markthistopic"); - $strmarkedthistopic = get_string("markedthistopic"); - $strmoveup = get_string("moveup"); - $strmovedown = get_string("movedown"); + $strtopichide = get_string('topichide', '', $strstudents); + $strtopicshow = get_string('topicshow', '', $strstudents); + $strmarkthistopic = get_string('markthistopic'); + $strmarkedthistopic = get_string('markedthistopic'); + $strmoveup = get_string('moveup'); + $strmovedown = get_string('movedown'); } @@ -75,32 +75,28 @@ print_heading_block(get_string('topicoutline'), 'outline'); print_spacer(8, 1, true); - echo ""; + echo '
'; /// If currently moving a file then show the current clipboard if (ismoving($course->id)) { - $stractivityclipboard = strip_tags(get_string("activityclipboard", "", addslashes($USER->activitycopyname))); - $strcancel= get_string("cancel"); - echo ""; - echo ""; - echo ""; - echo ""; + $stractivityclipboard = strip_tags(get_string('activityclipboard', '', addslashes($USER->activitycopyname))); + $strcancel= get_string('cancel'); + echo ''; + echo ''; + echo ''; } - /// Print Section 0 $section = 0; $thissection = $sections[$section]; if ($thissection->summary or $thissection->sequence or isediting($course->id)) { - echo ''; - echo ''; - echo ''; + echo ''; + echo ''; - echo ''; - echo ''; + echo ''; + echo ''; + echo ''; } @@ -135,16 +131,16 @@ if (!empty($displaysection) and $displaysection != $section) { if (empty($sections[$section])) { - $strsummary = ""; + $strsummary = ''; } else { - $strsummary = " - ".strip_tags($sections[$section]->summary); + $strsummary = ' - '.strip_tags($sections[$section]->summary); if (strlen($strsummary) < 57) { - $strsummary = " - $strsummary"; + $strsummary = ' - '.$strsummary; } else { - $strsummary = " - ".substr($strsummary, 0, 60)."..."; + $strsummary = ' - '.substr($strsummary, 0, 60).'...'; } } - $sectionmenu["topic=$section"] = s("$section$strsummary"); + $sectionmenu['topic='.$section] = s($section.$strsummary); $section++; continue; } @@ -156,10 +152,10 @@ unset($thissection); $thissection->course = $course->id; // Create a new section structure $thissection->section = $section; - $thissection->summary = ""; + $thissection->summary = ''; $thissection->visible = 1; - if (!$thissection->id = insert_record("course_sections", $thissection)) { - notify("Error inserting new topic!"); + if (!$thissection->id = insert_record('course_sections', $thissection)) { + notify('Error inserting new topic!'); } } @@ -170,27 +166,27 @@ $currenttopic = ($course->marker == $section); if (!$thissection->visible) { - $colorsides = 'class="topicsoutlinesidehidden"'; - $colormain = 'class="topicsoutlinecontenthidden"'; + $colorsides = 'topicsoutlinesidehidden'; + $colormain = 'topicsoutlinecontenthidden'; } else if ($currenttopic) { - $colorsides = 'class="topicsoutlinesidehighlight"'; - $colormain = 'class="topicsoutlinecontenthighlight"'; + $colorsides = 'topicsoutlinesidehighlight'; + $colormain = 'topicsoutlinecontenthighlight'; } else { - $colorsides = 'class="topicsoutlineside"'; - $colormain = 'class="topicsoutlinecontent"'; + $colorsides = 'topicsoutlineside'; + $colormain = 'topicsoutlinecontent'; } - echo ""; - echo ""; + echo ''; + echo ''; if (!isteacher($course->id) and !$thissection->visible) { // Hidden for students - echo '"; + echo ''; } else { - echo '"; + echo ''; } - echo ""; - echo ""; - echo ""; + echo ''; + echo ''; } $section++; } - echo "
"; - echo "
"; - echo "$stractivityclipboard  (sesskey\">$strcancel)"; - echo "
"; - echo "
\"\"
'; + echo $stractivityclipboard.'  ('.$strcancel.')'; + echo '
 '; + echo '
 '; $summaryformatoptions->noclean = true; echo format_text($thissection->summary, FORMAT_HTML, $summaryformatoptions); @@ -118,9 +114,9 @@ } echo ''; - echo ' 
 
 
"; - echo "
$section
"; - echo "
'; + echo ''.$section.''; + echo ''; - echo get_string("notavailable"); - echo "'; + echo get_string('notavailable'); + echo ''; + echo ''; $summaryformatoptions->noclean = true; echo format_text($thissection->summary, FORMAT_HTML, $summaryformatoptions); @@ -206,68 +202,65 @@ print_section_add_menus($course, $section, $modnames); } - echo ""; - echo ""; + echo ''; if ($displaysection == $section) { // Show the zoom boxes - echo "id&topic=all\" title=\"$strshowalltopics\">". - "pixpath/i/all.gif\" height=\"25\" width=\"16\" border=\"0\" />
"; + echo ''. + '
'; } else { - $strshowonlytopic = get_string("showonlytopic", "", $section); - echo "id&topic=$section\" title=\"$strshowonlytopic\">". - "pixpath/i/one.gif\" height=\"16\" width=\"16\" border=\"0\" alt=\"\" />
"; + $strshowonlytopic = get_string('showonlytopic', '', $section); + echo ''. + '
'; } if (isediting($course->id)) { if ($course->marker == $section) { // Show the "light globe" on/off - echo "id&marker=0&sesskey=$USER->sesskey\" title=\"$strmarkedthistopic\">". - "pixpath/i/marked.gif\" vspace=\"3\" height=\"16\" width=\"16\" border=\"0\" alt=\"\" />
"; + echo ''. + '
'; } else { - echo "id&marker=$section&sesskey=$USER->sesskey\" title=\"$strmarkthistopic\">". - "pixpath/i/marker.gif\" vspace=\"3\" height=\"16\" width=\"16\" border=\"0\" alt=\"\" />
"; + echo ''. + '
'; } if ($thissection->visible) { // Show the hide/show eye - echo "id&hide=$section&sesskey=$USER->sesskey\" title=\"$strtopichide\">". - "pixpath/i/hide.gif\" vspace=\"3\" height=\"16\" width=\"16\" border=\"0\" alt=\"\" />
"; + echo ''. + '
'; } else { - echo "id&show=$section&sesskey=$USER->sesskey\" title=\"$strtopicshow\">". - "pixpath/i/show.gif\" vspace=\"3\" height=\"16\" width=\"16\" border=\"0\" alt=\"\" />
"; + echo ''. + '
'; } if ($section > 1) { // Add a arrow to move section up - echo "id&section=$section&move=-1&sesskey=$USER->sesskey\" title=\"$strmoveup\">". - "pixpath/t/up.gif\" vspace=\"3\" height=\"11\" width=\"11\" border=\"0\" alt=\"\" />
"; + echo ''. + '
'; } if ($section < $course->numsections) { // Add a arrow to move section down - echo "id&section=$section&move=1&sesskey=$USER->sesskey\" title=\"$strmovedown\">". - "pixpath/t/down.gif\" vspace=\"3\" height=\"11\" width=\"11\" border=\"0\" alt=\"\" />
"; + echo ''. + '
'; } } - echo ""; - echo "
\"\"
 
"; + echo ''; if (!empty($sectionmenu)) { - echo "
"; - echo popup_form("$CFG->wwwroot/course/view.php?id=$course->id&", $sectionmenu, - "sectionmenu", "", get_string("jumpto"), "", "", true); - echo "
"; + echo '
'; + echo popup_form($CFG->wwwroot.'/course/view.php?id='.$course->id.'&', $sectionmenu, + 'sectionmenu', '', get_string('jumpto'), '', '', true); + echo '
'; } - echo ""; + echo ''; // The right column if(blocks_have_content($pageblocks[BLOCK_POS_RIGHT]) || $editing) { @@ -279,7 +272,6 @@ echo ''; } - echo "\n"; - echo "\n"; + echo ''; ?>