ILIAS  Release_5_0_x_branch Revision 61816
 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-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  function _construct () {
20  parent::__construct();
21  }
22 
23  private static function getFolderSettings() {
25  {
27  }
29  }
30 
31 
44  function _getCommands()
45  {
46  $commands = array();
47  $commands[] = array("permission" => "read", "cmd" => "view", "lang_var" => "show", "default" => true);
48 
49  include_once './Services/WebServices/FileManager/classes/class.ilFMSettings.php';
50  if(ilFMSettings::getInstance()->isEnabled())
51  {
52  $commands[] = array(
53  'permission' => 'read',
54  'cmd' => 'fileManagerLaunch',
55  'lang_var' => 'fm_start',
56  'enable_anonymous' => false
57  );
58  }
59 
60  // why here, why read permission? it just needs info_screen_enabled = true in ilObjCategoryListGUI (alex, 30.7.2008)
61  // this is not consistent, with all other objects...
62  //$commands[] = array("permission" => "read", "cmd" => "showSummary", "lang_var" => "info_short", "enable_anonymous" => "false");
64  {
65  $commands[] = array("permission" => "read", "cmd" => "downloadFolder", "lang_var" => "download", "enable_anonymous" => "false");
66  }
67  // BEGIN WebDAV: Mount Webfolder.
68  include_once ('Services/WebDAV/classes/class.ilDAVActivationChecker.php');
70  {
71  include_once './Services/WebDAV/classes/class.ilDAVUtils.php';
72  if(ilDAVUtils::getInstance()->isLocalPasswordInstructionRequired())
73  {
74  $commands[] = array('permission' => 'read', 'cmd' => 'showPasswordInstruction', 'lang_var' => 'mount_webfolder', 'enable_anonymous' => 'false');
75  }
76  else
77  {
78  $commands[] = array("permission" => "read", "cmd" => "mount_webfolder", "lang_var" => "mount_webfolder", "enable_anonymous" => "false");
79  }
80  }
81  $commands[] = array("permission" => "write", "cmd" => "enableAdministrationPanel", "lang_var" => "edit_content");
82  $commands[] = array("permission" => "write", "cmd" => "edit", "lang_var" => "settings");
83 
84  return $commands;
85  }
86 
87 
88  private function hasDownloadAction ($ref_id)
89  {
90  global $tree, $ilUser;
92  // default value should reflect previous behaviour (-> 0)
93  if ($settings->get("enable_download_folder", 0) != 1)
94  return false;
95 
96  /*
97  * deactivated check for now, because wrong ref_id here!
98 
99  $children = $tree->getChildsByTypeFilter($ref_id, array("file","fold"));
100 
101  // no children at all, so no download button
102  if (count ($children) == 0)
103  return false;
104  // check if at least one of the children has a read permission
105  foreach ($children as $child)
106  {
107  if ($rbacsystem->checkAccessOfUser($ilUser->getId(), "read", $child["ref_id"]))
108  return true;
109  }
110  return false;
111  */
112  return true;
113  }
114 
115 }
116 
117 ?>