Commit 0c71484e authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files
parents 11db718b 6f53cf7c
......@@ -38,8 +38,10 @@ $result = array();
if ($adminfiles = ArtefactTypeFile::get_admin_files($public)) {
foreach ($adminfiles as $adminfile) {
$result['adminfiles'][] = array('name' => $adminfile->title,
'id' => $adminfile->id);
$result['adminfiles'][] = array(
'name' => (!$public && $adminfile->parent ? get_string('public','admin').':' : '')
. $adminfile->title,
'id' => $adminfile->id);
}
}
else {
......
......@@ -419,20 +419,21 @@ 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('
SELECT
a.id, a.title
a.id, a.title, a.parent
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);
}
......
......@@ -132,6 +132,7 @@ $string['loadingmenuitems'] = 'Loading menu items';
$string['loadmenuitemsfailed'] = 'Failed to load menu items';
$string['loggedinmenu'] = 'Logged in menu';
$string['loggedoutmenu'] = 'Public menu';
$string['public'] = 'public';
// Site content
$string['about'] = 'About';
......
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