diff --git a/amd/build/format_card.min.js b/amd/build/format_card.min.js index 665e8fc..98b01bf 100644 --- a/amd/build/format_card.min.js +++ b/amd/build/format_card.min.js @@ -1,2 +1,2 @@ -define(["jquery","core/ajax","core/notification","format_remuiformat/common","./format_card_ordering"],function(i,t,o,a,e){return{init:function(){var r=function(i,o,a){return t.call([{methodname:"format_remuiformat_show_activity_in_row",args:{courseid:i,sectionid:o,activityid:a}}])[0]};i(document).ready(function(){i("body").is(".editing")&&e.init()}),i(".single-card").css({opacity:0,visibility:"visible"}).animate({opacity:1},600,"swing"),i(".remui-format-card.single-section-format .activity-cards .actions .toggle-row-column").on("click",function(){var t=i("[data-courseid]").data("courseid"),a=i("[data-sectionid]").data("sectionid"),e=i(this).data("activityid"),c=i(this);r(t,a,e).done(function(t){"row"==t.type?i(c).closest(".col-activity").removeClass("col-activity").addClass("row-activity"):i(c).closest(".row-activity").addClass("col-activity").removeClass("row-activity")}).fail(o.exception)}),i(".read-more-target .no-overflow").height()<110&&i(".read-more-trigger, .fadeout-summary").hide(),a.init()}}}); +define(["jquery","core/ajax","core/notification","format_remuiformat/common","./format_card_ordering"],function(i,t,o,a,r){return{init:function(){var e=function(i,o,a){return t.call([{methodname:"format_remuiformat_show_activity_in_row",args:{courseid:i,sectionid:o,activityid:a}}])[0]};i(document).ready(function(){i("body").is(".editing")&&r.init()}),i(".remui-format-card.single-section-format .activity-cards .actions .toggle-row-column").on("click",function(){var t=i("[data-courseid]").data("courseid"),a=i("[data-sectionid]").data("sectionid"),r=i(this).data("activityid"),c=i(this);e(t,a,r).done(function(t){"row"==t.type?i(c).closest(".col-activity").removeClass("col-activity").addClass("row-activity"):i(c).closest(".row-activity").addClass("col-activity").removeClass("row-activity")}).fail(o.exception)}),i(".read-more-target .no-overflow").height()<110&&i(".read-more-trigger, .fadeout-summary").hide(),a.init()}}}); //# sourceMappingURL=format_card.min.js.map diff --git a/amd/build/format_card.min.js.map b/amd/build/format_card.min.js.map index 0f16cdd..5934cfd 100644 --- a/amd/build/format_card.min.js.map +++ b/amd/build/format_card.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["format_card.js"],"names":["define","$","Ajax","Notification","common","ordering","init","PROMISES","courseid","sectionid","activityid","call","methodname","args","document","ready","is","css","opacity","visibility","animate","on","data","section","activity","this","selector","done","response","type","closest","removeClass","addClass","fail","exception","height","hide"],"mappings":"AAuBAA,OAAO,CACH,SACA,YACA,oBACA,4BACA,0BACD,SAASC,EAAGC,EAAMC,EAAcC,EAAQC,GAgEvC,MAAO,CACHC,KA/DJ,WAMI,IAAIC,EAQsB,SAASC,EAAUC,EAAWC,GAChD,OAAOR,EAAKS,KAAK,CAAC,CACdC,WAAY,0CACZC,KAAM,CACFL,SAAUA,EACVC,UAAWA,EACXC,WAAYA,MAEhB,IAKZT,EAAEa,UAAUC,MAAM,WACVd,EAAE,QAAQe,GAAG,aACbX,EAASC,SAIjBL,EAAE,gBAAgBgB,IAAI,CAAEC,QAAS,EAAKC,WAAY,YAAcC,QAAQ,CAAEF,QAAS,GAAQ,IAAK,SAGhGjB,EAAE,wFAAwFoB,GAAG,QAAS,WAClG,IAAIb,EAAWP,EAAE,mBAAmBqB,KAAK,YACrCC,EAAUtB,EAAE,oBAAoBqB,KAAK,aACrCE,EAAWvB,EAAEwB,MAAMH,KAAK,cACxBI,EAAWzB,EAAEwB,MACjBlB,EAA8BC,EAAUe,EAASC,GAChDG,KAAK,SAASC,GACU,OAAjBA,EAASC,KACT5B,EAAEyB,GAAUI,QAAQ,iBAAiBC,YAAY,gBAAgBC,SAAS,gBAE1E/B,EAAEyB,GAAUI,QAAQ,iBAAiBE,SAAS,gBAAgBD,YAAY,kBAGjFE,KAAK9B,EAAa+B,aAIHjC,EAAE,kCAAkCkC,SACpC,KAChBlC,EAAE,wCAAwCmC,OAG9ChC,EAAOE","sourcesContent":["// This file is part of Moodle - http://moodle.org/\r\n//\r\n// Moodle is free software: you can redistribute it and/or modify\r\n// it under the terms of the GNU General Public License as published by\r\n// the Free Software Foundation, either version 3 of the License, or\r\n// (at your option) any later version.\r\n//\r\n// Moodle is distributed in the hope that it will be useful,\r\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n// GNU General Public License for more details.\r\n//\r\n// You should have received a copy of the GNU General Public License\r\n// along with Moodle. If not, see .\r\n\r\n/**\r\n * Enhancements to Cards components for easy course accessibility.\r\n *\r\n * @module format/remuiformat\r\n * @copyright WisdmLabs\r\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\r\n */\r\n\r\ndefine([\r\n 'jquery',\r\n 'core/ajax',\r\n 'core/notification',\r\n 'format_remuiformat/common',\r\n './format_card_ordering'\r\n], function($, Ajax, Notification, common, ordering) {\r\n\r\n function init() {\r\n\r\n /**\r\n * Ajax promises\r\n * @type {Object}\r\n */\r\n var PROMISES = {\r\n\r\n /**\r\n * Toggle activity view type. Either row or column\r\n * @param {integer} courseid Current course id\r\n * @param {integer} sectionid Current Section id\r\n * @param {integer} activityid Selected activity id\r\n */\r\n SHOW_ACTIVITY_IN_ROW: function(courseid, sectionid, activityid) {\r\n return Ajax.call([{\r\n methodname: \"format_remuiformat_show_activity_in_row\",\r\n args: {\r\n courseid: courseid,\r\n sectionid: sectionid,\r\n activityid: activityid\r\n }\r\n }])[0];\r\n }\r\n }\r\n\r\n var cardminHeight = 200;\r\n $(document).ready(function() {\r\n if ($('body').is('.editing')) {\r\n ordering.init();\r\n }\r\n });\r\n\r\n $('.single-card').css({ opacity: 0.0, visibility: \"visible\", }).animate({ opacity: 1.0, }, 600, \"swing\");\r\n\r\n // Call AJAX to set activity layout (Row or Card).\r\n $('.remui-format-card.single-section-format .activity-cards .actions .toggle-row-column').on('click', function() {\r\n var courseid = $('[data-courseid]').data('courseid');\r\n var section = $('[data-sectionid]').data('sectionid');\r\n var activity = $(this).data('activityid');\r\n var selector = $(this);\r\n PROMISES.SHOW_ACTIVITY_IN_ROW(courseid, section, activity)\r\n .done(function(response) {\r\n if (response.type == 'row') {\r\n $(selector).closest('.col-activity').removeClass('col-activity').addClass('row-activity');\r\n } else {\r\n $(selector).closest('.row-activity').addClass('col-activity').removeClass('row-activity');\r\n }\r\n })\r\n .fail(Notification.exception);\r\n });\r\n\r\n // ... + Show full summary label show conditionally.\r\n var summaryheight = $('.read-more-target .no-overflow').height();\r\n if (summaryheight < 110) {\r\n $('.read-more-trigger, .fadeout-summary').hide();\r\n }\r\n\r\n common.init();\r\n }\r\n // Must return the init function.\r\n\r\n return {\r\n init: init\r\n };\r\n});\r\n"],"file":"format_card.min.js"} \ No newline at end of file +{"version":3,"sources":["format_card.js"],"names":["define","$","Ajax","Notification","common","ordering","init","PROMISES","courseid","sectionid","activityid","call","methodname","args","document","ready","is","on","data","section","activity","this","selector","done","response","type","closest","removeClass","addClass","fail","exception","height","hide"],"mappings":"AAuBAA,OAAO,CACH,SACA,YACA,oBACA,4BACA,0BACD,SAASC,EAAGC,EAAMC,EAAcC,EAAQC,GA8DvC,MAAO,CACHC,KA7DJ,WAMI,IAAIC,EAQsB,SAASC,EAAUC,EAAWC,GAChD,OAAOR,EAAKS,KAAK,CAAC,CACdC,WAAY,0CACZC,KAAM,CACFL,SAAUA,EACVC,UAAWA,EACXC,WAAYA,MAEhB,IAKZT,EAAEa,UAAUC,MAAM,WACVd,EAAE,QAAQe,GAAG,aACbX,EAASC,SAKjBL,EAAE,wFAAwFgB,GAAG,QAAS,WAClG,IAAIT,EAAWP,EAAE,mBAAmBiB,KAAK,YACrCC,EAAUlB,EAAE,oBAAoBiB,KAAK,aACrCE,EAAWnB,EAAEoB,MAAMH,KAAK,cACxBI,EAAWrB,EAAEoB,MACjBd,EAA8BC,EAAUW,EAASC,GAChDG,KAAK,SAASC,GACU,OAAjBA,EAASC,KACTxB,EAAEqB,GAAUI,QAAQ,iBAAiBC,YAAY,gBAAgBC,SAAS,gBAE1E3B,EAAEqB,GAAUI,QAAQ,iBAAiBE,SAAS,gBAAgBD,YAAY,kBAGjFE,KAAK1B,EAAa2B,aAIH7B,EAAE,kCAAkC8B,SACpC,KAChB9B,EAAE,wCAAwC+B,OAG9C5B,EAAOE","sourcesContent":["// This file is part of Moodle - http://moodle.org/\r\n//\r\n// Moodle is free software: you can redistribute it and/or modify\r\n// it under the terms of the GNU General Public License as published by\r\n// the Free Software Foundation, either version 3 of the License, or\r\n// (at your option) any later version.\r\n//\r\n// Moodle is distributed in the hope that it will be useful,\r\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n// GNU General Public License for more details.\r\n//\r\n// You should have received a copy of the GNU General Public License\r\n// along with Moodle. If not, see .\r\n\r\n/**\r\n * Enhancements to Cards components for easy course accessibility.\r\n *\r\n * @module format/remuiformat\r\n * @copyright WisdmLabs\r\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\r\n */\r\n\r\ndefine([\r\n 'jquery',\r\n 'core/ajax',\r\n 'core/notification',\r\n 'format_remuiformat/common',\r\n './format_card_ordering'\r\n], function($, Ajax, Notification, common, ordering) {\r\n\r\n function init() {\r\n\r\n /**\r\n * Ajax promises\r\n * @type {Object}\r\n */\r\n var PROMISES = {\r\n\r\n /**\r\n * Toggle activity view type. Either row or column\r\n * @param {integer} courseid Current course id\r\n * @param {integer} sectionid Current Section id\r\n * @param {integer} activityid Selected activity id\r\n */\r\n SHOW_ACTIVITY_IN_ROW: function(courseid, sectionid, activityid) {\r\n return Ajax.call([{\r\n methodname: \"format_remuiformat_show_activity_in_row\",\r\n args: {\r\n courseid: courseid,\r\n sectionid: sectionid,\r\n activityid: activityid\r\n }\r\n }])[0];\r\n }\r\n }\r\n\r\n var cardminHeight = 200;\r\n $(document).ready(function() {\r\n if ($('body').is('.editing')) {\r\n ordering.init();\r\n }\r\n });\r\n\r\n // Call AJAX to set activity layout (Row or Card).\r\n $('.remui-format-card.single-section-format .activity-cards .actions .toggle-row-column').on('click', function() {\r\n var courseid = $('[data-courseid]').data('courseid');\r\n var section = $('[data-sectionid]').data('sectionid');\r\n var activity = $(this).data('activityid');\r\n var selector = $(this);\r\n PROMISES.SHOW_ACTIVITY_IN_ROW(courseid, section, activity)\r\n .done(function(response) {\r\n if (response.type == 'row') {\r\n $(selector).closest('.col-activity').removeClass('col-activity').addClass('row-activity');\r\n } else {\r\n $(selector).closest('.row-activity').addClass('col-activity').removeClass('row-activity');\r\n }\r\n })\r\n .fail(Notification.exception);\r\n });\r\n\r\n // ... + Show full summary label show conditionally.\r\n var summaryheight = $('.read-more-target .no-overflow').height();\r\n if (summaryheight < 110) {\r\n $('.read-more-trigger, .fadeout-summary').hide();\r\n }\r\n\r\n common.init();\r\n }\r\n // Must return the init function.\r\n\r\n return {\r\n init: init\r\n };\r\n});\r\n"],"file":"format_card.min.js"} \ No newline at end of file diff --git a/amd/src/format_card.js b/amd/src/format_card.js index af96627..f7605c6 100644 --- a/amd/src/format_card.js +++ b/amd/src/format_card.js @@ -62,8 +62,6 @@ define([ } }); - $('.single-card').css({ opacity: 0.0, visibility: "visible", }).animate({ opacity: 1.0, }, 600, "swing"); - // Call AJAX to set activity layout (Row or Card). $('.remui-format-card.single-section-format .activity-cards .actions .toggle-row-column').on('click', function() { var courseid = $('[data-courseid]').data('courseid'); diff --git a/changes.txt b/changes.txt index c93ed98..a9770ce 100644 --- a/changes.txt +++ b/changes.txt @@ -1,3 +1,10 @@ +Version 1.0.9 +Fixes +* Fixed resource creation using drag and drop. +* Fixed activity deletion issue with card layout. +* Fixed video playback issue with card layout section description. +* Fixed remui sidebar issue with Course format. + Version 1.0.8 Fixes * Removed bootstrap classes from plugin CSS. @@ -40,7 +47,7 @@ Version 1.0.4 Fixes * Fixed issue when course layout resets on course restore. * Fixed multi-language support for section/topic summary in card format. -* Fixed language support issue in activity count showed in the general section in card format. +* Fixed language support issue in activity count showed in the general section in card format. * General section image changes when changed in the other duplicated course in List format. Tweaks diff --git a/classes/course_format_data_common_trait.php b/classes/course_format_data_common_trait.php index 1a9d4f4..fdd055f 100644 --- a/classes/course_format_data_common_trait.php +++ b/classes/course_format_data_common_trait.php @@ -13,7 +13,6 @@ // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . - /** * This is built using the bootstrapbase template to allow for new theme's using Moodle's new Bootstrap theme engine * @@ -475,7 +474,7 @@ public static function get_dummy_color_for_id($id) { /** * Fetches the last viewed activity from the database table mdl_logstore_standard_log. * - * @param int $course Course ID. + * @param object $course Course ID. * @return string Last viewed activity. */ public function get_activity_to_resume($course) { diff --git a/classes/external/api.php b/classes/external/api.php index b65762d..7ed3ede 100644 --- a/classes/external/api.php +++ b/classes/external/api.php @@ -13,7 +13,6 @@ // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . - /** * Provides format_remuiformat\external\api class. * diff --git a/classes/external/course_progress_data.php b/classes/external/course_progress_data.php index 32056f5..2e77e6d 100644 --- a/classes/external/course_progress_data.php +++ b/classes/external/course_progress_data.php @@ -13,7 +13,6 @@ // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . - /** * Provides format_remuiformat\external\course_progress_data trait. * @@ -105,7 +104,7 @@ public static function course_progress_data($courseid) { public static function course_progress_data_returns() { return new external_single_structure ( array( - 'percentage' => new external_value(PARAM_NUMBER, 'Course completion percentage'), + 'percentage' => new external_value(PARAM_FLOAT, 'Course completion percentage'), 'activitylist' => new external_multiple_structure( new external_value(PARAM_TEXT, 'Activity count details'), 'Acitvity count list' diff --git a/classes/external/move_activities.php b/classes/external/move_activities.php index cfb97db..b3da10b 100644 --- a/classes/external/move_activities.php +++ b/classes/external/move_activities.php @@ -13,7 +13,6 @@ // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . - /** * Provides format_remuiformat\external\move_activities trait. * diff --git a/classes/external/move_activity_to_section.php b/classes/external/move_activity_to_section.php index 3097759..278db41 100644 --- a/classes/external/move_activity_to_section.php +++ b/classes/external/move_activity_to_section.php @@ -13,7 +13,6 @@ // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . - /** * Provides format_remuiformat\external\move_activity_to_section trait. * diff --git a/classes/external/show_activity_in_row.php b/classes/external/show_activity_in_row.php index 866703c..c26c8ab 100644 --- a/classes/external/show_activity_in_row.php +++ b/classes/external/show_activity_in_row.php @@ -13,7 +13,6 @@ // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . - /** * Provides format_remuiformat\external\show_activity_in_row trait. * diff --git a/classes/mod_stats.php b/classes/mod_stats.php index 01df946..879f4b4 100644 --- a/classes/mod_stats.php +++ b/classes/mod_stats.php @@ -13,7 +13,6 @@ // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . - /** * This is built using the bootstrapbase template to allow for new theme's using Moodle's new Bootstrap theme engine * diff --git a/classes/output/card_all_sections_summary_renderable.php b/classes/output/card_all_sections_summary_renderable.php index b87284c..d935da6 100644 --- a/classes/output/card_all_sections_summary_renderable.php +++ b/classes/output/card_all_sections_summary_renderable.php @@ -13,7 +13,6 @@ // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . - /** * Sinigle Section Renderable - A topics based format that uses card layout to diaply the content. * @@ -179,8 +178,8 @@ private function get_card_format_context(&$export, $renderer, $editing, $rformat $generalsectionsummary, 400 ); $export->generalsection['fullsummary'] = $generalsectionsummary; - // Get course image if added. + // Get course image if added. $imgurl = $this->courseformatdatacommontrait->display_file($this->settings['remuicourseimage_filemanager']); $imgurl = $this->courseformatdatacommontrait->display_file($this->settings['remuicourseimage_filemanager']); if (empty($imgurl)) { diff --git a/classes/output/card_one_section_renderable.php b/classes/output/card_one_section_renderable.php index 0e68ca3..8c2689c 100644 --- a/classes/output/card_one_section_renderable.php +++ b/classes/output/card_one_section_renderable.php @@ -13,7 +13,6 @@ // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . - /** * Activity Renderable - A topics based format that uses card layout to diaply the content. * @@ -211,7 +210,8 @@ private function get_activities_details($section, $displayoptions = array()) { $activitydetails->move = course_get_cm_move($mod, $section->section); $activitydetails->title = $this->courserenderer->course_section_cm_name($mod, $displayoptions); $activitydetails->title .= $mod->afterlink; - $activitydetails->modulename = $mod->modfullname; + $activitydetails->modulename = $mod->modname; + $activitydetails->modulefullname = $mod->modfullname; $activitydetails->summary = $this->modstats->get_formatted_summary( $this->courserenderer->course_section_cm_text($mod, $displayoptions), $this->settings diff --git a/classes/output/list_all_sections_renderable.php b/classes/output/list_all_sections_renderable.php index 708d305..a0d481c 100644 --- a/classes/output/list_all_sections_renderable.php +++ b/classes/output/list_all_sections_renderable.php @@ -13,7 +13,6 @@ // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . - /** * Sinigle Section Renderable - A topics based format that uses card layout to diaply the content. * diff --git a/classes/output/list_all_sections_summary_renderable.php b/classes/output/list_all_sections_summary_renderable.php index a7ca605..2d68f0d 100644 --- a/classes/output/list_all_sections_summary_renderable.php +++ b/classes/output/list_all_sections_summary_renderable.php @@ -13,7 +13,6 @@ // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . - /** * Sinigle Section Renderable - A topics based format that uses card layout to diaply the content. * diff --git a/classes/output/list_one_section_renderable.php b/classes/output/list_one_section_renderable.php index 8a56a3d..c4bddfc 100644 --- a/classes/output/list_one_section_renderable.php +++ b/classes/output/list_one_section_renderable.php @@ -13,7 +13,6 @@ // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . - /** * Activity Renderable - A topics based format that uses card layout to diaply the content. * @@ -118,9 +117,9 @@ public function export_for_template(renderer_base $output) { // Check if the section is hidden section. if (!$sectioninfo->uservisible) { - if (!$course->hiddensections) { + if (!$this->course->hiddensections) { $export->hiddensection = $renderer->start_section_list(); - $export->hiddensection .= $renderer->section_hidden($displaysection, $this->course->id); + $export->hiddensection .= $renderer->section_hidden($this->displaysection, $this->course->id); $export->hiddensection .= $renderer->end_section_list(); } // Can't view this section. diff --git a/classes/usage_tracking.php b/classes/usage_tracking.php index 6ae55f8..489a642 100644 --- a/classes/usage_tracking.php +++ b/classes/usage_tracking.php @@ -13,7 +13,6 @@ // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . - /** * Edwiser Usage Tracking. * @@ -51,7 +50,6 @@ public function send_usage_analytics() { // TODO: A check needs to be added here, that user has agreed to send this data. // TODO: We will have to add a settings checkbox for that or something similar. - $lastsentdata = isset($CFG->usage_data_last_sent_format_remuiformat) ? $CFG->usage_data_last_sent_format_remuiformat : false; @@ -110,9 +108,7 @@ private function prepare_usage_analytics() { 'active_theme' => @$CFG->theme, // Include only with format type remuicourseformat. 'total_courses' => $DB->count_records('course', array('format' => 'remuiformat')), - // Includes hidden categories. 'total_categories' => $DB->count_records('course_categories'),. 'total_users' => $DB->count_records('user', array('deleted' => 0)), // Exclude deleted. - // Along with versions. 'installed_plugins' => $this->get_user_installed_plugins(),. 'system_version' => @$CFG->release, // Moodle version. 'system_lang' => @$CFG->lang, 'system_settings' => array( diff --git a/db/upgrade.php b/db/upgrade.php index 276cbe6..2d69c51 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -13,7 +13,6 @@ // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . - /** * This file keeps track of upgrades to the navigation block * diff --git a/format.php b/format.php index e95a006..a6ece9c 100644 --- a/format.php +++ b/format.php @@ -13,7 +13,6 @@ // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . - /** * Cards Format - A topics based format that uses card layout to diaply the content. * @@ -44,8 +43,8 @@ debugging('Outdated topic param passed to course/view.php', DEBUG_DEVELOPER); redirect($url); } -// End backwards-compatible aliasing.. +// End backwards-compatible aliasing. $coursecontext = context_course::instance($course->id); // Retrieve course format option fields and add them to the $course object. diff --git a/lang/en/format_remuiformat.php b/lang/en/format_remuiformat.php index 527aa5b..eb609b8 100644 --- a/lang/en/format_remuiformat.php +++ b/lang/en/format_remuiformat.php @@ -13,7 +13,6 @@ // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . - /** * Strings for component 'format_remuiformat' * @@ -87,7 +86,7 @@ $string['coursecompletionprogress'] = 'Course Progress'; $string['resumetoactivity'] = 'Resume'; -// For list. +// For list format. $string['remuicourseformat'] = 'Choose layout'; $string['remuicourseformat_card'] = 'Card Layout'; $string['remuicourseformat_list'] = 'List Layout'; diff --git a/lib.php b/lib.php index 7ae883e..f994823 100644 --- a/lib.php +++ b/lib.php @@ -13,7 +13,6 @@ // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . - /** * Cards Format - A topics based format that uses card layout to display the activities/section/topics. * @@ -639,8 +638,8 @@ public function update_course_format_options($data, $sectionid = null) { $data->remuicourseimage_filemanager = ''; } if (!empty($data)) { - // Used optional_param() instead of using $_POST and $_GET. + // Used optional_param() instead of using $_POST and $_GET. $contextid = context_course::instance($this->courseid); if (!empty($data->remuicourseimage_filemanager)) { file_postupdate_standard_filemanager( diff --git a/renderer.php b/renderer.php index 2fe5af5..b3c9317 100644 --- a/renderer.php +++ b/renderer.php @@ -13,7 +13,6 @@ // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . - /** * Cards Format - A topics based format that uses card layout to diaply the content. * @@ -467,7 +466,6 @@ public function change_number_sections($course, $sectionreturn = null) { // Current course format has 'numsections' option, which is very confusing and we suggest course format // developers to get rid of it (see MDL-57769 on how to do it). // Display "Increase section" / "Decrease section" links. - echo html_writer::start_tag('div', array('id' => 'changenumsections', 'class' => 'mdl-right')); // Increase number of sections. @@ -497,7 +495,6 @@ public function change_number_sections($course, $sectionreturn = null) { // Display the "Add section" link that will insert a section in the end. // Note to course format developers: inserting sections in the other positions should check both // capabilities 'moodle/course:update' and 'moodle/course:movesections'. - echo html_writer::start_tag('div', array('id' => 'changenumsections', 'class' => 'mdl-right')); if (get_string_manager()->string_exists('addsections', 'format_'.$course->format)) { $straddsections = get_string('addsections', 'format_'.$course->format); @@ -543,7 +540,6 @@ public function change_number_sections_context($course, $sectionreturn = null) { // Current course format has 'numsections' option, which is very confusing and we suggest course format. // developers to get rid of it (see MDL-57769 on how to do it). // Display "Increase section" / "Decrease section" links. - $straddsection = get_string('increasesections', 'moodle'); // Increase number of sections. @@ -580,7 +576,6 @@ public function change_number_sections_context($course, $sectionreturn = null) { // Display the "Add section" link that will insert a section in the end. // Note to course format developers: inserting sections in the other positions should check both // capabilities 'moodle/course:update' and 'moodle/course:movesections'. - $addnewsection->numsections = 0; if (get_string_manager()->string_exists('addsections', 'format_'.$course->format)) { @@ -726,11 +721,13 @@ public function abstract_html_contents($value, $limit = 100) { $value = mb_strimwidth($value, 6, mb_strwidth($value, 'UTF-8') - 13, '', 'UTF-8'); // and . // Remove empty tags. - $value = preg_replace( - '/<(\w+)\b(?:\s+[\w\-.:]+(?:\s*=\s*(?:"[^"]*"|"[^"]*"|[\w\-.:]+))?)*\s*\/?>\s*<\/\1\s*>/', - '', - $value - ); + if (stripos("\s*<\/\1\s*>/', + '', + $value + ); + } // Return. return $value; diff --git a/scss/card-layout.scss b/scss/card-layout.scss index eea9097..1152687 100644 --- a/scss/card-layout.scss +++ b/scss/card-layout.scss @@ -128,6 +128,7 @@ @media (min-width: 768px) { .general-section-activities .activity { flex: 0 0 33.33%; + width: 33.33%; & > div { width: 100%; } @@ -141,6 +142,7 @@ @media (max-width: 767px) { .general-section-activities .activity { flex: 0 0 50%; + width: 50%;; & > div { width: 100%; } @@ -163,9 +165,6 @@ border-bottom: 16px solid; border-bottom-color: transparent; } - .summary + [data-draggroups="resource"] { - display: none; - } .right.side { display: flex; @@ -188,7 +187,6 @@ // Styling for section cards .single-card { - visibility: hidden; min-height: 340px; margin-bottom: 1.75rem; padding-bottom: 50px; @@ -354,6 +352,11 @@ } // Styling for single section page &.single-section-format { + .section.main { + background: transparent; + border: 0; + box-shadow: none; + } .section-details { padding: 1rem 1rem 0; } @@ -410,20 +413,18 @@ width: 100%; } // Show activity as column. - &.col-activity { - display: flex; - @media (max-width: 767px) { - flex: 0 0 100%; - width: 100%; - } - @media (min-width: 768px) and (max-width: 1200px) { - flex: 0 0 50%; - width: 50%; - } - @media (min-width: 1201px) { - flex: 0 0 33.33%; - width: 33.33%; - } + display: flex; + @media (max-width: 767px) { + flex: 0 0 100%; + width: 100%; + } + @media (min-width: 768px) and (max-width: 1200px) { + flex: 0 0 50%; + width: 50%; + } + @media (min-width: 1201px) { + flex: 0 0 33.33%; + width: 33.33%; } .wdm-mod-name { margin-bottom: 0.5rem; @@ -503,6 +504,9 @@ } } } + .contentwithoutlink { + padding: 0; + } .single-card { a:hover { text-decoration: none; diff --git a/scss/list-layout.scss b/scss/list-layout.scss index 3dee445..13ddb44 100644 --- a/scss/list-layout.scss +++ b/scss/list-layout.scss @@ -217,6 +217,17 @@ .sections { list-style: none; .section { + &:not(#section-0) { + .content { + background: white; + } + } + &.main { + background: transparent; + border: 0; + box-shadow: none; + padding: 0; + } // Highliging current section .highlight { position: absolute; diff --git a/scss/styles.scss b/scss/styles.scss index d092e29..820365c 100644 --- a/scss/styles.scss +++ b/scss/styles.scss @@ -8,6 +8,16 @@ body#page-course-view-remuiformat { } } + &.editing { + .general-section-activities { + .activity { + &:nth-last-child(2) { + margin-right: auto; + } + } + } + } + .general-section-activities { display: flex; flex-wrap: wrap; @@ -296,27 +306,27 @@ body#page-course-view-remuiformat { } .w-full { - width: 100% !important; + width: 100%; } .d-flex { - display: flex !important; + display: flex; } .d-block { - display: block !important; + display: block; } .mdl-right { - text-align: right !important; + text-align: right; } .float-right { - float: right !important; + float: right; } .align-items-center { - align-items: center !important; + align-items: center; } // Show More / Show Less Button diff --git a/settings.php b/settings.php index 27d74db..58021e5 100644 --- a/settings.php +++ b/settings.php @@ -13,7 +13,6 @@ // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . - /** * Cards Format - A topics based format that uses card layout to diaply the content. * diff --git a/styles.css b/styles.css index fb6810c..a6b3c68 100644 --- a/styles.css +++ b/styles.css @@ -95,6 +95,7 @@ body#page-course-view-remuiformat .remui-format-card { @media (min-width: 768px) { body#page-course-view-remuiformat .remui-format-card.all-section-format .general-section-activities .activity { flex: 0 0 33.33%; + width: 33.33%; } body#page-course-view-remuiformat .remui-format-card.all-section-format .general-section-activities .activity > div { width: 100%; @@ -107,6 +108,7 @@ body#page-course-view-remuiformat .remui-format-card { @media (max-width: 767px) { body#page-course-view-remuiformat .remui-format-card.all-section-format .general-section-activities .activity { flex: 0 0 50%; + width: 50%; } body#page-course-view-remuiformat .remui-format-card.all-section-format .general-section-activities .activity > div { width: 100%; @@ -129,10 +131,6 @@ body#page-course-view-remuiformat .remui-format-card.all-section-format .section border-bottom-color: transparent; } -body#page-course-view-remuiformat .remui-format-card.all-section-format .section .summary + [data-draggroups="resource"] { - display: none; -} - body#page-course-view-remuiformat .remui-format-card.all-section-format .section .right.side { display: flex; } @@ -154,7 +152,6 @@ body#page-course-view-remuiformat .remui-format-card.all-section-format .section } body#page-course-view-remuiformat .remui-format-card.all-section-format .section .single-card { - visibility: hidden; min-height: 340px; margin-bottom: 1.75rem; padding-bottom: 50px; @@ -329,6 +326,12 @@ body#page-course-view-remuiformat .remui-format-card.all-section-format #section height: 140px; } +body#page-course-view-remuiformat .remui-format-card.single-section-format .section.main { + background: transparent; + border: 0; + box-shadow: none; +} + body#page-course-view-remuiformat .remui-format-card.single-section-format .section-details { padding: 1rem 1rem 0; } @@ -358,6 +361,7 @@ 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 { transition: all 0.5s ease; padding: 2rem 1rem 0rem; + display: flex; } body#page-course-view-remuiformat .remui-format-card.single-section-format .activity-cards .activity:hover { @@ -397,26 +401,22 @@ body#page-course-view-remuiformat .remui-format-card.single-section-format .acti width: 100%; } -body#page-course-view-remuiformat .remui-format-card.single-section-format .activity-cards .activity.col-activity { - display: flex; -} - @media (max-width: 767px) { - body#page-course-view-remuiformat .remui-format-card.single-section-format .activity-cards .activity.col-activity { + body#page-course-view-remuiformat .remui-format-card.single-section-format .activity-cards .activity { flex: 0 0 100%; width: 100%; } } @media (min-width: 768px) and (max-width: 1200px) { - body#page-course-view-remuiformat .remui-format-card.single-section-format .activity-cards .activity.col-activity { + body#page-course-view-remuiformat .remui-format-card.single-section-format .activity-cards .activity { flex: 0 0 50%; width: 50%; } } @media (min-width: 1201px) { - body#page-course-view-remuiformat .remui-format-card.single-section-format .activity-cards .activity.col-activity { + body#page-course-view-remuiformat .remui-format-card.single-section-format .activity-cards .activity { flex: 0 0 33.33%; width: 33.33%; } @@ -489,6 +489,10 @@ body#page-course-view-remuiformat .remui-format-card.single-section-format .acti display: none; } +body#page-course-view-remuiformat .remui-format-card .contentwithoutlink { + padding: 0; +} + body#page-course-view-remuiformat .remui-format-card .single-card a:hover { text-decoration: none; } @@ -692,6 +696,17 @@ body#page-course-view-remuiformat .remui-format-list .sections .section { width: 100%; } +body#page-course-view-remuiformat .remui-format-list .sections .section:not(#section-0) .content { + background: white; +} + +body#page-course-view-remuiformat .remui-format-list .sections .section.main { + background: transparent; + border: 0; + box-shadow: none; + padding: 0; +} + body#page-course-view-remuiformat .remui-format-list .sections .section .highlight { position: absolute; top: 0; @@ -841,6 +856,10 @@ body#page-course-view-remuiformat .remui-format-card .hide, body#page-course-vie display: none; } +body#page-course-view-remuiformat.editing .general-section-activities .activity:nth-last-child(2) { + margin-right: auto; +} + body#page-course-view-remuiformat .general-section-activities { display: flex; flex-wrap: wrap; @@ -1125,27 +1144,27 @@ body#page-course-view-remuiformat #changenumsections i.fa { } body#page-course-view-remuiformat .w-full { - width: 100% !important; + width: 100%; } body#page-course-view-remuiformat .d-flex { - display: flex !important; + display: flex; } body#page-course-view-remuiformat .d-block { - display: block !important; + display: block; } body#page-course-view-remuiformat .mdl-right { - text-align: right !important; + text-align: right; } body#page-course-view-remuiformat .float-right { - float: right !important; + float: right; } body#page-course-view-remuiformat .align-items-center { - align-items: center !important; + align-items: center; } body#page-course-view-remuiformat .showactivitywrapper { diff --git a/templates/card_general_section_edit.mustache b/templates/card_general_section_edit.mustache index a9fc5de..124ccab 100644 --- a/templates/card_general_section_edit.mustache +++ b/templates/card_general_section_edit.mustache @@ -65,7 +65,7 @@ ] } }} -
  • +
  • @@ -108,7 +108,7 @@ {{/activityexists}}
    -
      +
        {{#activities}}
      • diff --git a/templates/card_one_section.mustache b/templates/card_one_section.mustache index ebfad14..b671445 100644 --- a/templates/card_one_section.mustache +++ b/templates/card_one_section.mustache @@ -36,6 +36,7 @@ "viewurl": "viewurl", "title": "title", "modulename": "modulename", + "modulefullname": "Module full name", "summary": "summary", "completed": "completed", "hidden": "hidden", @@ -55,7 +56,7 @@
          -
        • +
        • {{#editing}} @@ -83,12 +84,12 @@ {{#editing}} {{{move}}} {{/editing}} -
          {{ modulename }}
          +
          {{ modulefullname }}
          {{#editing}}
          - {{# pix }} + {{# pix }} ecf-cols, format_remuiformat, {{# str }} showincard, format_remuiformat {{/ str }} {{/ pix }} diff --git a/templates/list_general_section_edit.mustache b/templates/list_general_section_edit.mustache index c0b9039..b74c5e8 100644 --- a/templates/list_general_section_edit.mustache +++ b/templates/list_general_section_edit.mustache @@ -50,7 +50,7 @@ ] } }} -
        • +
        • {{#rightside}}
          diff --git a/templates/list_sections.mustache b/templates/list_sections.mustache index cdb8b93..45be284 100644 --- a/templates/list_sections.mustache +++ b/templates/list_sections.mustache @@ -58,7 +58,7 @@ {{/addsection}} {{^addsection}} -
        • +
        • {{#highlighted}}
          {{/highlighted}}
          diff --git a/version.php b/version.php index 7096208..9356a63 100644 --- a/version.php +++ b/version.php @@ -13,7 +13,6 @@ // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . - /** * Version details * @@ -24,8 +23,8 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2020090200; // The current plugin version (Date: YYYYMMDDXX). -$plugin->release = '1.0.8'; +$plugin->version = 2020092900; // The current plugin version (Date: YYYYMMDDXX). +$plugin->release = '1.0.9'; $plugin->requires = 2017111300; // Requires this Moodle version (Moodle V3.4.0). $plugin->maturity = MATURITY_STABLE; $plugin->component = 'format_remuiformat'; // Full name of the plugin (used for diagnostics).