]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-8792 - Simply added help icon to explain the options available regarding embeddin...
authornicolasconnault <nicolasconnault>
Mon, 12 Mar 2007 05:46:41 +0000 (05:46 +0000)
committernicolasconnault <nicolasconnault>
Mon, 12 Mar 2007 05:46:41 +0000 (05:46 +0000)
lang/en_utf8/help/resource/frameifpossible.html [new file with mode: 0644]
lib/simpletest/testmodforumlib.php [new file with mode: 0644]
lib/simpletest/testmoodlelib.php
mod/resource/type/file/resource.class.php

diff --git a/lang/en_utf8/help/resource/frameifpossible.html b/lang/en_utf8/help/resource/frameifpossible.html
new file mode 100644 (file)
index 0000000..05b1ee6
--- /dev/null
@@ -0,0 +1,6 @@
+<h1>Embedding files in a frame</h1>
+<p>This option will allow the file to be displayed in a frame, so that the Moodle navigation remains on the page in an upper frame.</p>
+
+<p>Note that this option is normally not necessary for media types such as movies, audio files and flash files, as without this option turned on they will be embedded within a navigable page.</p>
+
+<p>Note also that the use of frames can break accessibility, and so this option will be completely ignored if the user has chosen the "Screenreader" option in their profile.</p>
\ No newline at end of file
diff --git a/lib/simpletest/testmodforumlib.php b/lib/simpletest/testmodforumlib.php
new file mode 100644 (file)
index 0000000..2e70d54
--- /dev/null
@@ -0,0 +1,57 @@
+<?php // $Id$
+
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+// NOTICE OF COPYRIGHT                                                   //
+//                                                                       //
+// Moodle - Modular Object-Oriented Dynamic Learning Environment         //
+//          http://moodle.org                                            //
+//                                                                       //
+// Copyright (C) 1999-2004  Martin Dougiamas  http://dougiamas.com       //
+//                                                                       //
+// This program is free software; you can redistribute it and/or modify  //
+// it under the terms of the GNU General Public License as published by  //
+// the Free Software Foundation; either version 2 of the License, or     //
+// (at your option) any later version.                                   //
+//                                                                       //
+// This program is distributed in the hope that it will be useful,       //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of        //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         //
+// GNU General Public License for more details:                          //
+//                                                                       //
+//          http://www.gnu.org/copyleft/gpl.html                         //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
+
+/**
+ * Unit tests for (some of) ../moodlelib.php.
+ *
+ * @copyright &copy; 2006 The Open University
+ * @author T.J.Hunt@open.ac.uk
+ * @author nicolas@moodle.com
+ * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
+ * @package moodlecore
+ */
+
+/** $Id */
+require_once(dirname(__FILE__) . '/../../config.php');
+
+global $CFG;
+require_once($CFG->libdir . '/simpletestlib.php');
+require_once($CFG->dirroot . '/mod/forum/lib.php');
+
+class modforumlib_test extends UnitTestCase {
+    
+    function setUp() {
+    }
+
+    function tearDown() {
+    }
+
+    function test_forum_cron() {
+        forum_cron();
+        $this->assertTrue(false);
+    }
+}
+
+?>
index 14bd707f18521ea6e22f236e5b1afe4c551fb9d1..373544a02df3cb6615197ce8f6ae6c523c4ebbe9 100644 (file)
@@ -123,6 +123,63 @@ class moodlelib_test extends UnitTestCase {
         $this->assertTrue(check_browser_version('Firefox', '1.5'));
         $this->assertFalse(check_browser_version('Firefox', '3.0'));        
     }
+    
+    function test_optional_param()
+    {
+        $_POST['username'] = 'post_user';   
+        $_GET['username'] = 'get_user';
+        $this->assertEqual(optional_param('username', 'default_user'), 'post_user');
+        
+        unset($_POST['username']);
+        $this->assertEqual(optional_param('username', 'default_user'), 'get_user');
+        
+        unset($_GET['username']);
+        $this->assertEqual(optional_param('username', 'default_user'), 'default_user');
+    }
+    
+    /**
+     * Used by {@link optional_param()} and {@link required_param()} to
+     * clean the variables and/or cast to specific types, based on
+     * an options field.
+     * <code>
+     * $course->format = clean_param($course->format, PARAM_ALPHA);
+     * $selectedgrade_item = clean_param($selectedgrade_item, PARAM_CLEAN);
+     * </code>
+     *
+     * @uses $CFG
+     * @uses PARAM_CLEAN
+     * @uses PARAM_INT
+     * @uses PARAM_INTEGER
+     * @uses PARAM_ALPHA
+     * @uses PARAM_ALPHANUM
+     * @uses PARAM_NOTAGS
+     * @uses PARAM_ALPHAEXT
+     * @uses PARAM_BOOL
+     * @uses PARAM_SAFEDIR
+     * @uses PARAM_CLEANFILE
+     * @uses PARAM_FILE
+     * @uses PARAM_PATH
+     * @uses PARAM_HOST
+     * @uses PARAM_URL
+     * @uses PARAM_LOCALURL
+     * @uses PARAM_CLEANHTML
+     * @uses PARAM_SEQUENCE
+     * @param mixed $param the variable we are cleaning
+     * @param int $type expected format of param after cleaning.
+     * @return mixed
+     */
+    function test_clean_param()
+    {
+        // Test unknown parameter type
+        
+        // Test Raw param
+        $this->assertEqual(clean_param('#()*#,9789\'".,<42897></?$(*DSFMO#$*)(SDJ)($*)', PARAM_RAW), 
+            '#()*#,9789\'".,<42897></?$(*DSFMO#$*)(SDJ)($*)');
+        
+        $this->assertEqual(clean_param('#()*#,9789\'".,<42897></?$(*DSFMO#$*)(SDJ)($*)', PARAM_CLEAN), 
+            '#()*#,9789\\\'\".,');
+        
+    }
 }
 
 ?>
index 94d885ae72438fa8ce4086a624f64fbadb11b367..4df1f365ab714114fad4f932f7de6eed19b345c7 100644 (file)
@@ -588,8 +588,10 @@ function setup_elements(&$mform) {
     $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->addElement('checkbox', 'framepage', get_string('frameifpossible', 'resource'));
+    
+    $mform->setHelpButton('framepage', array('frameifpossible', get_string('frameifpossible', 'resource'), 'resource'));
     $mform->setDefault('framepage', 0);
     $mform->disabledIf('framepage', 'windowpopup', 'eq', 1);
     $mform->setAdvanced('framepage');