encoding (rd)
This commit is contained in:
parent
60c4b8e1f8
commit
85f5a13f9f
1 changed files with 7 additions and 5 deletions
|
@ -47,7 +47,7 @@ class block_timetable extends block_base {
|
|||
$this->content = new stdClass();
|
||||
$this->content->items = array();
|
||||
$this->content->icons = array();
|
||||
$this->content->footer = 'Fächer<br>Lehrer<br>Räume';
|
||||
$this->content->footer = 'Fächer<br>Lehrer<br>Räume';
|
||||
$this->content->text = "";
|
||||
|
||||
/*
|
||||
|
@ -66,6 +66,7 @@ class block_timetable extends block_base {
|
|||
$this->content->text .= "site context";
|
||||
}
|
||||
*/
|
||||
// echo var_dump($USER);
|
||||
$view = 'subject';
|
||||
if ($this->page->course->idnumber && $this->page->course->shortname) {
|
||||
$class = $this->page->course->shortname;
|
||||
|
@ -75,8 +76,7 @@ class block_timetable extends block_base {
|
|||
$teacher = $USER->username;
|
||||
$teacher = str_replace("l_", "", $teacher);
|
||||
$teacher = str_replace("-fvs", "", $teacher);
|
||||
//echo var_dump($USER);
|
||||
$this->content->text .= "Stundenplan von Lehrer*in $teacher<br>";
|
||||
$this->content->text .= "Stundenplan von ".(substr($USER->firstname,0,1)).". {$USER->lastname}<br>";
|
||||
$ttable = new timetable('teacher',$teacher);
|
||||
$view = 'class';
|
||||
} elseif ($USER->department) {
|
||||
|
@ -97,9 +97,11 @@ class block_timetable extends block_base {
|
|||
$date = new DateTime();
|
||||
$monday = new DateTime();
|
||||
|
||||
$dayofweek = $date->format('w')-1;
|
||||
$dayofweek = $date->format('w');
|
||||
if ($dayofweek >= $numdayweek) {
|
||||
$monday->add(new DateInterval("P".(7-$dayofweek)."D"));
|
||||
$monday->add(new DateInterval("P".(8-$dayofweek)."D"));
|
||||
} elseif ($dayofweek < 1) {
|
||||
$monday->add(new DateInterval("P1D"));
|
||||
} else {
|
||||
$monday->sub(new DateInterval("P{$dayofweek}D"));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue