Class ilLMPageObjectGUI. More...
Inheritance diagram for ilLMPageObjectGUI:
Collaboration diagram for ilLMPageObjectGUI:Public Member Functions | |
| ilLMPageObjectGUI (&$a_content_obj) | |
| Constructor. | |
| setLMPageObject (&$a_pg_obj) | |
| set content object dependent page object (co page) | |
| & | executeCommand () |
| execute command | |
| view () | |
| preview () | |
| save () | |
| save co page object | |
| cancel () | |
| cancel | |
| getLinkXML ($a_int_links) | |
| get link targets | |
| history () | |
| history | |
| updateHistory () | |
| update history | |
| setTabs () | |
| output tabs | |
| getTabs (&$tabs_gui) | |
| adds tabs to tab gui object | |
| _goto ($a_target, $a_target_ref_id="") | |
| redirect script | |
Data Fields | |
| $obj | |
Class ilLMPageObjectGUI.
User Interface for Learning Module Page Objects Editing
ilLMPageObjectGUI: ilPageObjectGUI, ilMDEditorGUI
Definition at line 41 of file class.ilLMPageObjectGUI.php.
| ilLMPageObjectGUI::_goto | ( | $ | a_target, | |
| $ | a_target_ref_id = "" | |||
| ) |
redirect script
| string | $a_target |
Definition at line 397 of file class.ilLMPageObjectGUI.php.
References $_GET, $ilErr, ilLMObjectGUI::$lng, $ref_id, ilObject::_getAllReferences(), ilLMObject::_lookupContObjID(), ilObject::_lookupTitle(), exit, and ilUtil::sendInfo().
{
global $rbacsystem, $ilErr, $lng, $ilAccess;
// determine learning object
$lm_id = ilLMObject::_lookupContObjID($a_target);
// get all references
$ref_ids = ilObject::_getAllReferences($lm_id);
// always try passed ref id first
if (in_array($a_target_ref_id, $ref_ids))
{
$ref_ids = array_merge(array($a_target_ref_id), $ref_ids);
}
// check read permissions
foreach ($ref_ids as $ref_id)
{
// check read permissions
if ($ilAccess->checkAccess("read", "", $ref_id))
{
// don't redirect anymore, just set parameters
// (goto.php includes "ilias.php")
$_GET["baseClass"] = "ilLMPresentationGUI";
$_GET["obj_id"] = $a_target;
$_GET["ref_id"] = $ref_id;
include_once("ilias.php");
exit;
}
}
if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
{
$_GET["cmd"] = "frameset";
$_GET["target"] = "";
$_GET["ref_id"] = ROOT_FOLDER_ID;
ilUtil::sendInfo(sprintf($lng->txt("msg_no_perm_read_item"),
ilObject::_lookupTitle($lm_id)), true);
include("repository.php");
exit;
}
$ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
}
Here is the call graph for this function:| ilLMPageObjectGUI::cancel | ( | ) |
cancel
Definition at line 202 of file class.ilLMPageObjectGUI.php.
References $_GET, ilUtil::redirect(), and ilUtil::sendInfo().
{
ilUtil::sendInfo($this->lng->txt("msg_cancel"), true);
if ($_GET["obj_id"] != 0)
{
ilUtil::redirect($this->ctrl->getLinkTargetByClass("ilStructureObjectGUI",
"view", "", true));
}
//$this->ctrl->returnToParent($this);
}
Here is the call graph for this function:| & ilLMPageObjectGUI::executeCommand | ( | ) |
execute command
Definition at line 73 of file class.ilLMPageObjectGUI.php.
References $_GET, $cmd, $ret, ilFrameTargetInfo::_getFrame(), ilLMPageObject::_getPresentationTitle(), getLinkXML(), and setTabs().
Referenced by preview(), and view().
{
#echo "<br>:cmd:".$this->ctrl->getCmd().":cmdClass:".$this->ctrl->getCmdClass().":"; flush();
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
switch($next_class)
{
case 'ilmdeditorgui':
$this->setTabs();
include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
$md_gui =& new ilMDEditorGUI($this->content_object->getID(),
$this->obj->getId(), $this->obj->getType());
$md_gui->addObserver($this->obj,'MDUpdateListener','General');
$this->ctrl->forwardCommand($md_gui);
break;
case "ilpageobjectgui":
// Determine whether the view of a learning resource should
// be shown in the frameset of ilias, or in a separate window.
//$showViewInFrameset = $this->ilias->ini->readVariable("layout","view_target") == "frame";
$showViewInFrameset = true;
$this->ctrl->setReturn($this, "view");
$page_object =& $this->obj->getPageObject();
$page_object->buildDom();
$page_object->addUpdateListener($this, "updateHistory");
$int_links = $page_object->getInternalLinks();
$link_xml = $this->getLinkXML($int_links);
$page_gui =& new ilPageObjectGUI($page_object);
// set page view link
if ($showViewInFrameset)
{
$view_frame = ilFrameTargetInfo::_getFrame("MainContent");
}
else
{
$view_frame = "ilContObj".$this->content_object->getID();
}
$page_gui->setViewPageLink(ILIAS_HTTP_PATH."/goto.php?target=pg_".$this->obj->getId().
"_".$_GET["ref_id"],
$view_frame);
$page_gui->setIntLinkHelpDefault("StructureObject", $_GET["ref_id"]);
$page_gui->setTemplateTargetVar("ADM_CONTENT");
$page_gui->setLinkXML($link_xml);
$page_gui->enableChangeComments($this->content_object->isActiveHistoryUserComments());
$page_gui->setFileDownloadLink("ilias.php?cmd=downloadFile&ref_id=".$_GET["ref_id"]."&baseClass=ilLMPresentationGUI");
$page_gui->setFullscreenLink("ilias.php?cmd=fullscreen&ref_id=".$_GET["ref_id"]."&baseClass=ilLMPresentationGUI");
$page_gui->setLinkParams("ref_id=".$this->content_object->getRefId());
$page_gui->setSourcecodeDownloadScript("ilias.php?ref_id=".$_GET["ref_id"]."&baseClass=ilLMPresentationGUI");
$page_gui->setPresentationTitle(
ilLMPageObject::_getPresentationTitle($this->obj->getId(),
$this->content_object->getPageHeader(), $this->content_object->isActiveNumbering()));
$page_gui->setLocator($contObjLocator);
$page_gui->setHeader($this->lng->txt("page").": ".$this->obj->getTitle());
$page_gui->setEnabledActivation(true);
$page_gui->setActivationListener($this, "activatePage");
$page_gui->setActivated($this->obj->getActive());
$ret =& $this->ctrl->forwardCommand($page_gui);
//$ret =& $page_gui->executeCommand();
break;
default:
$ret =& $this->$cmd();
break;
}
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilLMPageObjectGUI::getLinkXML | ( | $ | a_int_links | ) |
get link targets
Definition at line 216 of file class.ilLMPageObjectGUI.php.
References $_GET, $target_arr, $target_id, ilFrameTargetInfo::_getFrame(), ilLMObject::_lookupContObjID(), ilObject::_lookupObjId(), and ilObject::_lookupType().
Referenced by executeCommand().
{
if ($a_layoutframes == "")
{
$a_layoutframes = array();
}
$link_info = "<IntLinkInfos>";
foreach ($a_int_links as $int_link)
{
$target = $int_link["Target"];
if (substr($target, 0, 4) == "il__")
{
$target_arr = explode("_", $target);
$target_id = $target_arr[count($target_arr) - 1];
$type = $int_link["Type"];
$targetframe = ($int_link["TargetFrame"] != "")
? $int_link["TargetFrame"]
: "None";
switch($type)
{
case "PageObject":
case "StructureObject":
$lm_id = ilLMObject::_lookupContObjID($target_id);
$cont_obj =& $this->content_object;
if ($lm_id == $cont_obj->getId())
{
$ltarget = "";
if ($type == "PageObject")
{
$this->ctrl->setParameter($this, "obj_id", $target_id);
$href = $this->ctrl->getLinkTargetByClass(get_class($this), "view", "", true);
}
else
{
$this->ctrl->setParameterByClass("ilstructureobjectgui", "obj_id", $target_id);
$href = $this->ctrl->getLinkTargetByClass("ilstructureobjectgui", "view", "", true);
}
$href = str_replace("&", "&", $href);
$this->ctrl->setParameter($this, "obj_id", $_GET["obj_id"]);
}
else
{
if ($type == "PageObject")
{
$href = "../goto.php?target=pg_".$target_id;
}
else
{
$href = "../goto.php?target=st_".$target_id;
}
$ltarget = "ilContObj".$lm_id;
}
break;
case "GlossaryItem":
$ltarget = $nframe = "_blank";
$href = "ilias.php?cmdClass=illmpresentationgui&baseClass=ilLMPresentationGUI&".
"obj_type=$type&cmd=glossary&ref_id=".$_GET["ref_id"].
"&obj_id=".$target_id."&frame=$nframe";
break;
case "MediaObject":
$ltarget = $nframe = "_blank";
$href = "ilias.php?cmdClass=illmpresentationgui&baseClass=ilLMPresentationGUI&obj_type=$type&cmd=media&ref_id=".$_GET["ref_id"].
"&mob_id=".$target_id."&frame=$nframe";
break;
case "RepositoryItem":
$obj_type = ilObject::_lookupType($target_id, true);
$obj_id = ilObject::_lookupObjId($target_id);
$href = "./goto.php?target=".$obj_type."_".$target_id;
$t_frame = ilFrameTargetInfo::_getFrame("MainContent", $obj_type);
$ltarget = $t_frame;
break;
}
$link_info.="<IntLinkInfo Target=\"$target\" Type=\"$type\" ".
"TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" />";
}
}
$link_info.= "</IntLinkInfos>";
//echo ":".htmlentities($link_info).":";
return $link_info;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilLMPageObjectGUI::getTabs | ( | &$ | tabs_gui | ) |
adds tabs to tab gui object
| object | $tabs_gui ilTabsGUI object |
Definition at line 361 of file class.ilLMPageObjectGUI.php.
References $tab.
Referenced by setTabs().
{
// back to upper context
$tabs_gui->addTarget("edit", $this->ctrl->getLinkTarget($this, "view")
, array("", "view"), "ilpageobjectgui");
$tabs_gui->addTarget("cont_preview", $this->ctrl->getLinkTarget($this, "preview")
, "preview", "ilpageobjectgui");
//$tabs_gui->addTarget("properties", $this->ctrl->getLinkTarget($this, "properties")
// , "properties", get_class($this));
$tabs_gui->addTarget("meta_data",
$this->ctrl->getLinkTargetByClass('ilmdeditorgui',''),
"", "ilmdeditorgui");
$tabs_gui->addTarget("history", $this->ctrl->getLinkTarget($this, "history")
, "history", get_class($this));
$tabs = $this->ctrl->getTabs();
foreach ($tabs as $tab)
{
$tabs_gui->addTarget($tab["lang_var"], $tab["link"]
, $tab["cmd"], $tab["class"]);
}
//$tabs_gui->addTarget("clipboard", $this->ctrl->getLinkTargetByClass("ilEditClipboardGUI", "view")
// , "view", "ilEditClipboardGUI");
}
Here is the caller graph for this function:| ilLMPageObjectGUI::history | ( | ) |
history
public
Definition at line 307 of file class.ilLMPageObjectGUI.php.
References setTabs().
{
$this->setTabs();
require_once("classes/class.ilHistoryGUI.php");
$hist_gui =& new ilHistoryGUI($this->obj->getId() ,
$this->content_object->getType().":pg");
$hist_html = $hist_gui->getHistoryTable(
$this->ctrl->getParameterArray($this, "history"),
$this->content_object->isActiveHistoryUserComments()
);
$this->tpl->setVariable("ADM_CONTENT", $hist_html);
}
Here is the call graph for this function:| ilLMPageObjectGUI::ilLMPageObjectGUI | ( | &$ | a_content_obj | ) |
Constructor.
| object | $a_content_obj content object (lm | dbk) public |
Definition at line 51 of file class.ilLMPageObjectGUI.php.
References ilLMObjectGUI::$ilias, ilLMObjectGUI::$lng, ilLMObjectGUI::$tpl, and ilLMObjectGUI::ilLMObjectGUI().
{
global $ilias, $tpl, $lng;
parent::ilLMObjectGUI($a_content_obj);
}
Here is the call graph for this function:| ilLMPageObjectGUI::preview | ( | ) |
Definition at line 163 of file class.ilLMPageObjectGUI.php.
References executeCommand(), and setTabs().
{
$this->ctrl->setCmdClass("ilpageobjectgui");
$this->ctrl->setCmd("preview");
$this->executeCommand();
$this->setTabs();
}
Here is the call graph for this function:| ilLMPageObjectGUI::save | ( | ) |
save co page object
Definition at line 174 of file class.ilLMPageObjectGUI.php.
References $_GET, ilLMObjectGUI::checkTree(), ilLMObjectGUI::putInTree(), ilUtil::redirect(), and ilUtil::stripSlashes().
{
$this->obj =& new ilLMPageObject($this->content_object);
$this->obj->setType("pg");
$this->obj->setTitle(ilUtil::stripSlashes($_POST["Fobject"]["title"]));
$this->obj->setDescription(ilUtil::stripSlashes($_POST["Fobject"]["desc"]));
$this->obj->setLMId($this->content_object->getId());
$this->obj->create();
// obj_id is empty, if page is created from "all pages" screen
// -> a free page is created (not in the tree)
//echo "<br>savePage:".$_GET["obj_id"].":";
if ($_GET["obj_id"] != 0)
{
$this->putInTree();
// check the tree
$this->checkTree();
ilUtil::redirect($this->ctrl->getLinkTargetByClass("ilStructureObjectGUI",
"view", "", true));
}
}
Here is the call graph for this function:| ilLMPageObjectGUI::setLMPageObject | ( | &$ | a_pg_obj | ) |
set content object dependent page object (co page)
Definition at line 63 of file class.ilLMPageObjectGUI.php.
{
$this->obj =& $a_pg_obj;
$this->obj->setLMId($this->content_object->getId());
$this->actions = $this->objDefinition->getActions($this->obj->getType());
}
| ilLMPageObjectGUI::setTabs | ( | ) |
output tabs
Definition at line 337 of file class.ilLMPageObjectGUI.php.
References ilUtil::getImagePath(), and getTabs().
Referenced by executeCommand(), history(), preview(), and view().
{
global $ilTabs;
//echo "setTabs";
// catch feedback message
#include_once("classes/class.ilTabsGUI.php");
#$tabs_gui =& new ilTabsGUI();
$this->getTabs($ilTabs);
$this->tpl->setCurrentBlock("header_image");
$this->tpl->setVariable("IMG_HEADER", ilUtil::getImagePath("icon_pg_b.gif"));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("content");
#$this->tpl->setVariable("TABS", $tabs_gui->getHTML());
$this->tpl->setVariable("HEADER",
$this->lng->txt($this->obj->getType()).": ".$this->obj->getTitle());
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilLMPageObjectGUI::updateHistory | ( | ) |
update history
Definition at line 325 of file class.ilLMPageObjectGUI.php.
References ilHistory::_createEntry().
{
require_once("classes/class.ilHistory.php");
ilHistory::_createEntry($this->obj->getId(), "update",
"", $this->content_object->getType().":pg",
"", true);
}
Here is the call graph for this function:| ilLMPageObjectGUI::view | ( | ) |
Definition at line 151 of file class.ilLMPageObjectGUI.php.
References executeCommand(), and setTabs().
{
//echo "<br>umschuss";
$this->ctrl->setCmdClass("ilpageobjectgui");
$this->ctrl->setCmd("view");
$this->executeCommand();
$this->setTabs();
}
Here is the call graph for this function:| ilLMPageObjectGUI::$obj |
Reimplemented from ilLMObjectGUI.
Definition at line 43 of file class.ilLMPageObjectGUI.php.
1.7.1