ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLMObjectGUI Class Reference

Base class for ilStructureObjects and ilPageObjects (see ILIAS DTD) More...

+ Inheritance diagram for ilLMObjectGUI:
+ Collaboration diagram for ilLMObjectGUI:

Public Member Functions

 __construct (ilObjLearningModule $a_content_obj)
 constructor More...
 
 setActions (?array $a_actions=null)
 
 getTargetFrame (string $a_cmd, string $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 create ()
 structure / page object creation form More...
 
 getCreateForm ()
 
 putInTree (?int $target=0)
 put this object into content object tree More...
 
 delete ()
 Confirm deletion screen (delete page or structure objects) More...
 
 cancelDelete ()
 cancel deletion of page/structure objects More...
 
 confirmedDelete ()
 page and structure object deletion More...
 
 showActions (array $a_actions)
 show possible action (form buttons) More...
 
 checkTree ()
 check the content object tree More...
 

Data Fields

ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilLMObject $obj
 
ilCtrl $ctrl
 
ilObjLearningModule $content_object
 
array $actions
 

Protected Attributes

int $requested_ref_id
 
ILIAS DI UIServices $ui
 
int $requested_obj_id
 
string $requested_totransl = ""
 
string $requested_transl = ""
 
string $requested_target
 
string $requested_new_type
 
array $target_frame
 
EditingGUIRequest $request
 

Detailed Description

Base class for ilStructureObjects and ilPageObjects (see ILIAS DTD)

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 26 of file class.ilLMObjectGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilLMObjectGUI::__construct ( ilObjLearningModule  $a_content_obj)

constructor

Definition at line 49 of file class.ilLMObjectGUI.php.

References $DIC, $lng, XapiProxy\$req, $request, $tpl, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\ui().

50  {
51  global $DIC;
52 
53  $tpl = $DIC["tpl"];
54  $lng = $DIC->language();
55  $ilCtrl = $DIC->ctrl();
56 
57  $this->tpl = $tpl;
58  $this->lng = $lng;
59  $this->ctrl = $ilCtrl;
60  $this->content_object = $a_content_obj;
61  $this->ui = $DIC->ui();
62  $this->request = $DIC
63  ->learningModule()
64  ->internal()
65  ->gui()
66  ->editing()
67  ->request();
69 
70  $this->requested_ref_id = $req->getRefId();
71  $this->requested_obj_id = $req->getObjId();
72  $this->requested_transl = $req->getTranslation();
73  $this->requested_totransl = $req->getToTranslation();
74  $this->requested_target = $req->getTarget();
75  $this->requested_new_type = $req->getNewType();
76  }
EditingGUIRequest $request
ilGlobalTemplateInterface $tpl
catch(\Exception $e) $req
Definition: xapiproxy.php:93
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ cancelDelete()

ilLMObjectGUI::cancelDelete ( )

cancel deletion of page/structure objects

Definition at line 194 of file class.ilLMObjectGUI.php.

References ilSession\clear(), and ILIAS\Repository\ctrl().

194  : void
195  {
196  ilSession::clear("saved_post");
197  $this->ctrl->redirect($this, $this->request->getBackCmd());
198  }
static clear(string $a_var)
+ Here is the call graph for this function:

◆ checkTree()

ilLMObjectGUI::checkTree ( )

check the content object tree

Definition at line 244 of file class.ilLMObjectGUI.php.

Referenced by ilStructureObjectGUI\save().

244  : void
245  {
246  $this->content_object->checkTree();
247  }
+ Here is the caller graph for this function:

◆ confirmedDelete()

ilLMObjectGUI::confirmedDelete ( )

page and structure object deletion

Definition at line 204 of file class.ilLMObjectGUI.php.

References ilObjContentObjectGUI\confirmedDelete(), and ILIAS\Repository\ctrl().

204  : void
205  {
206  $cont_obj_gui = new ilObjLearningModuleGUI(
207  "",
208  $this->content_object->getRefId(),
209  true,
210  false
211  );
212  $cont_obj_gui->confirmedDelete($this->obj->getId());
213  $this->ctrl->redirect($this, $this->request->getBackCmd());
214  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
confirmedDelete(int $a_parent_subobj_id=0)
delete page object or structure objects
+ Here is the call graph for this function:

◆ create()

ilLMObjectGUI::create ( )

structure / page object creation form

Definition at line 116 of file class.ilLMObjectGUI.php.

References getCreateForm().

116  : void
117  {
118  $form = $this->getCreateForm();
119  $this->tpl->setContent($form->getHTML());
120  }
+ Here is the call graph for this function:

◆ delete()

ilLMObjectGUI::delete ( )

Confirm deletion screen (delete page or structure objects)

Definition at line 177 of file class.ilLMObjectGUI.php.

References ilObjContentObjectGUI\delete().

177  : void
178  {
179  $this->setTabs();
180 
181  $cont_obj_gui = new ilObjLearningModuleGUI(
182  "",
183  $this->content_object->getRefId(),
184  true,
185  false
186  );
187  $cont_obj_gui->delete($this->obj->getId());
188  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
delete(int $a_parent_subobj_id=0)
confirm deletion screen for page object and structure object deletion
+ Here is the call graph for this function:

◆ getCreateForm()

ilLMObjectGUI::getCreateForm ( )

Definition at line 122 of file class.ilLMObjectGUI.php.

References $requested_new_type, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by create(), and ilStructureObjectGUI\save().

123  {
124  $new_type = $this->requested_new_type;
125  $this->ctrl->setParameter($this, "new_type", $new_type);
126  $form = new ilPropertyFormGUI();
127  $form->setFormAction($this->ctrl->getFormAction($this, "save"));
128  $form->setTitle($this->lng->txt($new_type . "_new"));
129 
130  $title = new ilTextInputGUI($this->lng->txt("title"), "title");
131  $form->addItem($title);
132 
133  $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
134  $form->addItem($desc);
135 
136  $form->addCommandButton("save", $this->lng->txt($new_type . "_add"));
137  $form->addCommandButton("cancel", $this->lng->txt("cancel"));
138 
139  return $form;
140  }
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTargetFrame()

ilLMObjectGUI::getTargetFrame ( string  $a_cmd,
string  $a_target_frame = "" 
)

get target frame for command (command is method name without "Object", e.g.

"perm")

Parameters
string$a_cmdcommand
string$a_target_framedefault target frame (is returned, if no special target frame was set)

Definition at line 100 of file class.ilLMObjectGUI.php.

103  : string {
104  if ($this->target_frame[$a_cmd] != "") {
105  return $this->target_frame[$a_cmd];
106  } elseif (!empty($a_target_frame)) {
107  return "target=\"" . $a_target_frame . "\"";
108  } else {
109  return "";
110  }
111  }

◆ putInTree()

ilLMObjectGUI::putInTree ( ?int  $target = 0)

put this object into content object tree

Definition at line 146 of file class.ilLMObjectGUI.php.

References $requested_target, and ilTree\POS_FIRST_NODE.

146  : void
147  {
148  if ($target == 0) {
149  $target = $this->requested_target;
150  }
151  $tree = new ilTree($this->content_object->getId());
152  $tree->setTableNames('lm_tree', 'lm_data');
153  $tree->setTreeTablePK("lm_id");
154 
155  $parent_id = ($this->requested_obj_id > 0)
156  ? $this->requested_obj_id
157  : $tree->getRootId();
158 
159  if ($target == "") {
160  // determine last child of current type
161  $childs = $tree->getChildsByType($parent_id, $this->obj->getType());
162  if (count($childs) == 0) {
163  $target = ilTree::POS_FIRST_NODE;
164  } else {
165  $target = $childs[count($childs) - 1]["obj_id"];
166  }
167  }
168  if (!$tree->isInTree($this->obj->getId())) {
169  $tree->insertNode($this->obj->getId(), $parent_id, $target);
170  }
171  }
const POS_FIRST_NODE

◆ setActions()

ilLMObjectGUI::setActions ( ?array  $a_actions = null)
Parameters
?array$a_actions action array (key = action key, value = action language string)

Definition at line 82 of file class.ilLMObjectGUI.php.

References $name.

82  : void
83  {
84  if (is_array($a_actions)) {
85  foreach ($a_actions as $name => $lng) {
86  $this->actions[$name] = array("name" => $name, "lng" => $lng);
87  }
88  } else {
89  $this->actions = [];
90  }
91  }
if($format !==null) $name
Definition: metadata.php:247

◆ showActions()

ilLMObjectGUI::showActions ( array  $a_actions)

show possible action (form buttons)

Definition at line 219 of file class.ilLMObjectGUI.php.

References $d, $name, ilUtil\getImagePath(), and ILIAS\Repository\lng().

Referenced by ilStructureObjectGUI\subchap().

219  : void
220  {
221  $d = [];
222  foreach ($a_actions as $name => $lng) {
223  $d[$name] = array("name" => $name, "lng" => $lng);
224  }
225 
226  $operations = $d;
227  if (count($operations) > 0) {
228  foreach ($operations as $val) {
229  $this->tpl->setCurrentBlock("operation_btn");
230  $this->tpl->setVariable("BTN_NAME", $val["name"]);
231  $this->tpl->setVariable("BTN_VALUE", $this->lng->txt($val["lng"]));
232  $this->tpl->parseCurrentBlock();
233  }
234 
235  $this->tpl->setCurrentBlock("operation");
236  $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.svg"));
237  $this->tpl->parseCurrentBlock();
238  }
239  }
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
if($format !==null) $name
Definition: metadata.php:247
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $actions

array ilLMObjectGUI::$actions

Definition at line 34 of file class.ilLMObjectGUI.php.

◆ $content_object

ilObjLearningModule ilLMObjectGUI::$content_object

Definition at line 33 of file class.ilLMObjectGUI.php.

Referenced by ilLMPageObjectGUI\getLinkXML().

◆ $ctrl

◆ $lng

◆ $obj

ilLMObject ilLMObjectGUI::$obj

◆ $request

EditingGUIRequest ilLMObjectGUI::$request
protected

◆ $requested_new_type

string ilLMObjectGUI::$requested_new_type
protected

Definition at line 41 of file class.ilLMObjectGUI.php.

Referenced by getCreateForm().

◆ $requested_obj_id

int ilLMObjectGUI::$requested_obj_id
protected

Definition at line 37 of file class.ilLMObjectGUI.php.

◆ $requested_ref_id

int ilLMObjectGUI::$requested_ref_id
protected

Definition at line 28 of file class.ilLMObjectGUI.php.

Referenced by ilLMPageObjectGUI\executeCommand().

◆ $requested_target

string ilLMObjectGUI::$requested_target
protected

Definition at line 40 of file class.ilLMObjectGUI.php.

Referenced by putInTree(), and ilStructureObjectGUI\putInTree().

◆ $requested_totransl

string ilLMObjectGUI::$requested_totransl = ""
protected

Definition at line 38 of file class.ilLMObjectGUI.php.

◆ $requested_transl

string ilLMObjectGUI::$requested_transl = ""
protected

◆ $target_frame

array ilLMObjectGUI::$target_frame
protected

Definition at line 42 of file class.ilLMObjectGUI.php.

◆ $tpl

◆ $ui


The documentation for this class was generated from the following file: