Index: mod/resource/type/file/resource.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/resource/type/file/resource.class.php,v
retrieving revision 1.76
diff -u -r1.76 resource.class.php
--- mod/resource/type/file/resource.class.php	11 Jan 2008 11:59:31 -0000	1.76
+++ mod/resource/type/file/resource.class.php	12 Mar 2008 13:37:52 -0000
@@ -2,9 +2,6 @@
 
 /**
 * Extend the base resource class for file resources
-*
-* Extend the base resource class for file resources
-*
 */
 class resource_file extends resource_base {
 
@@ -19,8 +16,6 @@
     /**
     * Sets the parameters property of the extended class
     *
-    * Sets the parameters property of the extended file resource class
-    *
     * @param    USER  global object
     * @param    CFG   global object
     */
@@ -127,7 +122,6 @@
         return parent::add_instance($resource);
     }
 
-
     function update_instance($resource) {
         $this->_postprocess($resource);
         return parent::update_instance($resource);
@@ -168,10 +162,13 @@
             unset($resource->$parametername);
         }
 
+        if ($resource->forcedownload) {
+            $resource->options = 'forcedownload';
+        }
+
         $resource->alltext = implode(',', $optionlist);
     }
 
-
     /**
     * Display the file resource
     *
@@ -197,10 +194,10 @@
     ///////////////////////////////////////////////
 
         /// Possible display modes are:
-        /// File displayed in a frame in a normal window
         /// File displayed embedded in a normal page
         /// File displayed in a popup window
-        /// File displayed emebedded in a popup window
+        /// File displayed embedded in a popup window
+        /// File not displayed at all, but downloaded
 
 
         /// First, find out what sort of file we are dealing with.
@@ -215,7 +212,7 @@
         $formatoptions = new object();
         $formatoptions->noclean = true;
 
-        if ($resource->options != "bogusoption_usedtobe_frame") { // TODO nicolasconnault 14-03-07: This option should be renamed "embed"
+        if ($resource->options != "forcedownload") { // TODO nicolasconnault 14-03-07: This option should be renamed "embed"
             if (in_array($mimetype, array('image/gif','image/jpeg','image/png'))) {  // It's an image
                 $resourcetype = "image";
                 $embedded = true;
@@ -675,7 +672,10 @@
             }
         }
     }
-
+    
+    /**
+     * TODO document
+     */
     function setup_elements(&$mform) {
         global $CFG, $RESOURCE_WINDOW_OPTIONS;
 
@@ -703,16 +703,22 @@
         }
 
         $mform->addElement('header', 'displaysettings', get_string('display', 'resource'));
+        
+        $mform->addElement('checkbox', 'forcedownload', get_string('forcedownload', 'resource'));
+        $mform->setHelpButton('forcedownload', array('forcedownload', get_string('forcedownload', 'resource'), 'resource'));
+        $mform->disabledIf('forcedownload', 'windowpopup', 'eq', 1);
 
         $woptions = array(0 => get_string('pagewindow', 'resource'), 1 => get_string('newwindow', 'resource'));
         $mform->addElement('select', 'windowpopup', get_string('display', 'resource'), $woptions);
         $mform->setDefault('windowpopup', !empty($CFG->resource_popup));
+        $mform->disabledIf('windowpopup', 'forcedownload', 'checked');
 
         $mform->addElement('checkbox', 'framepage', get_string('keepnavigationvisible', 'resource'));
 
         $mform->setHelpButton('framepage', array('frameifpossible', get_string('keepnavigationvisible', 'resource'), 'resource'));
         $mform->setDefault('framepage', 0);
         $mform->disabledIf('framepage', 'windowpopup', 'eq', 1);
+        $mform->disabledIf('framepage', 'forcedownload', 'checked');
         $mform->setAdvanced('framepage');
 
         foreach ($RESOURCE_WINDOW_OPTIONS as $option) {
Index: lang/en_utf8/resource.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lang/en_utf8/resource.php,v
retrieving revision 1.11
diff -u -r1.11 resource.php
--- lang/en_utf8/resource.php	22 Dec 2007 17:04:54 -0000	1.11
+++ lang/en_utf8/resource.php	12 Mar 2008 13:37:52 -0000
@@ -48,6 +48,7 @@
 $string['fetchservererror'] = 'An error was found with the remote server while trying to retrieve the web page (possibly a program error).';
 $string['filename'] = 'File name';
 $string['filtername'] = 'Resource Names Auto-linking';
+$string['forcedownload'] = 'Force download';
 $string['frameifpossible'] = 'Put resource in a frame to keep site navigation visible';
 $string['framesize'] = 'Frame size';
 $string['fulltext'] = 'Full text';
Index: lang/en_utf8/help/resource/forcedownload.html
===================================================================
RCS file: lang/en_utf8/help/resource/forcedownload.html
diff -N lang/en_utf8/help/resource/forcedownload.html
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ lang/en_utf8/help/resource/forcedownload.html	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,7 @@
+<h1>Force download</h1>
+
+<p>This setting ensures that the resource is not embedded
+in a browser window, but downloaded like any non-embeddable
+file. This is useful when one wants to avoid the pitfalls
+of cross-browser incompatibility and wrong multimedia plugin
+versions. It is the most accessible solution for file resources.</p>
