ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilSCORM2004NodeGUI Class Reference

Class ilSCORM2004NodeGUI. More...

+ Inheritance diagram for ilSCORM2004NodeGUI:
+ Collaboration diagram for ilSCORM2004NodeGUI:

Public Member Functions

 ilSCORM2004NodeGUI ($a_slm_obj, $a_node_id=0)
 constructor
 setParentGUI ($a_parentgui)
 Set Parent GUI class (ilObjSCORM2004LearningModuleGUI).
 getParentGUI ()
 Get Parent GUI class (ilObjSCORM2004LearningModuleGUI).
 getNodeObject ($a_node_id)
 Get node object (chapter/sco/page)
 putInTree ($a_parent_id, $a_target)
 put this object into content object tree
 showOrganization ()
 Confirm deletion screen (delete page or structure objects)
 insertChapter ()
 Insert Chapter.
 insertSco ()
 Insert Sco.
 insertAsset ()
 Insert Asset.
 insertPage ()
 Insert Page.
 insertTemplateGUI ()
 Insert Page with Layout.
 insertSpecialPage ()
 Insert special page.
 collapseAll ()
 Collapse all.
 ExpandAll ()
 Expand all.
 saveAllTitles ()
 Save Titles.
 deleteNodes ()
 Delete nodes in the hierarchy.
 cancelDelete ()
 cancel delete
 confirmedDelete ()
 confirmed delete
 setLocator ()
 Set Locator Items.
 setContentStyle ()
 Set content style sheet.
 copyItems ($a_return="showOrganization")
 Copy items to clipboard.
 cutItems ($a_return="showOrganization")
 Copy items to clipboard, then cut them from the current tree.
 insertPageClip ()
 Insert pages from clipboard.
 insertScoClip ()
 Insert scos from clipboard.
 insertAssetClip ()
 Insert assets from clipboard.

Data Fields

 $node_object
 $slm_object

Detailed Description

Class ilSCORM2004NodeGUI.

Base GUI class for scorm nodes (Chapter, SCO and Page)

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 14 of file class.ilSCORM2004NodeGUI.php.

Member Function Documentation

ilSCORM2004NodeGUI::cancelDelete ( )

cancel delete

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

References $ilCtrl.

{
global $ilCtrl;
$ilCtrl->redirect($this, "showOrganization");
}
ilSCORM2004NodeGUI::collapseAll ( )

Collapse all.

Definition at line 243 of file class.ilSCORM2004NodeGUI.php.

References $ilCtrl, and getParentGUI().

{
global $ilCtrl;
$this->getParentGUI()->collapseAll(false);
$ilCtrl->redirect($this, "showOrganization");
}

+ Here is the call graph for this function:

ilSCORM2004NodeGUI::confirmedDelete ( )

confirmed delete

Definition at line 296 of file class.ilSCORM2004NodeGUI.php.

References $ilCtrl, and getParentGUI().

{
global $ilCtrl;
$this->getParentGUI()->confirmedDelete(false);
$ilCtrl->redirect($this, "showOrganization");
}

+ Here is the call graph for this function:

ilSCORM2004NodeGUI::copyItems (   $a_return = "showOrganization")

Copy items to clipboard.

Definition at line 402 of file class.ilSCORM2004NodeGUI.php.

References $_POST, $ilCtrl, $lng, ilSCORM2004Node\clipboardCopy(), ilUtil\sendFailure(), ilUtil\sendInfo(), ilEditClipboard\setAction(), ilUtil\stripSlashesArray(), and ilSCORM2004Node\uniqueTypesCheck().

{
global $ilCtrl, $lng;
$todel = array(); // delete IDs < 0 (needed for non-js editing)
foreach($items as $k => $item)
{
if ($item < 0)
{
$todel[] = $k;
}
}
foreach($todel as $k)
{
unset($items[$k]);
}
{
ilUtil::sendFailure($lng->txt("sahs_choose_pages_chap_scos_ass_only"), true);
$ilCtrl->redirect($this, $a_return);
}
ilSCORM2004Node::clipboardCopy($this->slm_object->getId(), $items);
// @todo: move this to a service since it can be used here, too
include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
ilUtil::sendInfo($lng->txt("cont_selected_items_have_been_copied"), true);
$ilCtrl->redirect($this, $a_return);
}

+ Here is the call graph for this function:

ilSCORM2004NodeGUI::cutItems (   $a_return = "showOrganization")

Copy items to clipboard, then cut them from the current tree.

Definition at line 437 of file class.ilSCORM2004NodeGUI.php.

References $_POST, $ilCtrl, $lng, ilSCORM2004Node\clipboardCut(), ilUtil\sendFailure(), ilUtil\sendInfo(), ilEditClipboard\setAction(), ilUtil\stripSlashesArray(), and ilSCORM2004Node\uniqueTypesCheck().

