diff --git a/course/tests/behat/add_activities.feature b/course/tests/behat/add_activities.feature index 3d8a87ce6b2..eb2e88c762f 100644 --- a/course/tests/behat/add_activities.feature +++ b/course/tests/behat/add_activities.feature @@ -62,7 +62,7 @@ Feature: Add activities to courses And I am logged in as admin And I am on "Course 1" course homepage with editing mode on When I add a "Database" to section "3" - Then I should see "Moodle auto-format" in the "#menuintroeditorformat > option[selected]" "css_element" + Then the field "Description format" matches value "0" @javascript Scenario: The activity description should preserve the format used once edited (markdown version) @@ -76,8 +76,7 @@ Feature: Add activities to courses And I am on "Course 1" course homepage with editing mode on And I open "A4" actions menu When I click on "Edit settings" "link" in the "A4" activity - Then I should see "Markdown format" in the "#menuintroeditorformat > option[selected]" "css_element" - And I should not see "Plain text format" in the "#menuintroeditorformat > option[selected]" "css_element" + Then the field "Description format" matches value "4" @javascript Scenario: The activity description should preserve the format used once edited (plain text version) @@ -91,5 +90,4 @@ Feature: Add activities to courses And I am on "Course 1" course homepage with editing mode on And I open "A2" actions menu When I click on "Edit settings" "link" in the "A2" activity - Then I should see "Plain text format" in the "#menuintroeditorformat > option[selected]" "css_element" - And I should not see "Markdown format" in the "#menuintroeditorformat > option[selected]" "css_element" + Then the field "Description format" matches value "2" diff --git a/course/tests/behat/course_summary_format.feature b/course/tests/behat/course_summary_format.feature index 07956019d4b..0f803cc8d97 100644 --- a/course/tests/behat/course_summary_format.feature +++ b/course/tests/behat/course_summary_format.feature @@ -11,7 +11,7 @@ Feature: Summary text format should be preserved on edit and set by preferred ed And I log in as "admin" And I go to the courses management page When I click on "Create new course" "link" - Then I should see "Moodle auto-format" in the "#menusummary_editorformat > option[selected]" "css_element" + Then the field "Course summary format" matches value "0" Scenario: Summary format must be preserved on course edit Given the following "user preferences" exist: @@ -28,4 +28,4 @@ Feature: Summary text format should be preserved on edit and set by preferred ed And I set the field with xpath "//select[@name='summary_editor[format]']" to "4" And I press "Save and display" When I click on "Settings" "link" - Then I should see "Markdown format" in the "#menusummary_editorformat > option[selected]" "css_element" + Then the field "Course summary format" matches value "4" diff --git a/lang/en/editor.php b/lang/en/editor.php index 013b923b0aa..54f94d75b8c 100644 --- a/lang/en/editor.php +++ b/lang/en/editor.php @@ -53,6 +53,7 @@ $string['cutpastemozilla'] = 'Unfortunately, you cannot currently use normal key $string['delete'] = 'Delete'; $string['editors'] = 'Text editors'; $string['editorsettings'] = 'Manage editors'; +$string['editorxformat'] = '{$a} format'; $string['enterurlfirst'] = 'You have to enter an URL first'; $string['filebrowser'] = 'File Browser'; $string['findwhat'] = 'Find'; diff --git a/lib/editor/atto/tests/behat/autosave.feature b/lib/editor/atto/tests/behat/autosave.feature index f8f08dfd4ed..d4f4379749b 100644 --- a/lib/editor/atto/tests/behat/autosave.feature +++ b/lib/editor/atto/tests/behat/autosave.feature @@ -24,7 +24,7 @@ Feature: Atto Autosave And I click on "Save changes" "button" And I am on "Course 1" course homepage And I navigate to "Settings" in current page administration - And I set the field with xpath "//select[@name='summary_editor[format]']" to "1" + And I set the field "Course summary format" to "1" And I click on "Save and display" "button" And I log out diff --git a/lib/form/editor.php b/lib/form/editor.php index c985854458a..75676a21489 100644 --- a/lib/form/editor.php +++ b/lib/form/editor.php @@ -453,6 +453,7 @@ class MoodleQuickForm_editor extends HTML_QuickForm_element implements templatab $context['id'] = $id; $context['value'] = $text; $context['format'] = $format; + $context['formatlabel'] = get_string('editorxformat', 'editor', $this->_label); if (!is_null($this->getAttribute('onblur')) && !is_null($this->getAttribute('onchange'))) { $context['changelistener'] = true; diff --git a/lib/form/templates/editor_textarea.mustache b/lib/form/templates/editor_textarea.mustache index 22ed026dce9..9102dab1982 100644 --- a/lib/form/templates/editor_textarea.mustache +++ b/lib/form/templates/editor_textarea.mustache @@ -35,6 +35,7 @@