diff --git a/lang/en_utf8/help/resource/frameifpossible.html b/lang/en_utf8/help/resource/frameifpossible.html new file mode 100644 index 00000000000..d4127bce76d --- /dev/null +++ b/lang/en_utf8/help/resource/frameifpossible.html @@ -0,0 +1,11 @@ +

Embedding media in a frame

+

The normal way to display embedded media is either in an object element, if your +browser supports it, or on a page of its own. These methods are compliant with +XHTML strict standards. However, in some cases, your browser may not support the +type of file you want to embed, and you still want it to appear within your site's context +(with the navigation breadcrumbs etc..). The only way to do this is to enable this option. +However, this is not compliant with XHTML strict.

+

+If your users have the option screenreader switched on in their profile, it will override this +option, so that frames will never be used to display embedded media for these users. +

diff --git a/lib/simpletest/testmodforumlib.php b/lib/simpletest/testmodforumlib.php new file mode 100644 index 00000000000..2e70d54a416 --- /dev/null +++ b/lib/simpletest/testmodforumlib.php @@ -0,0 +1,57 @@ +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); + } +} + +?> diff --git a/lib/simpletest/testmoodlelib.php b/lib/simpletest/testmoodlelib.php index 14bd707f185..373544a02df 100644 --- a/lib/simpletest/testmoodlelib.php +++ b/lib/simpletest/testmoodlelib.php @@ -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. + * + * $course->format = clean_param($course->format, PARAM_ALPHA); + * $selectedgrade_item = clean_param($selectedgrade_item, PARAM_CLEAN); + * + * + * @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>assertEqual(clean_param('#()*#,9789\'".,<42897> diff --git a/mod/resource/type/file/resource.class.php b/mod/resource/type/file/resource.class.php index 94d885ae724..4df1f365ab7 100644 --- a/mod/resource/type/file/resource.class.php +++ b/mod/resource/type/file/resource.class.php @@ -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');