Commit d7965c0d authored by Penny Leach's avatar Penny Leach
Browse files

added artefact_in_view function for strict artefact -> view checking

(checks parent cache)
parent 7acb8113
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment