Inheritance diagram for ilLMObjectGUI:Public Member Functions | |
| ilLMObjectGUI (&$a_content_obj) | |
| constructor | |
| setActions ($a_actions="") | |
| build action array | |
| addMeta () | |
| add meta data | |
| deleteMeta () | |
| delete meta data | |
| chooseMetaSection () | |
| choose meta data section | |
| editMeta () | |
| edit meta data | |
| saveMeta () | |
| save meta data | |
| 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 form action 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 | |
| showPossibleSubObjects ($a_type) | |
| display subobject selection | |
| add_cell ($val, $link="") | |
| output a cell in object list | |
| showActions () | |
| show possible action (form buttons) | |
| checkTree () | |
| check the content object tree | |
Data Fields | |
| $ilias | |
| $tpl | |
| $lng | |
| $obj | |
| $objDefinition | |
| $ctrl | |
| $content_object | |
| $actions | |
Definition at line 37 of file class.ilLMObjectGUI.php.
| ilLMObjectGUI::add_cell | ( | $ | val, | |
| $ | link = "" | |||
| ) |
output a cell in object list
Reimplemented in ilStructureObjectGUI.
Definition at line 414 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::addMeta | ( | ) |
add meta data
Definition at line 93 of file class.ilLMObjectGUI.php.
References $_GET, $_POST, and sendInfo().
{
$this->setTabs();
$meta_gui =& new ilMetaDataGUI();
$meta_gui->setObject($this->obj);
$meta_name = $_POST["meta_name"] ? $_POST["meta_name"] : $_GET["meta_name"];
$meta_path = $_POST["meta_path"] ? $_POST["meta_path"] : $_GET["meta_path"];
$meta_index = $_POST["meta_index"] ? $_POST["meta_index"] : $_GET["meta_index"];
if ($meta_index == "")
$meta_index = 0;
$meta_section = $_POST["meta_section"] ? $_POST["meta_section"] : $_GET["meta_section"];
if ($meta_name != "")
{
$meta_gui->meta_obj->add($meta_name, $meta_path, $meta_index);
}
else
{
sendInfo($this->lng->txt("meta_choose_element"));
}
$meta_gui->edit("ADM_CONTENT", "adm_content", $this->ctrl->getLinkTarget($this),
$meta_section);
}
Here is the call graph for this function:| ilLMObjectGUI::cancelDelete | ( | ) |
cancel deletion of page/structure objects
Definition at line 362 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 471 of file class.ilLMObjectGUI.php.
Referenced by ilStructureObjectGUI::cutPage(), ilStructureObjectGUI::pastePage(), ilStructureObjectGUI::save(), and ilLMPageObjectGUI::save().
{
$this->content_object->checkTree();
}
Here is the caller graph for this function:| ilLMObjectGUI::chooseMetaSection | ( | ) |
choose meta data section
Definition at line 137 of file class.ilLMObjectGUI.php.
References $_REQUEST.
{
$this->setTabs();
$meta_gui =& new ilMetaDataGUI();
$meta_gui->setObject($this->obj);
$meta_gui->edit("ADM_CONTENT", "adm_content", $this->ctrl->getLinkTarget($this),
$_REQUEST["meta_section"]);
}
| ilLMObjectGUI::confirmedDelete | ( | ) |
page and structure object deletion
Definition at line 372 of file class.ilLMObjectGUI.php.
References $_GET.
{
$cont_obj_gui =& new ilObjContentObjectGUI("",$this->content_object->getRefId(),
true, false);
$cont_obj_gui->confirmedDelete($this->obj->getId());
$this->ctrl->redirect($this, $_GET["backcmd"]);
}
| ilLMObjectGUI::create | ( | ) |
structure / page object creation form
Reimplemented in ilStructureObjectGUI.
Definition at line 255 of file class.ilLMObjectGUI.php.
References $_GET, $_POST, $_SESSION, $data, $rbacsystem, 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, "", true).":";
$this->tpl->setVariable("FORMACTION",
$this->ctrl->getFormAction($this, "", true));
$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"));
/* if(count($_POST["id"]) > 1)
{
$this->ilias->raiseError($this->lng->txt("cont_max_one_pos"),$this->ilias->error_obj->MESSAGE);
}
$target = (count($_POST["id"]) == 1)
? $_POST["id"][0]
: "";
$meta_gui =& new ilMetaDataGUI();
$obj_str = (is_object($this->obj))
? "&obj_id=".$this->obj->getId()
: "";
$meta_gui->edit("ADM_CONTENT", "adm_content", "lm_edit.php?ref_id=".
$this->content_object->getRefId().$obj_str."&new_type=".$_POST["new_type"].
"&target=".$target."&cmd=saveMeta");*/
}
Here is the call graph for this function:| ilLMObjectGUI::delete | ( | ) |
confirm deletion screen (delete page or structure objects)
Definition at line 349 of file class.ilLMObjectGUI.php.
{
$this->setTabs();
$cont_obj_gui =& new ilObjContentObjectGUI("",$this->content_object->getRefId(),
true, false);
$cont_obj_gui->delete($this->obj->getId());
}
| ilLMObjectGUI::deleteMeta | ( | ) |
delete meta data
Definition at line 121 of file class.ilLMObjectGUI.php.
{
$this->setTabs();
$meta_gui =& new ilMetaDataGUI();
$meta_gui->setObject($this->obj);
$meta_index = $_POST["meta_index"] ? $_POST["meta_index"] : $_GET["meta_index"];
$meta_gui->meta_obj->delete($_GET["meta_name"], $_GET["meta_path"], $meta_index);
$meta_gui->edit("ADM_CONTENT", "adm_content", $this->ctrl->getLinkTarget($this),
$_GET["meta_section"]);
}
| ilLMObjectGUI::editMeta | ( | ) |
edit meta data
Definition at line 151 of file class.ilLMObjectGUI.php.
References $_GET.
{
$this->setTabs();
$meta_gui =& new ilMetaDataGUI();
$meta_gui->setObject($this->obj);
$meta_gui->edit("ADM_CONTENT", "adm_content", $this->ctrl->getLinkTarget($this),
$_GET["meta_section"]);
}
| ilLMObjectGUI::getTargetFrame | ( | $ | a_cmd, | |
| $ | a_target_frame = "" | |||
| ) |
get target frame for command (command is method name without "Object", e.g.
"perm")
| string | $a_cmd command | |
| string | $a_target_frame default target frame (is returned, if no special target frame was set) public |
Definition at line 186 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 form action for command (command is method name without "Object", e.g.
"perm")
| string | $a_cmd command | |
| string | $a_formaction default formaction (is returned, if no special formaction was set) public |
| string | command | |
| string | object type definition public |
Definition at line 234 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
| object | $a_content_obj content object |
Definition at line 54 of file class.ilLMObjectGUI.php.
References $ilCtrl, $ilias, $lng, $objDefinition, and $tpl.
Referenced by ilLMPageObjectGUI::ilLMPageObjectGUI(), and ilStructureObjectGUI::ilStructureObjectGUI().
{
global $ilias, $tpl, $lng, $objDefinition, $ilCtrl;
$this->ilias =& $ilias;
$this->tpl =& $tpl;
$this->lng =& $lng;
$this->ctrl =& $ilCtrl;
$this->objDefinition =& $objDefinition;
$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 312 of file class.ilLMObjectGUI.php.
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 caller graph for this function:| ilLMObjectGUI::saveMeta | ( | ) |
save meta data
Reimplemented in ilStructureObjectGUI.
Definition at line 165 of file class.ilLMObjectGUI.php.
References $_POST, and sendInfo().
{
//echo "lmobjectgui_Savemeta1<br>";
$meta_gui =& new ilMetaDataGUI();
$meta_gui->setObject($this->obj);
//$f = fopen("/opt/iliasdata/bb.txt", "a"); fwrite($f, "LMObjectGUI::saveMeta(), start\n"); fclose($f);
$meta_gui->save($_POST["meta_section"]);
//echo "lmobjectgui_Savemeta3<br>";
//$f = fopen("/opt/iliasdata/bb.txt", "a"); fwrite($f, "LMObjectGUI::saveMeta(), end\n"); fclose($f);
sendInfo($this->lng->txt("msg_obj_modified"), true);
$this->ctrl->redirect($this, "editMeta");
}
Here is the call graph for this function:| ilLMObjectGUI::setActions | ( | $ | a_actions = "" |
) |
build action array
| array | $a_actions action array (key = action key, value = action language string) private |
Definition at line 74 of file class.ilLMObjectGUI.php.
References $lng.
Referenced by ilStructureObjectGUI::subchap(), and ilStructureObjectGUI::view().
{
if (is_array($a_actions))
{
foreach ($a_actions as $name => $lng)
{
$this->actions[$name] = array("name" => $name, "lng" => $lng);
}
}
else
{
$this->actions = "";
}
}
Here is the caller graph for this function:| ilLMObjectGUI::showActions | ( | ) |
show possible action (form buttons)
public
Definition at line 437 of file class.ilLMObjectGUI.php.
References ilUtil::getImagePath().
Referenced by ilStructureObjectGUI::subchap(), and ilStructureObjectGUI::view().
{
$notoperations = array();
$operations = array();
$operations = $this->actions;
/*
foreach ($d as $row)
{
if (!in_array($row["name"], $notoperations))
{
$operations[] = $row;
}
}*/
if (count($operations) > 0)
{
foreach ($operations as $val)
{
$this->tpl->setCurrentBlock("operation_btn");
$this->tpl->setVariable("BTN_NAME", $val["lng"]);
$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:| ilLMObjectGUI::showPossibleSubObjects | ( | $ | a_type | ) |
display subobject selection
| string | $a_type parent object type |
Definition at line 386 of file class.ilLMObjectGUI.php.
References $d, $row, and formSelect().
{
$d = $this->objDefinition->getCreatableSubObjects($a_type);
if (count($d) > 0)
{
foreach ($d as $row)
{
$subobj[] = $row["name"];
}
}
if (is_array($subobj))
{
//build form
$opts = ilUtil::formSelect(12,"new_type",$subobj);
//$this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.gif"));
$this->tpl->setCurrentBlock("add_object");
$this->tpl->setVariable("SELECT_OBJTYPE", $opts);
//$this->tpl->setVariable("FORMACTION_OBJ_ADD", "adm_object.php?cmd=create&ref_id=".$_GET["ref_id"]);
$this->tpl->setVariable("BTN_NAME", "create");
$this->tpl->setVariable("TXT_ADD", $this->lng->txt("add"));
$this->tpl->parseCurrentBlock();
}
}
Here is the call graph for this function:| ilLMObjectGUI::$actions |
Definition at line 46 of file class.ilLMObjectGUI.php.
| ilLMObjectGUI::$content_object |
Definition at line 45 of file class.ilLMObjectGUI.php.
| ilLMObjectGUI::$ctrl |
Definition at line 44 of file class.ilLMObjectGUI.php.
| ilLMObjectGUI::$ilias |
Definition at line 39 of file class.ilLMObjectGUI.php.
Referenced by ilLMObjectGUI(), ilLMPageObjectGUI::ilLMPageObjectGUI(), and ilStructureObjectGUI::ilStructureObjectGUI().
| ilLMObjectGUI::$lng |
Definition at line 41 of file class.ilLMObjectGUI.php.
Referenced by ilLMObjectGUI(), ilLMPageObjectGUI::ilLMPageObjectGUI(), ilStructureObjectGUI::ilStructureObjectGUI(), and setActions().
| ilLMObjectGUI::$obj |
Reimplemented in ilLMPageObjectGUI, and ilStructureObjectGUI.
Definition at line 42 of file class.ilLMObjectGUI.php.
| ilLMObjectGUI::$objDefinition |
Definition at line 43 of file class.ilLMObjectGUI.php.
Referenced by ilLMObjectGUI().
| ilLMObjectGUI::$tpl |
Definition at line 40 of file class.ilLMObjectGUI.php.
Referenced by ilLMObjectGUI(), ilLMPageObjectGUI::ilLMPageObjectGUI(), and ilStructureObjectGUI::ilStructureObjectGUI().
1.7.1