Commit 361dce53 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Allow files in admin public folder to be added to the logged in menu

parent 7211a9fb
......@@ -419,11 +419,12 @@ class ArtefactTypeFile extends ArtefactTypeFileBase {
public static function get_admin_files($public) {
$pubfolder = ArtefactTypeFolder::admin_public_folder_id();
if ($public) {
$foldersql = 'parent = ' . ArtefactTypeFolder::admin_public_folder_id();
$foldersql = ' a.parent = ' . $pubfolder;
}
else {
$foldersql = 'parent IS NULL';
$foldersql = ' (a.parent = ' . $pubfolder . ' OR a.parent IS NULL) ';
}
$prefix = get_config('dbprefix');
return get_records_sql_array('
......@@ -431,8 +432,8 @@ class ArtefactTypeFile extends ArtefactTypeFileBase {
a.id, a.title
FROM ' . $prefix . 'artefact a
INNER JOIN ' . $prefix . 'artefact_file_files f ON f.artefact = a.id
WHERE a.' . $foldersql . "
AND f.adminfiles = 1
WHERE f.adminfiles = 1
AND ' . $foldersql . "
AND a.artefacttype != 'folder'", null);
}
......
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