Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Moodle Filter Opencast
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elc
Moodle Filter Opencast
Commits
0f646b5f
Commit
0f646b5f
authored
7 years ago
by
TamaraGunkel
Browse files
Options
Downloads
Plain Diff
Merge branch 'tobiasreischmann-feature/engageurl'
parents
7b364303
c58af724
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
filter.php
+11
-7
11 additions, 7 deletions
filter.php
lang/en/filter_opencast.php
+3
-1
3 additions, 1 deletion
lang/en/filter_opencast.php
lib.php
+4
-4
4 additions, 4 deletions
lib.php
settings.php
+5
-1
5 additions, 1 deletion
settings.php
version.php
+1
-1
1 addition, 1 deletion
version.php
with
24 additions
and
14 deletions
filter.php
+
11
−
7
View file @
0f646b5f
...
...
@@ -69,24 +69,28 @@ class filter_opencast extends moodle_text_filter {
}
else
if
(
$video
)
{
$video
=
false
;
if
(
substr
(
$match
,
0
,
7
)
===
"<source"
)
{
// Get apiurl from opencast tool.
$apiurl
=
get_config
(
'tool_opencast'
,
'apiurl'
);
// Get baseurl either from engageurl setting or from opencast tool.
$baseurl
=
get_config
(
'filter_opencast'
,
'engageurl'
);
if
(
empty
(
$baseurl
))
{
$baseurl
=
get_config
(
'tool_opencast'
,
'apiurl'
);
}
// Check if video is from opencast.
if
(
strpos
(
$match
,
$
api
url
)
===
false
)
{
if
(
strpos
(
$match
,
$
base
url
)
===
false
)
{
continue
;
}
if
(
strpos
(
$
api
url
,
'http'
)
!==
0
)
{
$
api
url
=
'http://'
.
$
api
url
;
if
(
strpos
(
$
base
url
,
'http'
)
!==
0
)
{
$
base
url
=
'http://'
.
$
base
url
;
}
// Extract id.
$id
=
substr
(
$match
,
strpos
(
$match
,
'api/'
)
+
4
,
36
);
$src
=
$CFG
->
wwwroot
.
'/filter/opencast/player/core.html?id='
.
$id
.
'&ocurl='
.
urlencode
(
$
api
url
);
$src
=
$CFG
->
wwwroot
.
'/filter/opencast/player/core.html?id='
.
$id
.
'&ocurl='
.
urlencode
(
$
base
url
);
// Create link to video.
$link
=
$
api
url
.
'/engage/theodul/ui/core.html?id='
.
$id
;
$link
=
$
base
url
.
'/engage/theodul/ui/core.html?id='
.
$id
;
// Collect the needed data being submitted to the template.
$mustachedata
=
new
stdClass
();
...
...
This diff is collapsed.
Click to expand it.
lang/en/filter_opencast.php
+
3
−
1
View file @
0f646b5f
...
...
@@ -29,3 +29,5 @@ $string['setting_consumerkey'] = 'Consumer key';
$string
[
'setting_consumerkey_desc'
]
=
'LTI Consumer key'
;
$string
[
'setting_consumersecret'
]
=
'Consumer secret'
;
$string
[
'setting_consumersecret_desc'
]
=
'LTI Consumer secret'
;
$string
[
'setting_engageurl'
]
=
'URL of the Opencast Engage server'
;
$string
[
'setting_engageurl_desc'
]
=
'If empty, the base URL of the admin tool is used.'
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
lib.php
+
4
−
4
View file @
0f646b5f
...
...
@@ -32,8 +32,8 @@ require_once($CFG->dirroot . '/lib/oauthlib.php');
function
filter_opencast_login
()
{
global
$PAGE
;
// Get
api
url of opencast
.
$endpoint
=
get_config
(
'
tool
_opencast'
,
'
api
url'
);
// Get url of opencast
engage server
$endpoint
=
get_config
(
'
filter
_opencast'
,
'
engage
url'
);
if
(
strpos
(
$endpoint
,
'http'
)
!==
0
)
{
$endpoint
=
'http://'
.
$endpoint
;
}
...
...
@@ -44,13 +44,13 @@ function filter_opencast_login() {
// Render form.
$renderer
=
$PAGE
->
get_renderer
(
'filter_opencast'
);
echo
$renderer
->
render_
player
(
$endpoint
,
$params
);
echo
$renderer
->
render_
lti_form
(
$endpoint
,
$params
);
// Submit form.
$PAGE
->
requires
->
js_call_amd
(
'filter_opencast/form'
,
'init'
);
}
function
filter_opencast_create_parameters
()
{
function
filter_opencast_create_parameters
(
$endpoint
)
{
global
$CFG
,
$COURSE
,
$USER
;
// Get consumerkey and consumersecret.
...
...
This diff is collapsed.
Click to expand it.
settings.php
+
5
−
1
View file @
0f646b5f
...
...
@@ -27,7 +27,11 @@ if ($ADMIN->fulltree) {
$settings
->
add
(
new
admin_setting_configtext
(
'filter_opencast/consumerkey'
,
get_string
(
'setting_consumerkey'
,
'filter_opencast'
),
get_string
(
'setting_consumerkey_desc'
,
'filter_opencast'
),
''
));
$settings
->
add
(
new
admin_setting_config
text
(
'filter_opencast/consumersecret'
,
$settings
->
add
(
new
admin_setting_config
passwordunmask
(
'filter_opencast/consumersecret'
,
get_string
(
'setting_consumersecret'
,
'filter_opencast'
),
get_string
(
'setting_consumersecret_desc'
,
'filter_opencast'
),
''
));
$settings
->
add
(
new
admin_setting_configtext
(
'filter_opencast/engageurl'
,
get_string
(
'setting_engageurl'
,
'filter_opencast'
),
get_string
(
'setting_engageurl_desc'
,
'filter_opencast'
),
''
));
}
This diff is collapsed.
Click to expand it.
version.php
+
1
−
1
View file @
0f646b5f
...
...
@@ -25,7 +25,7 @@
defined
(
'MOODLE_INTERNAL'
)
||
die
();
$plugin
->
version
=
20180
21501
;
// The current plugin version (Date: YYYYMMDDXX).
$plugin
->
version
=
20180
31900
;
// The current plugin version (Date: YYYYMMDDXX).
$plugin
->
requires
=
2017050500
;
// Requires this Moodle version.
$plugin
->
component
=
'filter_opencast'
;
// Full name of the plugin.
$plugin
->
dependencies
=
array
(
'tool_opencast'
=>
ANY_VERSION
);
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