10-25-04 require_once($CFG->dirroot.'/backup/bb/xsl_emulate_xslt.inc'); function get_subdirs($directory){ $opendirectory = opendir( $directory ); while($filename = readdir($opendirectory)) { if (is_dir($directory.$filename) and $filename != ".." and $filename != "."){ $subdirs[] = $filename; } } closedir($opendirectory); return $subdirs; } function choose_bb_xsl($manifest){ $f = fopen($manifest,"r"); $buffer = fgets($f, 400); $buffer = fgets($f, 400); fclose($f); if (strstr($buffer,"xmlns:bb=\"http://www.blackboard.com/content-packaging/\"")){ return "bb6_to_moodle.xsl"; } return "bb5.5_to_moodle.xsl"; } function blackboard_convert($dir){ global $CFG; // Check for a Blackboard manifest file if (is_readable($dir.'/imsmanifest.xml') && !is_readable($dir.'/moodle.xml')){ if (!function_exists('xslt_create')) { // XSLT MUST be installed for this to work notify('You need the XSLT library installed in PHP to open this Blackboard file'); return false; } //Select the proper XSL file $xslt_file = choose_bb_xsl($dir.'/imsmanifest.xml'); //TODO: Use the get_string function for this echo "