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

Parent class of all container content GUIs. More...

+ Inheritance diagram for ilContainerContentGUI:
+ Collaboration diagram for ilContainerContentGUI:

Public Member Functions

 __construct (&$container_gui_obj)
 Constructor.
 getContainerObject ()
 Get container object.
 getContainerGUI ()
 Get container GUI object.
 setOutput ()
 Sets view output into column layout.
 getMainContent ()
 Get content HTML for main column, this one must be overwritten in derived classes.
 determinePageEmbeddedBlocks ($a_container_page_html)
 Determine all blocks that are embedded in the container page.
 addEmbeddedBlock ($block_type, $block_parameter)
 Add embedded block.
 getEmbeddedBlocks ()
 Get page embedded blocks.
 renderPageEmbeddedBlocks ()
 Render Page Embedded Blocks.
 renderItem ($a_item_data, $a_position=0, $a_force_icon=false, $a_pos_prefix="")
 Render an item.
 insertPageEmbeddedBlocks ($a_output_html)
 Insert blocks into container page.
 getGroupedObjTypes ()
 Get grouped repository object types.
 getIntroduction ()
 Get introduction.
 getItemGroupsHTML ($a_pos=0)
 Get item groups HTML.
 renderItemGroup ($a_itgr)
 Render item group.

Data Fields

const DETAILS_DEACTIVATED = 0
const DETAILS_TITLE = 1
const DETAILS_ALL = 2
 $container_gui
 $container_obj

Protected Member Functions

 getDetailsLevel ($a_item_id)
 get details level
 getRightColumnHTML ()
 Get HTML for right column.
 getCenterColumnHTML ()
 Get HTML for center column.
 initRenderer ()
 Init container renderer.
 clearAdminCommandsDetermination ()
 cleaer administration commands determination
 determineAdminCommands ($a_ref_id, $a_admin_com_included_in_list=false)
 determin admin commands
 getItemGUI ($item_data, $a_show_path=false)
 Get ListGUI object for item.

Protected Attributes

 $details_level = self::DETAILS_DEACTIVATED
 $renderer

Private Member Functions

 __forwardToColumnGUI ()
 Get columngui output.

Detailed Description

Parent class of all container content GUIs.

These classes are responsible for displaying the content, i.e. the side column and main column and its subitems in container objects.

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

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

Constructor & Destructor Documentation

ilContainerContentGUI::__construct ( $container_gui_obj)

Constructor.

Definition at line 33 of file class.ilContainerContentGUI.php.

{
$this->container_gui = $container_gui_obj;
$this->container_obj = $this->container_gui->object;
}

Member Function Documentation

ilContainerContentGUI::__forwardToColumnGUI ( )
finalprivate

Get columngui output.

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

References $ilCtrl, ilObject\_lookupObjId(), ilObject\_lookupType(), ilColumnGUI\getCmdSide(), getContainerGUI(), getContainerObject(), getMainContent(), ilColumnGUI\getScreenMode(), IL_COL_LEFT, IL_COL_RIGHT, and IL_SCREEN_SIDE.

Referenced by getCenterColumnHTML().

