ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCommonActionDispatcherGUI Class Reference

Class ilCommonActionDispatcherGUI. More...

+ Collaboration diagram for ilCommonActionDispatcherGUI:

Public Member Functions

 __construct ($a_node_type, $a_access_handler, $a_obj_type, $a_node_id, $a_obj_id)
 Constructor.
 getAjaxHash ()
 Build ajax hash for current (object/node) properties.
 executeCommand ()
 setSubObject ($a_sub_obj_type, $a_sub_obj_id)
 Set sub object attributes.
 enableCommentsSettings ($a_value)
 Toggle comments settings.
 initHeaderAction ()
 Set header action menu.

Static Public Member Functions

static buildAjaxHash ($a_node_type, $a_node_id, $a_obj_type, $a_obj_id, $a_sub_type=null, $a_sub_id=null)
 Build ajax hash.
static getInstanceFromAjaxCall ()
 (Re-)Build instance from ajax call

Data Fields

const TYPE_REPOSITORY = 1
const TYPE_WORKSPACE = 2

Protected Attributes

 $obj_type
 $node_id
 $node_type
 $obj_id
 $sub_type
 $sub_id
 $enable_comments_settings

Detailed Description

Constructor & Destructor Documentation

ilCommonActionDispatcherGUI::__construct (   $a_node_type,
  $a_access_handler,
  $a_obj_type,
  $a_node_id,
  $a_obj_id 
)

Constructor.

Parameters
int$a_node_type
object$a_access_handler
string$a_obj_type
int$a_node_id
int$a_obj_id
Returns
object

Definition at line 37 of file class.ilCommonActionDispatcherGUI.php.

{
$this->node_type = (int)$a_node_type;
$this->access_handler = $a_access_handler;
$this->obj_type = (string)$a_obj_type;
$this->node_id = (int)$a_node_id;
$this->obj_id = (int)$a_obj_id;
}

Member Function Documentation

static ilCommonActionDispatcherGUI::buildAjaxHash (   $a_node_type,
  $a_node_id,
  $a_obj_type,
  $a_obj_id,
  $a_sub_type = null,
  $a_sub_id = null 
)
static

Build ajax hash.

Parameters
int$a_node_type
int$a_node_id
string$a_obj_type
int$a_obj_id
type$a_sub_type
type$a_sub_id
Returns
string

Definition at line 68 of file class.ilCommonActionDispatcherGUI.php.

Referenced by getAjaxHash(), and ilObjectListGUI\getListItemHTML().

{
return $a_node_type.";".$a_node_id.";".$a_obj_type.";".
$a_obj_id.";".$a_sub_type.";".$a_sub_id;
}

+ Here is the caller graph for this function:

ilCommonActionDispatcherGUI::enableCommentsSettings (   $a_value)

Toggle comments settings.

Parameters
bool$a_value

Definition at line 216 of file class.ilCommonActionDispatcherGUI.php.

{
$this->enable_comments_settings = (bool)$a_value;
}
ilCommonActionDispatcherGUI::executeCommand ( )

Definition at line 127 of file class.ilCommonActionDispatcherGUI.php.

References $_REQUEST, $cmd, $ilCtrl, $obj_type, $sub_type, and exit.

