ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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

 $ilias
 
 $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

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

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

33  {
34  global $ilias, $tpl, $lng, $ilCtrl;
35 
36  $this->ilias = $ilias;
37  $this->tpl = $tpl;
38  $this->lng = $lng;
39  $this->ctrl = $ilCtrl;
40  $this->content_object = $a_content_obj;
41  }
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...

Member Function Documentation

◆ add_cell()

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

output a cell in object list

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

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

◆ cancelDelete()

ilLMObjectGUI::cancelDelete ( )

cancel deletion of page/structure objects

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

References $_GET, and ilSession\clear().

171  {
172  ilSession::clear("saved_post");
173  $this->ctrl->redirect($this, $_GET["backcmd"]);
174  }
$_GET["client_id"]
static clear($a_var)
Unset a value.
+ Here is the call graph for this function:

◆ checkTree()

ilLMObjectGUI::checkTree ( )

check the content object tree

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

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

247  {
248  $this->content_object->checkTree();
249  }
+ Here is the caller graph for this function:

◆ confirmedDelete()

ilLMObjectGUI::confirmedDelete ( )

page and structure object deletion

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

References $_GET, and ilObjContentObjectGUI\confirmedDelete().

181  {
182  $cont_obj_gui = new ilObjContentObjectGUI("",$this->content_object->getRefId(),
183  true, false);
184  $cont_obj_gui->confirmedDelete($this->obj->getId());
185  $this->ctrl->redirect($this, $_GET["backcmd"]);
186  }
$_GET["client_id"]
confirmedDelete($a_parent_subobj_id=0)
delete page object or structure objects
Class ilObjContentObjectGUI.
+ Here is the call graph for this function:

◆ create()

ilLMObjectGUI::create ( )

structure / page object creation form

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

References $title.

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

◆ delete()

ilLMObjectGUI::delete ( )

Confirm deletion screen (delete page or structure objects)

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

References ilObjContentObjectGUI\delete().

158  {
159  $this->setTabs();
160 
161  $cont_obj_gui = new ilObjContentObjectGUI("",$this->content_object->getRefId(),
162  true, false);
163  $cont_obj_gui->delete($this->obj->getId());
164  }
Class ilObjContentObjectGUI.
delete($a_parent_subobj_id=0)
confirm deletion screen for page object and structure object deletion
+ Here is the call graph for this function:

◆ 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) public

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

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

◆ putInTree()

ilLMObjectGUI::putInTree ( )

put this object into content object tree

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

References $_GET, $target, IL_FIRST_NODE, and ilTree\setTableNames().

Referenced by ilLMPageObjectGUI\save().

121  {
122  $tree = new ilTree($this->content_object->getId());
123  $tree->setTableNames('lm_tree', 'lm_data');
124  $tree->setTreeTablePK("lm_id");
125 
126  $parent_id = (!empty($_GET["obj_id"]))
127  ? $_GET["obj_id"]
128  : $tree->getRootId();
129 
130  if (!empty($_GET["target"]))
131  {
132  $target = $_GET["target"];
133  }
134  else
135  {
136  // determine last child of current type
137  $childs = $tree->getChildsByType($parent_id, $this->obj->getType());
138  if (count($childs) == 0)
139  {
141  }
142  else
143  {
144  $target = $childs[count($childs) - 1]["obj_id"];
145  }
146  }
147  if (!$tree->isInTree($this->obj->getId()))
148  {
149  $tree->insertNode($this->obj->getId(), $parent_id, $target);
150  }
151  }
$_GET["client_id"]
const IL_FIRST_NODE
Definition: class.ilTree.php:5
setTableNames($a_table_tree, $a_table_obj_data, $a_table_obj_reference="")
set table names The primary key of the table containing your object_data must be 'obj_id' You may use...
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
+ Here is the call graph for this function:
+ 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) private

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

References array.

52  {
53  if (is_array($a_actions))
54  {
55  foreach ($a_actions as $name => $lng)
56  {
57  $this->actions[$name] = array("name" => $name, "lng" => $lng);
58  }
59  }
60  else
61  {
62  $this->actions = "";
63  }
64  }
Create styles array
The data for the language used.

◆ showActions()

ilLMObjectGUI::showActions (   $a_actions)

show possible action (form buttons)

public

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

References $d, array, and ilUtil\getImagePath().

Referenced by ilStructureObjectGUI\subchap().

216  {
217  foreach ($a_actions as $name => $lng)
218  {
219  $d[$name] = array("name" => $name, "lng" => $lng);
220  }
221 
222  $notoperations = array();
223  $operations = array();
224 
225  $operations = $d;
226 
227  if (count($operations) > 0)
228  {
229  foreach ($operations as $val)
230  {
231  $this->tpl->setCurrentBlock("operation_btn");
232  $this->tpl->setVariable("BTN_NAME", $val["name"]);
233  $this->tpl->setVariable("BTN_VALUE", $this->lng->txt($val["lng"]));
234  $this->tpl->parseCurrentBlock();
235  }
236 
237  $this->tpl->setCurrentBlock("operation");
238  $this->tpl->setVariable("IMG_ARROW",ilUtil::getImagePath("arrow_downright.svg"));
239  $this->tpl->parseCurrentBlock();
240  }
241  }
for($col=0; $col< 50; $col++) $d
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $actions

ilLMObjectGUI::$actions

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

◆ $content_object

ilLMObjectGUI::$content_object

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

Referenced by ilLMPageObjectGUI\getLinkXML().

◆ $ctrl

ilLMObjectGUI::$ctrl

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

◆ $ilias

ilLMObjectGUI::$ilias

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

Referenced by __construct().

◆ $lng

◆ $obj

ilLMObjectGUI::$obj

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

◆ $tpl


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