Note: You are currently viewing documentation for Moodle 2.5. Up-to-date documentation for the latest stable version of Moodle may be 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
 
Line 53: Line 53:
             } elseif ($mod->uservisible) {
             } elseif ($mod->uservisible) {
                 // Nope - in this case the link is fully working for user
                 // Nope - in this case the link is fully working for user
===2.5===
The code for displaying the course information has been moved to the renderer.php file.
Now, in course/renderer.php, function course_section_cm_text(), near line 775,
the current code is:
        if ($mod->get_url()) {
            if ($content) {
                // If specified, display extra content after link.
                $output = html_writer::tag('div', $content, array('class' =>
                        trim('contentafterlink ' . $textclasses)));
            }
        } else {
            // No link, so display only content. 
Add the code to display facetoface sessions following the "if ($mod->get_url()) {" line.
The code described above seems to work, but in debug mode, error messages are seen,
so it needs some work to fix it.
===Icon Fix===
===Icon Fix===



Latest revision as of 03:00, 24 November 2013

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+

NOTE: This section is written against the face-to-face version from Dongyoung Kim

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

2.5

The code for displaying the course information has been moved to the renderer.php file.

Now, in course/renderer.php, function course_section_cm_text(), near line 775, the current code is:

       if ($mod->get_url()) {
           if ($content) {
               // If specified, display extra content after link.
               $output = html_writer::tag('div', $content, array('class' =>
                       trim('contentafterlink ' . $textclasses)));
           }
       } else {
           // No link, so display only content.  

Add the code to display facetoface sessions following the "if ($mod->get_url()) {" line.

The code described above seems to work, but in debug mode, error messages are seen, so it needs some work to fix it.


Icon Fix

The Face to Face icon will not display without this modification to mod\facetoface\lib.php: Near line 2484, change

   $htmlactivitynameonly = '<img src="'.$CFG->pixpath.'/mod/facetoface/icon.gif" class="activityicon" alt="'.$facetoface->name.'" /> '

to

   $htmlactivitynameonly = '<img src="'.$CFG->pixpath.'http://<<myMoodleInstall>>/theme/image.php?theme=<<themeName>>&image=icon&rev=211&component=facetoface" class="activityicon" alt="'.$facetoface->name.'" /> '

Result

It will look like this:

Ftof01.png