ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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()
20  {
23  }
25  }
26 
27 
40  public 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  $commands[] = array(
48  'permission' => 'read',
49  'cmd' => 'fileManagerLaunch',
50  'lang_var' => 'fm_start',
51  'enable_anonymous' => false
52  );
53  }
54 
55  // why here, why read permission? it just needs info_screen_enabled = true in ilObjCategoryListGUI (alex, 30.7.2008)
56  // this is not consistent, with all other objects...
57  //$commands[] = array("permission" => "read", "cmd" => "showSummary", "lang_var" => "info_short", "enable_anonymous" => "false");
59  $commands[] = array("permission" => "read", "cmd" => "downloadFolder", "lang_var" => "download"); // #18805
60  }
61  // BEGIN WebDAV: Mount Webfolder.
62  include_once('Services/WebDAV/classes/class.ilDAVActivationChecker.php');
64  include_once './Services/WebDAV/classes/class.ilDAVUtils.php';
65  if (ilDAVUtils::getInstance()->isLocalPasswordInstructionRequired()) {
66  $commands[] = array('permission' => 'read', 'cmd' => 'showPasswordInstruction', 'lang_var' => 'mount_webfolder', 'enable_anonymous' => 'false');
67  } else {
68  $commands[] = array("permission" => "read", "cmd" => "mount_webfolder", "lang_var" => "mount_webfolder", "enable_anonymous" => "false");
69  }
70  }
71  $commands[] = array("permission" => "write", "cmd" => "enableAdministrationPanel", "lang_var" => "edit_content");
72  $commands[] = array("permission" => "write", "cmd" => "edit", "lang_var" => "settings");
73 
74  return $commands;
75  }
76 
77 
78  private static function hasDownloadAction($ref_id)
79  {
80  global $DIC;
81 
82  $tree = $DIC->repositoryTree();
83  $ilUser = $DIC->user();
85  // default value should reflect previous behaviour (-> 0)
86  if ($settings->get("enable_download_folder", 0) != 1) {
87  return false;
88  }
89 
90  /*
91  * deactivated check for now, because wrong ref_id here!
92 
93  *
94  $children = $tree->getChildsByTypeFilter($ref_id, array("file","fold"));
95 
96  // no children at all, so no download button
97  if (count ($children) == 0)
98  return false;
99  // check if at least one of the children has a read permission
100  foreach ($children as $child)
101  {
102  if ($rbacsystem->checkAccessOfUser($ilUser->getId(), "read", $child["ref_id"]))
103  return true;
104  }
105  return false;
106  */
107  return true;
108  }
109 }
static hasDownloadAction($ref_id)
global $DIC
Definition: saml.php:7
$_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.
Class ilObjectAccess.
static getInstance()
Get singleton instance.