capabilities
This commit is contained in:
parent
71c98918c4
commit
49e28c9956
3 changed files with 66 additions and 15 deletions
|
@ -61,31 +61,31 @@ class block_timetable extends block_base {
|
|||
$this->content->icons = array();
|
||||
$this->content->footer = '';
|
||||
|
||||
/*
|
||||
$view1 = 'subject';
|
||||
$view2 = 'teacher';
|
||||
|
||||
//$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>";
|
||||
$ttable = new timetable('class',$class);
|
||||
//$this->content->text .= "Stundenplan der Klasse $class<br>";
|
||||
$ttable = new \mod_timetable\timetable('class',$class);
|
||||
} elseif ($USER->department == "Lehrer" || $USER->department == "Lehrer_fvs") {
|
||||
$teacher = $USER->username;
|
||||
$teacher = str_replace("l_", "", $teacher);
|
||||
$teacher = str_replace("-fvs", "", $teacher);
|
||||
$this->content->text .= "Stundenplan von ".(substr($USER->firstname,0,1)).". {$USER->lastname}<br>";
|
||||
$ttable = new \mod\timetable\timetable('teacher',$teacher);
|
||||
$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>';
|
||||
//$this->content->text .= "Stundenplan von ".(substr($USER->firstname,0,1)).". {$USER->lastname}<br>";
|
||||
$ttable = new \mod_timetable\timetable('teacher',$teacher);
|
||||
//$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);
|
||||
$this->content->text .= "Stundenplan der Klasse $class<br>";
|
||||
$ttable = new \mod\timetable\timetable('class',$class);
|
||||
//$this->content->text .= "Stundenplan der Klasse $class<br>";
|
||||
$ttable = new \mod_timetable\timetable('class',$class);
|
||||
} else {
|
||||
return $this->content;
|
||||
}
|
||||
*/
|
||||
|
||||
$today = new \DateTime();
|
||||
$week = $today->format("W");
|
||||
$dayofweek = $today->format('w');
|
||||
|
@ -93,7 +93,7 @@ class block_timetable extends block_base {
|
|||
$week++;
|
||||
}
|
||||
|
||||
$ttable = new \mod_timetable\timetable('teacher','Da');
|
||||
//$ttable = new \mod_timetable\timetable('teacher','Da');
|
||||
$ttable->read_db($week);
|
||||
/*
|
||||
for ($i=0; $i<3; $i++) {
|
||||
|
|
51
db/access.php
Normal file
51
db/access.php
Normal file
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Plugin capabilities
|
||||
*
|
||||
* @package block_timetable
|
||||
* @category upgrade
|
||||
* @copyright 2020 Raphael Dannecker <raphael.dannecker@steinbeisschule-reutlingen.de>
|
||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$capabilities = array(
|
||||
|
||||
'block/timetable:addinstance' => array(
|
||||
'riskbitmask' => RISK_XSS,
|
||||
|
||||
'captype' => 'read',
|
||||
'contextlevel' => CONTEXT_USER,
|
||||
'archetypes' => array(
|
||||
'manager' => CAP_ALLOW
|
||||
),
|
||||
),
|
||||
|
||||
'block/timetable:myaddinstance' => array(
|
||||
'riskbitmask' => RISK_XSS,
|
||||
|
||||
'captype' => 'read',
|
||||
'contextlevel' => CONTEXT_USER,
|
||||
'archetypes' => array(
|
||||
'manager' => CAP_ALLOW
|
||||
),
|
||||
),
|
||||
|
||||
);
|
|
@ -26,7 +26,7 @@ defined('MOODLE_INTERNAL') || die();
|
|||
|
||||
$plugin->component = 'block_timetable';
|
||||
$plugin->release = '0.1.0';
|
||||
$plugin->version = 2020091200;
|
||||
$plugin->version = 2020091801;
|
||||
$plugin->requires = 2020061500;
|
||||
$plugin->maturity = MATURITY_ALPHA;
|
||||
$plugin->dependencies = [
|
||||
|
|
Loading…
Add table
Reference in a new issue