mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
trusttext:
* proposed by Martin Dougiamas * implemented by skodak Usage: 1/ change enabletrusttext to yes in site settings (it is off by default) or set it in config.php 2/ assign moodle/site:trustcontent capability to users whose text submitted in glossary entries, comments, forum posts etc. should not be cleaned == they can use javascript or any other forbidden tags in glossary and forums... done: * core * glossary (without proper upgrade) to do: * data cleaning in upgrades * forum, blocks and some other places (MD decides)
This commit is contained in:
parent
8618b509fd
commit
7d8a3cb06a
12 changed files with 193 additions and 33 deletions
|
@ -43,6 +43,8 @@ if (!$glossary->studentcanpost && !has_capability('mod/glossary:manageentries',
|
|||
}
|
||||
if ( $confirm ) {
|
||||
$form = data_submitted();
|
||||
trusttext_after_edit($form->text, $context);
|
||||
|
||||
if ( !isset($form->usedynalink) ) {
|
||||
$form->usedynalink = 0;
|
||||
}
|
||||
|
@ -245,6 +247,7 @@ if ( $confirm ) {
|
|||
$newentry->userid = $form->userid;
|
||||
$newentry->timecreated = $form->timecreated;
|
||||
|
||||
|
||||
if ( $aliases = get_records("glossary_alias","entryid",$e) ) {
|
||||
foreach ($aliases as $alias) {
|
||||
$newentry->aliases .= $alias->alias . "\n";
|
||||
|
@ -332,7 +335,7 @@ $tab = GLOSSARY_ADDENTRY_VIEW;
|
|||
include("tabs.html");
|
||||
|
||||
if (!$e) {
|
||||
require_capability('glossary_write', $context);
|
||||
require_capability('mod/glossary:write', $context);
|
||||
}
|
||||
|
||||
include("edit.html");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue