Mercurial > hg > lukkari
comparison 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 |
comparison
equal
deleted
inserted
replaced
144:f64a46fa7961 | 145:c028506aa9cc |
---|---|
56 "viikossa" => array( | 56 "viikossa" => array( |
57 "en" => "Total of <b>%1</b> hours in the week.", | 57 "en" => "Total of <b>%1</b> hours in the week.", |
58 "fi" => "Viikossa yhteensä <b>%1</b> tuntia.", | 58 "fi" => "Viikossa yhteensä <b>%1</b> tuntia.", |
59 ), | 59 ), |
60 | 60 |
61 "vuoroviikoin" => array( | |
62 "en" => "Every other week", | |
63 "fi" => "Vuoroviikoin", | |
64 ), | |
65 | |
61 "classNotSet" => array( | 66 "classNotSet" => array( |
62 "en" => "Class not set, using default <b>%1</b>.", | 67 "en" => "Class not set, using default <b>%1</b>.", |
63 "fi" => "Luokkaa ei asetettu, käytetään vakioarvoa <b>%1</b>.", | 68 "fi" => "Luokkaa ei asetettu, käytetään vakioarvoa <b>%1</b>.", |
64 ), | 69 ), |
65 | 70 |
205 else | 210 else |
206 return chentities($id); | 211 return chentities($id); |
207 } | 212 } |
208 | 213 |
209 | 214 |
210 function lukGetClassInfo($grouped, $data) | 215 function lukGetClassInfo($class) |
211 { | 216 { |
212 if ($grouped) | 217 $data = $class["data"]; |
218 if ($class["grouped"]) | |
213 { | 219 { |
214 $out = "<table><tr>"; | 220 $out = "<table><tr>"; |
215 | 221 |
216 $maxCount = 0; | 222 $maxCount = 0; |
217 foreach ($data as $col) | 223 foreach ($data as $col) |
233 $out .= "</td>"; | 239 $out .= "</td>"; |
234 } | 240 } |
235 $out .= "</tr>"; | 241 $out .= "</tr>"; |
236 } | 242 } |
237 | 243 |
238 return $out."</table>"; | 244 $out .= "</table>"; |
245 | |
246 if ($class["turns"]) | |
247 $out .= cmQM("vuoroviikoin"); | |
248 | |
249 return $out; | |
239 } | 250 } |
240 else | 251 else |
241 { | 252 { |
242 $out = lukMatchCourse($data[0][0])."<br />"; | 253 $out = lukMatchCourse($data[0][0])."<br />"; |
243 | 254 |
244 for ($i = 1; $i < count($data[0]); $i++) | 255 for ($i = 1; $i < count($data[0]); $i++) |
245 { | 256 { |
246 $out .= chentities($data[0][$i])."<br />"; | 257 $out .= chentities($data[0][$i])."<br />"; |
247 } | 258 } |
259 if ($class["turns"]) | |
260 $out .= cmQM("vuoroviikoin"); | |
248 | 261 |
249 return $out; | 262 return $out; |
250 } | 263 } |
251 } | 264 } |
252 | 265 |
369 | 382 |
370 $out .= " <td rowspan=\"".$class["hours"]."\" ". | 383 $out .= " <td rowspan=\"".$class["hours"]."\" ". |
371 "title=\"".lukClassGetHourStr($hour, $hour + $class["hours"] - 1)."\" class=\"". | 384 "title=\"".lukClassGetHourStr($hour, $hour + $class["hours"] - 1)."\" class=\"". |
372 ($isActive ? "clactive " : ""). | 385 ($isActive ? "clactive " : ""). |
373 (!$isActive && $nextActive ? "clnext " : ""). | 386 (!$isActive && $nextActive ? "clnext " : ""). |
374 ($class["grouped"] ? "clgrouped" : "clnormal")."\">". | 387 (($class["grouped"] || $class["turns"]) ? "clgrouped" : "clnormal")."\">". |
375 lukGetClassInfo($class["grouped"], $class["data"]). | 388 lukGetClassInfo($class). |
376 "<div class=\"nhours\"><span>".$class["hours"]."h</span></div></td>\n"; | 389 "<div class=\"nhours\"><span>".$class["hours"]."h</span></div></td>\n"; |
377 } | 390 } |
378 } | 391 } |
379 else | 392 else |
380 { | 393 { |