comparison index.php @ 153:9c6290ad087d

Improve class code handling.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 09 Dec 2014 21:32:25 +0200
parents 5c0eacb7d35d
children 4106691d3b25
comparison
equal deleted inserted replaced
152:4085ea7aa7a6 153:9c6290ad087d
15 15
16 $pageLanguages = array("fi", "en"); 16 $pageLanguages = array("fi", "en");
17 $pageCSSData = array("cookie" => "lukcss", "prefix" => "luk"); 17 $pageCSSData = array("cookie" => "lukcss", "prefix" => "luk");
18 18
19 $classDefaultID = "DEFAULT"; 19 $classDefaultID = "DEFAULT";
20 $classIDFile = "classes.txt"; 20 $classIDFile = array(FALSE => "classes.txt", TRUE => "classes_next.txt");
21 $courseCacheFile = "coursecache.txt"; 21 $courseCacheFile = "coursecache.txt";
22 22
23 if (file_exists("config.inc.php")) 23 if (file_exists("config.inc.php"))
24 @require "config.inc.php"; 24 @require "config.inc.php";
25 25
73 ), 73 ),
74 74
75 "classDataNotFound" => array( 75 "classDataNotFound" => array(
76 "fi" => "Luokan %1 tietoja ei löytynyt! Jos luokkakoodi on uusi, ". 76 "fi" => "Luokan %1 tietoja ei löytynyt! Jos luokkakoodi on uusi, ".
77 "ilmestyy se järjestelmään seuraavan päivityksen aikana. Luokkatiedot ". 77 "ilmestyy se järjestelmään seuraavan päivityksen aikana. Luokkatiedot ".
78 "päivitetään noin kerran viikossa.", 78 "päivitetään noin kerran viikossa. <b>On myös mahdollista, että luokkakoodi ".
79 "on olemassa vain seuraavan periodin tiedoissa.</b>",
79 80
80 "en" => "Data for class %1 was not found. If the class code is new, it ". 81 "en" => "Data for class %1 was not found. If the class code is new, it ".
81 "should appear in this system during the next update. The data is updated ". 82 "should appear in this system during the next update. The data is updated ".
82 "approximately once per week.", 83 "approximately once per week. <b>It is also possible that the code only ".
84 "exists for next period's data.</b>",
83 ), 85 ),
84 86
85 "classListNotFound" => array( 87 "classListNotFound" => array(
86 "fi" => "Luokkien listaa ei löytynyt. Kokeile ladata sivu uudelleen hetken kuluttua.", 88 "fi" => "Luokkien listaa ei löytynyt. Kokeile ladata sivu uudelleen hetken kuluttua.",
87 "en" => "Class list not found. An update may be in progress, try reloading in a minute.", 89 "en" => "Class list not found. An update may be in progress, try reloading in a minute.",
485 fclose($fp); 487 fclose($fp);
486 } 488 }
487 489
488 490
489 // Read classfile 491 // Read classfile
490 if (($classIDs = lukReadClassFile($classIDFile, &$timestamp)) === false) 492 if (($classIDs = lukReadClassFile($classIDFile[$nextPeriod], &$timestamp)) === false)
491 stError(cmQM("classListNotFound")); 493 stError(cmQM("classListNotFound"));
492 494
493 495
494 // Read class data 496 // Read class data
495 $dataFile = $cachePath.$classID.".data"; 497 $dataFile = $cachePath.$classID.".data";