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
8b6d75e2
Commit
8b6d75e2
authored
Dec 22, 2006
by
Richard Mansfield
Browse files
adminfiles flag added to get_my_files_data
parent
33b1f3b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/file/lib.php
View file @
8b6d75e2
...
...
@@ -149,7 +149,7 @@ class ArtefactTypeFileBase extends ArtefactType {
AND artefacttype IN '
.
$filetypesql
,
array
(
$title
));
}
public
static
function
get_my_files_data
(
$parentfolderid
,
$userid
)
{
public
static
function
get_my_files_data
(
$parentfolderid
,
$userid
,
$adminfiles
=
null
)
{
$prefix
=
get_config
(
'dbprefix'
);
...
...
@@ -157,7 +157,7 @@ class ArtefactTypeFileBase extends ArtefactType {
// if blogs are installed then also return the number of blog
// posts each file is attached to
$bloginstalled
=
get_field
(
'artefact_installed'
,
'active'
,
'name'
,
'blog'
);
$bloginstalled
=
!
$adminfiles
&&
get_field
(
'artefact_installed'
,
'active'
,
'name'
,
'blog'
);
$filetypesql
=
"('"
.
join
(
"','"
,
PluginArtefactFile
::
get_artefact_types
())
.
"')"
;
$filedata
=
get_records_sql_array
(
'SELECT
...
...
@@ -170,7 +170,7 @@ class ArtefactTypeFileBase extends ArtefactType {
.
(
$bloginstalled
?
(
'LEFT OUTER JOIN '
.
$prefix
.
'artefact_blog_blogpost_file b ON b.file = a.id'
)
:
''
)
.
'
WHERE a.parent'
.
$foldersql
.
'
AND a.owner = '
.
$userid
.
'
AND
'
.
(
$adminfiles
?
'f.adminfile = 1'
:
(
'
a.owner = '
.
$userid
))
.
'
AND a.artefacttype IN '
.
$filetypesql
.
'
GROUP BY
1, 2, 3, 4, 5, 6;'
,
''
);
...
...
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