mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 19:06:41 +02:00
MDL-22112, create wiki's first page automatically without ask user questions, and add capability check to wiki_create_page function
This commit is contained in:
parent
9d88a01ba6
commit
3b5e2acbd1
2 changed files with 11 additions and 11 deletions
|
@ -323,7 +323,8 @@ function wiki_refresh_page_links($page, $links) {
|
|||
* @param int $userid
|
||||
*/
|
||||
function wiki_create_page($swid, $title, $format, $userid) {
|
||||
global $DB;
|
||||
global $DB, $PAGE;
|
||||
require_capability('mod/wiki:editpage', $PAGE->context);
|
||||
// if page exists
|
||||
if ($page = wiki_get_page_by_title($swid, $title)) {
|
||||
return $page->id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue