diff --git a/block_hshcourselist.php b/block_hshcourselist.php index 227cc550c261f8bee0fc224f3e20861d3a9af65d..2c10558d70621b37d2f2b9864a7e109234764716 100644 --- a/block_hshcourselist.php +++ b/block_hshcourselist.php @@ -1,7 +1,6 @@ <?php defined('MOODLE_INTERNAL') || die(); - class block_hshcourselist extends block_base { private $globalconf; @@ -46,7 +45,7 @@ class block_hshcourselist extends block_base { $placeholder = ""; } $list_contents = ''; - $anchor = html_writer::tag('a', '', array('name' => 'hshcourselistanchor')); + $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::start_tag('label', array('for' => 'orderbysemestercheckbox_id')); @@ -68,11 +67,36 @@ class block_hshcourselist extends block_base { $input = html_writer::empty_tag('input', $inputattrs); $questionattrs = array( - 'src' => $OUTPUT->image_url('help', 'moodle'), - 'class' => 'hshcoursehelpclass', - 'id' => 'hshcoursehelpid' + 'class' => 'icon fa fa-question-circle text-info fa-fw', + 'title' => 'Hilfe für HsH Kurssuche', + 'aria-label' => 'Hilfe für HsH Kurssuche', + 'aria-hidden' => 'true' + ); + + $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>ODER</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'=>'' ); - $question = html_writer::empty_tag('img', $questionattrs); + + $questionhsh = html_writer::start_span("helpbutton"); + $questionhsh .= html_writer::start_tag('a', $atagparams); + $questionhsh .= html_writer::start_tag('i', $questionattrs); + $questionhsh .= html_writer::end_tag('i'); + $questionhsh .= html_writer::end_tag('a'); + $questionhsh .= html_writer::end_span(); $progressattrs = array( 'src' => $OUTPUT->image_url('i/loading_small', 'moodle'), @@ -83,18 +107,18 @@ class block_hshcourselist extends block_base { $progress = html_writer::empty_tag('img', $progressattrs); $formattrs = array( - 'id' => 'hshcourseform', - 'method' => 'post', - 'name' => 'hshcourselistform', - //'action' => $this->page->url->out().'#hshcourselistanchor' - 'action' => new moodle_url('/') - ); - - $form = html_writer::tag('form', $idSearchinglabel.$ordercheckbox.$input.$question.$progress, $formattrs); + 'id' => 'hshcourseform', + 'method' => 'post', + 'name' => 'hshcourselistform', + //'action' => $this->page->url->out().'#hshcourselistanchor' + 'action' => new moodle_url('/') + ); + + $form = html_writer::tag('form', $idSearchinglabel.$ordercheckbox.$questionhsh.$input.$progress, $formattrs); if (!empty($hshcoursesubmit)) { $courses = self::get_courses($search, $context_block, $this->globalconf->splitterms, - $this->globalconf->restrictcontext, $this->page->context, - $this->globalconf->idSearching, $this->config->orderbysemester); + $this->globalconf->restrictcontext, $this->page->context, + $this->globalconf->idSearching, $this->config->orderbysemester); if (!empty($courses)) { foreach ($courses as $course) { @@ -182,7 +206,7 @@ class block_hshcourselist extends block_base { if($idSearch) { $params = array_merge($params, array($search)); $where .= 'id = ?'; - // $where .= 'idnumber LIKE ?'; --- Bei Postgres nur "id" +// $where .= 'idnumber LIKE ?'; --- Bei Postgres nur "id" } else { $params = array_merge($params, array("%$search%", "%$search%")); $where .= 'shortname ILIKE ? OR fullname ILIKE ?'; @@ -208,6 +232,6 @@ class block_hshcourselist extends block_base { $fields = 'id, idnumber, shortname, fullname'; $courses = $DB->get_recordset_select('course', $where, $params, $order, $fields); - return $courses; + return $courses; } } diff --git a/lang/en/block_hshcourselist.php b/lang/en/block_hshcourselist.php index f237bbed7ebb2b81f038522a8398bddcd9253104..06657f137c3dda8ccd3671d669accdfa9e27f231 100644 --- a/lang/en/block_hshcourselist.php +++ b/lang/en/block_hshcourselist.php @@ -9,13 +9,13 @@ $string['blocksettings_display'] = 'Displaysettings'; $string['blocksettings_title'] = 'Titlesettings'; $string['enablecustomheader'] = 'Enable custom title'; $string['blocktitle'] = 'Blocktitel'; -$string['default_blocktitle'] = 'HsH-Kurssuche'; +$string['default_blocktitle'] = 'Kurssuche'; $string['blocksettings_footer'] = 'Footersettings'; $string['enablefooter'] = 'Enable Footer'; $string['blockfooter'] = 'Blockfooter'; -$string['headerconfig'] = 'Headerconfig'; +$string['headerconfig'] = 'Headerconfig'; $string['descconfig'] = 'Descconfig'; $string['displaymode'] = 'Displaymethod'; @@ -23,11 +23,18 @@ $string['displayZero'] = 'Course Shortname'; $string['displayOne'] = 'Course Fullname'; $string['displayTwo'] = 'Course Shortname + Fullname'; -$string['orderbysemester'] = 'Order by semester'; +$string['orderbysemester'] = 'Aktuelle Kurse oben anzeigen'; $string['loading'] = 'LOADING...'; $string['idSearchingLabel'] = ">> Es wird nur nach Kurs-ID's gesucht. <<"; $string['placeholder'] = "Placeholder for the searching field"; -$string['placeholder_settings'] = "Placeholder settings"; \ No newline at end of file +$string['placeholder_settings'] = "Placeholder settings"; + +$string["hsh_search"] = "HsH Kurssuche"; +$string["hsh_search_help"] = 'Die Kurssuche ist eine Volltextsuche in der Sie auch mehrere Suchbegriffe (mit Leerzeichen getrennt) eingeben können. +Verschiedene Suchbegriffe werden einzeln in den Kursnamen gesucht und dann eine vollständige Liste angezeigt. +Bsp: WiSe Programmieren => zeigt Ihnen alle Kurse, dessen Kursname oder Kurskurzname "WiSe" ODER "Programmieren" enthalten. +Kurzsuche: Möchten Sie einen Kurs schnell über die "id" finden, so können Sie dies durch das Voranstellen einer Raute "#" erreichen. +Bsp: #3303 zeigt Ihnen den Kurs "Moodle Demo-Kurs, ELC"'; \ No newline at end of file diff --git a/style.css b/style.css index 9f98cb9791b2bf53b6b6c80118ca067c325dde93..2f9b9375e182cd5f87edc5f30966a79d6b183b8d 100644 --- a/style.css +++ b/style.css @@ -19,6 +19,12 @@ margin-left: 98%; } +.block_hshcourselist { + h5::before { + content: "\f002" !important; + } +} + #hshcourselistsearch { width: 97% !important; } diff --git a/version.php b/version.php index 535b56cb3606ee33a4e9692902268b219428e442..271244765d43e66152bd63f1d33d56b47da5435c 100644 --- a/version.php +++ b/version.php @@ -1,4 +1,4 @@ <?php $plugin->component = 'block_hshcourselist'; -$plugin->version = 2018082401; // YYYYMMDDHH +$plugin->version = 2018082800; // YYYYMMDDHH $plugin->requires = 2016112900; // YYYYMMDDHH