Mercurial > hg > lukkari
diff index.php @ 145:c028506aa9cc
Separate the concepts of "every other week" classes and split group classes.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 10 Sep 2014 12:44:10 +0300 |
parents | f64a46fa7961 |
children | f559f0161fd5 |
line wrap: on
line diff
--- a/index.php Tue Sep 09 11:21:32 2014 +0300 +++ b/index.php Wed Sep 10 12:44:10 2014 +0300 @@ -58,6 +58,11 @@ "fi" => "Viikossa yhteensä <b>%1</b> tuntia.", ), + "vuoroviikoin" => array( + "en" => "Every other week", + "fi" => "Vuoroviikoin", + ), + "classNotSet" => array( "en" => "Class not set, using default <b>%1</b>.", "fi" => "Luokkaa ei asetettu, käytetään vakioarvoa <b>%1</b>.", @@ -207,9 +212,10 @@ } -function lukGetClassInfo($grouped, $data) +function lukGetClassInfo($class) { - if ($grouped) + $data = $class["data"]; + if ($class["grouped"]) { $out = "<table><tr>"; @@ -235,7 +241,12 @@ $out .= "</tr>"; } - return $out."</table>"; + $out .= "</table>"; + + if ($class["turns"]) + $out .= cmQM("vuoroviikoin"); + + return $out; } else { @@ -245,6 +256,8 @@ { $out .= chentities($data[0][$i])."<br />"; } + if ($class["turns"]) + $out .= cmQM("vuoroviikoin"); return $out; } @@ -371,8 +384,8 @@ "title=\"".lukClassGetHourStr($hour, $hour + $class["hours"] - 1)."\" class=\"". ($isActive ? "clactive " : ""). (!$isActive && $nextActive ? "clnext " : ""). - ($class["grouped"] ? "clgrouped" : "clnormal")."\">". - lukGetClassInfo($class["grouped"], $class["data"]). + (($class["grouped"] || $class["turns"]) ? "clgrouped" : "clnormal")."\">". + lukGetClassInfo($class). "<div class=\"nhours\"><span>".$class["hours"]."h</span></div></td>\n"; } }