Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle_mod-hvp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elc
moodle_mod-hvp
Commits
0dc0727a
Commit
0dc0727a
authored
6 years ago
by
Frode Petterson
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of github.com:h5p/h5p-moodle-plugin
parents
680faf33
87e21390
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
editor.js
+5
-1
5 additions, 1 deletion
editor.js
locallib.php
+6
-1
6 additions, 1 deletion
locallib.php
mod_form.php
+2
-1
2 additions, 1 deletion
mod_form.php
with
13 additions
and
3 deletions
editor.js
+
5
−
1
View file @
0dc0727a
...
...
@@ -23,8 +23,12 @@
$
(
'
input[name="h5paction"]
'
).
parents
(
'
.fitem
'
).
last
().
hide
();
}
const
mformId
=
H5PIntegration
.
editor
&&
H5PIntegration
.
editor
.
formId
!==
null
?
H5PIntegration
.
editor
.
formId
:
'
mform1
'
;
H5PEditor
.
init
(
$
(
'
#mform
1
'
),
$
(
'
#
'
+
mform
Id
),
$
(
'
input[name="h5paction"]
'
),
getRow
(
$fileField
),
getRow
(
$editor
),
...
...
This diff is collapsed.
Click to expand it.
locallib.php
+
6
−
1
View file @
0dc0727a
...
...
@@ -127,8 +127,12 @@ function hvp_get_core_assets($context) {
* Add required assets for displaying the editor.
*
* @param int $id Content being edited. null for creating new content
* @param string $mformid Id of Moodle form
*
* @throws coding_exception
* @throws moodle_exception
*/
function
hvp_add_editor_assets
(
$id
=
null
)
{
function
hvp_add_editor_assets
(
$id
=
null
,
$mformid
=
null
)
{
global
$PAGE
,
$CFG
,
$COURSE
;
// First we need to determine the context for permission handling.
...
...
@@ -201,6 +205,7 @@ function hvp_add_editor_assets($id = null) {
// @codingStandardsIgnoreLine
'apiVersion'
=>
H5PCore
::
$coreApi
,
'language'
=>
$language
,
'formId'
=>
$mformid
,
);
if
(
$id
!==
null
)
{
...
...
This diff is collapsed.
Click to expand it.
mod_form.php
+
2
−
1
View file @
0dc0727a
...
...
@@ -210,7 +210,8 @@ class mod_hvp_mod_form extends moodleform_mod {
// Add required editor assets.
require_once
(
'locallib.php'
);
\hvp_add_editor_assets
(
$content
===
null
?
null
:
$defaultvalues
[
'id'
]);
$mformid
=
$this
->
_form
->
getAttribute
(
'id'
);
\hvp_add_editor_assets
(
$content
===
null
?
null
:
$defaultvalues
[
'id'
],
$mformid
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment