MDL-69630 format_social: Add ajax support

This commit is contained in:
Stephen Bourget
2020-09-17 12:24:39 +08:00
committed by Mihail Geshoski
parent ab5d361c80
commit c96a155937
3 changed files with 21 additions and 6 deletions
@@ -16,14 +16,14 @@ Feature: Edit activities in social activities block
| user | course | role |
| user1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | course | idnumber | name |
| forum | C1 | forum | My forum name |
@javascript
Scenario: Edit name of acitivity in-place in social activities block
Given I log in as "user1"
And I am on "Course 1" course homepage with editing mode on
And I set the field "Add an activity to section 'section 0'" to "Forum"
And I set the field "Forum name" to "My forum name"
And I press "Save and return to course"
And I click on "Edit title" "link" in the "My forum name" activity in social activities block
And I set the field "New name for activity My forum name" to "New forum name"
And I press key "13" in the field "New name for activity My forum name"
@@ -42,9 +42,6 @@ Feature: Edit activities in social activities block
And I log in as "user1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Recent activity" block
And I set the field "Add an activity to section 'section 0'" to "Forum"
And I set the field "Forum name" to "My forum name"
And I press "Save and return to course"
And "My forum name" activity in social activities block should have "Hide" editing icon
And "My forum name" activity in social activities block should not have "Show" editing icon
And "My forum name" activity in social activities block should not have "Make available" editing icon
+15
View File
@@ -131,4 +131,19 @@ class format_social extends format_base {
// Return everything (nothing to hide).
return $this->get_format_options();
}
/**
* Returns the information about the ajax support in the given source format.
*
* The returned object's property (boolean)capable indicates that
* the course format supports Moodle course ajax features.
*
* @return stdClass
*/
public function supports_ajax() {
$ajaxsupport = new stdClass();
$ajaxsupport->capable = true;
return $ajaxsupport;
}
}
+3
View File
@@ -2,6 +2,9 @@ This files describes API changes for course formats
Overview of this plugin type at http://docs.moodle.org/dev/Course_formats
=== 3.10 ===
* Added the missing callback supports_ajax() to format_social.
=== 3.9 ===
* The following functions, previously used (exclusively) by upgrade steps are not available anymore because of the upgrade cleanup performed for this version. See MDL-65809 for more info: