Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
mahara
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
mahara
mahara
Commits
48a73e21
Commit
48a73e21
authored
Dec 31, 2019
by
Cecilia Vela Gurovic
Committed by
Gerrit Code Review
Dec 31, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Bug 1855023: Warning produced when adding/ editing an image gallery block"
parents
8a1d0196
a5012e5c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
15 deletions
+20
-15
htdocs/blocktype/lib.php
htdocs/blocktype/lib.php
+20
-15
No files found.
htdocs/blocktype/lib.php
View file @
48a73e21
...
...
@@ -2085,9 +2085,9 @@ class BlockInstance {
* Returns javascript to grab & eval javascript from files on the web
*
* @param array $jsfiles Each element of $jsfiles is either a url, a local filename,
* or an array
of the form
* or an array
in the form of
* array(
* 'file' => string // url or local js filename
* 'file' => string // url or local js filename
(or empty if initjs only is required)
* 'initjs' => string // js to be executed once the file's
* // contents have been loaded
* )
...
...
@@ -2097,7 +2097,11 @@ class BlockInstance {
public
function
get_get_javascript_javascript
(
$jsfiles
)
{
$js
=
''
;
foreach
(
$jsfiles
as
$jsfile
)
{
if
(
is_array
(
$jsfile
)
&&
empty
(
$jsfile
[
'file'
])
&&
!
empty
(
$jsfile
[
'initjs'
]))
{
// Just dealing with initjs option only so do this on page load
$js
.
=
"jQuery(function() {\n"
.
$jsfile
[
'initjs'
]
.
"
\n
})"
;
}
else
{
$file
=
(
is_array
(
$jsfile
)
&&
!
empty
(
$jsfile
[
'file'
]))
?
$jsfile
[
'file'
]
:
$jsfile
;
if
(
stripos
(
$file
,
'http://'
)
===
false
&&
stripos
(
$file
,
'https://'
)
===
false
)
{
...
...
@@ -2115,6 +2119,7 @@ class BlockInstance {
}
$js
.
=
"});
\n
"
;
}
}
return
$js
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment