troodle-expcontent/lib.php
Kumi 3247092e59
feat: add intro fields to exp360 module
Added 'intro' and 'introformat' fields to the exp360 module for enhanced activity descriptions. Updated database schema and upgrade script to accommodate new fields. Modified add and update instance functions and the form to manage intro fields. Bumped module version to 2024070503.
2024-07-05 11:38:10 +02:00

44 lines
858 B
PHP

<?php
defined('MOODLE_INTERNAL') || die();
function exp360_add_instance($exp360)
{
global $DB;
$exp360->timemodified = time();
$exp360->timecreated = time();
// Process standard intro fields.
$exp360->introformat = FORMAT_HTML;
$exp360->intro = '';
return $DB->insert_record('exp360', $exp360);
}
function exp360_update_instance($exp360)
{
global $DB;
$exp360->timemodified = time();
$exp360->id = $exp360->instance;
// Process standard intro fields.
$exp360->introformat = FORMAT_HTML;
$exp360->intro = '';
return $DB->update_record('exp360', $exp360);
}
function exp360_delete_instance($id)
{
global $DB;
if (!$exp360 = $DB->get_record('exp360', array('id' => $id))) {
return false;
}
$DB->delete_records('exp360', array('id' => $exp360->id));
return true;
}