ILIAS  Release_4_4_x_branch Revision 61816
 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.
 setRatingCallback ($a_gui, $a_cmd)
 Add callback for rating gui.
 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
 $rating_callback

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 39 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 70 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 239 of file class.ilCommonActionDispatcherGUI.php.

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

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

References $_GET, $_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;
case "ilratinggui":
include_once("./Services/Rating/classes/class.ilRatingGUI.php");
$rating_gui = new ilRatingGUI();
if(!$_GET["rnsb"])
{
$rating_gui->setObject($this->obj_id, $this->obj_type, $this->sub_id, $this->sub_type);
}
else
{
// coming from headaction ignore sub-objects
$rating_gui->setObject($this->obj_id, $this->obj_type);
}
$ilCtrl->forwardCommand($rating_gui);
if($this->rating_callback)
{
// as rating in categories is form-based we need to redirect
// somewhere after saving
$ilCtrl->redirect($this->rating_callback[0], $this->rating_callback[1]);
}
break;
default:
break;
}
exit();
}
ilCommonActionDispatcherGUI::getAjaxHash ( )

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

Returns
string

Definition at line 53 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 81 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(), ilObjPortfolioTemplateGUI\executeCommand(), ilObjBookingPoolGUI\executeCommand(), ilObjFileGUI\executeCommand(), ilObjectPluginGUI\executeCommand(), ilObjSurveyGUI\executeCommand(), ilObjSAHSLearningModuleGUI\executeCommand(), ilObjLinkResourceGUI\executeCommand(), ilObjGroupGUI\executeCommand(), ilObjWikiGUI\executeCommand(), ilObjContentObjectGUI\executeCommand(), ilObjItemGroupGUI\executeCommand(), ilObjCategoryGUI\executeCommand(), ilObjFileBasedLMGUI\executeCommand(), ilObjCloudGUI\executeCommand(), ilObjExerciseGUI\executeCommand(), ilObjMediaCastGUI\executeCommand(), ilObjMediaPoolGUI\executeCommand(), ilObjSessionGUI\executeCommand(), ilInfoScreenGUI\executeCommand(), ilObjSurveyQuestionPoolGUI\executeCommand(), ilObjQuestionPoolGUI\executeCommand(), ilWikiPageGUI\executeCommand(), ilObjFolderGUI\executeCommand(), ilObjDataCollectionGUI\executeCommand(), ilObjWorkspaceFolderGUI\executeCommand(), ilObjGlossaryGUI\executeCommand(), ilObjBibliographicGUI\executeCommand(), ilObjTestGUI\executeCommand(), ilObjOrgUnitGUI\executeCommand(), ilObjRootFolderGUI\executeCommand(), ilLMPresentationGUI\executeCommand(), ilObjPollGUI\executeCommand(), ilObjBlogGUI\executeCommand(), ilPDSelectedItemsBlockGUI\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 258 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::setRatingCallback (   $a_gui,
  $a_cmd 
)

Add callback for rating gui.

Parameters
object$a_gui
string$a_cmd

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

{
$this->rating_callback = array($a_gui, $a_cmd);
}
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 228 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 23 of file class.ilCommonActionDispatcherGUI.php.

ilCommonActionDispatcherGUI::$node_id
protected

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

Referenced by getInstanceFromAjaxCall().

ilCommonActionDispatcherGUI::$node_type
protected

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

Referenced by getInstanceFromAjaxCall().

ilCommonActionDispatcherGUI::$obj_id
protected

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

Referenced by getInstanceFromAjaxCall().

ilCommonActionDispatcherGUI::$obj_type
protected
ilCommonActionDispatcherGUI::$rating_callback
protected

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

ilCommonActionDispatcherGUI::$sub_id
protected

Definition at line 22 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: