diff --git a/lang/en/vpl.php b/lang/en/vpl.php index da11daa3b2c599071345960727a1091ca294e40b..06143b19ba2d4e32a0af0b88fd7576e0d4b958a3 100644 --- a/lang/en/vpl.php +++ b/lang/en/vpl.php @@ -43,6 +43,9 @@ $string ['browserupdate'] = 'Please update your browser to the last version<br / $string ['calculate'] = 'Calculate'; $string ['changesNotSaved'] = 'Changes have not been saved'; $string ['check_jail_servers'] = 'Check execution servers'; +$string ['checkforcourse'] = 'Check for course {$a}'; +$string ['checkgroups'] = 'Check groups consistency'; +$string ['checksitewide'] = 'Check sitewide'; $string ['clipboard'] = 'Clipboard'; $string ['closed'] = 'Closed'; $string ['comments'] = 'Comments'; diff --git a/views/checkvpls.php b/views/checkvpls.php index 79a9b08641ce1d85959e5ad63c171a74f883f3e8..46e452c62d2f977f539b10b3ecce40aca893b848 100644 --- a/views/checkvpls.php +++ b/views/checkvpls.php @@ -38,20 +38,40 @@ if (! $course = $DB->get_record( "course", array ( 'id' => $id ) )) { require_course_login( $course ); $PAGE->set_url( '/mod/vpl/views/checkvpls.php', array ( 'id' => $id ) ); + +$admin = is_siteadmin(); +$sitewide = $admin && optional_param('sitewide', 0, PARAM_INT); $strvpls = get_string( 'modulenameplural', VPL ); +$pagetitle = get_string( 'checkgroups', VPL ); +$coursename = format_string( $course->fullname ); +if (!$sitewide) { + $pagetitle .= ' (' . $coursename . ')'; +} $PAGE->navbar->add( $strvpls ); -$PAGE->set_title( get_string('checkall') ); -$PAGE->set_heading( $course->fullname ); +$PAGE->set_title( $pagetitle ); +$PAGE->set_heading( $coursename ); echo $OUTPUT->header(); -echo $OUTPUT->heading( get_string('checkall')); +echo $OUTPUT->heading( $pagetitle ); $einfo = array ( 'context' => \context_course::instance( $course->id ), 'objectid' => $course->id, 'userid' => $USER->id ); \mod_vpl\event\vpl_checkvpls::log( $einfo ); -$admin = is_siteadmin(); if ($admin) { + $url = $PAGE->url; + $filterurls = array( + $url->out(true, array('sitewide' => 0)), + $url->out(true, array('sitewide' => 1)) + ); + echo $OUTPUT->url_select( array ( + $filterurls [0] => get_string( 'checkforcourse', VPL, $coursename ), + $filterurls [1] => get_string( 'checksitewide', VPL ) + ), $filterurls [$sitewide], null ); + echo '<br>'; +} + +if ($sitewide) { $ovpls = $DB->get_records( VPL, array(), 'id' ); } else { $ovpls = get_all_instances_in_course( VPL, $course ); @@ -59,8 +79,8 @@ if ($admin) { // Get and select vpls to show. foreach ($ovpls as $ovpl) { $vpl = new mod_vpl( false, $ovpl->id ); - $instance = $vpl->get_instance(); if ( $vpl->is_group_activity() ) { + $instance = $vpl->get_instance(); // Check groups concistence. $groupingid = $vpl->get_course_module()->groupingid; $groups = groups_get_all_groups($vpl->get_course()->id, 0, $groupingid); @@ -98,8 +118,8 @@ foreach ($ovpls as $ovpl) { } $title = ''; - if ($admin) { - $title = $vpl->get_course()->shortname . ': '; + if ($sitewide) { + $title = $vpl->get_course()->shortname . ' > '; } $title .= $vpl->get_printable_name(); $icon = 'check';