Skip to content

Commit

Permalink
Fix to use non deprecated URL constructor and support mobile app
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewhancox committed Sep 30, 2020
1 parent 58c2a64 commit 4605712
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
13 changes: 4 additions & 9 deletions filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -911,15 +911,10 @@ function ($matches) {
}
$courseurl = new moodle_url('/course/view.php', array('id' => $courseid ));
$content .= '
<div class="card shadow mr-4 mb-4 ml-1" style="min-width:300px;max-width:300px;">
<a href="' . $courseurl . '" class="text-normal h-100">
<div class="card-img-top" style="background-image:url(' . $imgurl
. ');height:100px;max-width:300px;padding-top:50%;background-size:cover;'
. 'background-repeat:no-repeat;background-position:center;"></div>
<div class="card-title pt-1 pr-3 pb-1 pl-3 m-0">' . $course->get_formatted_name() . '</div>
</a>
</div>
';
<div class="filtercodes_coursecards card shadow mr-4 mb-4 ml-1">
<div class="card-img-top"><a href="' . $courseurl . '" class="text-normal h-100"><img src="' . $imgurl .'"></a></div>
<div class="card-title pt-1 pr-3 pb-1 pl-3 m-0"><a href="' . $courseurl . '">' . $course->get_formatted_name() . '</a></div>
</div>';
}
}
$replace['/'.$placeholder.'/i'] = !empty($header) ? $header . $content . $footer : '';
Expand Down
22 changes: 22 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
div.filtercodes_coursecards.card {
min-width: 300px;
max-width: 300px;
height: 300px;
}

div.filtercodes_coursecards div.card-img-top {
max-width: 300px;
text-align: center;
align-content: center;
height: 250px;
}

div.filtercodes_coursecards div.card-img-top img {
padding-top: 10px;
max-width: 100%;
max-height: 200px;
}

div.filtercodes_coursecards.card div.card-title {
height: 50px;
}
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2020070100; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2020070102; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2014051200; // Requires Moodle version 2.7.
$plugin->component = 'filter_filtercodes'; // Full name of the plugin (used for diagnostics).
$plugin->release = '2.0.0';
Expand Down

0 comments on commit 4605712

Please sign in to comment.