function course_iframe in Course 6
Same name and namespace in other branches
- 8.3 course.module \course_iframe()
- 8.2 course.module \course_iframe()
- 7.2 course.module \course_iframe()
- 7 course.module \course_iframe()
- 3.x course.module \course_iframe()
Generic Course IFrame function.
Parameters
string $url: An iframe HTML element src attribute.
string $height: A string representing an iframe height.
string $class: A HTML class attribute for the iframe.
2 calls to course_iframe()
- CourseObject::takeCourseObject in includes/
course_object.core.inc - Take a course object.
- course_object_reports_page in includes/
course.reports.inc - Page handler for course object reports.
File
- ./
course.module, line 1380 - course.module Core functionality for Courses.
Code
function course_iframe($url = NULL, $height = '600px', $class = NULL) {
$style = 'border:none; margin:0; width:100%; height:' . $height . ';';
$iframe = '<iframe name="course-viewer" src="' . $url . '" style="' . $style . '" class="' . $class . '" scrolling="no" frameborder="0" onload="resizeFrame(this);"></iframe>';
// Add JS to resize parent frame. This assumes additional JS on the targeted iframe content.
drupal_add_js(drupal_get_path('module', 'course') . '/js/resizeframe.js');
return $iframe;
}