MDL-14722 Added new maxattachments setting at admin and forum level to

set the maximum number of attachments for forum posts.   Default: 1.

Works, but still needs a bit of polishing to deal with re-editing posts (to stop people going above maxattachments)

Also fixed documentation for attachments.
This commit is contained in:
moodler 2008-09-08 05:46:42 +00:00
parent 757f30a20c
commit 30a9aff589
10 changed files with 111 additions and 28 deletions

View file

@ -166,6 +166,22 @@ function xmldb_forum_upgrade($oldversion) {
upgrade_mod_savepoint($result, 2008081900, 'forum');
}
if ($result && $oldversion < 2008090800) {
/// Define field maxattachments to be added to forum
$table = new xmldb_table('forum');
$field = new xmldb_field('maxattachments', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '1', 'maxbytes');
/// Conditionally launch add field maxattachments
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
/// forum savepoint reached
upgrade_mod_savepoint($result, 2008090800, 'forum');
}
return $result;
}