36 protected \ILIAS\DI\UIServices
$ui;
55 $ilCtrl =
$DIC->ctrl();
59 $this->
ctrl = $ilCtrl;
60 $this->content_object = $a_content_obj;
61 $this->
ui = $DIC->ui();
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();
82 public function setActions(?array $a_actions =
null): void
84 if (is_array($a_actions)) {
102 string $a_target_frame =
""
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 .
"\"";
118 $form = $this->getCreateForm();
119 $this->tpl->setContent($form->getHTML());
124 $new_type = $this->requested_new_type;
125 $this->
ctrl->setParameter($this,
"new_type", $new_type);
127 $form->setFormAction($this->
ctrl->getFormAction($this,
"save"));
128 $form->setTitle($this->
lng->txt($new_type .
"_new"));
131 $form->addItem($title);
134 $form->addItem($desc);
136 $form->addCommandButton(
"save", $this->
lng->txt($new_type .
"_add"));
137 $form->addCommandButton(
"cancel", $this->
lng->txt(
"cancel"));
151 $tree =
new ilTree($this->content_object->getId());
152 $tree->setTableNames(
'lm_tree',
'lm_data');
153 $tree->setTreeTablePK(
"lm_id");
155 $parent_id = ($this->requested_obj_id > 0)
156 ? $this->requested_obj_id
157 : $tree->getRootId();
161 $childs = $tree->getChildsByType($parent_id, $this->obj->getType());
162 if (count($childs) == 0) {
165 $target = $childs[count($childs) - 1][
"obj_id"];
168 if (!$tree->isInTree($this->obj->getId())) {
169 $tree->insertNode($this->obj->getId(), $parent_id, $target);
177 public function delete():
void
183 $this->content_object->getRefId(),
187 $cont_obj_gui->delete($this->obj->getId());
197 $this->
ctrl->redirect($this, $this->request->getBackCmd());
208 $this->content_object->getRefId(),
212 $cont_obj_gui->confirmedDelete($this->obj->getId());
213 $this->
ctrl->redirect($this, $this->request->getBackCmd());
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();
235 $this->tpl->setCurrentBlock(
"operation");
237 $this->tpl->parseCurrentBlock();
246 $this->content_object->checkTree();
Class ilCtrl provides processing control methods.
Base class for ilStructureObjects and ilPageObjects (see ILIAS DTD)
EditingGUIRequest $request
showActions(array $a_actions)
show possible action (form buttons)
cancelDelete()
cancel deletion of page/structure objects
checkTree()
check the content object tree
__construct(ilObjLearningModule $a_content_obj)
constructor
ilGlobalTemplateInterface $tpl
setActions(?array $a_actions=null)
string $requested_totransl
putInTree(?int $target=0)
put this object into content object tree
create()
structure / page object creation form
getTargetFrame(string $a_cmd, string $a_target_frame="")
get target frame for command (command is method name without "Object", e.g.
string $requested_new_type
confirmedDelete()
page and structure object deletion
ilObjLearningModule $content_object
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static clear(string $a_var)
This class represents a text area property in a property form.
This class represents a text property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
for( $i=6;$i< 13;$i++) for($i=1; $i< 13; $i++) $d
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
catch(\Exception $e) $req