{
global $ilCtrl;
// check access for object
if ($this->node_id &&
!$this->access_handler->checkAccess("visible", "", $this->node_id) &&
!$this->access_handler->checkAccess("read", "", $this->node_id))
{
exit();
}
$next_class = $ilCtrl->getNextClass($this);
$cmd = $ilCtrl->getCmd();
$ilCtrl->saveParameter($this, "cadh");
switch($next_class)
{
case "ilnotegui":
if($this->sub_type)
{
}
include_once "Services/Notes/classes/class.ilNoteGUI.php";
$note_gui = new ilNoteGUI($this->obj_id, $this->sub_id, $obj_type);
$note_gui->enablePrivateNotes(true);
// comments cannot be turned off globally
if($this->enable_comments_settings)
{
// should only be shown if active or permission to toggle
if($this->access_handler->checkAccess("write", "", $this->node_id) ||
$this->access_handler->checkAccess("edit_permissions", "", $this->node_id))
{
$note_gui->enableCommentsSettings();
}
}
/* this is different to the info screen but we need this
for sub-object action menus, e.g. wiki page */
else if($this->sub_id)
{
$note_gui->enablePublicNotes(true);
}
$ilCtrl->forwardCommand($note_gui);
break;
case "iltagginggui":
include_once "Services/Tagging/classes/class.ilTaggingGUI.php";
$tags_gui = new ilTaggingGUI($this->node_id);
$tags_gui->setObject($this->obj_id, $this->obj_type);
$ilCtrl->forwardCommand($tags_gui);
break;
case "ilobjectactivationgui":
$ilCtrl->setParameter($this, "parent_id", (int)$_REQUEST['parent_id']);
include_once 'Services/Object/classes/class.ilObjectActivationGUI.php';
$act_gui = new ilObjectActivationGUI((int)$_REQUEST['parent_id'],$this->node_id);
$ilCtrl->forwardCommand($act_gui);
break;
default:
break;
}
exit();
}
ilCommonActionDispatcherGUI::getAjaxHash ( )

Build ajax hash for current (object/node) properties.

Returns
string

Definition at line 51 of file class.ilCommonActionDispatcherGUI.php.

References buildAjaxHash().

Referenced by initHeaderAction().

