ILIAS  Release_4_2_x_branch Revision 61807
 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.
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 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 29379 2011-06-02 19:01:42Z 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 233 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 211 of file class.ilLMObjectGUI.php.

References $_GET.

{
session_unregister("saved_post");
$this->ctrl->redirect($this, $_GET["backcmd"]);
}
ilLMObjectGUI::checkTree ( )

check the content object tree

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

Referenced by ilStructureObjectGUI\cutPage(), ilStructureObjectGUI\pastePage(), 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 221 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 119 of file class.ilLMObjectGUI.php.

References $_GET, $_POST, $_SESSION, $data, getTargetFrame(), and getTemplateFile().

{
global $rbacsystem;
$new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"];
// fill in saved values in case of error
$data = array();
$data["fields"] = array();
$data["fields"]["title"] = $_SESSION["error_post_vars"]["Fobject"]["title"];
$data["fields"]["desc"] = $_SESSION["error_post_vars"]["Fobject"]["desc"];
$this->getTemplateFile("edit",$new_type);
foreach ($data["fields"] as $key => $val)
{
$this->tpl->setVariable("TXT_".strtoupper($key), $this->lng->txt($key));
$this->tpl->setVariable(strtoupper($key), $val);
if ($this->prepare_output)
{
$this->tpl->parseCurrentBlock();
}
}
$this->ctrl->setParameter($this, "new_type", $new_type);
//echo "<br>lmobjectgui_formaction";
//echo ":".$this->ctrl->getFormAction($this, "save", "bla").":";
$this->tpl->setVariable("FORMACTION",
$this->ctrl->getFormAction($this, "save"));
$this->tpl->setVariable("TXT_HEADER", $this->lng->txt($new_type."_new"));
$this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
$this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt($new_type."_add"));
$this->tpl->setVariable("CMD_SUBMIT", "save");
$this->tpl->setVariable("TARGET", $this->getTargetFrame("save"));
$this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
}

+ Here is the call graph for this function:

ilLMObjectGUI::delete ( )

Confirm deletion screen (delete page or structure objects)

Definition at line 198 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.

Referenced by create().

{
if ($this->target_frame[$a_cmd] != "")
{
return $this->target_frame[$a_cmd];
}
elseif (!empty($a_target_frame))
{
return "target=\"".$a_target_frame."\"";
}
else
{
return;
}
}

+ Here is the caller graph for this function:

ilLMObjectGUI::getTemplateFile (   $a_cmd,
  $a_type = "" 
)

get a template blockfile format: tpl.

<objtype>_<command>.html

Parameters
stringcommand
stringobject type definition public

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

References $_GET.

Referenced by create().

{
if (!$a_type)
{
$a_type = $_GET["type"];
}
$template = "tpl.".$a_type."_".$a_cmd.".html";
if (!$this->tpl->fileExists($template))
{
$template = "tpl.obj_".$a_cmd.".html";
}
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", $template);
}

+ Here is the caller graph for this function:

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

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

Referenced by ilStructureObjectGUI\subchap(), and ilStructureObjectGUI\view().

{
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.gif"));
$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: