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
204bd5b2
Commit
204bd5b2
authored
Apr 15, 2015
by
Robert Lyon
Committed by
Gerrit Code Review
Apr 15, 2015
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Limit AJAX loading to DB-heavy blocks"
parents
747c74ac
e350a077
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
4 deletions
+18
-4
htdocs/blocktype/inbox/lib.php
htdocs/blocktype/inbox/lib.php
+3
-0
htdocs/blocktype/lib.php
htdocs/blocktype/lib.php
+4
-4
htdocs/blocktype/newviews/lib.php
htdocs/blocktype/newviews/lib.php
+4
-0
htdocs/blocktype/recentforumposts/lib.php
htdocs/blocktype/recentforumposts/lib.php
+4
-0
htdocs/blocktype/watchlist/lib.php
htdocs/blocktype/watchlist/lib.php
+3
-0
No files found.
htdocs/blocktype/inbox/lib.php
View file @
204bd5b2
...
...
@@ -182,4 +182,7 @@ class PluginBlocktypeInbox extends SystemBlocktype {
return
get_string
(
'inboxblocktitle'
);
}
public
static
function
should_ajaxify
()
{
return
true
;
}
}
htdocs/blocktype/lib.php
View file @
204bd5b2
...
...
@@ -123,17 +123,17 @@ abstract class PluginBlocktype extends Plugin implements IPluginBlocktype {
* improves page-load times by allowing blocks to be rendered in parallel instead
* of in serial.
*
* You
might want to disable
this for:
* You
should avoid enabling
this for:
* - Blocks with particularly finicky Javascript contents
* - Blocks that need to write to the session (the Ajax loader uses the session in read-only)
* - Blocks that won't take long to render (static content, external content)
* - Blocks that use hide_title_on_empty_content() (since you have to compute the content first
* in order for that to work)
*
* @return boolean
*/
public
static
function
should_ajaxify
()
{
// If we want to hide the title if there is empty content, then we need to compute
// the content first, and we cant' do that if we're using AJAX.
return
!
static
::
hide_title_on_empty_content
();
return
false
;
}
/**
...
...
htdocs/blocktype/newviews/lib.php
View file @
204bd5b2
...
...
@@ -67,4 +67,8 @@ class PluginBlocktypeNewViews extends SystemBlocktype {
public
static
function
get_instance_title
(
BlockInstance
$instance
)
{
return
get_string
(
'title'
,
'blocktype.newviews'
);
}
public
static
function
should_ajaxify
()
{
return
true
;
}
}
htdocs/blocktype/recentforumposts/lib.php
View file @
204bd5b2
...
...
@@ -206,4 +206,8 @@ class PluginBlocktypeRecentForumPosts extends SystemBlocktype {
}
return
get_string
(
'title'
,
'blocktype.recentforumposts'
);
}
public
static
function
should_ajaxify
()
{
return
true
;
}
}
htdocs/blocktype/watchlist/lib.php
View file @
204bd5b2
...
...
@@ -98,4 +98,7 @@ class PluginBlocktypeWatchlist extends SystemBlocktype {
return
$view
->
get
(
'owner'
)
!=
null
;
}
public
static
function
should_ajaxify
()
{
return
true
;
}
}
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