{
return self::buildAjaxHash($this->node_type, $this->node_id, $this->obj_type,
$this->obj_id, $this->sub_type, $this->sub_id);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilCommonActionDispatcherGUI::getInstanceFromAjaxCall ( )
static

(Re-)Build instance from ajax call

Returns
object

Definition at line 79 of file class.ilCommonActionDispatcherGUI.php.

References $_GET, $ilUser, $node_id, $node_type, $obj_id, $obj_type, $sub_id, and $sub_type.

Referenced by ilRemoteObjectBaseGUI\executeCommand(), ilObjFileGUI\executeCommand(), ilObjBookingPoolGUI\executeCommand(), ilObjSAHSLearningModuleGUI\executeCommand(), ilObjLinkResourceGUI\executeCommand(), ilObjGroupGUI\executeCommand(), ilObjWikiGUI\executeCommand(), ilObjCategoryGUI\executeCommand(), ilObjContentObjectGUI\executeCommand(), ilObjItemGroupGUI\executeCommand(), ilObjFileBasedLMGUI\executeCommand(), ilObjExerciseGUI\executeCommand(), ilObjMediaCastGUI\executeCommand(), ilObjGlossaryGUI\executeCommand(), ilInfoScreenGUI\executeCommand(), ilObjMediaPoolGUI\executeCommand(), ilObjSessionGUI\executeCommand(), ilObjSurveyQuestionPoolGUI\executeCommand(), ilObjSurveyGUI\executeCommand(), ilObjTestGUI\executeCommand(), ilObjDataCollectionGUI\executeCommand(), ilObjWorkspaceFolderGUI\executeCommand(), ilObjQuestionPoolGUI\executeCommand(), ilObjFolderGUI\executeCommand(), ilWikiPageGUI\executeCommand(), ilObjRootFolderGUI\executeCommand(), ilLMPresentationGUI\executeCommand(), ilObjPollGUI\executeCommand(), ilPDSelectedItemsBlockGUI\executeCommand(), ilObjBlogGUI\executeCommand(), and ilObjCourseGUI\executeCommand().

{
global $ilAccess, $ilUser;
if(isset($_GET["cadh"]))
{
$parts = explode(";", (string)$_GET["cadh"]);
$node_type = $parts[0];
$node_id = $parts[1];
$obj_type = $parts[2];
$obj_id = $parts[3];
$sub_type = $parts[4];
$sub_id = $parts[5];
switch($node_type)
{
case self::TYPE_REPOSITORY:
$access_handler = $ilAccess;
break;
case self::TYPE_WORKSPACE:
include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
$tree = new ilWorkspaceTree($ilUser->getId());
include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
$access_handler = new ilWorkspaceAccessHandler($tree);
break;
default:
return null;
}
$dispatcher = new self($node_type, $access_handler, $obj_type, $node_id, $obj_id);
{
$dispatcher->setSubObject($sub_type, $sub_id);
}
if($node_type == self::TYPE_REPOSITORY)
{
$dispatcher->enableCommentsSettings(true);
}
return $dispatcher;
}
}

+ Here is the caller graph for this function:

ilCommonActionDispatcherGUI::initHeaderAction ( )

Set header action menu.

Definition at line 224 of file class.ilCommonActionDispatcherGUI.php.

References ilObjectListGUIFactory\_getListGUIByType(), ilObjectListGUI\CONTEXT_REPOSITORY, ilObjectListGUI\CONTEXT_WORKSPACE, and getAjaxHash().

{
// check access for object
if ($this->node_id &&
!$this->access_handler->checkAccess("visible", "", $this->node_id) &&
!$this->access_handler->checkAccess("read", "", $this->node_id))
{
return;
}
include_once 'Services/Object/classes/class.ilObjectListGUIFactory.php';
$this->header_action = ilObjectListGUIFactory::_getListGUIByType($this->obj_type);
// remove all currently unwanted actions
$this->header_action->enableCopy(false);
$this->header_action->enableCut(false);
$this->header_action->enableDelete(false);
$this->header_action->enableLink(false);
$this->header_action->enableInfoscreen(false);
$this->header_action->enablePayment(false);
$this->header_action->enableTimings(false);
switch($this->node_type)
{
case self::TYPE_REPOSITORY:
$this->header_action->enableSubscribe(true);
break;
case self::TYPE_WORKSPACE:
$this->header_action->enableSubscribe(false);
break;
}
$this->header_action->initItem($this->node_id, $this->obj_id, "", "",
$context);
$this->header_action->setHeaderSubObject($this->sub_type, $this->sub_id);
$this->header_action->setAjaxHash($this->getAjaxHash());
return $this->header_action;
}

+ Here is the call graph for this function:

ilCommonActionDispatcherGUI::setSubObject (   $a_sub_obj_type,
  $a_sub_obj_id 
)

Set sub object attributes.

Parameters
string$a_sub_obj_type
int$a_sub_obj_id

Definition at line 205 of file class.ilCommonActionDispatcherGUI.php.

Referenced by ilLMPresentationGUI\addHeaderAction(), and ilObjectGUI\initHeaderAction().

{
$this->sub_type = (string)$a_sub_obj_type;
$this->sub_id = (int)$a_sub_obj_id;
}

+ Here is the caller graph for this function:

Field Documentation

ilCommonActionDispatcherGUI::$enable_comments_settings
protected

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

ilCommonActionDispatcherGUI::$node_id
protected

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

Referenced by getInstanceFromAjaxCall().

ilCommonActionDispatcherGUI::$node_type
protected

Definition at line 18 of file class.ilCommonActionDispatcherGUI.php.

Referenced by getInstanceFromAjaxCall().

ilCommonActionDispatcherGUI::$obj_id
protected

Definition at line 19 of file class.ilCommonActionDispatcherGUI.php.

Referenced by getInstanceFromAjaxCall().

ilCommonActionDispatcherGUI::$obj_type
protected
ilCommonActionDispatcherGUI::$sub_id
protected

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

Referenced by getInstanceFromAjaxCall().

ilCommonActionDispatcherGUI::$sub_type
protected
const ilCommonActionDispatcherGUI::TYPE_WORKSPACE = 2

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