Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
9f12416c
Commit
9f12416c
authored
Oct 17, 2018
by
Robert Lyon
Committed by
Gerrit Code Review
Oct 17, 2018
Browse files
Merge "Bug 1797278: getting blocktype title through class"
parents
cd2c81a1
2b8287dc
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/statistics.php
View file @
9f12416c
...
...
@@ -195,19 +195,24 @@ function site_statistics($full=false) {
// Views graph
$smarty
=
smarty_core
();
$maxblocktypes
=
5
;
$
smarty
->
assign
(
'
blocktypecounts
'
,
get_records_sql_array
(
"
$blocktypecounts
=
get_records_sql_array
(
"
SELECT
b.blocktype,
CASE WHEN bi.artefactplugin IS NULL THEN b.blocktype
ELSE bi.artefactplugin || '/' || b.blocktype END AS langsection,
COUNT(b.id) AS blocks
FROM
{
block_instance
}
b
JOIN
{
blocktype_installed
}
bi ON (b.blocktype = bi.name)
JOIN
{
view
}
v ON (b.view = v.id AND v.type = 'portfolio')
GROUP BY b.blocktype
, langsection
GROUP BY b.blocktype
ORDER BY blocks DESC"
,
array
(),
0
,
$maxblocktypes
));
);
foreach
(
$blocktypecounts
as
$blocktype
)
{
safe_require
(
'blocktype'
,
$blocktype
->
blocktype
);
$classname
=
generate_class_name
(
'blocktype'
,
$blocktype
->
blocktype
);
$blocktype
->
title
=
$classname
::
get_title
();
}
$smarty
->
assign
(
'blocktypecounts'
,
$blocktypecounts
);
$smarty
->
assign
(
'viewtypes'
,
true
);
$smarty
->
assign
(
'viewcount'
,
$data
[
'views'
]);
$data
[
'viewsinfo'
]
=
$smarty
->
fetch
(
'admin/viewstatssummary.tpl'
);
...
...
htdocs/theme/raw/templates/admin/viewstatssummary.tpl
View file @
9f12416c
...
...
@@ -5,7 +5,7 @@
<h4>
{
str
tag
=
blockcountsbytype
section
=
admin
}
</h4>
<ul
class=
"list-group list-group-lite unstyled"
>
{
foreach
from
=
$blocktypecounts
item
=
item
}
<li
class=
"list-group-item"
>
{
str
tag
=
title
section
=
blocktype
.
$item
->
langsection
}
:
{
$item
->
blocks
}
</li>
<li
class=
"list-group-item"
>
{
$item
->
title
}
:
{
$item
->
blocks
}
</li>
{/
foreach
}
</ul>
{
if
$viewtypes
}
...
...
Write
Preview
Supports
Markdown
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