function course_iframe in Course 7
Same name and namespace in other branches
- 8.3 course.module \course_iframe()
- 8.2 course.module \course_iframe()
- 6 course.module \course_iframe()
- 7.2 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/
CourseObject.inc - Take a course object.
- course_object_reports_page in includes/
course.reports.inc - Page handler for course object reports.
File
- ./
course.module, line 1239 - 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 id="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;
}