Merge branch 'MDL-28445-35' of git://github.com/peterRd/moodle into MOODLE_35_STABLE

This commit is contained in:
Jake Dallimore 2019-01-21 15:59:10 +08:00
commit 284b7c820e
4 changed files with 12 additions and 9 deletions

View file

@ -72,7 +72,7 @@ $strglossary = get_string("modulename", "glossary");
$PAGE->navbar->add(get_string("categories","glossary"), $PAGE->navbar->add(get_string("categories","glossary"),
new moodle_url('/mod/glossary/editcategories.php', array('id' => $cm->id,'mode' => 'cat'))); new moodle_url('/mod/glossary/editcategories.php', array('id' => $cm->id,'mode' => 'cat')));
if (!empty($action)) { if (!empty($action)) {
$navaction = get_string($action). " " . core_text::strtolower(get_string("category","glossary")); $navaction = get_string(core_text::strtolower($action."category"), 'glossary');
$PAGE->navbar->add($navaction); $PAGE->navbar->add($navaction);
} }
$PAGE->set_title($glossary->name); $PAGE->set_title($glossary->name);
@ -118,7 +118,7 @@ if ( $hook >0 ) {
} else { } else {
echo $OUTPUT->header(); echo $OUTPUT->header();
echo $OUTPUT->heading(format_string($glossary->name), 2); echo $OUTPUT->heading(format_string($glossary->name), 2);
echo $OUTPUT->heading(format_string(get_string("edit"). " " . get_string("category","glossary")), 3); echo $OUTPUT->heading(format_string(get_string("editcategory", "glossary")), 3);
$name = $category->name; $name = $category->name;
$usedynalink = $category->usedynalink; $usedynalink = $category->usedynalink;
@ -148,7 +148,7 @@ if ( $hook >0 ) {
} else { } else {
echo $OUTPUT->header(); echo $OUTPUT->header();
echo $OUTPUT->heading(format_string($glossary->name), 2); echo $OUTPUT->heading(format_string($glossary->name), 2);
echo $OUTPUT->heading(format_string(get_string("delete"). " " . get_string("category","glossary")), 3); echo $OUTPUT->heading(format_string(get_string("deletecategory", "glossary")), 3);
echo $OUTPUT->box_start('generalbox boxaligncenter errorboxcontent boxwidthnarrow'); echo $OUTPUT->box_start('generalbox boxaligncenter errorboxcontent boxwidthnarrow');
echo "<div class=\"boxaligncenter deletecatconfirm\">".format_string($category->name, true, $fmtoptions)."<br/>"; echo "<div class=\"boxaligncenter deletecatconfirm\">".format_string($category->name, true, $fmtoptions)."<br/>";
@ -218,7 +218,7 @@ if ( $hook >0 ) {
} else { } else {
echo $OUTPUT->header(); echo $OUTPUT->header();
echo $OUTPUT->heading(format_string($glossary->name), 2); echo $OUTPUT->heading(format_string($glossary->name), 2);
echo "<h3 class=\"main\">" . get_string("add"). " " . get_string("category","glossary"). "</h3>"; echo "<h3 class=\"main\">" . get_string("addcategory", "glossary"). "</h3>";
$name=""; $name="";
require "editcategories.html"; require "editcategories.html";
} }
@ -287,7 +287,7 @@ echo $OUTPUT->heading(format_string($glossary->name), 2);
$options['action'] = "add"; $options['action'] = "add";
echo "<table class=\"editbuttons\" border=\"0\"><tr><td align=\"$rightalignment\">"; echo "<table class=\"editbuttons\" border=\"0\"><tr><td align=\"$rightalignment\">";
echo $OUTPUT->single_button(new moodle_url("editcategories.php", $options), get_string("add") . " " . get_string("category","glossary")); echo $OUTPUT->single_button(new moodle_url("editcategories.php", $options), get_string("addcategory", "glossary"));
echo "</td><td align=\"$leftalignment\">"; echo "</td><td align=\"$leftalignment\">";
unset($options['action']); unset($options['action']);
$options['mode'] = 'cat'; $options['mode'] = 'cat';

View file

@ -24,6 +24,7 @@
*/ */
$string['addcomment'] = 'Add comment'; $string['addcomment'] = 'Add comment';
$string['addcategory'] = 'Add category';
$string['addentry'] = 'Add a new entry'; $string['addentry'] = 'Add a new entry';
$string['addingcomment'] = 'Add a comment'; $string['addingcomment'] = 'Add a comment';
$string['alias'] = 'Keyword'; $string['alias'] = 'Keyword';
@ -105,6 +106,7 @@ $string['defaultsortorder'] = 'Default sort order';
$string['definition'] = 'Definition'; $string['definition'] = 'Definition';
$string['definitions'] = 'Definitions'; $string['definitions'] = 'Definitions';
$string['deleteentry'] = 'Delete entry'; $string['deleteentry'] = 'Delete entry';
$string['deletecategory'] = 'Delete category';
$string['deleteentrya'] = 'Delete entry: {$a}'; $string['deleteentrya'] = 'Delete entry: {$a}';
$string['deletenotenrolled'] = 'Delete entries by users not enrolled'; $string['deletenotenrolled'] = 'Delete entries by users not enrolled';
$string['deletingcomment'] = 'Deleting comment'; $string['deletingcomment'] = 'Deleting comment';
@ -138,6 +140,7 @@ $string['duplicateentry'] = 'Duplicate entry';
$string['editalways'] = 'Always allow editing'; $string['editalways'] = 'Always allow editing';
$string['editalways_help'] = 'This setting specifies whether entries are always editable or whether students can only edit their entries during a configured editing time (usually 30 minutes).'; $string['editalways_help'] = 'This setting specifies whether entries are always editable or whether students can only edit their entries during a configured editing time (usually 30 minutes).';
$string['editcategories'] = 'Edit categories'; $string['editcategories'] = 'Edit categories';
$string['editcategory'] = 'Edit category';
$string['editentry'] = 'Edit entry'; $string['editentry'] = 'Edit entry';
$string['editentrya'] = 'Edit entry: {$a}'; $string['editentrya'] = 'Edit entry: {$a}';
$string['editingcomment'] = 'Editing comment'; $string['editingcomment'] = 'Editing comment';

View file

@ -65,7 +65,7 @@ class behat_mod_glossary extends behat_base {
$this->execute("behat_forms::press_button", get_string('editcategories', 'mod_glossary')); $this->execute("behat_forms::press_button", get_string('editcategories', 'mod_glossary'));
$this->execute("behat_forms::press_button", get_string('add').' '.get_string('category', 'glossary')); $this->execute("behat_forms::press_button", get_string('addcategory', 'glossary'));
$this->execute('behat_forms::i_set_the_field_to', array('name', $this->escape($categoryname))); $this->execute('behat_forms::i_set_the_field_to', array('name', $this->escape($categoryname)));

View file

@ -34,16 +34,16 @@ Feature: Glossary entries can be organised in categories
And I follow "MyGlossary" And I follow "MyGlossary"
And I follow "Browse by category" And I follow "Browse by category"
And I press "Edit categories" And I press "Edit categories"
And I press "Add Category" And I press "Add category"
And I set the field "name" to "CategoryNoLinks" And I set the field "name" to "CategoryNoLinks"
And I press "Save changes" And I press "Save changes"
And I should see "0 Entries" in the "CategoryNoLinks" "table_row" And I should see "0 Entries" in the "CategoryNoLinks" "table_row"
And I press "Add Category" And I press "Add category"
And I set the field "name" to "CategoryAutoLinks" And I set the field "name" to "CategoryAutoLinks"
And I set the field "usedynalink" to "Yes" And I set the field "usedynalink" to "Yes"
And I press "Save changes" And I press "Save changes"
And I should see "0 Entries" in the "CategoryAutoLinks" "table_row" And I should see "0 Entries" in the "CategoryAutoLinks" "table_row"
And I press "Add Category" And I press "Add category"
And I set the field "name" to "Category2" And I set the field "name" to "Category2"
And I press "Save changes" And I press "Save changes"
And I click on "Edit" "link" in the "Category2" "table_row" And I click on "Edit" "link" in the "Category2" "table_row"