ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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
 

Protected Attributes

 $ui
 

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 36 of file class.ilLMObjectGUI.php.

37 {
38 global $DIC;
39
40 $tpl = $DIC["tpl"];
41 $lng = $DIC->language();
42 $ilCtrl = $DIC->ctrl();
43
44 $this->tpl = $tpl;
45 $this->lng = $lng;
46 $this->ctrl = $ilCtrl;
47 $this->content_object = $a_content_obj;
48 $this->ui = $DIC->ui();
49 }
global $ilCtrl
Definition: ilias.php:18
ui()
Definition: ui.php:5
$DIC
Definition: xapitoken.php:46

References $DIC, $ilCtrl, $lng, $tpl, and ui().

+ Here is the call graph for this function:

Member Function Documentation

◆ add_cell()

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

output a cell in object list

Reimplemented in ilStructureObjectGUI.

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

192 {
193 if (!empty($link)) {
194 $this->tpl->setCurrentBlock("begin_link");
195 $this->tpl->setVariable("LINK_TARGET", $link);
196 $this->tpl->parseCurrentBlock();
197 $this->tpl->touchBlock("end_link");
198 }
199
200 $this->tpl->setCurrentBlock("text");
201 $this->tpl->setVariable("TEXT_CONTENT", $val);
202 $this->tpl->parseCurrentBlock();
203 $this->tpl->setCurrentBlock("table_cell");
204 $this->tpl->parseCurrentBlock();
205 }

◆ cancelDelete()

ilLMObjectGUI::cancelDelete ( )

cancel deletion of page/structure objects

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

166 {
167 ilSession::clear("saved_post");
168 $this->ctrl->redirect($this, $_GET["backcmd"]);
169 }
$_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 241 of file class.ilLMObjectGUI.php.

242 {
243 $this->content_object->checkTree();
244 }

Referenced by ilStructureObjectGUI\save().

+ Here is the caller graph for this function:

◆ confirmedDelete()

ilLMObjectGUI::confirmedDelete ( )

page and structure object deletion

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

176 {
177 $cont_obj_gui = new ilObjContentObjectGUI(
178 "",
179 $this->content_object->getRefId(),
180 true,
181 false
182 );
183 $cont_obj_gui->confirmedDelete($this->obj->getId());
184 $this->ctrl->redirect($this, $_GET["backcmd"]);
185 }
Class ilObjContentObjectGUI.

References $_GET.

◆ create()

ilLMObjectGUI::create ( )

structure / page object creation form

Reimplemented in ilLMPageObjectGUI, and ilStructureObjectGUI.

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

93 {
94 $new_type = $_REQUEST["new_type"];
95
96 $this->ctrl->setParameter($this, "new_type", $new_type);
97 $form = new ilPropertyFormGUI();
98 $form->setFormAction($this->ctrl->getFormAction($this, "save"));
99 $form->setTitle($this->lng->txt($new_type . "_new"));
100
101 $title = new ilTextInputGUI($this->lng->txt("title"), "Fobject[title]");
102 //$title->setRequired(true);
103 $form->addItem($title);
104
105 $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "Fobject[desc]");
106 $form->addItem($desc);
107
108 $form->addCommandButton("save", $this->lng->txt($new_type . "_add"));
109 $form->addCommandButton("cancel", $this->lng->txt("cancel"));
110
111 $this->tpl->setContent($form->getHTML());
112 }
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.

◆ delete()

ilLMObjectGUI::delete ( )

Confirm deletion screen (delete page or structure objects)

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

149 {
150 $this->setTabs();
151
152 $cont_obj_gui = new ilObjContentObjectGUI(
153 "",
154 $this->content_object->getRefId(),
155 true,
156 false
157 );
158 $cont_obj_gui->delete($this->obj->getId());
159 }

◆ 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 78 of file class.ilLMObjectGUI.php.

79 {
80 if ($this->target_frame[$a_cmd] != "") {
81 return $this->target_frame[$a_cmd];
82 } elseif (!empty($a_target_frame)) {
83 return "target=\"" . $a_target_frame . "\"";
84 } else {
85 return;
86 }
87 }

◆ putInTree()

ilLMObjectGUI::putInTree ( )

put this object into content object tree

Reimplemented in ilStructureObjectGUI.

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

119 {
120 $tree = new ilTree($this->content_object->getId());
121 $tree->setTableNames('lm_tree', 'lm_data');
122 $tree->setTreeTablePK("lm_id");
123
124 $parent_id = (!empty($_GET["obj_id"]))
125 ? $_GET["obj_id"]
126 : $tree->getRootId();
127
128 if (!empty($_GET["target"])) {
129 $target = $_GET["target"];
130 } else {
131 // determine last child of current type
132 $childs = $tree->getChildsByType($parent_id, $this->obj->getType());
133 if (count($childs) == 0) {
134 $target = IL_FIRST_NODE;
135 } else {
136 $target = $childs[count($childs) - 1]["obj_id"];
137 }
138 }
139 if (!$tree->isInTree($this->obj->getId())) {
140 $tree->insertNode($this->obj->getId(), $parent_id, $target);
141 }
142 }
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...

References $_GET, and IL_FIRST_NODE.

◆ 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 59 of file class.ilLMObjectGUI.php.

60 {
61 if (is_array($a_actions)) {
62 foreach ($a_actions as $name => $lng) {
63 $this->actions[$name] = array("name" => $name, "lng" => $lng);
64 }
65 } else {
66 $this->actions = "";
67 }
68 }
if($format !==null) $name
Definition: metadata.php:230

References $lng, and $name.

◆ showActions()

ilLMObjectGUI::showActions (   $a_actions)

show possible action (form buttons)

@access public

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

214 {
215 foreach ($a_actions as $name => $lng) {
216 $d[$name] = array("name" => $name, "lng" => $lng);
217 }
218
219 $notoperations = array();
220 $operations = array();
221
222 $operations = $d;
223
224 if (count($operations) > 0) {
225 foreach ($operations as $val) {
226 $this->tpl->setCurrentBlock("operation_btn");
227 $this->tpl->setVariable("BTN_NAME", $val["name"]);
228 $this->tpl->setVariable("BTN_VALUE", $this->lng->txt($val["lng"]));
229 $this->tpl->parseCurrentBlock();
230 }
231
232 $this->tpl->setCurrentBlock("operation");
233 $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.svg"));
234 $this->tpl->parseCurrentBlock();
235 }
236 }
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

◆ $ui


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