{
global $ilCtrl, $lng;
$todel = array(); // delete IDs < 0 (needed for non-js editing)
foreach($items as $k => $item)
{
if ($item < 0)
{
$todel[] = $k;
}
}
foreach($todel as $k)
{
unset($items[$k]);
}
{
ilUtil::sendFailure($lng->txt("sahs_choose_pages_chap_scos_ass_only"), true);
$ilCtrl->redirect($this, $a_return);
}
ilSCORM2004Node::clipboardCut($this->slm_object->getId(), $items);
include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
ilUtil::sendInfo($lng->txt("cont_selected_items_have_been_cut"), true);
$ilCtrl->redirect($this, $a_return);
}

+ Here is the call graph for this function:

ilSCORM2004NodeGUI::deleteNodes ( )

Delete nodes in the hierarchy.

Definition at line 276 of file class.ilSCORM2004NodeGUI.php.

References $_GET, $ilCtrl, and getParentGUI().

{
global $ilCtrl;
$ilCtrl->setParameter($this, "backcmd", $_GET["backcmd"]);
$this->getParentGUI()->deleteNodes($ilCtrl->getFormAction($this));
}

+ Here is the call graph for this function:

ilSCORM2004NodeGUI::ExpandAll ( )

Expand all.

Definition at line 254 of file class.ilSCORM2004NodeGUI.php.

References $ilCtrl, and getParentGUI().

{
global $ilCtrl;
$this->getParentGUI()->expandAll(false);
$ilCtrl->redirect($this, "showOrganization");
}

+ Here is the call graph for this function:

ilSCORM2004NodeGUI::getNodeObject (   $a_node_id)

Get node object (chapter/sco/page)

Definition at line 58 of file class.ilSCORM2004NodeGUI.php.

References ilSCORM2004NodeFactory\getInstance().

Referenced by ilSCORM2004NodeGUI().

