Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-25630 moodle/index.php: Wraps individual front page content eleme…

…nts (Site news/Course list/Category names/Category combo) in divs with descriptive classes so they can be styled individually.
  • Loading branch information...
commit 4c71a80acdcff5e93974f7381841f4897e003c78 1 parent 2075186
Mary Evans lazydaisy authored

Showing 1 changed file with 40 additions and 1 deletion. Show diff stats Hide diff stats

  1. +40 1 index.php
41 index.php
@@ -180,6 +180,9 @@
180 180 $forumname = format_string($newsforum->name, true, array('context' => $newsforumcontext));
181 181 echo html_writer::tag('a', get_string('skipa', 'access', textlib::strtolower(strip_tags($forumname))), array('href'=>'#skipsitenews', 'class'=>'skip-block'));
182 182
  183 + // wraps site news forum in div container.
  184 + echo html_writer::start_tag('div', array('id'=>'site-news-forum'));
  185 +
183 186 if (isloggedin()) {
184 187 $SESSION->fromdiscussion = $CFG->wwwroot;
185 188 $subtext = '';
@@ -198,6 +201,10 @@
198 201 }
199 202
200 203 forum_print_latest_discussions($SITE, $newsforum, $SITE->newsitems, 'plain', 'p.modified DESC');
  204 +
  205 + //end site news forum div container
  206 + echo html_writer::end_tag('div');
  207 +
201 208 echo html_writer::tag('span', '', array('class'=>'skip-block-to', 'id'=>'skipsitenews'));
202 209 }
203 210 break;
@@ -206,14 +213,30 @@
206 213 $ncourses = $DB->count_records('course');
207 214 if (isloggedin() and !$hassiteconfig and !isguestuser() and empty($CFG->disablemycourses)) {
208 215 echo html_writer::tag('a', get_string('skipa', 'access', textlib::strtolower(get_string('mycourses'))), array('href'=>'#skipmycourses', 'class'=>'skip-block'));
  216 +
  217 + //wrap frontpage course list in div container
  218 + echo html_writer::start_tag('div', array('id'=>'frontpage-course-list'));
  219 +
209 220 echo $OUTPUT->heading(get_string('mycourses'), 2, 'headingblock header');
210 221 print_my_moodle();
  222 +
  223 + //end frontpage course list div container
  224 + echo html_writer::end_tag('div');
  225 +
211 226 echo html_writer::tag('span', '', array('class'=>'skip-block-to', 'id'=>'skipmycourses'));
212 227 } else if ((!$hassiteconfig and !isguestuser()) or ($ncourses <= FRONTPAGECOURSELIMIT)) {
213 228 // admin should not see list of courses when there are too many of them
214 229 echo html_writer::tag('a', get_string('skipa', 'access', textlib::strtolower(get_string('availablecourses'))), array('href'=>'#skipavailablecourses', 'class'=>'skip-block'));
  230 +
  231 + //wrap frontpage course list in div container
  232 + echo html_writer::start_tag('div', array('id'=>'frontpage-course-list'));
  233 +
215 234 echo $OUTPUT->heading(get_string('availablecourses'), 2, 'headingblock header');
216 235 print_courses(0);
  236 +
  237 + //end frontpage course list div container
  238 + echo html_writer::end_tag('div');
  239 +
217 240 echo html_writer::tag('span', '', array('class'=>'skip-block-to', 'id'=>'skipavailablecourses'));
218 241 } else {
219 242 echo html_writer::tag('div', get_string('therearecourses', '', $ncourses), array('class' => 'notifyproblem'));
@@ -223,19 +246,31 @@
223 246
224 247 case FRONTPAGECATEGORYNAMES:
225 248 echo html_writer::tag('a', get_string('skipa', 'access', textlib::strtolower(get_string('categories'))), array('href'=>'#skipcategories', 'class'=>'skip-block'));
  249 +
  250 + //wrap frontpage category names in div container
  251 + echo html_writer::start_tag('div', array('id'=>'frontpage-category-names'));
  252 +
226 253 echo $OUTPUT->heading(get_string('categories'), 2, 'headingblock header');
227 254 echo $OUTPUT->box_start('generalbox categorybox');
228 255 print_whole_category_list(NULL, NULL, NULL, -1, false);
229 256 echo $OUTPUT->box_end();
230 257 print_course_search('', false, 'short');
  258 +
  259 + //end frontpage category names div container
  260 + echo html_writer::end_tag('div');
  261 +
231 262 echo html_writer::tag('span', '', array('class'=>'skip-block-to', 'id'=>'skipcategories'));
232 263 break;
233 264
234 265 case FRONTPAGECATEGORYCOMBO:
235 266 echo html_writer::tag('a', get_string('skipa', 'access', textlib::strtolower(get_string('courses'))), array('href'=>'#skipcourses', 'class'=>'skip-block'));
  267 +
  268 + //wrap frontpage category combo in div container
  269 + echo html_writer::start_tag('div', array('id'=>'frontpage-category-combo'));
  270 +
236 271 echo $OUTPUT->heading(get_string('courses'), 2, 'headingblock header');
237 272 $renderer = $PAGE->get_renderer('core','course');
238   - // if there are too many courses, budiling course category tree could be slow,
  273 + // if there are too many courses, building course category tree could be slow,
239 274 // users should go to course index page to see the whole list.
240 275 $coursecount = $DB->count_records('course');
241 276 if (empty($CFG->numcoursesincombo)) {
@@ -249,6 +284,10 @@
249 284 echo $renderer->course_category_tree(get_course_category_tree());
250 285 }
251 286 print_course_search('', false, 'short');
  287 +
  288 + //end frontpage category combo div container
  289 + echo html_writer::end_tag('div');
  290 +
252 291 echo html_writer::tag('span', '', array('class'=>'skip-block-to', 'id'=>'skipcourses'));
253 292 break;
254 293

0 comments on commit 4c71a80

Please sign in to comment.
Something went wrong with that request. Please try again.