Skip to content

Commit fedcf12

Browse files
committed
[docs] Activity overview redirection
1 parent d249554 commit fedcf12

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/apis/plugintypes/mod/courseoverview.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,3 +232,19 @@ class overview extends activityoverviewbase {
232232
// Also, to handle timestamps, use $this->clock->time() instead.
233233
}
234234
```
235+
236+
## Redirect the index.php page to the course overview
237+
238+
The `activityoverviewbase` class provides a static method to redirect the old `mod/PLUGINNAME/index.php` page to the new course overview. This method should be called in the `index.php` file of the activity plugin.
239+
240+
This is an example of the `index.php` file of a plugin redirecting to the course overview:
241+
242+
```php
243+
require_once("../../config.php");
244+
245+
$courseid = required_param('id', PARAM_INT);
246+
247+
\core_courseformat\activityoverviewbase::redirect_to_overview_page($courseid, 'YOURPLUGINNAME');
248+
```
249+
250+
Once done, the plugin can deprecated any method, output or renderer related to the previous index page.

0 commit comments

Comments
 (0)