|
24 | 24 |
|
25 | 25 | use block_evasys_sync\dbtables;
|
26 | 26 | use block_evasys_sync\local\entity\evaluation_state;
|
| 27 | +use customfield_semester\data_controller; |
27 | 28 |
|
28 | 29 | require_once(__DIR__ . '/../../config.php');
|
29 |
| -global $DB, $USER, $OUTPUT, $PAGE; |
| 30 | +global $CFG, $DB, $USER, $OUTPUT, $PAGE; |
| 31 | +require_once($CFG->libdir . '/tablelib.php'); |
30 | 32 |
|
31 | 33 | require_login();
|
32 | 34 |
|
|
36 | 38 | $evasyscategory = \block_evasys_sync\evasys_category::for_category($id);
|
37 | 39 |
|
38 | 40 | $PAGE->set_url(new moodle_url('/blocks/evasys_sync/managecategory.php', ['id' => $id]));
|
39 |
| -$PAGE->set_context($category->get_context()); |
| 41 | +$PAGE->set_context(context_system::instance()); |
40 | 42 | $PAGE->set_title(get_string('evasys_sync', 'block_evasys_sync'));
|
41 | 43 |
|
42 |
| -require_capability('block/evasys_sync:managecourses', $PAGE->context); |
| 44 | +require_capability('block/evasys_sync:managecourses', $category->get_context()); |
43 | 45 |
|
44 | 46 | $cachekey = 'manageroverview';
|
45 | 47 | $cache = cache::make('block_evasys_sync', 'mformdata');
|
|
68 | 70 |
|
69 | 71 | $catids = array_merge($category->get_all_children_ids(), [$category->id]);
|
70 | 72 |
|
71 |
| -$categorynode = $PAGE->navigation->find($category->id, navigation_node::TYPE_CATEGORY); |
72 |
| -$evasysnode = $categorynode->add('Evaluations', new moodle_url('/blocks/evasys_sync/managecategory.php', ['id' => $category->id])); |
73 |
| -$evasysnode->add(\customfield_semester\data_controller::get_name_for_semester($data->semester))->make_active(); |
| 73 | +$PAGE->navigation->add('EvaSys', new moodle_url('/blocks/evasys_sync/manageroverview.php')) |
| 74 | + ->add( |
| 75 | + get_string('evaluations', 'block_evasys_sync') . ' in ' . data_controller::get_name_for_semester($data->semester), |
| 76 | + new moodle_url('/blocks/evasys_sync/managecategory.php', ['id' => $category->id]) |
| 77 | + )->make_active(); |
74 | 78 |
|
75 | 79 | list($inmanualsql, $params) = $DB->get_in_or_equal(evaluation_state::MANUAL_STATES, SQL_PARAMS_NAMED);
|
76 | 80 | list($incatsql, $incatparams) = $DB->get_in_or_equal($catids, SQL_PARAMS_NAMED);
|
|
0 commit comments