ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilLMObjectGUI Class Reference

Class ilLMObject. More...

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

Public Member Functions

 __construct (&$a_content_obj)
 constructor More...
 
 setActions ($a_actions="")
 build action array More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 create ()
 structure / page object creation form More...
 
 putInTree ()
 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...
 
 add_cell ($val, $link="")
 output a cell in object list More...
 
 showActions ($a_actions)
 show possible action (form buttons) More...
 
 checkTree ()
 check the content object tree More...
 

Data Fields

 $tpl
 
 $lng
 
 $obj
 
 $ctrl
 
 $content_object
 
 $actions
 

Detailed Description

Class ilLMObject.

Base class for ilStructureObjects and ilPageObjects (see ILIAS DTD)

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilLMObjectGUI::__construct ( $a_content_obj)

constructor

Parameters
object$a_content_objcontent object

Reimplemented in ilLMPageObjectGUI.

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

32 {
33 global $DIC;
34
35 $tpl = $DIC["tpl"];
36 $lng = $DIC->language();
37 $ilCtrl = $DIC->ctrl();
38
39 $this->tpl = $tpl;
40 $this->lng = $lng;
41 $this->ctrl = $ilCtrl;
42 $this->content_object = $a_content_obj;
43 }
global $ilCtrl
Definition: ilias.php:18
global $DIC
Definition: saml.php:7

References $DIC, $ilCtrl, $lng, and $tpl.

Member Function Documentation

◆ add_cell()

ilLMObjectGUI::add_cell (   $val,
  $link = "" 
)

output a cell in object list

Reimplemented in ilStructureObjectGUI.

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

187 {
188 if (!empty($link)) {
189 $this->tpl->setCurrentBlock("begin_link");
190 $this->tpl->setVariable("LINK_TARGET", $link);
191 $this->tpl->parseCurrentBlock();
192 $this->tpl->touchBlock("end_link");
193 }
194
195 $this->tpl->setCurrentBlock("text");
196 $this->tpl->setVariable("TEXT_CONTENT", $val);
197 $this->tpl->parseCurrentBlock();
198 $this->tpl->setCurrentBlock("table_cell");
199 $this->tpl->parseCurrentBlock();
200 }

◆ cancelDelete()

ilLMObjectGUI::cancelDelete ( )

cancel deletion of page/structure objects

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

161 {
162 ilSession::clear("saved_post");
163 $this->ctrl->redirect($this, $_GET["backcmd"]);
164 }
$_GET["client_id"]
static clear($a_var)
Unset a value.

References $_GET, and ilSession\clear().

+ Here is the call graph for this function:

◆ checkTree()

ilLMObjectGUI::checkTree ( )

check the content object tree

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

237 {
238 $this->content_object->checkTree();
239 }

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

+ Here is the caller graph for this function:

◆ confirmedDelete()

ilLMObjectGUI::confirmedDelete ( )

page and structure object deletion

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

171 {
172 $cont_obj_gui = new ilObjContentObjectGUI(
173 "",
174 $this->content_object->getRefId(),
175 true,
176 false
177 );
178 $cont_obj_gui->confirmedDelete($this->obj->getId());
179 $this->ctrl->redirect($this, $_GET["backcmd"]);
180 }
Class ilObjContentObjectGUI.

References $_GET.

◆ create()

ilLMObjectGUI::create ( )

structure / page object creation form

Reimplemented in ilStructureObjectGUI.

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

87 {
88 $new_type = $_REQUEST["new_type"];
89
90 $this->ctrl->setParameter($this, "new_type", $new_type);
91 include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
93 $form->setFormAction($this->ctrl->getFormAction($this, "save"));
94 $form->setTitle($this->lng->txt($new_type . "_new"));
95
96 $title = new ilTextInputGUI($this->lng->txt("title"), "Fobject[title]");
97 //$title->setRequired(true);
98 $form->addItem($title);
99
100 $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "Fobject[desc]");
101 $form->addItem($desc);
102
103 $form->addCommandButton("save", $this->lng->txt($new_type . "_add"));
104 $form->addCommandButton("cancel", $this->lng->txt("cancel"));
105
106 $this->tpl->setContent($form->getHTML());
107 }
This class represents a property form user interface.
This class represents a text area property in a property form.
This class represents a text property in a property form.
if(isset($_POST['submit'])) $form

