ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilObjObjectFolderGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
28{
34 public function __construct($data, int $id, bool $call_by_reference)
35 {
36 $this->type = "objf";
38 }
39
43 public function viewObject(): void
44 {
45 if (!$this->rbac_system->checkAccess("visible,read", $this->object->getRefId())) {
46 $this->error->raiseError($this->lng->txt("permission_denied"), $this->error->MESSAGE);
47 }
48
49 //prepare objectlist
50 $this->data = [];
51 $this->data["data"] = [];
52 $this->data["ctrl"] = [];
53 $this->data["cols"] = ["type","title","last_change"];
54
55 $this->maxcount = count($this->data["data"]);
56
57 // now compute control information
58 foreach ($this->data["data"] as $key => $val) {
59 $this->data["ctrl"][$key] = [
60 "ref_id" => $this->id,
61 "obj_id" => $val["obj_id"],
62 "type" => $val["type"],
63 ];
64
65 unset($this->data["data"][$key]["obj_id"]);
66 $this->data["data"][$key]["last_change"] = ilDatePresentation::formatDate(
67 new ilDateTime($this->data["data"][$key]["last_change"], IL_CAL_DATETIME)
68 );
69 }
70
71 // TODO: method 'displayList' is undefined
72 $this->displayList();
73 }
74
75 public function executeCommand(): void
76 {
77 $next_class = $this->ctrl->getNextClass($this);
78 $cmd = $this->ctrl->getCmd();
79 $this->prepareOutput();
80
81 switch ($next_class) {
82 case 'ilpermissiongui':
83 $perm_gui = new ilPermissionGUI($this);
84 $this->ctrl->forwardCommand($perm_gui);
85 break;
86
87 default:
88 if (!$cmd) {
89 $cmd = "view";
90 }
91 $cmd .= "Object";
92 $this->$cmd();
93
94 break;
95 }
96 }
97
98 protected function getTabs(): void
99 {
100 if ($this->rbac_system->checkAccess('edit_permission', $this->object->getRefId())) {
101 $this->tabs_gui->addTarget(
102 "settings",
103 $this->ctrl->getLinkTarget($this, "view"),
104 ["view",""]
105 );
106
107 $this->tabs_gui->addTarget(
108 "perm_settings",
109 $this->ctrl->getLinkTargetByClass([get_class($this),'ilpermissiongui'], "perm"),
110 ["perm","info","owner"],
111 'ilpermissiongui'
112 );
113 }
114 }
115}
const IL_CAL_DATETIME
error(string $a_errmsg)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
Class ilObjObjectFolderGUI.
getTabs()
@abstract overwrite in derived GUI class of your object type
__construct($data, int $id, bool $call_by_reference)
viewObject()
list children of current object
Class ilObjectGUI Basic methods of all Output classes.
prepareOutput(bool $show_sub_objects=true)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc