Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mahara
mahara
Commits
36cb264f
Commit
36cb264f
authored
Apr 15, 2015
by
Aaron Wells
Committed by
Gerrit Code Review
Apr 15, 2015
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Explicitly tell the template to use the AJAX block loader"
parents
c8ed0816
29053d1b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
htdocs/blocktype/lib.php
htdocs/blocktype/lib.php
+5
-1
htdocs/theme/raw/templates/view/blocktypecontainerviewing.tpl
...cs/theme/raw/templates/view/blocktypecontainerviewing.tpl
+3
-3
No files found.
htdocs/blocktype/lib.php
View file @
36cb264f
...
...
@@ -894,11 +894,16 @@ class BlockInstance {
if
(
!
safe_require_plugin
(
'blocktype'
,
$this
->
get
(
'blocktype'
)))
{
return
;
}
$smarty
=
smarty_core
();
$classname
=
generate_class_name
(
'blocktype'
,
$this
->
get
(
'blocktype'
));
if
(
get_config
(
'ajaxifyblocks'
)
&&
call_static_method
(
$classname
,
'should_ajaxify'
))
{
$content
=
''
;
$smarty
->
assign
(
'loadbyajax'
,
true
);
}
else
{
$smarty
->
assign
(
'loadbyajax'
,
false
);
try
{
$content
=
call_static_method
(
$classname
,
'render_instance'
,
$this
);
}
...
...
@@ -915,7 +920,6 @@ class BlockInstance {
}
}
$smarty
=
smarty_core
();
$smarty
->
assign
(
'id'
,
$this
->
get
(
'id'
));
$smarty
->
assign
(
'blocktype'
,
$this
->
get
(
'blocktype'
));
// hide the title if required and no content is present
...
...
htdocs/theme/raw/templates/view/blocktypecontainerviewing.tpl
View file @
36cb264f
...
...
@@ -17,13 +17,13 @@
<span
class=
"cb"
></span>
</div>
{/
if
}
<div
id=
"blockinstance-content-
{
$id
}
"
class=
"blockinstance-content
{
if
$retractable
&&
$retractedonload
}
js-hidden
{/
if
}
"
>
{
if
$content
}
{
$content
|
safe
}
{
else
}
{
if
$loadbyajax
}
<img
src=
"
{
theme_image_url
filename
=
"loading"
}
"
/>
<script
type=
"text/javascript"
>
jQuery
(
"
div#blockinstance-content-
{
$id
}
"
).
load
(
"
{
$WWWROOT
}
blocktype/blocktype.ajax.php?blockid=
{
$id
}
"
);
</script>
{
else
}
{
$content
|
safe
}
{/
if
}
</div>
</div>
...
...
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