Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from SE-Stuttgart/dev
#### Changelog release 1.1.3 ##### For Web Service Users - The web service function is renamed from *block_booksearch_get_searched_locations* to *block_booksearch_search_course_book_content* - The web service function *block_booksearch_search_course_book_content* no longer requires the parameter userid - We expect the web service user to check if the third user should have access to the information provided - Parameter Snippet: ``` /** * Returns description of method parameter * @return external_function_parameters */ public static function execute_parameters() { return new external_function_parameters( [ 'courseid' => new external_value(PARAM_INT, 'Id of the course the user wants to access', VALUE_REQUIRED), 'searchstring' => new external_value(PARAM_TEXT, 'String to search for in the course', VALUE_REQUIRED), 'contextlength' => new external_value(PARAM_INT, 'Number of words surrounding the found query word in each direction', VALUE_DEFAULT, 1), ] ); } ``` - As the web service may leak course information to non members, we now require the web service user has the capability to share course information with an unknown third user. - Therefore the web service user now requires to be a teacher, editing teacher or manager - Block usge via the ui still only requires course access - The web service function *block_booksearch_search_course_book_content* return value is no longer a JSON string but the datastructure itself. - Return Snippet: ``` /** * Returns description of the method return values. * @return external_value */ public static function execute_returns() { return new external_multiple_structure( new external_single_structure([ 'filename' => new external_value(PARAM_TEXT, 'name of the pdf file that has a matching book.'), 'pagenumber' => new external_value(PARAM_INT, 'page number this searched occurance happens in filename book.'), 'bookchapterurl' => new external_value(PARAM_RAW, 'url to pagenumber book chapter.'), 'contextsnippet' => new external_value(PARAM_RAW, 'text snippet around the occurance.'), ]) ); } ``` ##### For Developer - Reworked how the search works (*amd\src\search_and_display.js* and *classes\search\search.php*) - Updated the webservice, no longer in *externallib.php*, now in *classes\external\search_book_content.php* (More info in *Changelog for Web Service Users* - Added *styles.css* - Refactored *locallib.php* in own classes *classes\search\search.php* for the content search and *classes\data\data.php* for the file search and book pdf matching - Removed german language file. - Now uses ESM module *block_booksearch/search_and_display* for the ui javascript capabilities instead of plain js in <script>
- Loading branch information