~ubuntu-branches/ubuntu/trusty/moodle/trusty-proposed

« back to all changes in this revision

Viewing changes to index.php

  • Committer: Package Import Robot
  • Author(s): Tomasz Muras
  • Date: 2012-11-15 21:50:13 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20121115215013-hmzkwz3v5hvm2a0a
Tags: 2.2.6.dfsg-1
New upstream version: 2.2.6 (Build: 20121112)

Show diffs side-by-side

added added

removed removed

Lines of Context:
193
193
            break;
194
194
 
195
195
            case FRONTPAGECOURSELIST:
 
196
                $ncourses = $DB->count_records('course');
196
197
                if (isloggedin() and !$hassiteconfig and !isguestuser() and empty($CFG->disablemycourses)) {
197
198
                    echo html_writer::tag('a', get_string('skipa', 'access', moodle_strtolower(get_string('mycourses'))), array('href'=>'#skipmycourses', 'class'=>'skip-block'));
198
199
                    echo $OUTPUT->heading(get_string('mycourses'), 2, 'headingblock header');
199
200
                    print_my_moodle();
200
201
                    echo html_writer::tag('span', '', array('class'=>'skip-block-to', 'id'=>'skipmycourses'));
201
 
                } else if ((!$hassiteconfig and !isguestuser()) or ($DB->count_records('course') <= FRONTPAGECOURSELIMIT)) {
 
202
                } else if ((!$hassiteconfig and !isguestuser()) or ($ncourses <= FRONTPAGECOURSELIMIT)) {
202
203
                    // admin should not see list of courses when there are too many of them
203
204
                    echo html_writer::tag('a', get_string('skipa', 'access', moodle_strtolower(get_string('availablecourses'))), array('href'=>'#skipavailablecourses', 'class'=>'skip-block'));
204
205
                    echo $OUTPUT->heading(get_string('availablecourses'), 2, 'headingblock header');
205
206
                    print_courses(0);
206
207
                    echo html_writer::tag('span', '', array('class'=>'skip-block-to', 'id'=>'skipavailablecourses'));
 
208
                } else {
 
209
                    echo html_writer::tag('div', get_string('therearecourses', '', $ncourses), array('class' => 'notifyproblem'));
 
210
                    print_course_search('', false, 'short');
207
211
                }
208
212
            break;
209
213