From 87adac62efdbf826b08978a7162d32827e94068b Mon Sep 17 00:00:00 2001 From: Tobias Baden <tobias.baden@stud.hs-hannover.de> Date: Wed, 10 Apr 2019 14:16:23 +0200 Subject: [PATCH] Fixed most Code-Checker Errors Some MOODLE_INTERNAL-Errors still missing --- amd/build/jmodule.min.js | 4 +- amd/build/listselect.min.js | 2 +- amd/src/jmodule.js | 38 ++++++------ amd/src/listselect.js | 10 +-- block_hshcourselist.php | 107 +++++++++++++++++--------------- edit_form.php | 10 +-- hshcourselist.php | 5 +- lang/en/block_hshcourselist.php | 4 +- style.css | 2 +- version.php | 4 +- 10 files changed, 97 insertions(+), 89 deletions(-) diff --git a/amd/build/jmodule.min.js b/amd/build/jmodule.min.js index 52ff6a2..a272613 100644 --- a/amd/build/jmodule.min.js +++ b/amd/build/jmodule.min.js @@ -1,2 +1,2 @@ -/*! hshcourselist 2018-08-31 */ -define(["jquery"],function(a){function b(b,c,d,e,f,g,h,i,j){c&&(a("#hshcourseprogress").show(),a.ajax({type:"GET",url:j+"/blocks/hshcourselist/hshcourselist.php",data:"course="+b+"&instanceid="+e+"&sesskey="+f+"&contextid="+g+"&idSearching="+h+"&orderbysemester="+i,dataType:"json",success:function(b){var c=JSON.stringify(b),e=JSON.parse(c),f=a("<ul class='list-group' id='hshcourselistul'></ul>");e.length>0&&a.each(e,function(b,c){switch(d){case"0":displaystr=c.shortname;break;case"1":displaystr=c.fullname;break;case"2":displaystr=c.shortname+": "+c.fullname;break;default:displaystr=c.fullname}a('<li class="list-group-item hshcoursesearchlistitem " value="'+c.id+'"><a href="'+j+"/course/view.php?id="+c.id+'">'+displaystr+"</a> </li>").appendTo(f)}),a("#hshcourselistul").replaceWith(f),a("#hshcourseprogress").hide()},error:function(a){console.error("error "+JSON.stringify(a))}}))}return{init:function(c,d){var e,c=c,f=c.instanceid,g=c.sesskey,h=c.displaymode,i=c.contextid,j=!1,k=!1,l=c.orderbysemester;a("#hshcourseprogress").hide(),a(".idSarchingLabel").hide(),a("#orderbysemestercheckbox_id").on("change",function(){l=document.getElementById("orderbysemestercheckbox_id").checked,j=!0,e=document.getElementById("hshcourselistsearch").value,e=e.replace(/%/g,""),e=e.trim(),"#"===e.slice(0,1)?(a(".idSarchingLabel").show(),k=!0,e=e.slice(1)):(a(".idSarchingLabel").hide(),k=!1),(1==k||e.length>=3)&&b(e,j,h,f,g,i,k,l,d)}),a("#hshcourselistsearch").on("keyup",function(c){var m=c.keyCode;l=document.getElementById("orderbysemestercheckbox_id").checked,40!==m&&38!==m&&13!==m&&(j=!0,e=document.getElementById("hshcourselistsearch").value,e=e.replace(/%/g,""),e=e.trim(),"#"===e.slice(0,1)?(a(".idSarchingLabel").show(),k=!0,e=e.slice(1)):(a(".idSarchingLabel").hide(),k=!1),(1==k||e.length>=3)&&b(e,j,h,f,g,i,k,l,d))}),a("#hshcourseform").on("submit",function(a){a.preventDefault,j=!0,k=!1,l=document.getElementById("orderbysemestercheckbox_id").checked,e=document.getElementById("hshcourselistsearch").value,e=e.replace(/%/g,""),e=e.trim(),"#"===e.slice(0,1)?(k=!0,e=e.slice(1)):k=!1,(1==k||e.length>=3)&&b(e,j,h,f,g,i,k,l,d)})}}}); \ No newline at end of file +/*! hshcourselist 2019-04-10 */ +define(["jquery"],function(a){function b(b,c,d,e,f,g,h,i,j){c&&(a("#hshcourseprogress").show(),a.ajax({type:"GET",url:j+"/blocks/hshcourselist/hshcourselist.php",data:"course="+b+"&instanceid="+e+"&sesskey="+f+"&contextid="+g+"&idsearching="+h+"&orderbysemester="+i,dataType:"json",success:function(b){var c=JSON.stringify(b),e=JSON.parse(c),f=a("<ul class='list-group' id='hshcourselistul'></ul>");e.length>0&&a.each(e,function(b,c){switch(d){case"0":displaystr=c.shortname;break;case"1":displaystr=c.fullname;break;case"2":displaystr=c.shortname+": "+c.fullname;break;default:displaystr=c.fullname}a('<li class="list-group-item hshcoursesearchlistitem " value="'+c.id+'"><a href="'+j+"/course/view.php?id="+c.id+'">'+displaystr+"</a> </li>").appendTo(f)}),a("#hshcourselistul").replaceWith(f),a("#hshcourseprogress").hide()},error:function(a){console.error("error "+JSON.stringify(a))}}))}return{init:function(c,d){var e,c=c,f=c.instanceid,g=c.sesskey,h=c.displaymode,i=c.contextid,j=!1,k=!1,l=c.orderbysemester;a("#hshcourseprogress").hide(),a(".idSarchingLabel").hide(),a("#orderbysemestercheckbox_id").on("change",function(){l=document.getElementById("orderbysemestercheckbox_id").checked,j=!0,e=document.getElementById("hshcourselistsearch").value,e=e.replace(/%/g,""),e=e.trim(),"#"===e.slice(0,1)?(a(".idSarchingLabel").show(),k=!0,e=e.slice(1)):(a(".idSarchingLabel").hide(),k=!1),(1==k||e.length>=3)&&b(e,j,h,f,g,i,k,l,d)}),a("#hshcourselistsearch").on("keyup",function(c){var m=c.keyCode;l=document.getElementById("orderbysemestercheckbox_id").checked,40!==m&&38!==m&&13!==m&&(j=!0,e=document.getElementById("hshcourselistsearch").value,e=e.replace(/%/g,""),e=e.trim(),"#"===e.slice(0,1)?(a(".idSarchingLabel").show(),k=!0,e=e.slice(1)):(a(".idSarchingLabel").hide(),k=!1),(1==k||e.length>=3)&&b(e,j,h,f,g,i,k,l,d))}),a("#hshcourseform").on("submit",function(a){a.preventDefault,j=!0,k=!1,l=document.getElementById("orderbysemestercheckbox_id").checked,e=document.getElementById("hshcourselistsearch").value,e=e.replace(/%/g,""),e=e.trim(),"#"===e.slice(0,1)?(k=!0,e=e.slice(1)):k=!1,(1==k||e.length>=3)&&b(e,j,h,f,g,i,k,l,d)})}}}); \ No newline at end of file diff --git a/amd/build/listselect.min.js b/amd/build/listselect.min.js index 2655698..51b37e0 100644 --- a/amd/build/listselect.min.js +++ b/amd/build/listselect.min.js @@ -1,2 +1,2 @@ -/*! hshcourselist 2018-09-12 */ +/*! hshcourselist 2019-04-10 */ define(["jquery"],function(a){function b(b,c){var d=c+"/course/view.php?id="+b.val();a("#hshcourseform").attr("action",d)}function c(a){a.removeClass("active"),a.removeClass("activeCourseSearch")}function d(a){a.addClass("active"),a.addClass("activeCourseSearch")}function e(a){var b=window.innerHeight,c=a.getBoundingClientRect(),d=c.bottom,e=c.top;d>b&&a.scrollIntoView({block:"end",behavior:"smooth"}),e<0&&a.scrollIntoView({block:"start",behavior:"smooth"})}return{init:function(f){a("input").keydown(function(g){var h,i=a(".hshcoursesearchlistitem"),j=i.filter(".activeCourseSearch"),k=g.keyCode;if(40===k||38===k||13===k){c(i),38===k?(h=!j.length||j.is(":first-child")?i.last():j.prev(),b(h,f)):40===k?(h=!j.length||j.is(":last-child")?i.eq(0):j.next(),b(h,f)):13===k&&(h=j,isNaN(h.val())&&(h=i.eq(0)),b(h,f)),d(h);e(document.getElementsByClassName("activeCourseSearch")[0])}})}}}); \ No newline at end of file diff --git a/amd/src/jmodule.js b/amd/src/jmodule.js index 6785cbc..2a8ca8b 100644 --- a/amd/src/jmodule.js +++ b/amd/src/jmodule.js @@ -15,7 +15,7 @@ define(['jquery'], function ($) { - function search(searchstring, reloadBool, displaymode, instanceid, sesskey, contextid, idSearching, orderbysemester, wwwroot) { + function search(searchstring, reloadBool, displaymode, instanceid, sesskey, contextid, idsearching, orderbysemester, wwwroot) { if (reloadBool) { $("#hshcourseprogress").show(); $.ajax({ @@ -23,7 +23,7 @@ define(['jquery'], function ($) { url: wwwroot + '/blocks/hshcourselist/hshcourselist.php', data: 'course=' + searchstring + '&instanceid=' + instanceid + '&sesskey=' + sesskey + '&contextid=' + contextid - + '&idSearching=' + idSearching + '&orderbysemester=' + orderbysemester, + + '&idsearching=' + idsearching + '&orderbysemester=' + orderbysemester, dataType: "json", success: function (response) { var plainJSON = JSON.stringify(response); @@ -72,7 +72,7 @@ define(['jquery'], function ($) { var displaymode = jsdataobject.displaymode; var contextid = jsdataobject.contextid; var reloadList = false; - var idSearching = false; + var idsearching = false; var searchstring; var orderbysemester = jsdataobject.orderbysemester; var displaystr; @@ -88,16 +88,16 @@ define(['jquery'], function ($) { searchstring = searchstring.trim(); if (searchstring.slice(0, 1) === '#') { $(".idSarchingLabel").show(); - idSearching = true; + idsearching = true; searchstring = searchstring.slice(1); } else { $(".idSarchingLabel").hide(); - idSearching = false; + idsearching = false; } - if (idSearching == true || searchstring.length >= 3) { - search(searchstring, reloadList, displaymode, instanceid, sesskey, contextid, idSearching, orderbysemester, wwwroot); + if (idsearching == true || searchstring.length >= 3) { + search(searchstring, reloadList, displaymode, instanceid, sesskey, contextid, idsearching, orderbysemester, wwwroot); } else { - // Search start after 3 chars or searching by id + // Search start after 3 chars or searching by id. } }); @@ -111,37 +111,37 @@ define(['jquery'], function ($) { searchstring = searchstring.trim(); if (searchstring.slice(0, 1) === '#') { $(".idSarchingLabel").show(); - idSearching = true; + idsearching = true; searchstring = searchstring.slice(1); } else { $(".idSarchingLabel").hide(); - idSearching = false; + idsearching = false; } - if (idSearching == true || searchstring.length >= 3) { - search(searchstring, reloadList, displaymode, instanceid, sesskey, contextid, idSearching, orderbysemester, wwwroot); + if (idsearching == true || searchstring.length >= 3) { + search(searchstring, reloadList, displaymode, instanceid, sesskey, contextid, idsearching, orderbysemester, wwwroot); } else { - // Search start after 3 chars or searching by id + // Search start after 3 chars or searching by id. } } }); $('#hshcourseform').on('submit', function (e) { e.preventDefault; reloadList = true; - idSearching = false; + idsearching = false; orderbysemester = document.getElementById('orderbysemestercheckbox_id').checked; searchstring = document.getElementById('hshcourselistsearch').value; searchstring = searchstring.replace(/%/g, ''); searchstring = searchstring.trim(); if (searchstring.slice(0, 1) === '#') { - idSearching = true; + idsearching = true; searchstring = searchstring.slice(1); } else { - idSearching = false; + idsearching = false; } - if (idSearching == true || searchstring.length >= 3) { - search(searchstring, reloadList, displaymode, instanceid, sesskey, contextid, idSearching, orderbysemester, wwwroot); + if (idsearching == true || searchstring.length >= 3) { + search(searchstring, reloadList, displaymode, instanceid, sesskey, contextid, idsearching, orderbysemester, wwwroot); } else { - // Search start after 3 chars or searching by id + // Search start after 3 chars or searching by id. } }); }, diff --git a/amd/src/listselect.js b/amd/src/listselect.js index b93640e..1054c58 100644 --- a/amd/src/listselect.js +++ b/amd/src/listselect.js @@ -44,11 +44,11 @@ define(["jquery"], function($) { var elementTop = elementPosition.top; if (elementBottom > windowSize) { - // Scroll an den unteren Rand des Bildes + // Scroll an den unteren Rand des Bildes. element.scrollIntoView({ block: "end", behavior: "smooth" }); } if (elementTop < 0) { - // Scroll an den oberen Rand des Bildes + // Scroll an den oberen Rand des Bildes. element.scrollIntoView({ block: "start", behavior: "smooth" }); } } @@ -68,7 +68,7 @@ define(["jquery"], function($) { setInactive(listItems); if (key === 38) { - // KEY UP + // KEY UP! if (!selected.length || selected.is(":first-child")) { current = listItems.last(); } else { @@ -76,7 +76,7 @@ define(["jquery"], function($) { } changeActionString(current, wwwroot); } else if (key === 40) { - // KEY DOWN + // KEY DOWN! if (!selected.length || selected.is(":last-child")) { current = listItems.eq(0); } else { @@ -84,7 +84,7 @@ define(["jquery"], function($) { } changeActionString(current, wwwroot); } else if (key === 13) { - // KEY ENTER + // KEY ENTER! current = selected; if (isNaN(current.val())) { current = listItems.eq(0); diff --git a/block_hshcourselist.php b/block_hshcourselist.php index 6ae612d..b7995c8 100644 --- a/block_hshcourselist.php +++ b/block_hshcourselist.php @@ -31,7 +31,7 @@ class block_hshcourselist extends block_base { $this->title = get_string('default_blocktitle', 'block_hshcourselist'); } - //stop it showing up on any add block lists + // Stop it showing up on any add block lists. public function applicable_formats() { return (array( 'all' => false, @@ -56,27 +56,28 @@ class block_hshcourselist extends block_base { } $this->content = new stdClass(); - $context_block = context_block::instance($this->instance->id); + $contextblock = context_block::instance($this->instance->id); $search = optional_param('hshcoursesearch', '', PARAM_TEXT); $hshcoursesubmit = optional_param('hshcoursesubmit', false, PARAM_TEXT); - // set placeholder - if($this->config->placeholder) { + // Set placeholder. + if ($this->config->placeholder) { $placeholder = $this->config->placeholder; } else { $placeholder = ""; } - $list_contents = ''; + $listcontents = ''; $anchor = html_writer::tag('a', '', array('name' => 'hshcourselistanchor')); - $ordercheckbox = html_writer::empty_tag('input', array('type' => 'checkbox', 'name' => 'orderbysemestercheckbox', 'id' => 'orderbysemestercheckbox_id')); + $ordercheckbox = html_writer::empty_tag('input', + array('type' => 'checkbox', 'name' => 'orderbysemestercheckbox', 'id' => 'orderbysemestercheckbox_id')); $ordercheckbox .= html_writer::start_tag('label', array('for' => 'orderbysemestercheckbox_id')); $ordercheckbox .= get_string('orderbysemester', 'block_hshcourselist'); $ordercheckbox .= html_writer::end_tag('label'); - $idSearchinglabel = html_writer::empty_tag('p', array('class' => 'idSarchingLabel')); - $idSearchinglabel .= get_string('idSearchingLabel', 'block_hshcourselist'); - $idSearchinglabel .= html_writer::end_tag('p'); + $idsearchinglabel = html_writer::empty_tag('p', array('class' => 'idSarchingLabel')); + $idsearchinglabel .= get_string('idsearchinglabel', 'block_hshcourselist'); + $idsearchinglabel .= html_writer::end_tag('p'); $inputattrs = array( 'autocomplete' => 'off', @@ -96,21 +97,25 @@ class block_hshcourselist extends block_base { ); $atagparams = array( - 'class'=>'btn btn-link p-0', - 'role'=>'button', - 'data-container'=>'body', - 'data-toggle'=>'popover', - 'data-placement'=>'right', - 'data-content'=>"<div class='no-overflow'><p>Die Kurssuche ist eine Volltextsuche in der Sie auch mehrere Suchbegriffe (mit Leerzeichen getrennt) eingeben können.<br/> - Verschiedene Suchbegriffe werden einzeln in den Kursnamen gesucht und dann eine vollständige Liste angezeigt.<br/> - Bsp: WiSe Programmieren => zeigt Ihnen alle Kurse, dessen Kursname oder Kurskurzname 'WiSe' <i>UND</i> 'Programmieren' enthalten.</p> - <p>Kurzsuche: Möchten Sie einen Kurs schnell über die <i>'id'</i> finden, so können Sie dies durch das Voranstellen einer Raute <i>'#'</i> erreichen.<br/> + 'class' => 'btn btn-link p-0', + 'role' => 'button', + 'data-container' => 'body', + 'data-toggle' => 'popover', + 'data-placement' => 'right', + 'data-content' => "<div class='no-overflow'><p>Die Kurssuche ist eine Volltextsuche in der Sie auch mehrere + Suchbegriffe (mit Leerzeichen getrennt) eingeben können.<br/> + Verschiedene Suchbegriffe werden einzeln in den Kursnamen gesucht und dann eine vollständige + Liste angezeigt.<br/> + Bsp: WiSe Programmieren => zeigt Ihnen alle Kurse, dessen Kursname oder Kurskurzname 'WiSe' + <i>UND</i> 'Programmieren' enthalten.</p> + <p>Kurzsuche: Möchten Sie einen Kurs schnell über die <i>'id'</i> finden, so können Sie dies + durch das Voranstellen einer Raute <i>'#'</i> erreichen.<br/> Bsp: <i>#3303</i> zeigt Ihnen den Kurs <i>'Moodle Demo-Kurs, ELC'</i></p>", - 'data-html'=>'true', - 'tabindex'=>'0', - 'data-trigger'=>'focus', - 'data-original-title'=>'', - 'title'=>'' + 'data-html' => 'true', + 'tabindex' => '0', + 'data-trigger' => 'focus', + 'data-original-title' => '', + 'title' => '' ); $questionhsh = html_writer::start_span("helpbutton"); @@ -135,11 +140,11 @@ class block_hshcourselist extends block_base { 'action' => new moodle_url('/') ); - $form = html_writer::tag('form', $idSearchinglabel.$ordercheckbox.$input.$questionhsh.$progress, $formattrs); + $form = html_writer::tag('form', $idsearchinglabel.$ordercheckbox.$input.$questionhsh.$progress, $formattrs); if (!empty($hshcoursesubmit)) { - $courses = self::get_courses($search, $context_block, $this->globalconf->splitterms, + $courses = self::get_courses($search, $contextblock, $this->globalconf->splitterms, $this->globalconf->restrictcontext, $this->page->context, - $this->globalconf->idSearching, $this->config->orderbysemester); + $this->globalconf->idsearching, $this->config->orderbysemester); if (!empty($courses)) { foreach ($courses as $course) { @@ -151,30 +156,33 @@ class block_hshcourselist extends block_base { $displaymode = 2; } switch ($displaymode): - case 1: $resultstr = $course->shortname; break; - case 2: $resultstr = $course->fullname; break; - default: $resultstr = $course->shortname.': '.$course->fullname; break; + case 1: $resultstr = $course->shortname; + break; + case 2: $resultstr = $course->fullname; + break; + default: $resultstr = $course->shortname.': '.$course->fullname; + break; endswitch; $link = html_writer::tag('a', $resultstr, array('href' => $url->out())); $li = html_writer::tag('li', $link); - $list_contents .= $li; + $listcontents .= $li; } } } - if(!isset($this->config->orderbysemester)) { + if (!isset($this->config->orderbysemester)) { $orderbysemester = false; } else { $orderbysemester = $this->config->orderbysemester; } - if(!isset($this->config->displaymode)) { + if (!isset($this->config->displaymode)) { $displaymode = 2; } else { $displaymode = $this->config->displaymode; } - $list = html_writer::tag('ul', $list_contents, array('id' => 'hshcourselistul')); + $list = html_writer::tag('ul', $listcontents, array('id' => 'hshcourselistul')); $this->content->text = $anchor.$form.$list; $jsdata = array( 'instanceid' => $this->instance->id, @@ -185,12 +193,12 @@ class block_hshcourselist extends block_base { ); $this->page->requires->js_call_amd('block_hshcourselist/jmodule', 'init', array($jsdata, $CFG->wwwroot)); - //Einstellungen für den Custom-Footer + // Einstellungen für den Custom-Footer. if (!empty($this->config->footer) && $this->config->enablefooter) { $this->content->footer = $this->config->footer; } - //Einstellungen für den Custom-Header + // Einstellungen für den Custom-Header. if (!empty($this->config->title) && $this->config->enablecustomheader) { $this->title = $this->config->title; } @@ -198,16 +206,17 @@ class block_hshcourselist extends block_base { return $this->content; } - public static function get_courses($search, $blockcontext, $splitterms = false, $restrictcontext = false, $pagecontext = null, $idSearch, $orderbysemester) { + public static function get_courses($search, $blockcontext, $splitterms = false, + $restrictcontext = false, $pagecontext = null, $idsearch, $orderbysemester) { global $DB; $params = array(SITEID); - $keywordArray = explode(" ", $search); - $paramscount = count($keywordArray); - $duplicatedKeywordArray = array(); - for ($x = 0; $x <= $paramscount-1; $x++) { - $actualLength = count($duplicatedKeywordArray); - $duplicatedKeywordArray[$actualLength] = "%".$keywordArray[$x]."%"; - $duplicatedKeywordArray[$actualLength+1] = "%".$keywordArray[$x]."%"; + $keywordarray = explode(" ", $search); + $paramscount = count($keywordarray); + $duplicatedkeywordarray = array(); + for ($x = 0; $x <= $paramscount - 1; $x++) { + $actuallength = count($duplicatedkeywordarray); + $duplicatedkeywordarray[$actuallength] = "%".$keywordarray[$x]."%"; + $duplicatedkeywordarray[$actuallength + 1] = "%".$keywordarray[$x]."%"; } $where = 'id != ? AND ('; if ($splitterms) { @@ -215,7 +224,7 @@ class block_hshcourselist extends block_base { $like = '%1$s LIKE'; foreach ($terms as $key => $term) { $like .= ' ?'; - if ($key < count($terms)-1) { + if ($key < count($terms) - 1) { $like .= ' AND %1$s LIKE'; } $terms[$key] = '%'.$term.'%'; @@ -223,13 +232,13 @@ class block_hshcourselist extends block_base { $params = array_merge($params, $terms, $terms); $where .= sprintf($like, 'shortname').' OR '.sprintf($like, 'fullname'); } else { - if($idSearch) { + if ($idsearch) { $params = array_merge($params, array($search)); $where .= 'id = ?'; } else { - $params = array_merge($params, $duplicatedKeywordArray); + $params = array_merge($params, $duplicatedkeywordarray); $where .= '(fullname ILIKE ? OR shortname ILIKE ?)'; - for ($i = 1; $i <= $paramscount-1; $i++) { + for ($i = 1; $i <= $paramscount - 1; $i++) { $where .= ' AND (fullname ILIKE ? OR shortname ILIKE ?)'; } } @@ -244,9 +253,9 @@ class block_hshcourselist extends block_base { $params[] = $pagecontext->instanceid; } } - if($orderbysemester) { + if ($orderbysemester) { $order = 'startdate DESC'; - } else if($idSearch) { + } else if ($idsearch) { $order = 'idnumber'; } else { $order = 'fullname'; diff --git a/edit_form.php b/edit_form.php index d920e32..806d205 100644 --- a/edit_form.php +++ b/edit_form.php @@ -26,7 +26,7 @@ class block_hshcourselist_edit_form extends block_edit_form { protected function specific_definition($mform) { - // Blocktitel + // Blocktitel. $mform->addElement('header', 'titlesettings', get_string('blocksettings_title', 'block_hshcourselist')); $mform->addElement('selectyesno', 'config_enablecustomheader', get_string('enablecustomheader', 'block_hshcourselist')); $mform->setDefault('config_enablecustomheader', 0); @@ -34,13 +34,13 @@ class block_hshcourselist_edit_form extends block_edit_form { $mform->setDefault('config_title', get_string('default_blocktitle', 'block_hshcourselist')); $mform->setType('config_title', PARAM_TEXT); - //Placeholder Text - $mform->addElement('header', 'placeholdersettings',get_string('placeholder_settings', 'block_hshcourselist')); + // Placeholder Text. + $mform->addElement('header', 'placeholdersettings', get_string('placeholder_settings', 'block_hshcourselist')); $mform->addElement('text', 'config_placeholder', get_string('placeholder', 'block_hshcourselist')); $mform->setDefault('config_placeholder', ""); $mform->setType('config_placeholder', PARAM_TEXT); - // Displaysettings + // Displaysettings. $mform->addElement('header', 'displaysettings', get_string('blocksettings_display', 'block_hshcourselist')); $selectoptions = array(0 => get_string('displayZero', 'block_hshcourselist'), 1 => get_string('displayOne', 'block_hshcourselist'), @@ -49,7 +49,7 @@ class block_hshcourselist_edit_form extends block_edit_form { $mform->setDefault('config_displaymode', 0); $mform->addElement('header', 'footersettings', get_string('blocksettings_footer', 'block_hshcourselist')); - // Blockfooter + // Blockfooter. $mform->addElement('selectyesno', 'config_enablefooter', get_string('enablefooter', 'block_hshcourselist')); $mform->setDefault('config_enablefooter', 0); $mform->addElement('text', 'config_footer', get_string('blockfooter', 'block_hshcourselist')); diff --git a/hshcourselist.php b/hshcourselist.php index a0882ff..e5e9e76 100644 --- a/hshcourselist.php +++ b/hshcourselist.php @@ -24,7 +24,6 @@ */ -//define('AJAX_SCRIPT', true); require_once('../../config.php'); require_once($CFG->dirroot . '/blocks/moodleblock.class.php'); require_once($CFG->dirroot . '/blocks/hshcourselist/block_hshcourselist.php'); @@ -33,12 +32,12 @@ $context = context_block::instance($instanceid); $course = required_param('course', PARAM_TEXT); $pagecontextid = required_param('contextid', PARAM_INT); $config = get_config('block_hshcourselist'); -$idSearching = required_param('idSearching', PARAM_BOOL); +$idsearching = required_param('idsearching', PARAM_BOOL); $orderbysemester = required_param('orderbysemester', PARAM_BOOL); $output = array(); if (!empty($course)) { $catcontext = context::instance_by_id($pagecontextid, IGNORE_MISSING); - $courses = block_hshcourselist::get_courses($course, $context, false, false, null, $idSearching, $orderbysemester); + $courses = block_hshcourselist::get_courses($course, $context, false, false, null, $idsearching, $orderbysemester); if (!empty($courses)) { foreach ($courses as $course) { $output[] = $course; diff --git a/lang/en/block_hshcourselist.php b/lang/en/block_hshcourselist.php index 7837008..85aa8ac 100644 --- a/lang/en/block_hshcourselist.php +++ b/lang/en/block_hshcourselist.php @@ -39,7 +39,7 @@ $string['blocksettings_footer'] = 'Footersettings'; $string['enablefooter'] = 'Enable Footer'; $string['blockfooter'] = 'Blockfooter'; -$string['headerconfig'] = 'Headerconfig'; +$string['headerconfig'] = 'Headerconfig'; $string['descconfig'] = 'Descconfig'; $string['displaymode'] = 'Displaymethod'; @@ -51,7 +51,7 @@ $string['orderbysemester'] = 'Aktuelle Kurse oben anzeigen'; $string['loading'] = 'LOADING...'; -$string['idSearchingLabel'] = ">> Es wird nur nach Kurs-ID's gesucht. <<"; +$string['idsearchinglabel'] = ">> Es wird nur nach Kurs-ID's gesucht. <<"; $string['placeholder'] = "Placeholder for the searching field"; $string['placeholder_settings'] = "Placeholder settings"; diff --git a/style.css b/style.css index 2c401ed..0b7fefc 100644 --- a/style.css +++ b/style.css @@ -20,7 +20,7 @@ } .block_hshcourselist { - h5::before { + h5::before { content: "\f002" !important; } } diff --git a/version.php b/version.php index 2aaafeb..2450529 100644 --- a/version.php +++ b/version.php @@ -25,5 +25,5 @@ $plugin->component = 'block_hshcourselist'; -$plugin->version = 2019031700; // YYYYMMDDHH -$plugin->requires = 2016112900; // YYYYMMDDHH +$plugin->version = 2019041001; // YYYYMMDDHH. +$plugin->requires = 2016112900; // YYYYMMDDHH. \ No newline at end of file -- GitLab