{
global $ilCtrl, $ilAccess;
include_once("Services/Block/classes/class.ilColumnGUI.php");
// this gets us the subitems we need in setColumnSettings()
// todo: this should be done in ilCourseGUI->getSubItems
$obj_id = ilObject::_lookupObjId($this->getContainerObject()->getRefId());
$obj_type = ilObject::_lookupType($obj_id);
if (!$ilCtrl->isAsynch())
{
//if ($column_gui->getScreenMode() != IL_SCREEN_SIDE)
{
// right column wants center
{
$column_gui = new ilColumnGUI($obj_type, IL_COL_RIGHT);
$this->getContainerGUI()->setColumnSettings($column_gui);
$html = $ilCtrl->forwardCommand($column_gui);
}
// left column wants center
{
$column_gui = new ilColumnGUI($obj_type, IL_COL_LEFT);
$this->getContainerGUI()->setColumnSettings($column_gui);
$html = $ilCtrl->forwardCommand($column_gui);
}
}
else
{
$html = $this->getMainContent();
}
}
return $html;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerContentGUI::addEmbeddedBlock (   $block_type,
  $block_parameter 
)

Add embedded block.

Parameters

Definition at line 377 of file class.ilContainerContentGUI.php.

Referenced by determinePageEmbeddedBlocks().

{
$this->embedded_block[$block_type][] = $block_parameter;
}

+ Here is the caller graph for this function:

ilContainerContentGUI::clearAdminCommandsDetermination ( )
protected

cleaer administration commands determination

Definition at line 269 of file class.ilContainerContentGUI.php.

Referenced by ilContainerSimpleContentGUI\__showMaterials(), ilContainerSessionsContentGUI\__showMaterials(), ilContainerByTypeContentGUI\renderItemList(), ilContainerObjectiveGUI\showMaterials(), and ilContainerObjectiveGUI\showObjectives().

{
$this->adminCommands = false;
}

+ Here is the caller graph for this function:

ilContainerContentGUI::determineAdminCommands (   $a_ref_id,
  $a_admin_com_included_in_list = false 
)
protected

determin admin commands

Definition at line 277 of file class.ilContainerContentGUI.php.

References getContainerGUI().

Referenced by renderItem().

{
global $rbacsystem;
//echo "-".$a_admin_com_included_in_list."-";
if (!$this->adminCommands)
{
if (!$this->getContainerGUI()->isActiveAdministrationPanel())
{
if ($rbacsystem->checkAccess("delete", $a_ref_id))
{
$this->adminCommands = true;
}
}
else
{
$this->adminCommands = $a_admin_com_included_in_list;
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerContentGUI::determinePageEmbeddedBlocks (   $a_container_page_html)

Determine all blocks that are embedded in the container page.

Definition at line 349 of file class.ilContainerContentGUI.php.

References addEmbeddedBlock(), and getGroupedObjTypes().

Referenced by insertPageEmbeddedBlocks().

{
$type_grps = $this->getGroupedObjTypes();
// iterate all types
foreach ($type_grps as $type => $v)
{
// set template (overall or type specific)
if (is_int(strpos($a_container_page_html, "[list-".$type."]")))
{
$this->addEmbeddedBlock("type", $type);
}
}
// determine item groups
while (eregi("\[(item-group-([0-9]*))\]", $a_container_page_html, $found))
{
$this->addEmbeddedBlock("itgr", (int) $found[2]);
$a_container_page_html = eregi_replace("\[".$found[1]."\]", $html, $a_container_page_html);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerContentGUI::getCenterColumnHTML ( )
protected

Get HTML for center column.

Definition at line 169 of file class.ilContainerContentGUI.php.

References $ilCtrl, $ilDB, $tpl, __forwardToColumnGUI(), and getMainContent().

Referenced by setOutput().

{
global $ilCtrl, $tpl, $ilDB;
$ilCtrl->saveParameterByClass("ilcolumngui", "col_return");
$tpl->addOnLoadCode("il.Object.setRedrawListItemUrl('".
$ilCtrl->getLinkTarget($this->container_gui, "redrawListItem", "", true)."');");
$tpl->addOnLoadCode("il.Object.setRatingUrl('".
$ilCtrl->getLinkTargetByClass(array(get_class($this->container_gui), "ilcommonactiondispatchergui", "ilratinggui"),
"saveRating", "", true, false)."');");
switch ($ilCtrl->getNextClass())
{
case "ilcolumngui":
$ilCtrl->setReturn($this->container_gui, "");
$html = $this->__forwardToColumnGUI();
break;
default:
$ilDB->useSlave(true);
$html = $this->getMainContent();
$ilDB->useSlave(false);
break;
}
return $html;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerContentGUI::getDetailsLevel (   $a_item_id)
protected

get details level

protected

Parameters
@return

Reimplemented in ilContainerSimpleContentGUI, ilContainerObjectiveGUI, ilContainerSessionsContentGUI, and ilContainerByTypeContentGUI.

Definition at line 46 of file class.ilContainerContentGUI.php.

References $details_level.

Referenced by renderItem().

{
}

+ Here is the caller graph for this function:

ilContainerContentGUI::getEmbeddedBlocks ( )

Get page embedded blocks.

Definition at line 385 of file class.ilContainerContentGUI.php.

{
return $this->embedded_block;
}
ilContainerContentGUI::getGroupedObjTypes ( )

Get grouped repository object types.

Returns
array array of object types

Definition at line 653 of file class.ilContainerContentGUI.php.

References getContainerObject().

Referenced by determinePageEmbeddedBlocks(), insertPageEmbeddedBlocks(), and ilContainerByTypeContentGUI\renderItemList().

{
global $objDefinition;
if (empty($this->type_grps))
{
$this->type_grps =
$objDefinition->getGroupedRepositoryObjectTypes($this->getContainerObject()->getType());
}
return $this->type_grps;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerContentGUI::getIntroduction ( )

Get introduction.

Definition at line 668 of file class.ilContainerContentGUI.php.

References $ilCtrl, $ilUser, $lng, $tpl, and ilObject\_getIcon().

Referenced by ilContainerByTypeContentGUI\getMainContent().

{
global $ilUser, $lng, $ilCtrl;
$lng->loadLanguageModule("rep");
$tpl = new ilTemplate("tpl.rep_intro.html", true, true, "Services/Repository");
$tpl->setVariable("IMG_REP_LARGE", ilObject::_getIcon("", "big", "root"));
$tpl->setVariable("TXT_WELCOME", $lng->txt("rep_intro"));
$tpl->setVariable("TXT_INTRO_1", $lng->txt("rep_intro1"));
$tpl->setVariable("TXT_INTRO_2", $lng->txt("rep_intro2"));
$tpl->setVariable("TXT_INTRO_3", sprintf($lng->txt("rep_intro3"), $lng->txt("add")));
$tpl->setVariable("TXT_INTRO_4", sprintf($lng->txt("rep_intro4"), $lng->txt("cat_add")));
$tpl->setVariable("TXT_INTRO_5", $lng->txt("rep_intro5"));
$tpl->setVariable("TXT_INTRO_6", $lng->txt("rep_intro6"));
return $tpl->get();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerContentGUI::getItemGroupsHTML (   $a_pos = 0)

Get item groups HTML.

Parameters
@return

Definition at line 693 of file class.ilContainerContentGUI.php.

References renderItemGroup().

Referenced by ilContainerSimpleContentGUI\__showMaterials(), ilContainerSessionsContentGUI\__showMaterials(), ilContainerByTypeContentGUI\renderItemList(), and ilContainerObjectiveGUI\showMaterials().

{
if (is_array($this->items["itgr"]))
{
foreach ($this->items["itgr"] as $itgr)
{
if (!$this->renderer->hasCustomBlock($itgr["child"]))
{
$this->renderItemGroup($itgr);
$this->renderer->setBlockPosition($itgr["ref_id"], ++$a_pos);
}
}
}
return $a_pos;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerContentGUI::getItemGUI (   $item_data,
  $a_show_path = false 
)
protected

Get ListGUI object for item.

Definition at line 302 of file class.ilContainerContentGUI.php.

References ilObjectListGUIFactory\_getListGUIByType(), and getContainerGUI().

Referenced by renderItem(), renderItemGroup(), and ilContainerObjectiveGUI\renderObjective().

{
include_once 'Services/Object/classes/class.ilObjectListGUIFactory.php';
// get item list gui object
if (!is_object ($this->list_gui[$item_data["type"]]))
{
$item_list_gui =& ilObjectListGUIFactory::_getListGUIByType($item_data["type"]);
$item_list_gui->setContainerObject($this->getContainerGUI());
$this->list_gui[$item_data["type"]] =& $item_list_gui;
}
else
{
$item_list_gui =& $this->list_gui[$item_data["type"]];
}
// unique js-ids
$item_list_gui->setParentRefId($item_data["parent"]);
$item_list_gui->setDefaultCommandParameters(array());
$item_list_gui->disableTitleLink(false);
$item_list_gui->resetConditionTarget();
// show administration command buttons (or not)
if (!$this->getContainerGUI()->isActiveAdministrationPanel())
{
// $item_list_gui->enableDelete(false);
// $item_list_gui->enableLink(false);
// $item_list_gui->enableCut(false);
}
// activate common social commands
$item_list_gui->enableComments(true);
$item_list_gui->enableNotes(true);
$item_list_gui->enableTags(true);
$item_list_gui->enableRating(true);
// container specific modifications
$this->getContainerGUI()->modifyItemGUI($item_list_gui, $item_data, $a_show_path);
return $item_list_gui;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerContentGUI::getMainContent ( )
abstract

Get content HTML for main column, this one must be overwritten in derived classes.

Reimplemented in ilContainerObjectiveGUI, ilContainerSessionsContentGUI, ilContainerByTypeContentGUI, and ilContainerSimpleContentGUI.

Referenced by __forwardToColumnGUI(), and getCenterColumnHTML().

+ Here is the caller graph for this function:

ilContainerContentGUI::getRightColumnHTML ( )
protected

Get HTML for right column.

Definition at line 119 of file class.ilContainerContentGUI.php.

References $ilCtrl, $ilUser, $lng, ilObject\_lookupObjId(), ilObject\_lookupType(), getContainerGUI(), getContainerObject(), IL_COL_RIGHT, IL_SCREEN_FULL, and IL_SCREEN_SIDE.

Referenced by setOutput().

{
global $ilUser, $lng, $ilCtrl, $ilAccess, $ilPluginAdmin;;
$ilCtrl->saveParameterByClass("ilcolumngui", "col_return");
$obj_id = ilObject::_lookupObjId($this->getContainerObject()->getRefId());
$obj_type = ilObject::_lookupType($obj_id);
include_once("Services/Block/classes/class.ilColumnGUI.php");
$column_gui = new ilColumnGUI($obj_type, IL_COL_RIGHT);
if ($column_gui->getScreenMode() == IL_SCREEN_FULL)
{
return "";
}
$this->getContainerGUI()->setColumnSettings($column_gui);
if ($ilCtrl->getNextClass() == "ilcolumngui" &&
$column_gui->getCmdSide() == IL_COL_RIGHT &&
$column_gui->getScreenMode() == IL_SCREEN_SIDE)
{
$html = $ilCtrl->forwardCommand($column_gui);
}
else
{
if (!$ilCtrl->isAsynch())
{
$html = "";
// user interface plugin slot + default rendering
include_once("./Services/UIComponent/classes/class.ilUIHookProcessor.php");
$uip = new ilUIHookProcessor("Services/Container", "right_column",
array("container_content_gui" => $this));
if (!$uip->replaced())
{
$html = $ilCtrl->getHTML($column_gui);
}
$html = $uip->getHTML($html);
}
}
return $html;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerContentGUI::initRenderer ( )
protected

Init container renderer.

Definition at line 208 of file class.ilContainerContentGUI.php.

References $_SESSION, ilContainerSorting\_getInstance(), getContainerGUI(), and getContainerObject().

Referenced by ilContainerSimpleContentGUI\__showMaterials(), ilContainerSessionsContentGUI\__showMaterials(), ilContainerObjectiveGUI\getMainContent(), and ilContainerByTypeContentGUI\renderItemList().

{
include_once('./Services/Container/classes/class.ilContainerSorting.php');
include_once "Services/Container/classes/class.ilContainerRenderer.php";
$this->renderer = new ilContainerRenderer(
($this->getContainerGUI()->isActiveAdministrationPanel() && !$_SESSION["clipboard"])
,$this->getContainerGUI()->isMultiDownloadEnabled()
,$this->getContainerGUI()->isActiveOrdering() && (get_class($this) != "ilContainerObjectiveGUI") // no block sorting in objective view
,$sorting->getBlockPositions()
);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerContentGUI::insertPageEmbeddedBlocks (   $a_output_html)

Insert blocks into container page.

Definition at line 620 of file class.ilContainerContentGUI.php.

References determinePageEmbeddedBlocks(), getGroupedObjTypes(), and renderPageEmbeddedBlocks().

Referenced by ilContainerSimpleContentGUI\__showMaterials(), ilContainerSessionsContentGUI\__showMaterials(), ilContainerByTypeContentGUI\renderItemList(), and ilContainerObjectiveGUI\showObjectives().

{
$this->determinePageEmbeddedBlocks($a_output_html);
$this->renderPageEmbeddedBlocks($this->items);
// iterate all types
foreach ($this->getGroupedObjTypes() as $type => $v)
{
// set template (overall or type specific)
if (is_int(strpos($a_output_html, "[list-".$type."]")))
{
$a_output_html = eregi_replace("\[list-".$type."\]",
$this->renderer->renderSingleTypeBlock($type), $a_output_html);
}
}
// insert all item groups
while (eregi("\[(item-group-([0-9]*))\]", $a_output_html, $found))
{
$itgr_ref_id = (int) $found[2];
$a_output_html = eregi_replace("\[".$found[1]."\]",
$this->renderer->renderSingleCustomBlock($itgr_ref_id), $a_output_html);
}
return $a_output_html;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerContentGUI::renderItem (   $a_item_data,
  $a_position = 0,
  $a_force_icon = false,
  $a_pos_prefix = "" 
)

Render an item.

Parameters
arrayitem data
Returns
string item HTML

Definition at line 457 of file class.ilContainerContentGUI.php.

References $_SESSION, $ilCtrl, $ilSetting, ilContainerSorting\_getInstance(), ilObjectActivation\addListGUIActivationProperty(), ilObjectListGUI\DETAILS_ALL, ilObjectListGUI\DETAILS_MINIMAL, determineAdminCommands(), ilContainer\getCompleteDescriptions(), getContainerGUI(), getContainerObject(), getDetailsLevel(), getItemGUI(), and ilObjectActivation\getItemsByEvent().

Referenced by ilContainerSimpleContentGUI\__showMaterials(), ilContainerSessionsContentGUI\__showMaterials(), renderItemGroup(), ilContainerByTypeContentGUI\renderItemList(), renderPageEmbeddedBlocks(), and ilContainerObjectiveGUI\showMaterials().

{
global $ilSetting,$ilAccess,$ilCtrl;
// Pass type, obj_id and tree to checkAccess method to improve performance
if(!$ilAccess->checkAccess('visible','',$a_item_data['ref_id'],$a_item_data['type'],$a_item_data['obj_id'],$a_item_data['tree']))
{
return '';
}
$item_list_gui = $this->getItemGUI($a_item_data);
if ($ilSetting->get("icon_position_in_lists") == "item_rows" ||
$a_item_data["type"] == "sess" || $a_force_icon)
{
$item_list_gui->enableIcon(true);
}
if ($this->getContainerGUI()->isActiveAdministrationPanel() && !$_SESSION["clipboard"])
{
$item_list_gui->enableCheckbox(true);
}
else if ($this->getContainerGUI()->isMultiDownloadEnabled())
{
// display multi download checkboxes
$item_list_gui->enableDownloadCheckbox($a_item_data["ref_id"], true);
}
if ($this->getContainerGUI()->isActiveItemOrdering() && ($a_item_data['type'] != 'sess' || get_class($this) != 'ilContainerSessionsContentGUI'))
{
$item_list_gui->setPositionInputField($a_pos_prefix."[".$a_item_data["ref_id"]."]",
sprintf('%d', (int)$a_position*10));
}
if($a_item_data['type'] == 'sess' and get_class($this) != 'ilContainerObjectiveGUI')
{
switch($this->getDetailsLevel($a_item_data['obj_id']))
{
case self::DETAILS_TITLE:
$item_list_gui->setDetailsLevel(ilObjectListGUI::DETAILS_MINIMAL);
$item_list_gui->enableExpand(true);
$item_list_gui->setExpanded(false);
$item_list_gui->enableDescription(false);
$item_list_gui->enableProperties(true);
break;
case self::DETAILS_ALL:
$item_list_gui->setDetailsLevel(ilObjectListGUI::DETAILS_ALL);
$item_list_gui->enableExpand(true);
$item_list_gui->setExpanded(true);
$item_list_gui->enableDescription(true);
$item_list_gui->enableProperties(true);
break;
default:
$item_list_gui->setDetailsLevel(ilObjectListGUI::DETAILS_ALL);
$item_list_gui->enableExpand(true);
$item_list_gui->enableDescription(true);
$item_list_gui->enableProperties(true);
break;
}
}
if(method_exists($this, "addItemDetails"))
{
$this->addItemDetails($item_list_gui, $a_item_data);
}
// show subitems
if($a_item_data['type'] == 'sess' and (
$this->getDetailsLevel($a_item_data['obj_id']) != self::DETAILS_TITLE or
$this->getContainerGUI()->isActiveAdministrationPanel() or
$this->getContainerGUI()->isActiveItemOrdering()
)
)
{
$pos = 1;
include_once('./Services/Container/classes/class.ilContainerSorting.php');
include_once('./Services/Object/classes/class.ilObjectActivation.php');
$items = ilObjectActivation::getItemsByEvent($a_item_data['obj_id']);
$items = ilContainerSorting::_getInstance($this->getContainerObject()->getId())->sortSubItems('sess',$a_item_data['obj_id'],$items);
$item_readable = $ilAccess->checkAccess('read','',$a_item_data['ref_id']);
foreach($items as $item)
{
// TODO: this should be removed and be handled by if(strlen($sub_item_html))
// see mantis: 0003944
if(!$ilAccess->checkAccess('visible','',$item['ref_id']))
{
continue;
}
$item_list_gui2 = $this->getItemGUI($item);
$item_list_gui2->enableIcon(true);
$item_list_gui2->enableItemDetailLinks(false);
// unique js-ids
$item_list_gui2->setParentRefId($a_item_data['ref_id']);
// @see mantis 10488
if(!$item_readable and !$ilAccess->checkAccess('write','',$item['ref_id']))
{
$item_list_gui2->forceVisibleOnly(true);
}
if ($this->getContainerGUI()->isActiveAdministrationPanel() && !$_SESSION["clipboard"])
{
$item_list_gui2->enableCheckbox(true);
}
else if ($this->getContainerGUI()->isMultiDownloadEnabled())
{
// display multi download checkbox
$item_list_gui2->enableDownloadCheckbox($item['ref_id'], true);
}
if ($this->getContainerGUI()->isActiveItemOrdering())
{
$item_list_gui2->setPositionInputField("[sess][".$a_item_data['obj_id']."][".$item["ref_id"]."]",
sprintf('%d', (int)$pos*10));
$pos++;
}
// #10611
$sub_item_html = $item_list_gui2->getListItemHTML($item['ref_id'],
$item['obj_id'], $item['title'], $item['description']);
$this->determineAdminCommands($item["ref_id"],$item_list_gui2->adminCommandsIncluded());
if(strlen($sub_item_html))
{
$item_list_gui->addSubItemHTML($sub_item_html);
}
}
}
if ($ilSetting->get("item_cmd_asynch"))
{
$asynch = true;
$ilCtrl->setParameter($this->container_gui, "cmdrefid", $a_item_data['ref_id']);
$asynch_url = $ilCtrl->getLinkTarget($this->container_gui,
"getAsynchItemList", "", true, false);
$ilCtrl->setParameter($this->container_gui, "cmdrefid", "");
}
include_once "Services/Object/classes/class.ilObjectActivation.php";
ilObjectActivation::addListGUIActivationProperty($item_list_gui, $a_item_data);
$html = $item_list_gui->getListItemHTML($a_item_data['ref_id'],
$a_item_data['obj_id'], $a_item_data['title'], $a_item_data['description'],
$asynch, false, $asynch_url);
$this->determineAdminCommands($a_item_data["ref_id"],
$item_list_gui->adminCommandsIncluded());
return $html;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerContentGUI::renderItemGroup (   $a_itgr)

Render item group.

Parameters
@return

Definition at line 716 of file class.ilContainerContentGUI.php.

References ilContainerSorting\_getInstance(), ilContainer\getCompleteDescriptions(), getContainerObject(), getItemGUI(), ilObjectActivation\getItemsByItemGroup(), and renderItem().

Referenced by getItemGroupsHTML(), and renderPageEmbeddedBlocks().

{
global $ilAccess;
// #16493
$perm_ok = ($ilAccess->checkAccess("visible", "", $a_itgr['ref_id']) &&
$ilAccess->checkAccess("read", "", $a_itgr['ref_id']));
include_once('./Services/Container/classes/class.ilContainerSorting.php');
include_once('./Services/Object/classes/class.ilObjectActivation.php');
$items = ilObjectActivation::getItemsByItemGroup($a_itgr['ref_id']);
// if no permission is given, set the items to "rendered" but
// do not display the whole block
if (!$perm_ok)
{
foreach($items as $item)
{
$this->renderer->hideItem($item["child"]);
}
return;
}
$item_list_gui = $this->getItemGUI($a_itgr);
$item_list_gui->enableNotes(false);
$item_list_gui->enableTags(false);
$item_list_gui->enableComments(false);
$item_list_gui->enableTimings(false);
$item_list_gui->getListItemHTML($a_itgr["ref_id"], $a_itgr["obj_id"],
$a_itgr["title"], $a_itgr["description"]);
$commands_html = $item_list_gui->getCommandsHTML();
$this->renderer->addCustomBlock($a_itgr["ref_id"], $a_itgr["title"], $commands_html);
// render item group sub items
$this->getContainerObject()->getId())->sortSubItems('itgr', $a_itgr['obj_id'], $items);
// #18285
$position = 1;
foreach($items as $item)
{
$html2 = $this->renderItem($item, $position++, false, "[itgr][".$a_itgr['obj_id']."]");
if ($html2 != "")
{
// :TODO: show it multiple times?
$this->renderer->addItemToBlock($a_itgr["ref_id"], $item["type"], $item["child"], $html2, true);
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerContentGUI::renderPageEmbeddedBlocks ( )

Render Page Embedded Blocks.

Definition at line 393 of file class.ilContainerContentGUI.php.

References $lng, $ref_id, renderItem(), renderItemGroup(), and ilUtil\sortArray().

Referenced by insertPageEmbeddedBlocks().

{
global $lng;
// item groups
if (is_array($this->embedded_block["itgr"]))
{
$item_groups = array();
if (is_array($this->items["itgr"]))
{
foreach ($this->items["itgr"] as $ig)
{
$item_groups[$ig["ref_id"]] = $ig;
}
}
foreach ($this->embedded_block["itgr"] as $ref_id)
{
if(isset($item_groups[$ref_id]))
{
$this->renderItemGroup($item_groups[$ref_id]);
}
}
}
// type specific blocks
if (is_array($this->embedded_block["type"]))
{
foreach ($this->embedded_block["type"] as $k => $type)
{
if (is_array($this->items[$type]) &&
$this->renderer->addTypeBlock($type))
{
// :TODO: obsolete?
if($type == 'sess')
{
$this->items['sess'] = ilUtil::sortArray($this->items['sess'],'start','ASC',true,true);
}
$position = 1;
foreach($this->items[$type] as $k => $item_data)
{
if(!$this->renderer->hasItem($item_data["child"]))
{
$html = $this->renderItem($item_data, $position++);
if ($html != "")
{
$this->renderer->addItemToBlock($type, $item_data["type"], $item_data["child"], $html);
}
}
}
}
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerContentGUI::setOutput ( )

Sets view output into column layout.

This method sets the output of the right and main column in the global standard template.

Definition at line 77 of file class.ilContainerContentGUI.php.

References $ilCtrl, $ilUser, $tpl, ilObject\_lookupObjId(), ilChangeEvent\_recordReadEvent(), getCenterColumnHTML(), getContainerObject(), and getRightColumnHTML().

{
global $tpl, $ilCtrl;
// note: we do not want to get the center html in case of
// asynchronous calls to blocks in the right column (e.g. news)
// see #13012
if ($ilCtrl->getNextClass() == "ilcolumngui" &&
$ilCtrl->isAsynch())
{
$tpl->setRightContent($this->getRightColumnHTML());
}
// BEGIN ChangeEvent: record read event.
require_once('Services/Tracking/classes/class.ilChangeEvent.php');
global $ilUser;
//global $log;
//$log->write("setOutput");
$obj_id = ilObject::_lookupObjId($this->getContainerObject()->getRefId());
$this->getContainerObject()->getType(),
$this->getContainerObject()->getRefId(),
$obj_id, $ilUser->getId());
// END ChangeEvent: record read event.
$tpl->setContent($this->getCenterColumnHTML());
// see above, all other cases (this was the old position of setRightContent,
// maybe the position above is ok and all ifs can be removed)
if ($ilCtrl->getNextClass() != "ilcolumngui" ||
!$ilCtrl->isAsynch())
{
$tpl->setRightContent($this->getRightColumnHTML());
}
}

+ Here is the call graph for this function:

Field Documentation

ilContainerContentGUI::$container_gui

Definition at line 26 of file class.ilContainerContentGUI.php.

Referenced by getContainerGUI().

ilContainerContentGUI::$container_obj

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

Referenced by getContainerObject().

ilContainerContentGUI::$details_level = self::DETAILS_DEACTIVATED
protected

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

Referenced by getDetailsLevel().

ilContainerContentGUI::$renderer
protected

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


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