Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
h5p-3425407
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
h5p-3425407
Commits
7d4e7a5c
Commit
7d4e7a5c
authored
5 years ago
by
paalj
Browse files
Options
Downloads
Patches
Plain Diff
Fix indentation
parent
97c9cfa9
No related branches found
Branches containing commit
Tags
7.x-1.40
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
h5p.classes.inc
+47
-47
47 additions, 47 deletions
h5p.classes.inc
with
47 additions
and
47 deletions
h5p.classes.inc
+
47
−
47
View file @
7d4e7a5c
...
...
@@ -809,57 +809,57 @@ class H5PDrupal implements H5PFrameworkInterface {
*/
public
function
loadContent
(
$id
)
{
$content
=
db_query
(
"SELECT hn.content_id AS id,
hn.json_content AS params,
hn.embed_type,
n.title,
n.language,
hl.library_id,
hl.machine_name AS library_name,
hl.major_version AS library_major_version,
hl.minor_version AS library_minor_version,
hl.embed_types AS library_embed_types,
hl.fullscreen AS library_fullscreen,
hn.filtered,
hn.disable,
hn.slug,
hn.authors AS meta_authors,
hn.source AS meta_source,
hn.license AS meta_license,
hn.license_version AS meta_license_version,
hn.license_extras AS meta_license_extras,
hn.year_from AS meta_year_from,
hn.year_to AS meta_year_to,
hn.changes AS meta_changes,
hn.author_comments AS meta_author_comments
FROM
{
h5p_nodes
}
hn
JOIN
{
node
}
n ON n.nid = hn.nid
JOIN
{
h5p_libraries
}
hl ON hl.library_id = hn.main_library_id
WHERE content_id = :id"
,
array
(
':id'
=>
$id
)
)
->
fetchObject
();
"SELECT hn.content_id AS id,
hn.json_content AS params,
hn.embed_type,
n.title,
n.language,
hl.library_id,
hl.machine_name AS library_name,
hl.major_version AS library_major_version,
hl.minor_version AS library_minor_version,
hl.embed_types AS library_embed_types,
hl.fullscreen AS library_fullscreen,
hn.filtered,
hn.disable,
hn.slug,
hn.authors AS meta_authors,
hn.source AS meta_source,
hn.license AS meta_license,
hn.license_version AS meta_license_version,
hn.license_extras AS meta_license_extras,
hn.year_from AS meta_year_from,
hn.year_to AS meta_year_to,
hn.changes AS meta_changes,
hn.author_comments AS meta_author_comments
FROM
{
h5p_nodes
}
hn
JOIN
{
node
}
n ON n.nid = hn.nid
JOIN
{
h5p_libraries
}
hl ON hl.library_id = hn.main_library_id
WHERE content_id = :id"
,
array
(
':id'
=>
$id
)
)
->
fetchObject
();
if
(
$content
===
FALSE
)
{
return
NULL
;
}
if
(
$content
===
FALSE
)
{
return
NULL
;
}
// Build metadata object
$content
->
metadata
=
array
();
foreach
(
array
(
'authors'
,
'source'
,
'license'
,
'license_version'
,
'license_extras'
,
'year_from'
,
'year_to'
,
'changes'
,
'author_comments'
)
as
$value
)
{
$lookup
=
'meta_'
.
$value
;
if
(
isset
(
$content
->
$lookup
))
{
$content
->
metadata
[
$value
]
=
$content
->
$lookup
;
// These fields are used to store complex data and need to be "extended"
if
(
$value
===
'authors'
||
$value
===
'changes'
)
{
$content
->
metadata
[
$value
]
=
json_decode
(
$content
->
metadata
[
$value
]);
}
unset
(
$content
->
$lookup
);
// Build metadata object
$content
->
metadata
=
array
();
foreach
(
array
(
'authors'
,
'source'
,
'license'
,
'license_version'
,
'license_extras'
,
'year_from'
,
'year_to'
,
'changes'
,
'author_comments'
)
as
$value
)
{
$lookup
=
'meta_'
.
$value
;
if
(
isset
(
$content
->
$lookup
))
{
$content
->
metadata
[
$value
]
=
$content
->
$lookup
;
// These fields are used to store complex data and need to be "extended"
if
(
$value
===
'authors'
||
$value
===
'changes'
)
{
$content
->
metadata
[
$value
]
=
json_decode
(
$content
->
metadata
[
$value
]);
}
unset
(
$content
->
$lookup
);
}
$content
->
metadata
[
'title'
]
=
$content
->
title
;
$content
->
metadata
=
H5PCore
::
snakeToCamel
(
$content
->
metadata
);
}
$content
->
metadata
[
'title'
]
=
$content
->
title
;
$content
->
metadata
=
H5PCore
::
snakeToCamel
(
$content
->
metadata
);
return
H5PCore
::
snakeToCamel
(
$content
);
}
...
...
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