ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilLMPageObjectGUI Class Reference

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
 edit ()
 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
- Public Member Functions inherited from ilLMObjectGUI
 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 ()
 show possible action (form buttons)
 checkTree ()
 check the content object tree
 activatePage ($a_active)
 activates page or chapter (currently only for pages implemented)

Data Fields

 $obj
- Data Fields inherited from ilLMObjectGUI
 $ilias
 $tpl
 $lng
 $obj
 $ctrl
 $content_object
 $actions

Detailed Description

Class ilLMPageObjectGUI.

User Interface for Learning Module Page Objects Editing

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id:
class.ilLMPageObjectGUI.php 17655 2008-10-10 12:16:56Z akill

ilLMPageObjectGUI: ilPageObjectGUI

Definition at line 41 of file class.ilLMPageObjectGUI.php.

Member Function Documentation

ilLMPageObjectGUI::_goto (   $a_target,
  $a_target_ref_id = "" 
)

redirect script

Parameters
string$a_target

Definition at line 422 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");
}
}
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");
}
$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 227 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::edit ( )

Definition at line 177 of file class.ilLMPageObjectGUI.php.

References executeCommand().

{
//echo "<br>umschuss";
$this->ctrl->setCmdClass("ilpageobjectgui");
$this->ctrl->setCmd("edit");
$this->executeCommand();
//$this->setTabs();
}

+ Here is the call graph for this function:

& ilLMPageObjectGUI::executeCommand ( )

execute command

Definition at line 72 of file class.ilLMPageObjectGUI.php.

References $_GET, $cmd, $ilCtrl, $obj, $ret, ilLMObjectGUI\$tpl, ilFrameTargetInfo\_getFrame(), ilLMPageObject\_getPresentationTitle(), ilUtil\getImagePath(), getLinkXML(), and ilPageObjectGUI\setEditPreview().

Referenced by edit(), and preview().

{
global $tpl, $ilCtrl;
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
//echo "<br>:cmd:".$this->ctrl->getCmd().":cmdClass:".$this->ctrl->getCmdClass().":".
// ":nextClass:".$next_class.":"; flush();
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, "edit");
/* $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);
$page_gui =& new ilPageObjectGUI($this->obj->content_object->getType(),
$this->obj->getId());
$page_gui->setEditPreview(true);
$page_gui->activateMetaDataEditor($this->content_object->getID(),
$this->obj->getId(), $this->obj->getType(),
$this->obj, "MDUpdateListener");
// 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->getPageObject()->buildDom();
$int_links = $page_gui->getPageObject()->getInternalLinks();
$link_xml = $this->getLinkXML($int_links);
$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(
$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());
$up_gui = ($this->content_object->getType() == "dbk")
? "ilobjdlbookgui"
: "ilobjlearningmodulegui";
$ilCtrl->setParameterByClass($up_gui, "active_node", $this->obj->getId());
$page_gui->setExplorerUpdater("tree", "tree_div",
$ilCtrl->getLinkTargetByClass($up_gui, "explorer", "", true));
$tpl->setTitleIcon(ilUtil::getImagePath("icon_pg_b.gif"));
$tpl->setTitle($this->lng->txt("page").": ".$this->obj->getTitle());
$ret = $this->ctrl->forwardCommand($page_gui);
//$ret =& $page_gui->executeCommand();
$tpl->setContent($ret);
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 241 of file class.ilLMPageObjectGUI.php.

References $_GET, ilLMObjectGUI\$content_object, $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);
$type = $int_link["Type"];
$targetframe = ($int_link["TargetFrame"] != "")
? $int_link["TargetFrame"]
: "None";
switch($type)
{
case "PageObject":
case "StructureObject":
$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), "edit");
}
else
{
$this->ctrl->setParameterByClass("ilstructureobjectgui", "obj_id", $target_id);
$href = $this->ctrl->getLinkTargetByClass("ilstructureobjectgui", "view");
}
$href = str_replace("&", "&amp;", $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&amp;baseClass=ilLMPresentationGUI&amp;".
"obj_type=$type&amp;cmd=glossary&amp;ref_id=".$_GET["ref_id"].
"&amp;obj_id=".$target_id."&amp;frame=$nframe";
break;
case "MediaObject":
$ltarget = $nframe = "_blank";
$href = "ilias.php?cmdClass=illmpresentationgui&amp;baseClass=ilLMPresentationGUI&amp;obj_type=$type&amp;cmd=media&amp;ref_id=".$_GET["ref_id"].
"&amp;mob_id=".$target_id."&amp;frame=$nframe";
break;
case "RepositoryItem":
$obj_type = ilObject::_lookupType($target_id, true);
$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

Parameters
object$tabs_guiilTabsGUI object

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

Parameters
object$a_content_objcontent 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 189 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 200 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",
"edit", "", 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());
}
ilLMPageObjectGUI::setTabs ( )

output tabs

Definition at line 362 of file class.ilLMPageObjectGUI.php.

References ilUtil\getImagePath(), and getTabs().

Referenced by history(), and preview().

{
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 350 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:

Field Documentation

ilLMPageObjectGUI::$obj

Definition at line 43 of file class.ilLMPageObjectGUI.php.

Referenced by executeCommand().


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