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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elc
Moodle Filter Opencast
Commits
840b2ba7
Unverified
Commit
840b2ba7
authored
6 years ago
by
Tobias Reischmann
Browse files
Options
Downloads
Patches
Plain Diff
Moved get_config out of for loop
parent
a31e6ab3
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
filter.php
+6
-6
6 additions, 6 deletions
filter.php
with
6 additions
and
6 deletions
filter.php
+
6
−
6
View file @
840b2ba7
...
...
@@ -43,6 +43,12 @@ class filter_opencast extends moodle_text_filter {
public
function
filter
(
$text
,
array
$options
=
array
())
{
global
$PAGE
;
// 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'
);
}
if
(
stripos
(
$text
,
'</video>'
)
===
false
)
{
// Performance shortcut - if there are no </video> tags, nothing can match.
return
$text
;
...
...
@@ -73,12 +79,6 @@ class filter_opencast extends moodle_text_filter {
$video
=
false
;
if
(
substr
(
$match
,
0
,
7
)
===
"<source"
)
{
// 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
,
$baseurl
)
===
false
)
{
continue
;
...
...
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