ILIAS
Release_3_10_x_branch Revision 61812
◀ ilDoc Overview
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
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
require_once
'Services/WebDAV/classes/class.ilDAVServer.php'
;
76
if
(
ilDAVServer::_isActive
() &&
ilDAVServer::_isActionsVisible
())
77
{
78
$commands[] = array(
"permission"
=>
"read"
,
"cmd"
=>
"mount_webfolder"
,
"lang_var"
=>
"mount_webfolder"
,
"enable_anonymous"
=>
"false"
);
79
}
80
$commands[] = array(
"permission"
=>
"write"
,
"cmd"
=>
"edit"
,
"lang_var"
=>
"edit"
);
81
// END WebDAV: Mount Webfolder.
82
83
return
$commands;
84
}
85
86
87
private
function
hasDownloadAction
(
$ref_id
)
88
{
89
global $tree, $ilUser;
90
$settings =
ilObjFolderAccess::getFolderSettings
();
91
// default value should reflect previous behaviour (-> 0)
92
if
($settings->get(
"enable_download_folder"
, 0) != 1)
93
return
false
;
94
95
/*
96
* deactivated check for now, because wrong ref_id here!
97
98
$children = $tree->getChildsByTypeFilter($ref_id, array("file","fold"));
99
100
// no children at all, so no download button
101
if (count ($children) == 0)
102
return false;
103
// check if at least one of the children has a read permission
104
foreach ($children as $child)
105
{
106
if ($rbacsystem->checkAccessOfUser($ilUser->getId(), "read", $child["ref_id"]))
107
return true;
108
}
109
return false;
110
*/
111
return
true
;
112
}
113
114
}
115
116
?>
Modules
Folder
classes
class.ilObjFolderAccess.php
Generated on Tue Apr 26 2016 19:00:34 for ILIAS by
1.8.1.2 (using
Doxyfile
)