Skip to content
GitLab
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
d7965c0d
Commit
d7965c0d
authored
Dec 08, 2006
by
Penny Leach
Browse files
added artefact_in_view function for strict artefact -> view checking
(checks parent cache)
parent
7acb8113
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/mahara.php
View file @
d7965c0d
...
...
@@ -1023,6 +1023,19 @@ function can_view_view($view_id, $user_id=null) {
return
false
;
}
function
artefact_in_view
(
$artefact
,
$view
)
{
$prefix
=
get_config
(
'dbprefix'
);
$sql
=
'SELECT a.id
FROM mh_view_artefact a WHERE view = ? AND artefact = ?
UNION
SELECT c.parent
FROM mh_view_artefact top JOIN mh_artefact_parent_cache c
ON c.parent = top.artefact
WHERE top.view = ? AND c.artefact = ?'
;
return
record_exists_sql
(
$sql
,
array
(
$view
,
$artefact
,
$view
,
$artefact
));
}
function
get_dir_contents
(
$directory
)
{
$contents
=
array
();
$dirhandle
=
opendir
(
$directory
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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