Note: You are currently viewing documentation for Moodle 2.0. Up-to-date documentation for the latest stable version is 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
(Add one of IRD's images)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
To display the session dates directly on the course page, add the following
{{Facetoface}}
code to the print_section() function in course/lib.php:


  --- /cvs/moodle18/course/lib.php 2007-10-05 20:19:29.000000000 +1300
=Code to add=
+++ course/lib.php 2007-11-06 21:14:08.000000000 +1300
 
@@ -1382,6 +1382,10 @@
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:
                          echo "</span>";
 
                      }
  } elseif ($mod->modname == 'facetoface') {
    include_once($CFG->dirroot.'/mod/facetoface/lib.php');
+                } elseif ($mod->modname == 'facetoface') {
    echo facetoface_print_coursemodule_info($mod);
+                    include_once($CFG->dirroot.'/mod/facetoface/lib.php');
 
+                    echo facetoface_print_coursemodule_info($mod);
=Where to add the code=
+
 
                  } else { // Normal activity
==1.9==
 
                      //Accessibility: for files get description via icon.
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 [http://moodle.org/mod/forum/discuss.php?d=181601 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
===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>>&amp;image=icon&amp;rev=211&amp;component=facetoface" class="activityicon" alt="'.$facetoface->name.'" /> '
 
=Result=


It will look like this:
It will look like this:


[[Image:Ftof01.png]]
[[Image:Ftof01.png]]

Latest revision as of 18:36, 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+

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

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