ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilLMObjectGUI Class Reference

Class ilLMObject. More...

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

Public Member Functions

 ilLMObjectGUI (&$a_content_obj)
 constructor
 setActions ($a_actions="")
 build action array
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 create ()
 structure / page object creation form
 putInTree ()
 put this object into content object tree
 delete ()
 Confirm deletion screen (delete page or structure objects)
 cancelDelete ()
 cancel deletion of page/structure objects
 confirmedDelete ()
 page and structure object deletion
 add_cell ($val, $link="")
 output a cell in object list
 showActions ($a_actions)
 show possible action (form buttons)
 checkTree ()
 check the content object tree

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:
class.ilLMObjectGUI.php 57001 2015-01-11 17:55:28Z akill

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

Member Function Documentation

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

output a cell in object list

Reimplemented in ilStructureObjectGUI.

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

{
if(!empty($link))
{
$this->tpl->setCurrentBlock("begin_link");
$this->tpl->setVariable("LINK_TARGET", $link);
$this->tpl->parseCurrentBlock();
$this->tpl->touchBlock("end_link");
}
$this->tpl->setCurrentBlock("text");
$this->tpl->setVariable("TEXT_CONTENT", $val);
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("table_cell");
$this->tpl->parseCurrentBlock();
}
ilLMObjectGUI::cancelDelete ( )

cancel deletion of page/structure objects

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

References $_GET, and ilSession\clear().

{
ilSession::clear("saved_post");
$this->ctrl->redirect($this, $_GET["backcmd"]);
}

+ Here is the call graph for this function:

ilLMObjectGUI::checkTree ( )

check the content object tree

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

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

{
$this->content_object->checkTree();
}

+ Here is the caller graph for this function:

ilLMObjectGUI::confirmedDelete ( )

page and structure object deletion

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

References $_GET, and ilObjContentObjectGUI\confirmedDelete().

{
$cont_obj_gui =& new ilObjContentObjectGUI("",$this->content_object->getRefId(),
true, false);
$cont_obj_gui->confirmedDelete($this->obj->getId());
$this->ctrl->redirect($this, $_GET["backcmd"]);
}

+ Here is the call graph for this function:

ilLMObjectGUI::create ( )

structure / page object creation form

Reimplemented in ilStructureObjectGUI.

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

References $_REQUEST.

{
$new_type = $_REQUEST["new_type"];
$this->ctrl->setParameter($this, "new_type", $new_type);
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this, "save"));
$form->setTitle( $this->lng->txt($new_type."_new"));
$title = new ilTextInputGUI($this->lng->txt("title"), "Fobject[title]");
//$title->setRequired(true);
$form->addItem($title);
$desc = new ilTextAreaInputGUI($this->lng->txt("description"), "Fobject[desc]");
$form->addItem($desc);
$form->addCommandButton("save", $this->lng->txt($new_type."_add"));
$form->addCommandButton("cancel", $this->lng->txt("cancel"));
$this->tpl->setContent($form->getHTML());
}
ilLMObjectGUI::delete ( )

Confirm deletion screen (delete page or structure objects)

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

References ilObjContentObjectGUI\delete().

{
$this->setTabs();
$cont_obj_gui =& new ilObjContentObjectGUI("",$this->content_object->getRefId(),
true, false);
$cont_obj_gui->delete($this->obj->getId());
}

+ Here is the call graph for this function:

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.

{
if ($this->target_frame[$a_cmd] != "")
{
return $this->target_frame[$a_cmd];
}
elseif (!empty($a_target_frame))
{
return "target=\"".$a_target_frame."\"";
}
else
{
return;
}
}
ilLMObjectGUI::ilLMObjectGUI ( $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.

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

{
global $ilias, $tpl, $lng, $ilCtrl;
$this->ilias =& $ilias;
$this->tpl =& $tpl;
$this->lng =& $lng;
$this->ctrl =& $ilCtrl;
$this->content_object =& $a_content_obj;
}

+ Here is the caller graph for this function:

ilLMObjectGUI::putInTree ( )

put this object into content object tree

Reimplemented in ilStructureObjectGUI.

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

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

Referenced by ilLMPageObjectGUI\save().

{
$tree = new ilTree($this->content_object->getId());
$tree->setTableNames('lm_tree', 'lm_data');
$tree->setTreeTablePK("lm_id");
$parent_id = (!empty($_GET["obj_id"]))
? $_GET["obj_id"]
: $tree->getRootId();
if (!empty($_GET["target"]))
{
$target = $_GET["target"];
}
else
{
// determine last child of current type
$childs =& $tree->getChildsByType($parent_id, $this->obj->getType());
if (count($childs) == 0)
{
$target = IL_FIRST_NODE;
}
else
{
$target = $childs[count($childs) - 1]["obj_id"];
}
}
if (!$tree->isInTree($this->obj->getId()))
{
$tree->insertNode($this->obj->getId(), $parent_id, $target);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 $lng.

{
if (is_array($a_actions))
{
foreach ($a_actions as $name => $lng)
{
$this->actions[$name] = array("name" => $name, "lng" => $lng);
}
}
else
{
$this->actions = "";
}
}
ilLMObjectGUI::showActions (   $a_actions)

show possible action (form buttons)

public

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

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

Referenced by ilStructureObjectGUI\subchap().

{
foreach ($a_actions as $name => $lng)
{
$d[$name] = array("name" => $name, "lng" => $lng);
}
$notoperations = array();
$operations = array();
$operations = $d;
if (count($operations) > 0)
{
foreach ($operations as $val)
{
$this->tpl->setCurrentBlock("operation_btn");
$this->tpl->setVariable("BTN_NAME", $val["name"]);
$this->tpl->setVariable("BTN_VALUE", $this->lng->txt($val["lng"]));
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock("operation");
$this->tpl->setVariable("IMG_ARROW",ilUtil::getImagePath("arrow_downright.svg"));
$this->tpl->parseCurrentBlock();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilLMObjectGUI::$actions

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

ilLMObjectGUI::$content_object

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

Referenced by ilLMPageObjectGUI\getLinkXML().

ilLMObjectGUI::$ctrl

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

ilLMObjectGUI::$obj

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


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