Skip to content

Commit

Permalink
MDL-10259 core Adding a search courses box if there are too many courses
Browse files Browse the repository at this point in the history
  • Loading branch information
David Monllao committed Sep 7, 2012
1 parent 935c3d5 commit 98795fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,17 +204,21 @@
break;

case FRONTPAGECOURSELIST:
$ncourses = $DB->count_records('course');
if (isloggedin() and !$hassiteconfig and !isguestuser() and empty($CFG->disablemycourses)) {
echo html_writer::tag('a', get_string('skipa', 'access', textlib::strtolower(get_string('mycourses'))), array('href'=>'#skipmycourses', 'class'=>'skip-block'));
echo $OUTPUT->heading(get_string('mycourses'), 2, 'headingblock header');
print_my_moodle();
echo html_writer::tag('span', '', array('class'=>'skip-block-to', 'id'=>'skipmycourses'));
} else if ((!$hassiteconfig and !isguestuser()) or ($DB->count_records('course') <= FRONTPAGECOURSELIMIT)) {
} else if ((!$hassiteconfig and !isguestuser()) or ($ncourses <= FRONTPAGECOURSELIMIT)) {
// admin should not see list of courses when there are too many of them
echo html_writer::tag('a', get_string('skipa', 'access', textlib::strtolower(get_string('availablecourses'))), array('href'=>'#skipavailablecourses', 'class'=>'skip-block'));
echo $OUTPUT->heading(get_string('availablecourses'), 2, 'headingblock header');
print_courses(0);
echo html_writer::tag('span', '', array('class'=>'skip-block-to', 'id'=>'skipavailablecourses'));
} else {
echo html_writer::tag('div', get_string('therearecourses', '', $ncourses), array('class' => 'notifyproblem'));
print_course_search('', false, 'short');
}
break;

Expand Down
1 change: 1 addition & 0 deletions lang/en/moodle.php
Original file line number Diff line number Diff line change
Expand Up @@ -1670,6 +1670,7 @@
$string['themes'] = 'Themes';
$string['themesaved'] = 'New theme saved';
$string['thereareno'] = 'There are no {$a} in this course';
$string['therearecourses'] = 'There are {$a} courses';
$string['thiscategorycontains'] = 'This category contains';
$string['time'] = 'Time';
$string['timezone'] = 'Timezone';
Expand Down

0 comments on commit 98795fd

Please sign in to comment.