References $form, and $title.

◆ delete()

ilLMObjectGUI::delete ( )

Confirm deletion screen (delete page or structure objects)

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

144 {
145 $this->setTabs();
146
147 $cont_obj_gui = new ilObjContentObjectGUI(
148 "",
149 $this->content_object->getRefId(),
150 true,
151 false
152 );
153 $cont_obj_gui->delete($this->obj->getId());
154 }

◆ getTargetFrame()

ilLMObjectGUI::getTargetFrame (   $a_cmd,
  $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) @access public

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

73 {
74 if ($this->target_frame[$a_cmd] != "") {
75 return $this->target_frame[$a_cmd];
76 } elseif (!empty($a_target_frame)) {
77 return "target=\"" . $a_target_frame . "\"";
78 } else {
79 return;
80 }
81 }

◆ putInTree()

ilLMObjectGUI::putInTree ( )

put this object into content object tree

Reimplemented in ilStructureObjectGUI.

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

114 {
115 $tree = new ilTree($this->content_object->getId());
116 $tree->setTableNames('lm_tree', 'lm_data');
117 $tree->setTreeTablePK("lm_id");
118
119 $parent_id = (!empty($_GET["obj_id"]))
120 ? $_GET["obj_id"]
121 : $tree->getRootId();
122
123 if (!empty($_GET["target"])) {
124 $target = $_GET["target"];
125 } else {
126 // determine last child of current type
127 $childs = $tree->getChildsByType($parent_id, $this->obj->getType());
128 if (count($childs) == 0) {
130 } else {
131 $target = $childs[count($childs) - 1]["obj_id"];
132 }
133 }
134 if (!$tree->isInTree($this->obj->getId())) {
135 $tree->insertNode($this->obj->getId(), $parent_id, $target);
136 }
137 }
const IL_FIRST_NODE
Definition: class.ilTree.php:5
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
$target
Definition: test.php:19

References $_GET, $target, $tree, and IL_FIRST_NODE.

Referenced by ilLMPageObjectGUI\save().

+ Here is the caller graph for this function:

◆ setActions()

ilLMObjectGUI::setActions (   $a_actions = "")

build action array

Parameters
array$a_actionsaction array (key = action key, value = action language string) @access private

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

54 {
55 if (is_array($a_actions)) {
56 foreach ($a_actions as $name => $lng) {
57 $this->actions[$name] = array("name" => $name, "lng" => $lng);
58 }
59 } else {
60 $this->actions = "";
61 }
62 }

References $lng, and $name.

◆ showActions()

ilLMObjectGUI::showActions (   $a_actions)

show possible action (form buttons)

@access public

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

209 {
210 foreach ($a_actions as $name => $lng) {
211 $d[$name] = array("name" => $name, "lng" => $lng);
212 }
213
214 $notoperations = array();
215 $operations = array();
216
217 $operations = $d;
218
219 if (count($operations) > 0) {
220 foreach ($operations as $val) {
221 $this->tpl->setCurrentBlock("operation_btn");
222 $this->tpl->setVariable("BTN_NAME", $val["name"]);
223 $this->tpl->setVariable("BTN_VALUE", $this->lng->txt($val["lng"]));
224 $this->tpl->parseCurrentBlock();
225 }
226
227 $this->tpl->setCurrentBlock("operation");
228 $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.svg"));
229 $this->tpl->parseCurrentBlock();
230 }
231 }
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
for( $i=6;$i< 13;$i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296

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

Referenced by ilStructureObjectGUI\subchap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $actions

ilLMObjectGUI::$actions

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

◆ $content_object

ilLMObjectGUI::$content_object

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

Referenced by ilLMPageObjectGUI\getLinkXML().

◆ $ctrl

◆ $lng

◆ $obj

ilLMObjectGUI::$obj

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

◆ $tpl


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