diff --git a/interface.php b/interface.php index f0112c3..2d51808 100644 --- a/interface.php +++ b/interface.php @@ -303,13 +303,32 @@ function get_last_viewed() { $categorymeta = get_meta_for('category'); $lva = get_config('block_custom_course_menu')->lastviewedamount; if ($CFG->version < 2014051200) { // Moodle < 2.7. - $sql = "SELECT * FROM {log} a INNER JOIN (SELECT c.*,course, MAX(time) as time FROM {log} l JOIN {course} c ON - c.id=l.course WHERE userid='$USER->id' AND course != 1 AND module='course' GROUP BY course) b ON - a.course = b.course AND a.time = b.time GROUP BY a.course ORDER BY b.time DESC LIMIT $lva)"; + $sql = "SELECT * + FROM {log} a + INNER JOIN (SELECT c.*, course, MAX(time) as time + FROM {log} l + JOIN {course} c + ON c.id = l.course + WHERE userid = '$USER->id' + AND course != 1 + AND module = 'course' + GROUP BY course) b + ON a.course = b.course + AND a.time = b.time + GROUP BY a.course + ORDER BY b.time DESC + LIMIT $lva"; } else { // Moodle 2.7+. - $sql = "SELECT a.courseid, max(a.timecreated) as date, a.userid FROM (SELECT * FROM {logstore_standard_log} - WHERE courseid !=0 and courseid !=1) as a WHERE a.userid='$USER->id' GROUP BY a.userid,a.courseid ORDER BY date - DESC LIMIT $lva"; + $sql = "SELECT a.courseid, max(a.timecreated) as date, a.userid + FROM (SELECT * + FROM {logstore_standard_log} + WHERE courseid !=0 + AND courseid !=1) AS a + WHERE a.userid = '$USER->id' + AND a.origin != 'cli' + GROUP BY a.userid, a.courseid + ORDER BY date DESC + LIMIT $lva"; } $latestcourses = $DB->get_records_sql($sql); diff --git a/styles.css b/styles.css index 1f033d2..99c3e68 100644 --- a/styles.css +++ b/styles.css @@ -9,19 +9,19 @@ content: "\f205"; } .block_custom_course_menu #custom_course_menu_interface { + clear: both; float: right; margin: -10px 5px; text-decoration: none; - clear: both; } .block_custom_course_menu ul.custom_course_menu_category_list { - padding-left: 0; - margin: 0; list-style: none; + margin: 0; + padding-left: 0; } .block_custom_course_menu input[type='text'] { - width: 80%; max-width: 250px; + width: 80%; } .handle { cursor: move; @@ -37,26 +37,25 @@ display: none; } .block_custom_course_menu ul.custom_course_menu_category_list li { - margin-bottom: 0; - list-style: none; font-weight: bold; + list-style: none; + margin-bottom: 0; } -.block_custom_course_menu ul.custom_course_menu_category_list li.inconspicuous -.courselist_course span { +.block_custom_course_menu ul.custom_course_menu_category_list li.inconspicuous .courselist_course span { text-decoration: line-through; } .block_custom_course_menu ul.custom_course_menu_category_list ul { - padding-left: 0; + list-style: none; + margin-bottom: 0; margin-left: 0; margin-top: 0; - margin-bottom: 0; - list-style: none; + padding-left: 0; } .block_custom_course_menu ul.custom_course_menu_category_list ul li { - margin-left: 0.5em; - margin-bottom: 0; - list-style: none; font-weight: normal; + list-style: none; + margin-bottom: 0; + margin-left: 0.5em; } .block_custom_course_menu ul.custom_course_menu_list.inconspicuous, .block_custom_course_menu ul.custom_course_menu_list.collapsed { @@ -70,12 +69,12 @@ } .block_custom_course_menu .scrollable { display: inline-block; - max-width: 98%; - white-space: nowrap; line-height: 20px; - vertical-align: middle; + max-width: 98%; overflow: hidden; text-overflow: ellipsis; + vertical-align: middle; + white-space: nowrap; } .block_custom_course_menu span.scrollable { max-width: 90%; @@ -84,14 +83,14 @@ max-width: 73%; } .block_custom_course_menu .scrollable span { - left: 0%; - width: 100%; - position: relative; - -webkit-transition: left 5s, width 5s; -moz-transition: left 5s, width 5s; - transition: left 5s, width 5s; + -webkit-transition: left 5s, width 5s; -webkit-transition-delay: 1.5s; /* Safari */ + left: 0; + position: relative; + transition: left 5s, width 5s; transition-delay: 1.5s; + width: 100%; } .block_custom_course_menu .scrollable span:hover { left: -100%; @@ -115,20 +114,20 @@ width: 1px; } .ui-helper-reset { - margin: 0; - padding: 0; border: 0; - outline: 0; - line-height: 1.3; - text-decoration: none; font-size: 100%; + line-height: 1.3; list-style: none; + margin: 0; + outline: 0; + padding: 0; + text-decoration: none; } .ui-helper-clearfix:before, .ui-helper-clearfix:after { + border-collapse: collapse; content: ""; display: table; - border-collapse: collapse; } .ui-helper-clearfix:after { clear: both; @@ -137,13 +136,13 @@ min-height: 0; /* support: IE7 */ } .ui-helper-zfix { - width: 100%; + filter: alpha(Opacity=0); height: 100%; - top: 0; left: 0; - position: absolute; opacity: 0; - filter: alpha(Opacity=0); + position: absolute; + top: 0; + width: 100%; } .ui-front { z-index: 100; @@ -157,18 +156,18 @@ ----------------------------------*/ /* states and images */ .ui-icon { + background-repeat: no-repeat; display: block; - text-indent: -99999px; overflow: hidden; - background-repeat: no-repeat; + text-indent: -99999px; } /* Misc visuals ----------------------------------*/ /* Overlays */ .ui-widget-overlay { + height: 100%; + left: 0; position: fixed; top: 0; - left: 0; width: 100%; - height: 100%; }