From: nicolasconnault Date: Mon, 12 Mar 2007 05:46:41 +0000 (+0000) Subject: MDL-8792 - Simply added help icon to explain the options available regarding embeddin... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=facb512c06155c31448701af9f1d29a010f28a21;p=moodle.git MDL-8792 - Simply added help icon to explain the options available regarding embedding media files in the site. --- diff --git a/lang/en_utf8/help/resource/frameifpossible.html b/lang/en_utf8/help/resource/frameifpossible.html new file mode 100644 index 0000000000..05b1ee63be --- /dev/null +++ b/lang/en_utf8/help/resource/frameifpossible.html @@ -0,0 +1,6 @@ +

Embedding files in a frame

+

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.

+ +

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.

+ +

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.

\ No newline at end of file diff --git a/lib/simpletest/testmodforumlib.php b/lib/simpletest/testmodforumlib.php new file mode 100644 index 0000000000..2e70d54a41 --- /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 14bd707f18..373544a02d 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 94d885ae72..4df1f365ab 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');