timetable in slider (rd)
This commit is contained in:
parent
a6334e6c86
commit
3a996bd5a5
2 changed files with 179 additions and 14 deletions
|
|
@ -33,7 +33,7 @@ class block_timetable extends block_base {
|
|||
}
|
||||
|
||||
function get_content() {
|
||||
global $CFG, $OUTPUT, $USER;
|
||||
global $CFG, $OUTPUT, $USER, $PAGE;
|
||||
|
||||
if ($this->content !== null) {
|
||||
return $this->content;
|
||||
|
|
@ -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 = '<div class="timetable_legend"><a href="javascript:M.block_timetable.view_subject()">Fächer</a> - <a href="javascript:M.block_timetable.view_teacher()">Lehrer</a> - <a href="javascript:M.block_timetable.view_room()">Räume</a></div>';
|
||||
$this->content->text = "";
|
||||
|
||||
/*
|
||||
|
|
@ -67,7 +67,8 @@ class block_timetable extends block_base {
|
|||
}
|
||||
*/
|
||||
// echo var_dump($USER);
|
||||
$view = 'subject';
|
||||
$view1 = 'subject';
|
||||
$view2 = 'teacher';
|
||||
if ($this->page->course->idnumber && $this->page->course->shortname) {
|
||||
$class = $this->page->course->shortname;
|
||||
$this->content->text .= "Stundenplan der Klasse $class<br>";
|
||||
|
|
@ -78,7 +79,9 @@ class block_timetable extends block_base {
|
|||
$teacher = str_replace("-fvs", "", $teacher);
|
||||
$this->content->text .= "Stundenplan von ".(substr($USER->firstname,0,1)).". {$USER->lastname}<br>";
|
||||
$ttable = new timetable('teacher',$teacher);
|
||||
$view = 'class';
|
||||
$view1 = 'class';
|
||||
$view2 = 'subject';
|
||||
$this->content->footer = '<div class="timetable_legend"><a href="javascript:M.block_timetable.view_class()">Klassen</a> - <a href="javascript:M.block_timetable.view_subject()">Fächer</a> - <a href="javascript:M.block_timetable.view_room()">Räume</a></div>';
|
||||
} elseif ($USER->department) {
|
||||
$class = $USER->department;
|
||||
$class = str_replace("_", "/", $class);
|
||||
|
|
@ -91,7 +94,7 @@ class block_timetable extends block_base {
|
|||
//$context_id = get_context_instance_by_id($course->id);
|
||||
//echo "Contextid = $contextid->contextlevel\n";
|
||||
|
||||
|
||||
/*
|
||||
$numdayweek = 5 + get_config('timetable', 'saturday');
|
||||
|
||||
$date = new DateTime();
|
||||
|
|
@ -113,10 +116,48 @@ class block_timetable extends block_base {
|
|||
$this->content->text .= $monday->format('d.m') . " - " . $lastday->format('d.m');
|
||||
//$ttable = new timetable('class',$class);
|
||||
$ttable->read_db($week);
|
||||
*/
|
||||
//$this->content->text .= $ttable->monday->format('d.m') . " - " . $ttable->lastday->format('d.m');
|
||||
|
||||
$jsmodule = array(
|
||||
'name' => 'block_timetable',
|
||||
'fullpath' => '/blocks/timetable/module.js',
|
||||
'requires' => array()
|
||||
);
|
||||
$opts =Array();
|
||||
$opts['someinstancesetting'] = 1;
|
||||
$PAGE->requires->js_init_call('M.block_timetable.helper.init', array($opts),false,$jsmodule);
|
||||
|
||||
$this->content->text .= html_writer::start_tag('div', ['data-region' => 'calendar', 'class' => 'maincalendar']);
|
||||
$this->content->text .= $ttable->print_table($view);
|
||||
$this->content->text .= html_writer::start_tag('div', ['class' =>'slider']);
|
||||
$this->content->text .= html_writer::start_tag('div', ['class' =>'slides']);
|
||||
for ($i=0; $i<3; $i++) {
|
||||
$ttable->read_db($i);
|
||||
// $this->content->text .= $ttable->print_navigation($i);
|
||||
//$this->content->text .= html_writer::start_tag('div', ['class' =>'slide', 'id'=>"slide-$i", 'data-region' => 'calendar']);
|
||||
$this->content->text .= html_writer::start_tag('div', ['class' => 'slide', 'id'=>"slide-$i"]);
|
||||
//$this->content->text .= $ttable->print_table($view1);
|
||||
$this->content->text .= $ttable->print_table($view1,$i);
|
||||
$this->content->text .= $ttable->print_table($view2,$i);
|
||||
$this->content->text .= $ttable->print_table('room',$i);
|
||||
$this->content->text .= html_writer::end_tag('div');
|
||||
}
|
||||
$this->content->text .= html_writer::end_tag('div');
|
||||
|
||||
$this->content->text .= html_writer::end_tag('div');
|
||||
$this->content->text .= html_writer::end_tag('div');
|
||||
|
||||
/*
|
||||
$this->content->text .= html_writer::start_tag('div', ['data-region' => 'calendar', 'style' => 'display: none;']);
|
||||
$this->content->text .= $ttable->print_table($view1);
|
||||
$this->content->text .= html_writer::end_tag('div');
|
||||
$this->content->text .= html_writer::start_tag('div', ['data-region' => 'calendar', 'style' => 'display: none;']);
|
||||
$this->content->text .= $ttable->print_table($view2);
|
||||
$this->content->text .= html_writer::end_tag('div');
|
||||
$this->content->text .= html_writer::start_tag('div', ['data-region' => 'calendar', 'style' => 'displaay: none;']);
|
||||
$this->content->text .= $ttable->print_table('room');
|
||||
$this->content->text .= html_writer::end_tag('div');
|
||||
$this->content->text .= html_writer::end_tag('div');
|
||||
*/
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue