diff --git a/changes.txt b/changes.txt index ebf7451..59aa305 100644 --- a/changes.txt +++ b/changes.txt @@ -1,5 +1,10 @@ CHANGES LOG +Version 4.1.7 +============= +Feature - Compatibility with Moodle 4.4. +Tweak - Further UI/UX improvements done + Version 4.1.6 ============= Tweak - UI improvement in Course header for teachers information. @@ -34,7 +39,7 @@ Version 4.1.1 ============= Fix - Input field editable text visibility when background image is available on section cards. Tweak - Next/Prev button design changes. -Tweak - Minor design updates on card width of section and activities. +Tweak - Minor design updates on card width of section and activities. Version 4.1.0 ============= diff --git a/classes/course_format_data_common_trait.php b/classes/course_format_data_common_trait.php index a20eb7a..159b115 100644 --- a/classes/course_format_data_common_trait.php +++ b/classes/course_format_data_common_trait.php @@ -30,6 +30,8 @@ use core_completion\progress; use core\activity_dates; use core_course\output\activity_completion; +use core_tag\reportbuilder\local\entities\instance; + require_once($CFG->dirroot.'/course/format/remuiformat/classes/mod_stats.php'); /** @@ -234,7 +236,7 @@ public function get_list_activities_details($section, $course, $courserenderer, * @return array Sections data */ public function get_all_section_data($renderer, $editing, $rformat, $settings, $course, $courseformat, $courserenderer) { - global $USER; + global $USER , $OUTPUT, $CFG; $modinfo = get_fast_modinfo($course); $context = context_course::instance($course->id); $startfrom = 1; @@ -249,7 +251,7 @@ public function get_all_section_data($renderer, $editing, $rformat, $settings, $ $data->index = $sectionindex; $data->num = $section->section; $data->id = $section->id; - $data->sectionreturnid = course_get_format($course)->get_section_number(); + $data->sectionreturnid = $this->edw_get_section_num(course_get_format($course)); $data->insertafter = false; // Check if the user has permission to view this section or not. @@ -311,6 +313,9 @@ public function get_all_section_data($renderer, $editing, $rformat, $settings, $ if (!$section->visible) { $data->ishidden = true; $data->notavailable = true; + // $visibilityclass = $courseformat->get_output_classname('content\\section\\visibility'); + // $visibility = new $visibilityclass($courseformat, $section); + // $data->visibility = $visibility->export_for_template($OUTPUT); if (has_capability('moodle/course:viewhiddensections', $context, $USER)) { $data->hiddenfromstudents = true; $data->notavailable = false; @@ -367,6 +372,10 @@ public function get_all_section_data($renderer, $editing, $rformat, $settings, $ $data->activityinfostring = implode($extradetails['activityinfo']); $data->progressinfo = $extradetails['progressinfo']; $data->checkrightsidecontent = true; + if($CFG->backup_release > '4.3'){ + $data->sectionpageurl = $CFG->wwwroot."/course/section.php?id=".$section->id; + $data->showsectionpageurlbtn = true; + } if(!$course->enablecompletion){ $data->progressinfo = false; } @@ -939,7 +948,7 @@ public function get_opendue_status(&$activitydetails, $availstatus, $mod) { * @return array Output array */ private function get_activities_details($section, $course, $courserenderer, $settings, $displayoptions = array()) { - global $PAGE, $USER; + global $PAGE, $USER, $CFG; $modinfo = get_fast_modinfo($course); $output = array(); @@ -1147,4 +1156,13 @@ public function add_generalsection_data(&$export, $renderer, $editing, $course, } } + public function edw_get_section_num($obj){ + global $CFG; + if($CFG->backup_release > '4.3'){ + return $obj->get_sectionnum(); + }else{ + return $obj->get_section_number(); + } + + } } diff --git a/classes/output/card_all_sections_summary_renderable.php b/classes/output/card_all_sections_summary_renderable.php index acebe55..9738e7a 100644 --- a/classes/output/card_all_sections_summary_renderable.php +++ b/classes/output/card_all_sections_summary_renderable.php @@ -29,7 +29,7 @@ use templatable; use stdClass; -require_once($CFG->dirroot.'/course/format/renderer.php'); +// require_once($CFG->dirroot.'/course/format/renderer.php'); require_once($CFG->dirroot.'/course/renderer.php'); require_once($CFG->dirroot.'/course/format/remuiformat/classes/mod_stats.php'); require_once($CFG->dirroot.'/course/format/remuiformat/classes/course_format_data_common_trait.php'); diff --git a/classes/output/card_one_section_renderable.php b/classes/output/card_one_section_renderable.php index 007ee67..9341cc0 100644 --- a/classes/output/card_one_section_renderable.php +++ b/classes/output/card_one_section_renderable.php @@ -31,7 +31,7 @@ use html_writer; use context_course; use core_completion\progress; -require_once($CFG->dirroot.'/course/format/renderer.php'); +// require_once($CFG->dirroot.'/course/format/renderer.php'); require_once($CFG->dirroot.'/course/format/remuiformat/classes/mod_stats.php'); require_once($CFG->dirroot.'/course/format/remuiformat/classes/course_format_data_common_trait.php'); require_once($CFG->dirroot.'/course/format/remuiformat/lib.php'); diff --git a/classes/output/courseformat/content/section.php b/classes/output/courseformat/content/section.php index c4a8ac1..a90364f 100644 --- a/classes/output/courseformat/content/section.php +++ b/classes/output/courseformat/content/section.php @@ -44,8 +44,9 @@ public function export_for_template(\renderer_base $output): stdClass { $format = $this->format; $data = parent::export_for_template($output); + $courseformatdatacommontrait = \format_remuiformat\course_format_data_common_trait::getinstance(); - if (!$this->format->get_section_number()) { + if (!$courseformatdatacommontrait->edw_get_section_num($this->format)) { $addsectionclass = $format->get_output_classname('content\\addsection'); $addsection = new $addsectionclass($format); $data->numsections = $addsection->export_for_template($output); diff --git a/classes/output/courseformat/content/section/controlmenu.php b/classes/output/courseformat/content/section/controlmenu.php index 26da07c..a2c2b9f 100644 --- a/classes/output/courseformat/content/section/controlmenu.php +++ b/classes/output/courseformat/content/section/controlmenu.php @@ -54,7 +54,8 @@ public function section_control_items() { $format = $this->format; $section = $this->section; $course = $format->get_course(); - $sectionreturn = $format->get_section_number(); + $courseformatdatacommontrait = \format_remuiformat\course_format_data_common_trait::getinstance(); + $sectionreturn = $courseformatdatacommontrait->edw_get_section_num($format);; $coursecontext = context_course::instance($course->id); diff --git a/classes/output/list_all_sections_renderable.php b/classes/output/list_all_sections_renderable.php index bf419b9..918324e 100644 --- a/classes/output/list_all_sections_renderable.php +++ b/classes/output/list_all_sections_renderable.php @@ -30,7 +30,7 @@ use stdClass; use context_course; -require_once($CFG->dirroot.'/course/format/renderer.php'); +// require_once($CFG->dirroot.'/course/format/renderer.php'); require_once($CFG->dirroot.'/course/renderer.php'); require_once($CFG->dirroot.'/course/format/remuiformat/classes/mod_stats.php'); require_once($CFG->dirroot.'/course/format/remuiformat/classes/course_format_data_common_trait.php'); diff --git a/classes/output/list_all_sections_summary_renderable.php b/classes/output/list_all_sections_summary_renderable.php index 206635d..8760752 100644 --- a/classes/output/list_all_sections_summary_renderable.php +++ b/classes/output/list_all_sections_summary_renderable.php @@ -30,7 +30,7 @@ use stdClass; use context_course; -require_once($CFG->dirroot.'/course/format/renderer.php'); +// require_once($CFG->dirroot.'/course/format/renderer.php'); require_once($CFG->dirroot.'/course/renderer.php'); require_once($CFG->dirroot.'/course/format/remuiformat/classes/mod_stats.php'); require_once($CFG->dirroot.'/course/format/remuiformat/classes/course_format_data_common_trait.php'); diff --git a/classes/output/list_one_section_renderable.php b/classes/output/list_one_section_renderable.php index 55c3771..8daee00 100644 --- a/classes/output/list_one_section_renderable.php +++ b/classes/output/list_one_section_renderable.php @@ -31,7 +31,7 @@ use html_writer; use context_course; use core_completion\progress; -require_once($CFG->dirroot.'/course/format/renderer.php'); +// require_once($CFG->dirroot.'/course/format/renderer.php'); require_once($CFG->dirroot.'/course/format/remuiformat/classes/mod_stats.php'); require_once($CFG->dirroot.'/course/format/remuiformat/lib.php'); diff --git a/lang/en/format_remuiformat.php b/lang/en/format_remuiformat.php index c86e99b..cbe7394 100644 --- a/lang/en/format_remuiformat.php +++ b/lang/en/format_remuiformat.php @@ -23,7 +23,7 @@ // Plugin Name. $string['pluginname'] = 'Edwiser course formats'; - +$string['plugin_description'] = 'Courses are presented as collapsible lists OR as cards of sections with a responsive design for better navigation.'; // Settings. $string['defaultcoursedisplay'] = 'Course display default'; $string['defaultcoursedisplay_desc'] = "Either show all the sections on a single page or section zero and the chosen section on page."; diff --git a/lib.php b/lib.php index 39ce1a9..ed46a7a 100644 --- a/lib.php +++ b/lib.php @@ -637,7 +637,7 @@ public function allow_stealth_module_visibility($cm, $section) { * @return null|array|stdClass any data for the Javascript post-processor (must be json-encodeable) */ public function section_action($section, $action, $sr) { - global $PAGE; + global $PAGE, $CFG; if ($action == 'deleteSection') { return null; @@ -652,7 +652,13 @@ public function section_action($section, $action, $sr) { // For show/hide actions call the parent method and return the new content for .section_availability element. $rv = parent::section_action($section, $action, $sr); $renderer = $PAGE->get_renderer('format_topics'); - $rv['section_availability'] = $renderer->section_availability($this->get_section($section)); + $format = course_get_format($this->courseid); + if($CFG->backup_release > '4.3'){ + $rv['section_availability'] = new \core_courseformat\output\local\content\section\availability($format, $this->get_section($section)); + }else{ + $rv['section_availability'] = $renderer->section_availability($this->get_section($section)); + } + return $rv; } diff --git a/renderer.php b/renderer.php index 5d4540c..fb7286d 100644 --- a/renderer.php +++ b/renderer.php @@ -22,7 +22,7 @@ */ defined('MOODLE_INTERNAL') || die(); -require_once($CFG->dirroot.'/course/format/renderer.php'); +// require_once($CFG->dirroot.'/course/format/renderer.php'); require_once($CFG->dirroot.'/course/format/remuiformat/classes/mod_stats.php'); use core_courseformat\output\section_renderer; @@ -80,7 +80,8 @@ public function __construct(moodle_page $page, $target) { * @return object courserenderer */ public function get_base_renderer() { - return $this->courserenderer; + global $PAGE; + return $PAGE->get_renderer('core_course'); } /** diff --git a/scss/card-layout.scss b/scss/card-layout.scss index 38f4e9d..fa185f7 100644 --- a/scss/card-layout.scss +++ b/scss/card-layout.scss @@ -611,6 +611,8 @@ } // Toggle row column button styling .toggle-row-column { + padding: 6px 5px; + width: 33px; border: $border-height solid #e4eaec; img.icon { margin: 0; diff --git a/scss/list-layout.scss b/scss/list-layout.scss index 8fc28f8..2092ae6 100644 --- a/scss/list-layout.scss +++ b/scss/list-layout.scss @@ -224,6 +224,11 @@ border: $border-height solid $light-border; } + &.collapsed{ + .summary.card-text{ + display: none; + } + } .content { .panel-title, @@ -431,7 +436,11 @@ li:not(:last-child) { margin-bottom: $margin-16; } + li:has(.divider.bulk-hidden){ + margin-bottom: 0px; + } .activity{ + border-top: 0; .activitytitle { gap: $gap-24; @media (max-width:$sm-screen-bp) { diff --git a/scss/styles.scss b/scss/styles.scss index ad0bf20..413cac1 100644 --- a/scss/styles.scss +++ b/scss/styles.scss @@ -273,9 +273,23 @@ body#page-course-view-remuiformat { } .action-menu-trigger, .action-menu { - .dropdown-toggle::after { - display: none; + .dropdown-toggle::after { + display: none; + } + + .dropdown-subpanel { + .dropdown-toggle{ + display: flex; + justify-content: space-between; + align-items: center; + &::before { + display: inline-block; + order: 3; + transform: rotate(180deg); + font-size: 10px; + } } + } } .stretched-link::after { display: none; @@ -653,6 +667,9 @@ body#page-course-view-remuiformat { text-align: left; color: $paragraph-color; } + .activityinstance{ + position: relative; + } } } } @@ -1023,3 +1040,8 @@ body#page-course-view-remuiformat { } } } +.section{ + .dndupload-preview-overlay,.dndupload-preview-wrapper{ + display: none; + } +} diff --git a/styles.css b/styles.css index 4af24b5..423c171 100644 --- a/styles.css +++ b/styles.css @@ -633,6 +633,8 @@ body#page-course-view-remuiformat .remui-format-card.single-section-format .acti body#page-course-view-remuiformat .remui-format-card.single-section-format .activity-cards .activity .toggle-row-column, body#page-course-view-remuiformat .remui-format-card.single-section-format .activity-cards.section .activity .toggle-row-column { + padding: 6px 5px; + width: 33px; border: 1px solid #e4eaec; } @@ -964,6 +966,10 @@ body#page-course-view-remuiformat .remui-format-list .sections .section:not(#sec border: 1px solid #EBF0F9; } +body#page-course-view-remuiformat .remui-format-list .sections .section.collapsed .summary.card-text { + display: none; +} + body#page-course-view-remuiformat .remui-format-list .sections .section .content .panel-title, body#page-course-view-remuiformat .remui-format-list .sections .section .content h3 a { margin: 0px; @@ -1189,6 +1195,16 @@ body#page-course-view-remuiformat .remui-format-list .card-footer ul.section li: margin-bottom: 16px; } +body#page-course-view-remuiformat .remui-format-list .activities-list ul.section li:has(.divider.bulk-hidden), +body#page-course-view-remuiformat .remui-format-list .card-footer ul.section li:has(.divider.bulk-hidden) { + margin-bottom: 0px; +} + +body#page-course-view-remuiformat .remui-format-list .activities-list ul.section .activity, +body#page-course-view-remuiformat .remui-format-list .card-footer ul.section .activity { + border-top: 0; +} + body#page-course-view-remuiformat .remui-format-list .activities-list ul.section .activity .activitytitle, body#page-course-view-remuiformat .remui-format-list .card-footer ul.section .activity .activitytitle { gap: 24px; @@ -1354,13 +1370,7 @@ body#page-course-view-remuiformat .remui-format-list .section_availability.cours body#page-course-view-remuiformat .remui-format-list .activity-item .activity-grid { grid-template-rows: 1fr repeat(6, -webkit-min-content); grid-template-rows: 1fr repeat(6, min-content); - grid-template-areas: "icon name groupmode completion actions" - "icon visibility groupmode completion actions" - "icon visibility groupmode completion actions" - "dates dates dates dates dates" - "altcontent altcontent altcontent altcontent altcontent" - "afterlink afterlink afterlink afterlink afterlink" - "availability availability availability availability availability"; + grid-template-areas: "icon name groupmode completion actions" "icon visibility groupmode completion actions" "icon visibility groupmode completion actions" "dates dates dates dates dates" "altcontent altcontent altcontent altcontent altcontent" "afterlink afterlink afterlink afterlink afterlink" "availability availability availability availability availability"; } body#page-course-view-remuiformat .remui-format-list .activity-item .activity-grid .activity-dates { @@ -1689,6 +1699,22 @@ body#page-course-view-remuiformat.editing .action-menu .dropdown-toggle::after { display: none; } +body#page-course-view-remuiformat.editing .action-menu-trigger .dropdown-subpanel .dropdown-toggle, +body#page-course-view-remuiformat.editing .action-menu .dropdown-subpanel .dropdown-toggle { + display: flex; + justify-content: space-between; + align-items: center; +} + +body#page-course-view-remuiformat.editing .action-menu-trigger .dropdown-subpanel .dropdown-toggle::before, +body#page-course-view-remuiformat.editing .action-menu .dropdown-subpanel .dropdown-toggle::before { + display: inline-block; + order: 3; + -webkit-transform: rotate(180deg); + transform: rotate(180deg); + font-size: 10px; +} + body#page-course-view-remuiformat.editing .stretched-link::after { display: none; } @@ -2068,6 +2094,10 @@ body#page-course-view-remuiformat .course-content .sections #section-0 .general- color: #4C5A73; } +body#page-course-view-remuiformat .course-content .sections #section-0 .general-section .activities-wrapper .general-section-activities .activity .activityinstance { + position: relative; +} + body#page-course-view-remuiformat .course-content .sections #section-0 .general-section .showactivity { font-size: 14px; line-height: 17px; @@ -2396,3 +2426,7 @@ body#page-course-view-remuiformat .availabilityinfo.isrestricted ul { body#page-course-view-remuiformat.limitedwidth header.hasbackground.design-1 .header-sub-section .progress-resume-wrapper { flex-direction: column; } + +.section .dndupload-preview-overlay, .section .dndupload-preview-wrapper { + display: none; +} diff --git a/templates/card_general_section.mustache b/templates/card_general_section.mustache index 5e13317..0004017 100644 --- a/templates/card_general_section.mustache +++ b/templates/card_general_section.mustache @@ -112,7 +112,8 @@ {{#modhiddenfromstudents}}