ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPersonalWorkspaceGUI Class Reference

GUI class for personal workspace. More...

+ Collaboration diagram for ilPersonalWorkspaceGUI:

Public Member Functions

 __construct ()
 constructor
 executeCommand ()
 execute command

Protected Member Functions

 initTree ()
 Init personal tree.
 renderBack ()
 renderLocator ()
 Build locator for current node.

Protected Attributes

 $tree
 $node_id

Detailed Description

Constructor & Destructor Documentation

ilPersonalWorkspaceGUI::__construct ( )

constructor

Definition at line 27 of file class.ilPersonalWorkspaceGUI.php.

References $_REQUEST, $ilCtrl, $lng, and initTree().

{
global $ilCtrl, $lng, $ilHelp;
$lng->loadLanguageModule("wsp");
$this->initTree();
$ilCtrl->saveParameter($this, "wsp_id");
$this->node_id = $_REQUEST["wsp_id"];
if(!$this->node_id)
{
$this->node_id = $this->tree->getRootId();
}
}

+ Here is the call graph for this function:

Member Function Documentation

ilPersonalWorkspaceGUI::executeCommand ( )

execute command

Definition at line 47 of file class.ilPersonalWorkspaceGUI.php.

References $_REQUEST, $cmd, $ilCtrl, $tpl, ilMainMenuGUI\MODE_FULL, renderBack(), renderLocator(), and ilObject2GUI\WORKSPACE_NODE_ID.

{
global $ilCtrl, $objDefinition, $tpl, $ilMainMenu;
$ilCtrl->setReturn($this, "render");
$cmd = $ilCtrl->getCmd();
// new type
if($_REQUEST["new_type"])
{
$class_name = $objDefinition->getClassName($_REQUEST["new_type"]);
// Only set the fixed cmdClass if the next class is different to
// the GUI class of the new object.
// An example:
// ilObjLinkResourceGUI tries to forward to ilLinkInputGUI (adding an internal link
// when creating a link resource)
// Without this fix, the cmdClass ilObjectCopyGUI would never be reached
if (strtolower($ilCtrl->getNextClass($this)) != strtolower("ilObj".$class_name."GUI"))
{
$ilCtrl->setCmdClass("ilObj".$class_name."GUI");
}
}
// root node
$next_class = $ilCtrl->getNextClass();
if(!$next_class)
{
$node = $this->tree->getNodeData($this->node_id);
$next_class = "ilObj".$objDefinition->getClassName($node["type"])."GUI";
$ilCtrl->setCmdClass($next_class);
}
// if we do this here the object can still change the breadcrumb
$this->renderLocator();
// current node
$class_path = $ilCtrl->lookupClassPath($next_class);
include_once($class_path);
$class_name = $ilCtrl->getClassForClasspath($class_path);
if($_REQUEST["new_type"])
{
$gui = new $class_name(null, ilObject2GUI::WORKSPACE_NODE_ID, $this->node_id);
$gui->setCreationMode();
}
else
{
$gui = new $class_name($this->node_id, ilObject2GUI::WORKSPACE_NODE_ID, false);
}
$ilCtrl->forwardCommand($gui);
if($ilMainMenu->getMode() == ilMainMenuGUI::MODE_FULL)
{
$this->renderBack();
}
$tpl->setLocator();
}

+ Here is the call graph for this function:

ilPersonalWorkspaceGUI::initTree ( )
protected

Init personal tree.

Definition at line 109 of file class.ilPersonalWorkspaceGUI.php.

References $ilUser.

Referenced by __construct().

{
global $ilUser;
$user_id = $ilUser->getId();
include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
$this->tree = new ilWorkspaceTree($user_id);
if(!$this->tree->getRootId())
{
$this->tree->createTreeForUser($user_id);
}
}

+ Here is the caller graph for this function:

ilPersonalWorkspaceGUI::renderBack ( )
protected

Definition at line 123 of file class.ilPersonalWorkspaceGUI.php.

References $ilCtrl, $ilUser, and $lng.

Referenced by executeCommand().

{
global $lng, $ilTabs, $ilCtrl, $ilUser;
$root = $this->tree->getNodeData($this->node_id);
if($root["type"] != "wfld" && $root["type"] != "wsrt")
{
// do not override existing back targets, e.g. public user profile gui
if(!$ilTabs->back_target)
{
$owner = $this->tree->lookupOwner($this->node_id);
// workspace
if($owner == $ilUser->getId())
{
$parent = $this->tree->getParentNodeData($this->node_id);
if($parent["wsp_id"])
{
if($parent["type"] == "wsrt")
{
$class = "ilobjworkspacerootfoldergui";
}
else
{
$class = "ilobjworkspacefoldergui";
}
$ilCtrl->setParameterByClass($class, "wsp_id", $parent["wsp_id"]);
$ilTabs->setBackTarget($lng->txt("back"),
$ilCtrl->getLinkTargetByClass($class, ""));
}
}
// "shared by others"
else
{
$ilCtrl->setParameterByClass("ilobjworkspacerootfoldergui", "wsp_id", "");
$ilCtrl->setParameterByClass("ilobjworkspacerootfoldergui", "user", $owner);
$ilTabs->setBackTarget($lng->txt("back"),
$ilCtrl->getLinkTargetByClass("ilobjworkspacerootfoldergui", "share"));
}
}
}
}

+ Here is the caller graph for this function:

ilPersonalWorkspaceGUI::renderLocator ( )
protected

Build locator for current node.

Definition at line 168 of file class.ilPersonalWorkspaceGUI.php.

References $ilCtrl, $lng, $path, and $tpl.

Referenced by executeCommand().

{
global $lng, $ilCtrl, $ilLocator, $tpl, $objDefinition;
$ilLocator->clearItems();
// we have no path if shared item
$path = $this->tree->getPathFull($this->node_id);
if($path)
{
foreach($path as $node)
{
$obj_class = "ilObj".$objDefinition->getClassName($node["type"])."GUI";
$ilCtrl->setParameter($this, "wsp_id", $node["wsp_id"]);
switch($node["type"])
{
case "wsrt":
$ilLocator->addItem($lng->txt("wsp_personal_workspace"), $ilCtrl->getLinkTargetByClass($obj_class, "render"));
break;
case "blog":
case $objDefinition->isContainer($node["type"]):
$ilLocator->addItem($node["title"], $ilCtrl->getLinkTargetByClass($obj_class, "render"));
break;
default:
$ilLocator->addItem($node["title"], $ilCtrl->getLinkTargetByClass($obj_class, "edit"));
break;
}
}
}
$ilCtrl->setParameter($this, "wsp_id", $this->node_id);
}

+ Here is the caller graph for this function:

Field Documentation

ilPersonalWorkspaceGUI::$node_id
protected

Definition at line 22 of file class.ilPersonalWorkspaceGUI.php.

ilPersonalWorkspaceGUI::$tree
protected

Definition at line 21 of file class.ilPersonalWorkspaceGUI.php.


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