-
+ 1)) {
+ print_tabs($tabrows, $tab, $inactive, $activated);
+}
+?>
@@ -117,4 +120,4 @@
break;
}
echo html_writer::empty_tag('hr');
-?>
+?>
\ No newline at end of file
diff --git a/mod/glossary/tests/behat/categories.feature b/mod/glossary/tests/behat/categories.feature
index f42dc43c1de..cd8c16e21e3 100644
--- a/mod/glossary/tests/behat/categories.feature
+++ b/mod/glossary/tests/behat/categories.feature
@@ -17,9 +17,11 @@ Feature: Glossary entries can be organised in categories
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
+ And the following "activities" exist:
+ | activity | name | intro | displayformat | course | idnumber |
+ | glossary | MyGlossary | Test glossary description | encyclopedia | C1 | glossary1 |
And the following "activities" exist:
| activity | name | intro | course | idnumber |
- | glossary | MyGlossary | Test glossary description | C1 | glossary1 |
| label | name | check autolinking of CategoryAutoLinks and CategoryNoLinks text | C1 | label1 |
# Log in as admin and enable autolinking filter
And I log in as "admin"
diff --git a/mod/glossary/tests/behat/search_entries.feature b/mod/glossary/tests/behat/search_entries.feature
index c2f682328f0..a9e0939bdd0 100644
--- a/mod/glossary/tests/behat/search_entries.feature
+++ b/mod/glossary/tests/behat/search_entries.feature
@@ -16,12 +16,11 @@ Feature: Glossary entries can be searched or browsed by alphabet, category, date
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
+ And the following "activities" exist:
+ | activity | name | intro | displayformat | course | idnumber |
+ | glossary | Test glossary name | Test glossary description | fullwithauthor | C1 | g1 |
And I log in as "teacher1"
And I follow "Course 1"
- And I turn editing mode on
- And I add a "Glossary" to section "1" and I fill the form with:
- | Name | Test glossary name |
- | Description | Test glossary description |
And I follow "Test glossary name"
And I add a glossary entries category named "The ones I like"
And I add a glossary entries category named "All for you"
diff --git a/mod/glossary/view.php b/mod/glossary/view.php
index c7b83e1ad6c..a616df1cd35 100644
--- a/mod/glossary/view.php
+++ b/mod/glossary/view.php
@@ -73,14 +73,11 @@ if ($page != 0 && $offset == 0) {
$offset = $page * $entriesbypage;
}
-// Get visible tabs for this glossary format.
-$glossarytabs = $DB->get_field('glossary_formats', 'showtabs', array('name' => $glossary->displayformat));
-$showtabs = glossary_get_visible_tabs($glossarytabs);
-
/// setting the default values for the display mode of the current glossary
/// only if the glossary is viewed by the first time
if ( $dp = $DB->get_record('glossary_formats', array('name'=>$glossary->displayformat)) ) {
/// Based on format->defaultmode, we build the defaulttab to be showed sometimes
+ $showtabs = glossary_get_visible_tabs($dp);
switch ($dp->defaultmode) {
case 'cat':
$defaulttab = GLOSSARY_CATEGORY_VIEW;
@@ -122,6 +119,7 @@ if ( $dp = $DB->get_record('glossary_formats', array('name'=>$glossary->displayf
}
} else {
$defaulttab = GLOSSARY_STANDARD_VIEW;
+ $showtabs = array($defaulttab);
$printpivot = 1;
if ( $mode == '' and $hook == '' and $show == '') {
$mode = 'letter';