Moving from old "timezones" location to the new "timezone" one. MDL-12024 ; merged...
authorstronk7 <stronk7>
Mon, 31 Dec 2007 15:08:08 +0000 (15:08 +0000)
committerstronk7 <stronk7>
Mon, 31 Dec 2007 15:08:08 +0000 (15:08 +0000)
admin/timezoneimport.php

index b38ecdbbed720570246e4e6631fac757ba817de4..8506ad2b7ce3bdfe21721ce472340ab5429553f2 100644 (file)
@@ -23,9 +23,9 @@
     if (!$ok or !confirm_sesskey()) {
         $message = '<br /><br />';
         $message .= $CFG->dataroot.'/temp/olson.txt<br />';
-        $message .= $CFG->dataroot.'/temp/timezones.txt<br />';
-        $message .= '<a href="http://download.moodle.org/timezones/">http://download.moodle.org/timezones/</a><br />';
-        $message .= '<a href="'.$CFG->wwwroot.'/lib/timezones.txt">'.$CFG->dirroot.'/lib/timezones.txt</a><br />';
+        $message .= $CFG->dataroot.'/temp/timezone.txt<br />';
+        $message .= '<a href="http://download.moodle.org/timezone/">http://download.moodle.org/timezone/</a><br />';
+        $message .= '<a href="'.$CFG->wwwroot.'/lib/timezone.txt">'.$CFG->dirroot.'/lib/timezone.txt</a><br />';
         $message .= '<br />';
 
         $message = get_string("configintrotimezones", 'admin', $message);
@@ -53,7 +53,7 @@
 
 /// Next, look for a CSV file locally
 
-    $source = $CFG->dataroot.'/temp/timezones.txt';
+    $source = $CFG->dataroot.'/temp/timezone.txt';
     if (!$importdone and is_readable($source)) {
         if ($timezones = get_records_csv($source, 'timezone')) {
             update_timezone_records($timezones);
     }
 
 /// Otherwise, let's try moodle.org's copy
-    $source = 'http://download.moodle.org/timezones/';
+    $source = 'http://download.moodle.org/timezone/';
     if (!$importdone && ($content=download_file_content($source))) {
-        if ($file = fopen($CFG->dataroot.'/temp/timezones.txt', 'w')) {            // Make local copy
+        if ($file = fopen($CFG->dataroot.'/temp/timezone.txt', 'w')) {            // Make local copy
             fwrite($file, $content);
             fclose($file);
-            if ($timezones = get_records_csv($CFG->dataroot.'/temp/timezones.txt', 'timezone')) {  // Parse it
+            if ($timezones = get_records_csv($CFG->dataroot.'/temp/timezone.txt', 'timezone')) {  // Parse it
                 update_timezone_records($timezones);
                 $importdone = $source;
             }
-            unlink($CFG->dataroot.'/temp/timezones.txt');
+            unlink($CFG->dataroot.'/temp/timezone.txt');
         }
     }
 
 
 /// Final resort, use the copy included in Moodle
-    $source = $CFG->dirroot.'/lib/timezones.txt';
+    $source = $CFG->dirroot.'/lib/timezone.txt';
     if (!$importdone and is_readable($source)) {  // Distribution file
         if ($timezones = get_records_csv($source, 'timezone')) {
             update_timezone_records($timezones);