{
include_once("./Modules/Scorm2004/classes/class.ilSCORM2004NodeFactory.php");
$this->node_object = ilSCORM2004NodeFactory::getInstance($this->slm_object,
$a_node_id, false);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSCORM2004NodeGUI::getParentGUI ( )

Get Parent GUI class (ilObjSCORM2004LearningModuleGUI).

Returns
object Parent GUI class

Definition at line 50 of file class.ilSCORM2004NodeGUI.php.

Referenced by collapseAll(), confirmedDelete(), deleteNodes(), ilSCORM2004PageNodeGUI\executeCommand(), ExpandAll(), insertAsset(), insertChapter(), insertPage(), insertSco(), insertSpecialPage(), insertTemplateGUI(), saveAllTitles(), setLocator(), and showOrganization().

{
return $this->parentgui;
}

+ Here is the caller graph for this function:

ilSCORM2004NodeGUI::ilSCORM2004NodeGUI (   $a_slm_obj,
  $a_node_id = 0 
)

constructor

Parameters
object$a_content_objnode object

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

References getNodeObject().

Referenced by ilSCORM2004ChapterGUI\ilSCORM2004ChapterGUI(), ilSCORM2004PageNodeGUI\ilSCORM2004PageNodeGUI(), and ilSCORM2004ScoGUI\ilSCORM2004ScoGUI().

{
$this->slm_object = $a_slm_obj;
$this->node_object = null;
if ($a_node_id > 0)
{
$this->getNodeObject($a_node_id);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSCORM2004NodeGUI::insertAsset ( )

Insert Asset.

Definition at line 201 of file class.ilSCORM2004NodeGUI.php.

References $ilCtrl, $res, and getParentGUI().

{
global $ilCtrl;
$res = $this->getParentGUI()->insertAsset(false);
$ilCtrl->setParameter($this, "highlight", $res["items"]);
$ilCtrl->redirect($this, "showOrganization", "node_".$res["node_id"]);
}

+ Here is the call graph for this function:

ilSCORM2004NodeGUI::insertAssetClip ( )

Insert assets from clipboard.

Definition at line 500 of file class.ilSCORM2004NodeGUI.php.

References $ilCtrl, and ilHierarchyFormGUI\getPostNodeId().

{
global $ilCtrl, $ilUser;
$ilCtrl->redirect($this, "showOrganization",
}

+ Here is the call graph for this function:

ilSCORM2004NodeGUI::insertChapter ( )

Insert Chapter.

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

References $ilCtrl, $res, and getParentGUI().

{
global $ilCtrl;
$res = $this->getParentGUI()->insertChapter(false);
$ilCtrl->setParameter($this, "highlight", $res["items"]);
$ilCtrl->redirect($this, "showOrganization", "node_".$res["node_id"]);
}

+ Here is the call graph for this function:

ilSCORM2004NodeGUI::insertPage ( )

Insert Page.

Definition at line 213 of file class.ilSCORM2004NodeGUI.php.

References $ilCtrl, $res, and getParentGUI().

{
global $ilCtrl;
$res = $this->getParentGUI()->insertPage(false);
$ilCtrl->setParameter($this, "highlight", $res["items"]);
$ilCtrl->redirect($this, "showOrganization", "node_".$res["node_id"]);
}

+ Here is the call graph for this function:

ilSCORM2004NodeGUI::insertPageClip ( )

Insert pages from clipboard.

Definition at line 474 of file class.ilSCORM2004NodeGUI.php.

References $ilCtrl, and ilHierarchyFormGUI\getPostNodeId().

{
global $ilCtrl, $ilUser;
ilSCORM2004Node::insertPageClip($this->slm_object);
$ilCtrl->redirect($this, "showOrganization",
}

+ Here is the call graph for this function:

ilSCORM2004NodeGUI::insertSco ( )

Insert Sco.

Definition at line 189 of file class.ilSCORM2004NodeGUI.php.

References $ilCtrl, $res, and getParentGUI().

{
global $ilCtrl;
$res = $this->getParentGUI()->insertSco(false);
$ilCtrl->setParameter($this, "highlight", $res["items"]);
$ilCtrl->redirect($this, "showOrganization", "node_".$res["node_id"]);
}

+ Here is the call graph for this function:

ilSCORM2004NodeGUI::insertScoClip ( )

Insert scos from clipboard.

Definition at line 487 of file class.ilSCORM2004NodeGUI.php.

References $ilCtrl, and ilHierarchyFormGUI\getPostNodeId().

{
global $ilCtrl, $ilUser;
ilSCORM2004Node::insertScoClip($this->slm_object);
$ilCtrl->redirect($this, "showOrganization",
}

+ Here is the call graph for this function:

ilSCORM2004NodeGUI::insertSpecialPage ( )

Insert special page.

Definition at line 234 of file class.ilSCORM2004NodeGUI.php.

References $ilCtrl, and getParentGUI().

{
global $ilCtrl;
$this->getParentGUI()->insertSpecialPage(true);
}

+ Here is the call graph for this function:

ilSCORM2004NodeGUI::insertTemplateGUI ( )

Insert Page with Layout.

Definition at line 225 of file class.ilSCORM2004NodeGUI.php.

References $ilCtrl, and getParentGUI().

{
global $ilCtrl;
$this->getParentGUI()->insertTemplateGUI(true);
}

+ Here is the call graph for this function:

ilSCORM2004NodeGUI::putInTree (   $a_parent_id,
  $a_target 
)

put this object into content object tree

Todo:
: move to application class

Definition at line 70 of file class.ilSCORM2004NodeGUI.php.

References ilTree\setTableNames().

{
$tree = new ilTree($this->slm_object->getId());
$tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
$tree->setTreeTablePK("slm_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->node_obj->getId()))
{
$tree->insertNode($this->node_obj->getId(), $parent_id, $target);
}
}

+ Here is the call graph for this function:

ilSCORM2004NodeGUI::saveAllTitles ( )

Save Titles.

Definition at line 265 of file class.ilSCORM2004NodeGUI.php.

References $ilCtrl, and getParentGUI().

{
global $ilCtrl;
$this->getParentGUI()->saveAllTitles(false);
$ilCtrl->redirect($this, "showOrganization");
}

+ Here is the call graph for this function:

ilSCORM2004NodeGUI::setContentStyle ( )

Set content style sheet.

Definition at line 380 of file class.ilSCORM2004NodeGUI.php.

References $tpl, ilObjStyleSheet\getContentStylePath(), ilObjStyleSheet\getPlaceHolderStylePath(), and ilObjStyleSheet\getSyntaxStylePath().

Referenced by ilSCORM2004PageNodeGUI\executeCommand().

{
global $tpl;
// content styles
include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
$tpl->setCurrentBlock("ContentStyle");
$tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
ilObjStyleSheet::getContentStylePath($this->slm_object->getStyleSheetId()));
$tpl->setVariable("LOCATION_ADDITIONAL_STYLESHEET",
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("SyntaxStyle");
$tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
$tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSCORM2004NodeGUI::setLocator ( )

Set Locator Items.

Definition at line 307 of file class.ilSCORM2004NodeGUI.php.

References $_GET, $ilCtrl, $path, $tpl, ilUtil\getImagePath(), getParentGUI(), and ilTree\setTableNames().

Referenced by ilSCORM2004ChapterGUI\executeCommand(), ilSCORM2004PageNodeGUI\executeCommand(), ilSCORM2004ScoGUI\executeCommand(), ilSCORM2004ScoGUI\import(), ilSCORM2004ScoGUI\sahs_questions(), ilSCORM2004ScoGUI\sco_resources(), ilSCORM2004ScoGUI\showExportList(), showOrganization(), ilSCORM2004ScoGUI\showProperties(), and ilSCORM2004ChapterGUI\showProperties().

{
global $ilLocator, $tpl, $ilCtrl;
$ilLocator->addRepositoryItems($_GET["ref_id"]);
$this->getParentGUI()->addLocatorItems();
if ($_GET["obj_id"] > 0)
{
$tree = new ilTree($this->slm_object->getId());
$tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
$tree->setTreeTablePK("slm_id");
$path = $tree->getPathFull($_GET["obj_id"]);
for( $i = 1; $i < count($path); $i++)
{
//var_dump($path[$i]);
switch($path[$i]["type"])
{
case "chap":
$ilCtrl->setParameterByClass("ilscorm2004chaptergui", "obj_id",
$path[$i]["child"]);
$ilLocator->addItem($path[$i]["title"],
$ilCtrl->getLinkTargetByClass("ilscorm2004chaptergui",
"showOrganization"), "", 0, $path[$i]["type"],
ilUtil::getImagePath("icon_chap_s.gif"));
break;
case "seqc":
$ilCtrl->setParameterByClass("ilscorm2004seqchaptergui", "obj_id",
$path[$i]["child"]);
$ilLocator->addItem($path[$i]["title"],
$ilCtrl->getLinkTargetByClass("ilscorm2004seqchaptergui",
"showOrganization"), "", 0, $path[$i]["type"],
ilUtil::getImagePath("icon_chap_s.gif"));
break;
case "sco":
$ilCtrl->setParameterByClass("ilscorm2004scogui", "obj_id",
$path[$i]["child"]);
$ilLocator->addItem($path[$i]["title"],
$ilCtrl->getLinkTargetByClass("ilscorm2004scogui",
"showOrganization"), "", 0, $path[$i]["type"],
ilUtil::getImagePath("icon_sco_s.gif"));
break;
case "ass":
$ilCtrl->setParameterByClass("ilscorm2004assetgui", "obj_id",
$path[$i]["child"]);
$ilLocator->addItem($path[$i]["title"],
$ilCtrl->getLinkTargetByClass("ilscorm2004assetgui",
"showOrganization"), "", 0, $path[$i]["type"],
ilUtil::getImagePath("icon_sca_s.gif"));
break;
case "page":
$ilCtrl->setParameterByClass("ilscorm2004pagegui", "obj_id",
$path[$i]["child"]);
$ilLocator->addItem($path[$i]["title"],
$ilCtrl->getLinkTargetByClass("ilscorm2004pagegui",
"edit"), "", 0, $path[$i]["type"],
ilUtil::getImagePath("icon_pg_s.gif"));
break;
}
}
}
$ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
$tpl->setLocator();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSCORM2004NodeGUI::setParentGUI (   $a_parentgui)

Set Parent GUI class (ilObjSCORM2004LearningModuleGUI).

Parameters
object$a_parentguiParent GUI class

Definition at line 40 of file class.ilSCORM2004NodeGUI.php.

{
$this->parentgui = $a_parentgui;
}
ilSCORM2004NodeGUI::showOrganization ( )

Confirm deletion screen (delete page or structure objects)

Todo:
: check if we need this

cancel deletion of page/structure objects

Todo:
: check if we need this

page and structure object deletion

Todo:
: check if we need this

check the content object tree

Todo:
: check if we need this

Show subhiearchy of pages and subchapters

Definition at line 161 of file class.ilSCORM2004NodeGUI.php.

References $ilCtrl, $lng, $tpl, ilUtil\getImagePath(), getParentGUI(), and setLocator().

Referenced by ilSCORM2004ChapterGUI\executeCommand(), and ilSCORM2004ScoGUI\executeCommand().

{
global $lng, $ilCtrl, $tpl, $ilTabs;
$this->setTabs();
$ilTabs->setTabActive("sahs_organization");
$this->setLocator();
$this->getParentGUI()->showOrganization($this->node_object->getId(),
$ilCtrl->getFormAction($this), $this->node_object->getTitle(),
ilUtil::getImagePath("icon_".$this->node_object->getType().".gif"),
$this, "showOrganization");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilSCORM2004NodeGUI::$node_object

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

Referenced by ilSCORM2004PageNodeGUI\executeCommand().

ilSCORM2004NodeGUI::$slm_object

Definition at line 17 of file class.ilSCORM2004NodeGUI.php.


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