Note: You are currently viewing documentation for Moodle 3.4. Up-to-date documentation for the latest stable version of Moodle is likely available here: Integrating Face-to-face sessions on the course page.

Integrating Face-to-face sessions on the course page: Difference between revisions

From MoodleDocs
(More explicit instructions, remove the patch)
Line 10: Line 10:


=Where to add the code=
=Where to add the code=
==1.9==


In between this block:
In between this block:
Line 22: Line 24:


On 1.9, it should be close to line 1347.
On 1.9, it should be close to line 1347.
==2.0+==
Near line 1553
in between this block:
            // We may be displaying this just in order to show information
            // about visibility, without the actual link
            $contentpart = '';
and this block:
            if ($mod->uservisible) {
            // Nope - in this case the link is fully working for user
Be sure to change the if statement of the '''if ($mod->uservisible) {''' to '''elseif ($mod->uservisible) {'''
The resulting code should look like this:
            // We may be displaying this just in order to show information
            // about visibility, without the actual link
            $contentpart = '';
            if ($mod->modname == 'facetoface') {
                include_once($CFG->dirroot.'/mod/facetoface/lib.php');
                echo facetoface_print_coursemodule_info($mod);
            } elseif ($mod->uservisible) {
                // Nope - in this case the link is fully working for user


=Result=
=Result=

Revision as of 18:00, 26 August 2011

Code to add

To display the session dates directly on the course page, you must add a couple of lines to the print_section() function in course/lib.php:

} elseif ($mod->modname == 'facetoface') {
    include_once($CFG->dirroot.'/mod/facetoface/lib.php');
    echo facetoface_print_coursemodule_info($mod);

Where to add the code

1.9

In between this block:

if ($mod->modname == "label") {

and the matching else clause:

} else { // Normal activity

The code goes just above the 'else' line just shown.

On 1.9, it should be close to line 1347.

2.0+

Near line 1553

in between this block:

           // We may be displaying this just in order to show information
           // about visibility, without the actual link
           $contentpart = ;

and this block:

            if ($mod->uservisible) {
            // Nope - in this case the link is fully working for user

Be sure to change the if statement of the if ($mod->uservisible) { to elseif ($mod->uservisible) {

The resulting code should look like this:

           // We may be displaying this just in order to show information
           // about visibility, without the actual link
           $contentpart = ;
           if ($mod->modname == 'facetoface') { 
               include_once($CFG->dirroot.'/mod/facetoface/lib.php');
               echo facetoface_print_coursemodule_info($mod);
           } elseif ($mod->uservisible) {
               // Nope - in this case the link is fully working for user

Result

It will look like this:

Ftof01.png