ILIAS
Release_4_2_x_branch Revision 61807
◀ ilDoc Overview
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Groups
Pages
class.ilObjFolderAccess.php
Go to the documentation of this file.
1
<?php
2
3
/* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5
include_once(
"classes/class.ilObjectAccess.php"
);
6
15
class
ilObjFolderAccess
extends
ilObjectAccess
16
{
17
private
static
$folderSettings
;
18
19
function
_construct
() {
20
parent::__construct();
21
}
22
23
private
static
function
getFolderSettings
() {
24
if
(is_null (
ilObjFolderAccess::$folderSettings
))
25
{
26
ilObjFolderAccess::$folderSettings
=
new
ilSetting
(
'fold'
);
27
}
28
return
ilObjFolderAccess::$folderSettings
;
29
}
30
31
44
function
_getCommands
()
45
{
46
$commands = array();
47
$commands[] = array(
"permission"
=>
"read"
,
"cmd"
=>
"view"
,
"lang_var"
=>
"show"
,
"default"
=>
true
);
48
// why here, why read permission? it just needs info_screen_enabled = true in ilObjCategoryListGUI (alex, 30.7.2008)
49
// this is not consistent, with all other objects...
50
//$commands[] = array("permission" => "read", "cmd" => "showSummary", "lang_var" => "info_short", "enable_anonymous" => "false");
51
if
(
ilObjFolderAccess::hasDownloadAction
(
$_GET
[
"ref_id"
]))
52
{
53
$commands[] = array(
"permission"
=>
"read"
,
"cmd"
=>
"downloadFolder"
,
"lang_var"
=>
"download"
,
"enable_anonymous"
=>
"false"
);
54
}
55
// BEGIN WebDAV: Mount Webfolder.
56
include_once (
'Services/WebDAV/classes/class.ilDAVActivationChecker.php'
);
57
if
(
ilDAVActivationChecker::_isActive
())
58
{
59
include_once
'./Services/WebDAV/classes/class.ilDAVUtils.php'
;
60
if
(
ilDAVUtils::getInstance
()->isLocalPasswordInstructionRequired())
61
{
62
$commands[] = array(
'permission'
=>
'read'
,
'cmd'
=>
'showPasswordInstruction'
,
'lang_var'
=>
'mount_webfolder'
,
'enable_anonymous'
=>
'false'
);
63
}
64
else
65
{
66
$commands[] = array(
"permission"
=>
"read"
,
"cmd"
=>
"mount_webfolder"
,
"lang_var"
=>
"mount_webfolder"
,
"enable_anonymous"
=>
"false"
);
67
}
68
}
69
$commands[] = array(
"permission"
=>
"write"
,
"cmd"
=>
"edit"
,
"lang_var"
=>
"edit"
);
70
71
return
$commands;
72
}
73
74
75
private
function
hasDownloadAction
(
$ref_id
)
76
{
77
global $tree, $ilUser;
78
$settings =
ilObjFolderAccess::getFolderSettings
();
79
// default value should reflect previous behaviour (-> 0)
80
if
($settings->get(
"enable_download_folder"
, 0) != 1)
81
return
false
;
82
83
/*
84
* deactivated check for now, because wrong ref_id here!
85
86
$children = $tree->getChildsByTypeFilter($ref_id, array("file","fold"));
87
88
// no children at all, so no download button
89
if (count ($children) == 0)
90
return false;
91
// check if at least one of the children has a read permission
92
foreach ($children as $child)
93
{
94
if ($rbacsystem->checkAccessOfUser($ilUser->getId(), "read", $child["ref_id"]))
95
return true;
96
}
97
return false;
98
*/
99
return
true
;
100
}
101
102
}
103
104
?>
Modules
Folder
classes
class.ilObjFolderAccess.php
Generated on Fri Apr 22 2016 19:03:47 for ILIAS by
1.8.1.2 (using
Doxyfile
)