Quick Search (block_quicksearch)
Adds a quick search block to Moodle, allowing authorised users to search users and courses from a single block interface.
Requirements
- Moodle 4.0+.
- Works with themes that support standard Moodle block regions.
Installation
- Copy this folder to:
blocks/quicksearch
- Visit Site administration ' Notifications
- Complete the plugin installation
- Add the block to the desired Moodle page
- Configure the plugin at
Site administration ' Plugins ' Blocks ' Quick Search
Features
User Search
- Search active Moodle users
- Search by:
- First name
- Last name
- Full name
- Username
- Email
- Open user profile
- Open advanced user edit page
- Log in as user when the current user has the required Moodle capability
Course Search
- Search Moodle courses
- Search by:
- Full course name
- Course short name
- Open course page
- Open course participants page
- Open course settings page
Interface
- Single block interface
- AJAX-based search
- Debounced search requests
- Loading indicators
- Empty result messages
- Search term highlighting
- Mustache template rendering
- AMD JavaScript module
Configuration
The plugin can be configured at:
Site administration ' Plugins ' Blocks ' Quick Search
Available settings:
- Enable block
- Block title
- Result limit
Result limit
Defines the maximum number of users and courses returned by each search request.
The plugin validates the configured limit and falls back to a safe default when needed.
Capabilities
block/quicksearch:addinstance — Add a new Quick Search block instance
block/quicksearch:myaddinstance — Add a new Quick Search block to the Dashboard
block/quicksearch:view — View and use the Quick Search block
Permission Requirements
The block only displays content to logged-in, non-guest users with:
The user search endpoint also requires:
The course search endpoint also requires:
moodle/course:viewhiddencourses
The "Log in as" action is only displayed when the current user has:
Security
The plugin uses Moodle security APIs and standards:
require_login()
require_sesskey()
require_capability()
PARAM_TEXT
PARAM_INT
$DB->sql_like()
$DB->sql_like_escape()
- Moodle URL generation with
moodle_url
- Output rendering through Mustache templates
- JavaScript loaded through AMD
Data and Privacy (GDPR)
The plugin does not create custom database tables and does not store personal data.
The block only displays existing Moodle user and course information to authorised users during search requests.
Displayed user data may include:
- Full name
- Username
- User profile link
- User edit link, when permitted
- Login as link, when permitted
Displayed course data may include:
- Course full name
- Course short name
- Course page link
- Participants page link
- Course settings link
No user preferences are stored by this plugin.
Privacy API
Implements:
\core_privacy\local\metadata\null_provider
Technical Structure
Main plugin files:
block_quicksearch.php
settings.php
version.php
db/access.php
classes/privacy/provider.php
templates/content.mustache
amd/src/search.js
amd/build/search.min.js
ajax_usuarios.php
ajax_cursos.php
styles.css
pix/icon.png
License
This plugin is licensed under the GNU GPL v3 or later.
See LICENSE for full license details.