ILIAS
eassessment Revision 61809
◀ 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
+-----------------------------------------------------------------------------+
4
| ILIAS open source |
5
+-----------------------------------------------------------------------------+
6
| Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7
| |
8
| This program is free software; you can redistribute it and/or |
9
| modify it under the terms of the GNU General Public License |
10
| as published by the Free Software Foundation; either version 2 |
11
| of the License, or (at your option) any later version. |
12
| |
13
| This program is distributed in the hope that it will be useful, |
14
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
15
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16
| GNU General Public License for more details. |
17
| |
18
| You should have received a copy of the GNU General Public License |
19
| along with this program; if not, write to the Free Software |
20
| Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21
+-----------------------------------------------------------------------------+
22
*/
23
24
include_once(
"classes/class.ilObjectAccess.php"
);
25
34
class
ilObjFolderAccess
extends
ilObjectAccess
35
{
36
private
static
$folderSettings
;
37
38
function
_construct
() {
39
parent::__construct();
40
}
41
42
private
static
function
getFolderSettings
() {
43
if
(is_null (
ilObjFolderAccess::$folderSettings
))
44
{
45
ilObjFolderAccess::$folderSettings
=
new
ilSetting
(
'fold'
);
46
}
47
return
ilObjFolderAccess::$folderSettings
;
48
}
49
50
63
function
_getCommands
()
64
{
65
$commands = array();
66
$commands[] = array(
"permission"
=>
"read"
,
"cmd"
=>
"view"
,
"lang_var"
=>
"show"
,
"default"
=>
true
);
67
// why here, why read permission? it just needs info_screen_enabled = true in ilObjCategoryListGUI (alex, 30.7.2008)
68
// this is not consistent, with all other objects...
69
//$commands[] = array("permission" => "read", "cmd" => "showSummary", "lang_var" => "info_short", "enable_anonymous" => "false");
70
if
(
ilObjFolderAccess::hasDownloadAction
(
$_GET
[
"ref_id"
]))
71
{
72
$commands[] = array(
"permission"
=>
"read"
,
"cmd"
=>
"downloadFolder"
,
"lang_var"
=>
"download"
,
"enable_anonymous"
=>
"false"
);
73
}
74
// BEGIN WebDAV: Mount Webfolder.
75
include_once (
'Services/WebDAV/classes/class.ilDAVActivationChecker.php'
);
76
if
(
ilDAVActivationChecker::_isActive
())
77
{
78
include_once
'./Services/WebDAV/classes/class.ilDAVUtils.php'
;
79
if
(
ilDAVUtils::getInstance
()->isLocalPasswordInstructionRequired())
80
{
81
$commands[] = array(
'permission'
=>
'read'
,
'cmd'
=>
'showPasswordInstruction'
,
'lang_var'
=>
'mount_webfolder'
,
'enable_anonymous'
=>
'false'
);
82
}
83
else
84
{
85
$commands[] = array(
"permission"
=>
"read"
,
"cmd"
=>
"mount_webfolder"
,
"lang_var"
=>
"mount_webfolder"
,
"enable_anonymous"
=>
"false"
);
86
}
87
}
88
$commands[] = array(
"permission"
=>
"write"
,
"cmd"
=>
"edit"
,
"lang_var"
=>
"edit"
);
89
90
return
$commands;
91
}
92
93
94
private
function
hasDownloadAction
(
$ref_id
)
95
{
96
global $tree, $ilUser;
97
$settings =
ilObjFolderAccess::getFolderSettings
();
98
// default value should reflect previous behaviour (-> 0)
99
if
($settings->get(
"enable_download_folder"
, 0) != 1)
100
return
false
;
101
102
/*
103
* deactivated check for now, because wrong ref_id here!
104
105
$children = $tree->getChildsByTypeFilter($ref_id, array("file","fold"));
106
107
// no children at all, so no download button
108
if (count ($children) == 0)
109
return false;
110
// check if at least one of the children has a read permission
111
foreach ($children as $child)
112
{
113
if ($rbacsystem->checkAccessOfUser($ilUser->getId(), "read", $child["ref_id"]))
114
return true;
115
}
116
return false;
117
*/
118
return
true
;
119
}
120
121
}
122
123
?>
Modules
Folder
classes
class.ilObjFolderAccess.php
Generated on Mon Apr 25 2016 19:01:09 for ILIAS by
1.8.1.2 (using
Doxyfile
)