From 7ac1e095b83dcbf19bbbcf8d64cdfc240f8ac412 Mon Sep 17 00:00:00 2001 From: thepurpleblob Date: Fri, 24 Feb 2006 18:49:01 +0000 Subject: [PATCH] Moving export default filename function. --- mod/quiz/locallib.php | 48 ------------------------------------------- 1 file changed, 48 deletions(-) diff --git a/mod/quiz/locallib.php b/mod/quiz/locallib.php index 98d852d8b74..7eae18e2a84 100644 --- a/mod/quiz/locallib.php +++ b/mod/quiz/locallib.php @@ -477,54 +477,6 @@ function quiz_get_question_review($quiz, $question) { \"$strpreview\""; } -/// FUNCTIONS USED BY IMPORT AND EXPORT /////////////////////////////// - -/** -* Create default export filename -* -* @return string default export filename -* @param object $course -* @param object $category -*/ -function default_export_filename($course,$category) { - //Take off some characters in the filename !! - $takeoff = array(" ", ":", "/", "\\", "|"); - $export_word = str_replace($takeoff,"_",strtolower(get_string("exportfilename","quiz"))); - //If non-translated, use "export" - if (substr($export_word,0,1) == "[") { - $export_word= "export"; - } - - //Calculate the date format string - $export_date_format = str_replace(" ","_",get_string("exportnameformat","quiz")); - //If non-translated, use "%Y%m%d-%H%M" - if (substr($export_date_format,0,1) == "[") { - $export_date_format = "%%Y%%m%%d-%%H%%M"; - } - - //Calculate the shortname - $export_shortname = clean_filename($course->shortname); - if (empty($export_shortname) or $export_shortname == '_' ) { - $export_shortname = $course->id; - } - - //Calculate the category name - $export_categoryname = clean_filename($category->name); - - //Calculate the final export filename - //The export word - $export_name = $export_word."-"; - //The shortname - $export_name .= strtolower($export_shortname)."-"; - //The category name - $export_name .= strtolower($export_categoryname)."-"; - //The date format - $export_name .= userdate(time(),$export_date_format,99,false); - //The extension - no extension, supplied by format - // $export_name .= ".txt"; - - return $export_name; -} /**