ÿØÿà JFIF    ÿÛ „  ( %!1"%)+...383-7(-.+  -%%--------+------------/----------------------------ÿÀ  ¶" ÿÄ     ÿÄ @    !1AQaq‘¡"±ÁÑð2’BRráS‚ñ3b¢CT²Ò #cÿÄ    ÿÄ '   1!AQ2a"‘±#ÿÚ   ? ò(/p‘—–¢·,M|¯G»R£üešT. ôŸEoCFñ‡ 4ÔkåóxR|µÁ¨ÓDà!Ç´µ˜‡p ÍQ‹§!þž^õWsŒy  åÁ§$á«%ºq˜™JyyË0y«^Ϗ -3ÃÏËÈ£Æ\P’ä„s&•‹Üs üô'àWt¹pñCp$bÚF`·7.^)¾!)ÒÙ˜–ÅÏš^h¾ø³·ìe±ŒaeÖ—Í,e=B}Jéߦ$$½—šÙÜCC¯¶è8β–Åkèwx LÉngT±æ¹£Ócœ¿Í/©Éÿ ‰ÚCÒ­mq;Tt¶–}0"zÖPcd1š­¤tˆ„ÐÓâqú[™öUCŠ2޿د­É(¸ßúçšmW,Ò ºf‹Ån™ÄLêÁ8üÁkÁ€L¥ÍuJ1œôrÂSŒÓöt!7EUíïb)AËi¬â-ÙHk8òÁiXYwÅ)O^"ÇØriÛô{»wRUKÙÏÚlÓ¬€‚’שT ] ªb—ÊîKC^×M“xùäñz¬zJ× {4[¹M'IÆeH1LCWÕ]œûº WDæà°OÅ‚¹c²ÞuA–rL`HšpCez‡V’— Ž‚Ë„–ñ­'µR0ÕÖ=À:±G»C\nÆÉ5*¢ †3šhQ4ýÒi$Õ1"Ü]¢p-q3zcQ$ªö¨¥æf›‘»´ÝÚHá„e²JÇ–iÊ:·à¬Øc5Åk»Laª*wi [0Ówk ¦a¦0Õ²ÅÅ‚T¸’³q:Æ<¹ú Ò˜Æ}2VE•Ѐp¡Ô3Úº …h³^LJºçì¥Ánó|˜ÖˆÎˆ+« ¦dø‘Mº–d\ªDðÛ„Ì×LÝ——Ð9Ç|•FèçVm™¨€™3õS–9Äå¢<̉Ìm¢±`·º˜&Z²ž Ë®D«¶»6™‰©­HÈ Àá«h­i³04æ’hxœi3ï¨(ÓL·†‹¶ËpŒ ƒÜÒ? :õdsÀ –3æÓ·Üjâ¬9—]8n¼&]I F£¼…ì–—Œ0v°LǐÅfÛ2TÖ’aµ˜N@ÖBSÏ^à´4-±°b×nÈÈœÆD=KdŒø…ÄÈK,›ÖR§fjü$^ÔÎ!„6^ s:Üun\ôkCÞò÷<—Lúl Í›G¹ÀPá¼Nc¡šÒ…ÙWͳœ±vÊáЄ×9‹P‰cEØ‘™›µŸP<×g1 º©Ø¬wiÁ^l5× I/';Ë+´Z‡ÓÄFÕp[Èð’ HÄ ó 9¬Dl4“é±Ï”V=^Hð;žLädÉa‚°Ë,#/Ž~²BÔÛ QãñQtIeórVB,ÏÂf‹4#Μc‹É3ZIÖ Œ¢¥·üxa‡Ãçè„jŠ[5 Ä!U?,3žÎ×…ðdÓ÷háŠA‰ìÄ4÷ÃÜZÃE{‰®+W\ZÍE[‰»µk»MÝ­`¢©†˜ÃV‹-f¢¡†¢a«eŠ%«Y¨©q%jâd,Ôq`) ¤¦…šˆ ¦E>0Ùb²t–Ÿ  ÷jsςҒKÈcø(é›;k(’#ôŒQ ™C> õ³M9óºÆµ¤çâ;uÀ)5>RÔ¸fÓ~Ȧ—’-$fe«"FâUˆÊwµPÏu w+"åÉó¨6s™Û9(À¨ù©hE°½†n`m~“@©›p!Vkhµ Á1šbEqqÊ@ºèl›2 –Yã%‘‚hÛ{a¶‡ÅÞM²¬çL34®Çl]®‹ŽØŒm'RÜe35æöˆ­Á­ cP9šeÁköo´L³Ì=p8]”‡B¶,šº|ɏdzXˆØk*ÇÚ{#ñ‰pã(€¶‡9ý'šÜ³½¯kƒ†Â’ëSOƒ•Å®H6+a¢µˆ‹Y¨b˜b+XˆÖ!°u!¢"µˆˆn2ˆ Å0Ä`Å Ô®c(ÓÜGº•Ä»Œ âWî%q.áÐÄ÷î%umÍ£+ÜQ,Vn¦-GphU¸¢X­&,Gt ·K¢ÅÅ·¥RÄÊÉbKn N­R2g$VµÕó Qr#–ÓZUÏð0ÎtÙÀœz ëöo“Îk¯n„T°"SÞ+³/…€½"ižãO%Í%&Δâ‘ËØ´IˆÓ°Ë‰ÞM3.™yçÁzit›`4C`k¢¼á!álÄï sÂ[×!¤l¾æo"ƒIÔ'@ªu)3›ô®“@Z à¾] üœ'‡4¸PÞkÁ-qÄH‰ÓÍBd´ÿ —¹°ÄA&ÊUC„öz‚‚RæŠtf¬>˜ÑidšEçÑL÷áý¡V±h§­c¿¥¨ƒ@g¼…Ýö^ÞËc.ž„æ“I[ ª+·zÐÒÚ,½Ð»¶€C›7jk$๖€Ž¾ÅÙpp¶ÍþéΤ ½ØÎŒq ñpæžÅ¥#Øâ49ÃÂK^MYV“,¶Éz_òæ:…;Õ«¦I3âJ£¤û5$7Èxün\â]Êe¯(Ÿ&Ž‹¶2<6Ćf× æ¢ƱqWı[(ÙÂŽç‚T7¨@ÈÉÍß‚ïÙ"&3TYlGށ†)†#5ŠA©^T2ÆÁ†)©†©†¤yGXÁ†©"†)©¼ÅV WS†#©]R–r‹q5ÕbâWþBh¯u+ªÅÄ×ü„nÑ^êkªÁj‰jeœWˆÕÕ`µDµ2Ì+Ä µDµµ5Ô{¤Þ0RF’H÷AÛ<ÊÁ§ ƈæ0Ñ£ê4 öÚµ[¬/1²€â<-¬šö²r×0o×w ´xÐÒË„ g01¬„åEM蛇Ã\6µE›‘fÙO k÷CºnÓ1`iîÒ² áÂ!ÑLÄÿ ³¬\õ*:M=Ç»c‹2[‰ØsÕLò\ŒK L^™üÄN\¶#» Ç\……ßïIœÉ$¸ÎñÍ®ÔHÇ Ûí/´>Li”„†g^$ 7NÍÑÑ2M2ªNg=k½Ð}Ÿl6‡ —JWˆ”ÞéT·+µ¦üÂFè¢Vs6ýÆ4»2+2IÝ9ô9®ÇGÙÇ1+Ä8;*Õ§ž½D*îÑWÚçá3Ma¤·ˆ¥t}š²Ü…Q+Æüµ8HíS”üxGéÁˆ¦Ël„éÈ 5 µÄƒ6äÜ(kIš¯S†fÖ&¸®×v|Äyˆ*禌Éù@7-®Ä[]ÎÖ¿ê`º…=:…žJVnݳvðÖKE¼‚ »mà ÷f®:Ë ™–4rð¡4` ܹçž~‹C=œ…¾Ïj|VDtK.ƒ"9 Ï ­–éXá³6WÒïIL-Ї Ç home/smkb8269/public_html/lms.smk-almanshuriyah.sch.id/mod/lesson/overrides.php000064400000030007152267036500023464 0ustar00. /** * This page handles listing of lesson overrides * * @package mod_lesson * @copyright 2015 Jean-Michel Vedrine * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require_once(__DIR__ . '/../../config.php'); require_once($CFG->dirroot.'/mod/lesson/lib.php'); require_once($CFG->dirroot.'/mod/lesson/locallib.php'); require_once($CFG->dirroot.'/mod/lesson/override_form.php'); $cmid = required_param('cmid', PARAM_INT); $mode = optional_param('mode', '', PARAM_ALPHA); // One of 'user' or 'group', default is 'group'. list($course, $cm) = get_course_and_cm_from_cmid($cmid, 'lesson'); $lesson = $DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST); require_login($course, false, $cm); $context = context_module::instance($cm->id); // Check the user has the required capabilities to list overrides. require_capability('mod/lesson:manageoverrides', $context); $lessongroupmode = groups_get_activity_groupmode($cm); $accessallgroups = ($lessongroupmode == NOGROUPS) || has_capability('moodle/site:accessallgroups', $context); // Get the course groups that the current user can access. $groups = $accessallgroups ? groups_get_all_groups($cm->course) : groups_get_activity_allowed_groups($cm); // Default mode is "group", unless there are no groups. if ($mode != "user" and $mode != "group") { if (!empty($groups)) { $mode = "group"; } else { $mode = "user"; } } $groupmode = ($mode == "group"); $url = new moodle_url('/mod/lesson/overrides.php', array('cmid' => $cm->id, 'mode' => $mode)); $PAGE->set_url($url); // Display a list of overrides. $PAGE->set_pagelayout('admin'); $PAGE->add_body_class('limitedwidth'); $PAGE->set_title(get_string('overrides', 'lesson')); $PAGE->set_heading($course->fullname); $PAGE->activityheader->set_attrs([ 'hidecompletion' => true, 'description' => '' ]); navigation_node::override_active_url(new moodle_url('/mod/lesson/overrides.php', ['cmid' => $cmid])); $renderer = $PAGE->get_renderer('mod_lesson'); echo $OUTPUT->header(); // Delete orphaned group overrides. $sql = 'SELECT o.id FROM {lesson_overrides} o LEFT JOIN {groups} g ON o.groupid = g.id WHERE o.groupid IS NOT NULL AND g.id IS NULL AND o.lessonid = ?'; $params = array($lesson->id); $orphaned = $DB->get_records_sql($sql, $params); if (!empty($orphaned)) { $DB->delete_records_list('lesson_overrides', 'id', array_keys($orphaned)); } $overrides = []; // Fetch all overrides. if ($groupmode) { $colname = get_string('group'); // To filter the result by the list of groups that the current user has access to. if ($groups) { $params = ['lessonid' => $lesson->id]; list($insql, $inparams) = $DB->get_in_or_equal(array_keys($groups), SQL_PARAMS_NAMED); $params += $inparams; $sql = "SELECT o.*, g.name FROM {lesson_overrides} o JOIN {groups} g ON o.groupid = g.id WHERE o.lessonid = :lessonid AND g.id $insql ORDER BY g.name"; $overrides = $DB->get_records_sql($sql, $params); } } else { $colname = get_string('user'); list($sort, $params) = users_order_by_sql('u'); $params['lessonid'] = $lesson->id; $userfieldsapi = \core_user\fields::for_name(); if ($accessallgroups) { $sql = 'SELECT o.*, ' . $userfieldsapi->get_sql('u', false, '', '', false)->selects . ' FROM {lesson_overrides} o JOIN {user} u ON o.userid = u.id WHERE o.lessonid = :lessonid ORDER BY ' . $sort; $overrides = $DB->get_records_sql($sql, $params); } else if ($groups) { list($insql, $inparams) = $DB->get_in_or_equal(array_keys($groups), SQL_PARAMS_NAMED); $params += $inparams; $sql = 'SELECT o.*, ' . $userfieldsapi->get_sql('u', false, '', '', false)->selects . ' FROM {lesson_overrides} o JOIN {user} u ON o.userid = u.id JOIN {groups_members} gm ON u.id = gm.userid WHERE o.lessonid = :lessonid AND gm.groupid ' . $insql . ' ORDER BY ' . $sort; $overrides = $DB->get_records_sql($sql, $params); } } $overrides = $DB->get_records_sql($sql, $params); $canoverride = true; $errormessage = ''; if ($groupmode) { if (empty($groups)) { // There are no groups. $canoverride = false; $errormessage = get_string('groupsnone', 'lesson'); } } else { $users = array(); // See if there are any users in the lesson. if ($accessallgroups) { $users = get_enrolled_users($context, '', 0, 'u.id'); $nousermessage = get_string('usersnone', 'lesson'); } else if ($groups) { $enrolledjoin = get_enrolled_join($context, 'u.id'); list($ingroupsql, $ingroupparams) = $DB->get_in_or_equal(array_keys($groups), SQL_PARAMS_NAMED); $params = $enrolledjoin->params + $ingroupparams; $sql = "SELECT u.id FROM {user} u JOIN {groups_members} gm ON gm.userid = u.id {$enrolledjoin->joins} WHERE gm.groupid $ingroupsql AND {$enrolledjoin->wheres} ORDER BY $sort"; $users = $DB->get_records_sql($sql, $params); $nousermessage = get_string('usersnone', 'lesson'); } else { $nousermessage = get_string('groupsnone', 'lesson'); } $info = new \core_availability\info_module($cm); $users = $info->filter_user_list($users); if (empty($users)) { // There are no users. $canoverride = false; $errormessage = $nousermessage; } } // Initialise table. $table = new html_table(); $table->headspan = array(1, 2, 1); $table->colclasses = array('colname', 'colsetting', 'colvalue', 'colaction'); $table->head = array( $colname, get_string('overrides', 'lesson'), get_string('action'), ); $userurl = new moodle_url('/user/view.php', array()); $groupurl = new moodle_url('/group/overview.php', array('id' => $cm->course)); $overridedeleteurl = new moodle_url('/mod/lesson/overridedelete.php'); $overrideediturl = new moodle_url('/mod/lesson/overrideedit.php'); $hasinactive = false; // Whether there are any inactive overrides. foreach ($overrides as $override) { $fields = array(); $values = array(); $active = true; // Check for inactive overrides. if (!$groupmode) { if (!is_enrolled($context, $override->userid)) { // User not enrolled. $active = false; } else if (!\core_availability\info_module::is_user_visible($cm, $override->userid)) { // User cannot access the module. $active = false; } } // Format available. if (isset($override->available)) { $fields[] = get_string('lessonopens', 'lesson'); $values[] = $override->available > 0 ? userdate($override->available) : get_string('noopen', 'lesson'); } // Format deadline. if (isset($override->deadline)) { $fields[] = get_string('lessoncloses', 'lesson'); $values[] = $override->deadline > 0 ? userdate($override->deadline) : get_string('noclose', 'lesson'); } // Format timelimit. if (isset($override->timelimit)) { $fields[] = get_string('timelimit', 'lesson'); $values[] = $override->timelimit > 0 ? format_time($override->timelimit) : get_string('none', 'lesson'); } // Format option to try a question again. if (isset($override->review)) { $fields[] = get_string('displayreview', 'lesson'); $values[] = $override->review ? get_string('yes') : get_string('no'); } // Format number of attempts. if (isset($override->maxattempts)) { $fields[] = get_string('maximumnumberofattempts', 'lesson'); $values[] = $override->maxattempts > 0 ? $override->maxattempts : get_string('unlimited'); } // Format retake allowed. if (isset($override->retake)) { $fields[] = get_string('retakesallowed', 'lesson'); $values[] = $override->retake ? get_string('yes') : get_string('no'); } // Format password. if (isset($override->password)) { $fields[] = get_string('usepassword', 'lesson'); $values[] = $override->password !== '' ? get_string('enabled', 'lesson') : get_string('none', 'lesson'); } // Icons. $iconstr = ''; // Edit. $editurlstr = $overrideediturl->out(true, array('id' => $override->id)); $iconstr = '' . $OUTPUT->pix_icon('t/edit', get_string('edit')) . ' '; // Duplicate. $copyurlstr = $overrideediturl->out(true, array('id' => $override->id, 'action' => 'duplicate')); $iconstr .= '' . $OUTPUT->pix_icon('t/copy', get_string('copy')) . ' '; // Delete. $deleteurlstr = $overridedeleteurl->out(true, array('id' => $override->id, 'sesskey' => sesskey())); $iconstr .= '' . $OUTPUT->pix_icon('t/delete', get_string('delete')) . ' '; if ($groupmode) { $usergroupstr = '' . format_string($override->name, true, ['context' => $context]) . ''; } else { $usergroupstr = '' . fullname($override) . ''; } $class = ''; if (!$active) { $class = "dimmed_text"; $usergroupstr .= '*'; $hasinactive = true; } $usergroupcell = new html_table_cell(); $usergroupcell->rowspan = count($fields); $usergroupcell->text = $usergroupstr; $actioncell = new html_table_cell(); $actioncell->rowspan = count($fields); $actioncell->text = $iconstr; for ($i = 0; $i < count($fields); ++$i) { $row = new html_table_row(); $row->attributes['class'] = $class; if ($i == 0) { $row->cells[] = $usergroupcell; } $cell1 = new html_table_cell(); $cell1->text = $fields[$i]; $row->cells[] = $cell1; $cell2 = new html_table_cell(); $cell2->text = $values[$i]; $row->cells[] = $cell2; if ($i == 0) { $row->cells[] = $actioncell; } $table->data[] = $row; } } $overrideselect = new \mod_lesson\output\override_action_menu($cm->id, $url, $canoverride); echo $renderer->render($overrideselect); // Output the table and button. echo html_writer::start_tag('div', array('id' => 'lessonoverrides')); if (count($table->data)) { echo html_writer::table($table); } // No overrides to be displayed. if (!$overrides) { echo $OUTPUT->notification(get_string('nooverridecreated', 'lesson'), 'info', false); } if ($hasinactive) { echo $OUTPUT->notification(get_string('inactiveoverridehelp', 'lesson'), 'dimmed_text'); } echo html_writer::start_tag('div', array('class' => 'buttons')); if (!empty($errormessage)) { echo $OUTPUT->notification($errormessage, 'error'); } echo html_writer::end_tag('div'); echo html_writer::end_tag('div'); // Finish the page. echo $OUTPUT->footer(); home/smkb8269/public_html/lms.smk-almanshuriyah.sch.id/mod/assign/overrides.php000064400000032226152267116650023457 0ustar00. /** * This page handles listing of assign overrides * * @package mod_assign * @copyright 2016 Ilya Tregubov * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require_once(dirname(__FILE__) . '/../../config.php'); require_once($CFG->dirroot.'/mod/assign/lib.php'); require_once($CFG->dirroot.'/mod/assign/locallib.php'); require_once($CFG->dirroot.'/mod/assign/override_form.php'); $cmid = required_param('cmid', PARAM_INT); $mode = optional_param('mode', '', PARAM_ALPHA); // One of 'user' or 'group', default is 'group'. $action = optional_param('action', '', PARAM_ALPHA); $redirect = $CFG->wwwroot.'/mod/assign/overrides.php?cmid=' . $cmid . '&mode=group'; list($course, $cm) = get_course_and_cm_from_cmid($cmid, 'assign'); $assign = $DB->get_record('assign', array('id' => $cm->instance), '*', MUST_EXIST); require_login($course, false, $cm); $context = context_module::instance($cm->id); // Check the user has the required capabilities to list overrides. require_capability('mod/assign:manageoverrides', $context); $assigngroupmode = groups_get_activity_groupmode($cm); $accessallgroups = ($assigngroupmode == NOGROUPS) || has_capability('moodle/site:accessallgroups', $context); $overridecountgroup = $DB->count_records('assign_overrides', array('userid' => null, 'assignid' => $assign->id)); // Get the course groups that the current user can access. $groups = $accessallgroups ? groups_get_all_groups($cm->course) : groups_get_activity_allowed_groups($cm); // Default mode is "group", unless there are no groups. if ($mode != "user" and $mode != "group") { if (!empty($groups)) { $mode = "group"; } else { $mode = "user"; } } $groupmode = ($mode == "group"); $url = new moodle_url('/mod/assign/overrides.php', array('cmid' => $cm->id, 'mode' => $mode)); $PAGE->set_url($url); navigation_node::override_active_url(new moodle_url('/mod/assign/overrides.php', ['cmid' => $cmid])); if ($action == 'movegroupoverride') { $id = required_param('id', PARAM_INT); $dir = required_param('dir', PARAM_ALPHA); if (confirm_sesskey()) { move_group_override($id, $dir, $assign->id); } redirect($redirect); } // Display a list of overrides. $PAGE->set_pagelayout('admin'); $PAGE->add_body_class('limitedwidth'); $PAGE->set_title(get_string('overrides', 'assign')); $PAGE->set_heading($course->fullname); $activityheader = $PAGE->activityheader; $activityheader->set_attrs([ 'description' => '', 'hidecompletion' => true, 'title' => $activityheader->is_title_allowed() ? format_string($assign->name, true, ['context' => $context]) : "" ]); echo $OUTPUT->header(); echo $OUTPUT->heading(get_string('overrides', 'mod_assign'), 2); $overridemenu = new \mod_assign\output\override_actionmenu($url, $cm); $renderer = $PAGE->get_renderer('mod_assign'); echo $renderer->render($overridemenu); // Delete orphaned group overrides. $sql = 'SELECT o.id FROM {assign_overrides} o LEFT JOIN {groups} g ON o.groupid = g.id WHERE o.groupid IS NOT NULL AND g.id IS NULL AND o.assignid = ?'; $params = array($assign->id); $orphaned = $DB->get_records_sql($sql, $params); if (!empty($orphaned)) { $DB->delete_records_list('assign_overrides', 'id', array_keys($orphaned)); } $overrides = []; // Fetch all overrides. if ($groupmode) { $colname = get_string('group'); // To filter the result by the list of groups that the current user has access to. if ($groups) { $params = ['assignid' => $assign->id]; list($insql, $inparams) = $DB->get_in_or_equal(array_keys($groups), SQL_PARAMS_NAMED); $params += $inparams; $sql = "SELECT o.*, g.name FROM {assign_overrides} o JOIN {groups} g ON o.groupid = g.id WHERE o.assignid = :assignid AND g.id $insql ORDER BY o.sortorder"; $overrides = $DB->get_records_sql($sql, $params); } } else { $colname = get_string('user'); list($sort, $params) = users_order_by_sql('u'); $params['assignid'] = $assign->id; $userfieldsapi = \core_user\fields::for_name(); if ($accessallgroups) { $sql = 'SELECT o.*, ' . $userfieldsapi->get_sql('u', false, '', '', false)->selects . ' FROM {assign_overrides} o JOIN {user} u ON o.userid = u.id WHERE o.assignid = :assignid ORDER BY ' . $sort; $overrides = $DB->get_records_sql($sql, $params); } else if ($groups) { list($insql, $inparams) = $DB->get_in_or_equal(array_keys($groups), SQL_PARAMS_NAMED); $params += $inparams; $sql = 'SELECT o.*, ' . $userfieldsapi->get_sql('u', false, '', '', false)->selects . ' FROM {assign_overrides} o JOIN {user} u ON o.userid = u.id JOIN {groups_members} gm ON u.id = gm.userid WHERE o.assignid = :assignid AND gm.groupid ' . $insql . ' ORDER BY ' . $sort; $overrides = $DB->get_records_sql($sql, $params); } } // Initialise table. $table = new html_table(); $table->headspan = array(1, 2, 1); $table->colclasses = array('colname', 'colsetting', 'colvalue', 'colaction'); $table->head = array( $colname, get_string('overrides', 'assign'), get_string('action'), ); $userurl = new moodle_url('/user/view.php', array()); $groupurl = new moodle_url('/group/overview.php', array('id' => $cm->course)); $overridedeleteurl = new moodle_url('/mod/assign/overridedelete.php'); $overrideediturl = new moodle_url('/mod/assign/overrideedit.php'); $hasinactive = false; // Whether there are any inactive overrides. $PAGE->requires->js_call_amd('mod_assign/override_modal_manager', 'init', [$mode, !empty($assign->gradepenalty)]); foreach ($overrides as $override) { $fields = array(); $values = array(); $active = true; // Check for inactive overrides. if (!$groupmode) { if (!is_enrolled($context, $override->userid)) { // User not enrolled. $active = false; } else if (!\core_availability\info_module::is_user_visible($cm, $override->userid)) { // User cannot access the module. $active = false; } } // Format allowsubmissionsfromdate. if (isset($override->allowsubmissionsfromdate)) { $fields[] = get_string('open', 'assign'); $values[] = $override->allowsubmissionsfromdate > 0 ? userdate($override->allowsubmissionsfromdate) : get_string('noopen', 'assign'); } // Format duedate. if (isset($override->duedate)) { $fields[] = get_string('duedate', 'assign'); $values[] = $override->duedate > 0 ? userdate($override->duedate) : get_string('noclose', 'assign'); } // Format cutoffdate. if (isset($override->cutoffdate)) { $fields[] = get_string('cutoffdate', 'assign'); $values[] = $override->cutoffdate > 0 ? userdate($override->cutoffdate) : get_string('noclose', 'assign'); } // Format timelimit. $timelimitenabled = get_config('assign', 'enabletimelimit'); if ($timelimitenabled && isset($override->timelimit)) { $fields[] = get_string('timelimit', 'assign'); $values[] = $override->timelimit > 0 ? format_time($override->timelimit) : get_string('none', 'assign'); } // Icons. $iconstr = ''; // Edit. $editurlstr = $overrideediturl->out(true, array('id' => $override->id)); $iconstr = '' . $OUTPUT->pix_icon('t/edit', get_string('edit')) . ' '; // Duplicate. $copyurlstr = $overrideediturl->out(true, array('id' => $override->id, 'action' => 'duplicate')); $iconstr .= '' . $OUTPUT->pix_icon('t/copy', get_string('copy')) . ' '; // Delete. $deletelink = html_writer::link( "#", $OUTPUT->pix_icon('t/delete', get_string('delete')), [ 'class' => 'delete-override', 'data-overrideid' => $override->id, 'data-sesskey' => sesskey(), ], ); $iconstr .= $deletelink; if ($groupmode) { $usergroupstr = html_writer::link( $groupurl->out(true, ['group' => $override->groupid]), format_string($override->name, true, ['context' => $context]), ['class' => 'usergroupname'], ); // Move up. if ($override->sortorder > 1) { $iconstr .= '' . $OUTPUT->pix_icon('t/up', get_string('moveup')) . ' '; } else { $iconstr .= $OUTPUT->spacer() . ' '; } // Move down. if ($override->sortorder < $overridecountgroup) { $iconstr .= '' . $OUTPUT->pix_icon('t/down', get_string('movedown')) . ' '; } else { $iconstr .= $OUTPUT->spacer() . ' '; } } else { $usergroupstr = html_writer::link( $userurl->out(false, ['id' => $override->userid, 'course' => $course->id]), fullname($override), ['class' => 'usergroupname'], ); } $class = ''; if (!$active) { $class = "dimmed_text"; $usergroupstr .= '*'; $hasinactive = true; } $usergroupcell = new html_table_cell(); $usergroupcell->rowspan = count($fields); $usergroupcell->text = $usergroupstr; $actioncell = new html_table_cell(); $actioncell->rowspan = count($fields); $actioncell->text = $iconstr; for ($i = 0; $i < count($fields); ++$i) { $row = new html_table_row(); $row->attributes['class'] = $class; if ($i == 0) { $row->cells[] = $usergroupcell; } $cell1 = new html_table_cell(); $cell1->text = $fields[$i]; $row->cells[] = $cell1; $cell2 = new html_table_cell(); $cell2->text = $values[$i]; $row->cells[] = $cell2; if ($i == 0) { $row->cells[] = $actioncell; } $table->data[] = $row; } } // Output the table and button. echo html_writer::start_tag('div', array('id' => 'assignoverrides')); if (count($table->data)) { echo html_writer::table($table); } else { if ($groupmode) { echo $OUTPUT->notification(get_string('nogroupoverrides', 'mod_assign'), 'info'); } else { echo $OUTPUT->notification(get_string('nouseroverrides', 'mod_assign'), 'info'); } } if ($hasinactive) { echo $OUTPUT->notification(get_string('inactiveoverridehelp', 'assign'), 'dimmed_text'); } echo html_writer::start_tag('div', array('class' => 'buttons')); $options = array(); if ($groupmode) { if (empty($groups)) { // There are no groups. echo $OUTPUT->notification(get_string('groupsnone', 'assign'), 'error'); $options['disabled'] = true; } } else { $users = array(); // See if there are any users in the assign. if ($accessallgroups) { $users = get_enrolled_users($context, '', 0, 'u.id'); $nousermessage = get_string('usersnone', 'assign'); } else if ($groups) { $enrolledjoin = get_enrolled_join($context, 'u.id'); list($ingroupsql, $ingroupparams) = $DB->get_in_or_equal(array_keys($groups), SQL_PARAMS_NAMED); $params = $enrolledjoin->params + $ingroupparams; $sql = "SELECT u.id FROM {user} u JOIN {groups_members} gm ON gm.userid = u.id {$enrolledjoin->joins} WHERE gm.groupid $ingroupsql AND {$enrolledjoin->wheres} ORDER BY $sort"; $users = $DB->get_records_sql($sql, $params); $nousermessage = get_string('usersnone', 'assign'); } else { $nousermessage = get_string('groupsnone', 'assign'); } $info = new \core_availability\info_module($cm); $users = $info->filter_user_list($users); if (empty($users)) { // There are no users. echo $OUTPUT->notification($nousermessage, 'error'); $options['disabled'] = true; } } echo html_writer::end_tag('div'); echo html_writer::end_tag('div'); // Finish the page. echo $OUTPUT->footer();