ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilObjFolderAccess.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once("./Services/Object/classes/class.ilObjectAccess.php");
6 
16 {
17  private static $folderSettings;
18 
19  private static function getFolderSettings() {
21  {
23  }
25  }
26 
27 
40  static function _getCommands()
41  {
42  $commands = array();
43  $commands[] = array("permission" => "read", "cmd" => "view", "lang_var" => "show", "default" => true);
44 
45  include_once './Services/WebServices/FileManager/classes/class.ilFMSettings.php';
46  if(ilFMSettings::getInstance()->isEnabled())
47  {
48  $commands[] = array(
49  'permission' => 'read',
50  'cmd' => 'fileManagerLaunch',
51  'lang_var' => 'fm_start',
52  'enable_anonymous' => false
53  );
54  }
55 
56  // why here, why read permission? it just needs info_screen_enabled = true in ilObjCategoryListGUI (alex, 30.7.2008)
57  // this is not consistent, with all other objects...
58  //$commands[] = array("permission" => "read", "cmd" => "showSummary", "lang_var" => "info_short", "enable_anonymous" => "false");
60  {
61  $commands[] = array("permission" => "read", "cmd" => "downloadFolder", "lang_var" => "download"); // #18805
62  }
63  // BEGIN WebDAV: Mount Webfolder.
64  include_once ('Services/WebDAV/classes/class.ilDAVActivationChecker.php');
66  {
67  include_once './Services/WebDAV/classes/class.ilDAVUtils.php';
68  if(ilDAVUtils::getInstance()->isLocalPasswordInstructionRequired())
69  {
70  $commands[] = array('permission' => 'read', 'cmd' => 'showPasswordInstruction', 'lang_var' => 'mount_webfolder', 'enable_anonymous' => 'false');
71  }
72  else
73  {
74  $commands[] = array("permission" => "read", "cmd" => "mount_webfolder", "lang_var" => "mount_webfolder", "enable_anonymous" => "false");
75  }
76  }
77  $commands[] = array("permission" => "write", "cmd" => "enableAdministrationPanel", "lang_var" => "edit_content");
78  $commands[] = array("permission" => "write", "cmd" => "edit", "lang_var" => "settings");
79 
80  return $commands;
81  }
82 
83 
84  private static function hasDownloadAction ($ref_id)
85  {
86  global $tree, $ilUser;
88  // default value should reflect previous behaviour (-> 0)
89  if ($settings->get("enable_download_folder", 0) != 1)
90  return false;
91 
92  /*
93  * deactivated check for now, because wrong ref_id here!
94 
95  *
96  $children = $tree->getChildsByTypeFilter($ref_id, array("file","fold"));
97 
98  // no children at all, so no download button
99  if (count ($children) == 0)
100  return false;
101  // check if at least one of the children has a read permission
102  foreach ($children as $child)
103  {
104  if ($rbacsystem->checkAccessOfUser($ilUser->getId(), "read", $child["ref_id"]))
105  return true;
106  }
107  return false;
108  */
109  return true;
110  }
111 
112 }
113 
114 ?>
static hasDownloadAction($ref_id)
ILIAS Setting Class.
$_GET["client_id"]
static _isActive()
Static getter.
Class ilObjFileAccess.
$ilUser
Definition: imgupload.php:18
static _getCommands()
get commands
Create styles array
The data for the language used.
static getInstance()
Get singleton instance.
$ref_id
Definition: sahs_server.php:39
Class ilObjectAccess.
static getInstance()
Get singleton instance.