Línea 245... |
Línea 245... |
245 |
* @param bool $enabled Whether the library is enabled or not
|
245 |
* @param bool $enabled Whether the library is enabled or not
|
246 |
* @param int $runnable Whether the library is runnable (1) or not (0)
|
246 |
* @param int $runnable Whether the library is runnable (1) or not (0)
|
247 |
* @return stdClass An object representing the added library record
|
247 |
* @return stdClass An object representing the added library record
|
248 |
*/
|
248 |
*/
|
249 |
public function create_library_record(string $machinename, string $title, int $majorversion = 1,
|
249 |
public function create_library_record(string $machinename, string $title, int $majorversion = 1,
|
250 |
int $minorversion = 0, int $patchversion = 1, string $semantics = '', string $addto = null,
|
250 |
int $minorversion = 0, int $patchversion = 1, string $semantics = '', ?string $addto = null,
|
251 |
string $tutorial = null, string $example = null, bool $enabled = true, int $runnable = 1): stdClass {
|
251 |
?string $tutorial = null, ?string $example = null, bool $enabled = true, int $runnable = 1): stdClass {
|
252 |
global $DB;
|
252 |
global $DB;
|
Línea 253... |
Línea 253... |
253 |
|
253 |
|
254 |
$content = [
|
254 |
$content = [
|
255 |
'machinename' => $machinename,
|
255 |
'machinename' => $machinename,
|
Línea 281... |
Línea 281... |
281 |
* @param string $jsoncontent The content in json format
|
281 |
* @param string $jsoncontent The content in json format
|
282 |
* @param string $filtered The filtered content parameters
|
282 |
* @param string $filtered The filtered content parameters
|
283 |
* @param array|null $filerecord The file associated to the H5P entry.
|
283 |
* @param array|null $filerecord The file associated to the H5P entry.
|
284 |
* @return int The ID of the added record
|
284 |
* @return int The ID of the added record
|
285 |
*/
|
285 |
*/
|
286 |
public function create_h5p_record(int $mainlibid, string $jsoncontent = null, string $filtered = null,
|
286 |
public function create_h5p_record(int $mainlibid, ?string $jsoncontent = null, ?string $filtered = null,
|
287 |
?array $filerecord = null): int {
|
287 |
?array $filerecord = null): int {
|
288 |
global $DB;
|
288 |
global $DB;
|
Línea 289... |
Línea 289... |
289 |
|
289 |
|
290 |
if (!$jsoncontent) {
|
290 |
if (!$jsoncontent) {
|