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
56edec15
Commit
56edec15
authored
Jun 25, 2009
by
Richard Mansfield
Browse files
Check viewtype when building blocktype category list on view editing page
parent
d8a11f78
Changes
1
Show whitespace changes
Inline
Side-by-side
htdocs/lib/view.php
View file @
56edec15
...
...
@@ -729,8 +729,9 @@ class View {
require_once
(
get_config
(
'docroot'
)
.
'/blocktype/lib.php'
);
$categories
=
array
();
$sql
=
'SELECT bic.* FROM {blocktype_installed_category} bic
JOIN {blocktype_installed} bi ON bic.blocktype = bi.name WHERE bi.active = 1'
;
foreach
(
get_records_sql_array
(
$sql
,
array
())
as
$blocktypecategory
)
{
JOIN {blocktype_installed} bi ON (bic.blocktype = bi.name AND bi.active = 1)
JOIN {blocktype_installed_viewtype} biv ON (bi.name = biv.blocktype AND biv.viewtype = ?)'
;
foreach
(
get_records_sql_array
(
$sql
,
array
(
$this
->
get
(
'type'
)))
as
$blocktypecategory
)
{
safe_require
(
'blocktype'
,
$blocktypecategory
->
blocktype
);
if
(
call_static_method
(
generate_class_name
(
"blocktype"
,
$blocktypecategory
->
blocktype
),
"allowed_in_view"
,
$this
))
{
if
(
!
isset
(
$categories
[
$blocktypecategory
->
category
]))
{
...
...
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