diff --git a/db/access.php b/db/access.php new file mode 100644 index 0000000..94191d8 --- /dev/null +++ b/db/access.php @@ -0,0 +1,76 @@ +. + +/** + * Plugin capabilities + * + * @package mod_timetable + * @category upgrade + * @copyright 2020 Raphael Dannecker + * @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'mod/timetable:view_teacher' => array( + 'riskbitmask' => RISK_XSS, + + 'captype' => 'read', + 'contextlevel' => CONTEXT_USER, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ), + ), + + 'mod/timetable:view_class' => array( + 'riskbitmask' => RISK_XSS, + + 'captype' => 'read', + 'contextlevel' => CONTEXT_USER, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ), + ), + + 'mod/timetable:view_room' => array( + 'riskbitmask' => RISK_XSS, + + 'captype' => 'read', + 'contextlevel' => CONTEXT_USER, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ), + ), + + 'mod/timetable:view_own_class' => array( + 'riskbitmask' => RISK_XSS, + + 'captype' => 'read', + 'contextlevel' => CONTEXT_USER, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW, + 'student' => CAP_ALLOW + ), + ), + +); diff --git a/styles.css b/styles.css new file mode 100644 index 0000000..bd1c863 --- /dev/null +++ b/styles.css @@ -0,0 +1,60 @@ +.timetableffffo th { + width: 4rem; +} + +.timetable_description { + display:block; + float: left; + width:92%; + text-align: center; + font-weight: bold; +} + +.block_timetable .timetable_description { + width:100%; +} + +div.timetable { + border:2px solid black; +} + +.block_timetable div.timetable { + border:0px; +} + +.timetable table { + text-align: center; + padding-top:0rem; + padding-bottom:0rem; + margin: 0 auto; + width: 100%; + line-height: 1; +} + +.block_timetable table { + max-width: 280px; +} + +.timetable table.caption { + padding-top:0pt; + padding-bottom:0pt; +} + +#close { + display:block; + float:right +} + +.block_timetable #close { + display: none; +} + + +.timetable th, +.timetable td { + padding: 2px; + font-size: 0.8em; + text-align: center; + width: 5rem; +} + \ No newline at end of file